Skip to content

Commit

Permalink
Regenerate client from commit ffc670cf of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Feb 14, 2024
1 parent 385f52d commit f26a195
Show file tree
Hide file tree
Showing 19 changed files with 457 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-14 10:50:03.602357",
"spec_repo_commit": "9348385b"
"regenerated": "2024-02-14 14:32:10.755184",
"spec_repo_commit": "ffc670cf"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-14 10:50:03.618501",
"spec_repo_commit": "9348385b"
"regenerated": "2024-02-14 14:32:10.770793",
"spec_repo_commit": "ffc670cf"
}
}
}
12 changes: 12 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3207,6 +3207,18 @@ components:
key.'
example: https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
type: string
cloud_run_revision_filters:
description: 'Limit the Cloud Run revisions that are pulled into Datadog
by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
errors:
description: An array of errors.
example:
Expand Down
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7388,6 +7388,18 @@ components:
description: Your service account email address.
example: datadog-service-account@test-project.iam.gserviceaccount.com
type: string
cloud_run_revision_filters:
description: 'List of filters to limit the Cloud Run revisions that are
pulled into Datadog by using tags.

Only Cloud Run revision resources that apply to specified filters are
imported into Datadog.'
example:
- $KEY:$VALUE
items:
description: Cloud Run Filters
type: string
type: array
host_filters:
description: Your Host Filters.
items:
Expand Down
38 changes: 37 additions & 1 deletion api/datadogV1/model_gcp_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type GCPAccount struct {
// Should be `https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL`
// where `$CLIENT_EMAIL` is the email found in your JSON service account key.
ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"`
// Limit the Cloud Run revisions that are pulled into Datadog by using tags.
// Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
// An array of errors.
Errors []string `json:"errors,omitempty"`
// Limit the GCE instances that are pulled into Datadog by using tags.
Expand Down Expand Up @@ -238,6 +241,34 @@ func (o *GCPAccount) SetClientX509CertUrl(v string) {
o.ClientX509CertUrl = &v
}

// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise.
func (o *GCPAccount) GetCloudRunRevisionFilters() []string {
if o == nil || o.CloudRunRevisionFilters == nil {
var ret []string
return ret
}
return o.CloudRunRevisionFilters
}

// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPAccount) GetCloudRunRevisionFiltersOk() (*[]string, bool) {
if o == nil || o.CloudRunRevisionFilters == nil {
return nil, false
}
return &o.CloudRunRevisionFilters, true
}

// HasCloudRunRevisionFilters returns a boolean if a field has been set.
func (o *GCPAccount) HasCloudRunRevisionFilters() bool {
return o != nil && o.CloudRunRevisionFilters != nil
}

// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field.
func (o *GCPAccount) SetCloudRunRevisionFilters(v []string) {
o.CloudRunRevisionFilters = v
}

// GetErrors returns the Errors field value if set, zero value otherwise.
func (o *GCPAccount) GetErrors() []string {
if o == nil || o.Errors == nil {
Expand Down Expand Up @@ -542,6 +573,9 @@ func (o GCPAccount) MarshalJSON() ([]byte, error) {
if o.ClientX509CertUrl != nil {
toSerialize["client_x509_cert_url"] = o.ClientX509CertUrl
}
if o.CloudRunRevisionFilters != nil {
toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters
}
if o.Errors != nil {
toSerialize["errors"] = o.Errors
}
Expand Down Expand Up @@ -588,6 +622,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) {
ClientEmail *string `json:"client_email,omitempty"`
ClientId *string `json:"client_id,omitempty"`
ClientX509CertUrl *string `json:"client_x509_cert_url,omitempty"`
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
Errors []string `json:"errors,omitempty"`
HostFilters *string `json:"host_filters,omitempty"`
IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"`
Expand All @@ -604,7 +639,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"auth_provider_x509_cert_url", "auth_uri", "automute", "client_email", "client_id", "client_x509_cert_url", "cloud_run_revision_filters", "errors", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "private_key", "private_key_id", "project_id", "resource_collection_enabled", "token_uri", "type"})
} else {
return err
}
Expand All @@ -614,6 +649,7 @@ func (o *GCPAccount) UnmarshalJSON(bytes []byte) (err error) {
o.ClientEmail = all.ClientEmail
o.ClientId = all.ClientId
o.ClientX509CertUrl = all.ClientX509CertUrl
o.CloudRunRevisionFilters = all.CloudRunRevisionFilters
o.Errors = all.Errors
o.HostFilters = all.HostFilters
o.IsCspmEnabled = all.IsCspmEnabled
Expand Down
38 changes: 37 additions & 1 deletion api/datadogV2/model_gcpsts_service_account_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type GCPSTSServiceAccountAttributes struct {
Automute *bool `json:"automute,omitempty"`
// Your service account email address.
ClientEmail *string `json:"client_email,omitempty"`
// List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags.
// Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
// Your Host Filters.
HostFilters []string `json:"host_filters,omitempty"`
// When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
Expand Down Expand Up @@ -134,6 +137,34 @@ func (o *GCPSTSServiceAccountAttributes) SetClientEmail(v string) {
o.ClientEmail = &v
}

// GetCloudRunRevisionFilters returns the CloudRunRevisionFilters field value if set, zero value otherwise.
func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFilters() []string {
if o == nil || o.CloudRunRevisionFilters == nil {
var ret []string
return ret
}
return o.CloudRunRevisionFilters
}

// GetCloudRunRevisionFiltersOk returns a tuple with the CloudRunRevisionFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GCPSTSServiceAccountAttributes) GetCloudRunRevisionFiltersOk() (*[]string, bool) {
if o == nil || o.CloudRunRevisionFilters == nil {
return nil, false
}
return &o.CloudRunRevisionFilters, true
}

// HasCloudRunRevisionFilters returns a boolean if a field has been set.
func (o *GCPSTSServiceAccountAttributes) HasCloudRunRevisionFilters() bool {
return o != nil && o.CloudRunRevisionFilters != nil
}

// SetCloudRunRevisionFilters gets a reference to the given []string and assigns it to the CloudRunRevisionFilters field.
func (o *GCPSTSServiceAccountAttributes) SetCloudRunRevisionFilters(v []string) {
o.CloudRunRevisionFilters = v
}

// GetHostFilters returns the HostFilters field value if set, zero value otherwise.
func (o *GCPSTSServiceAccountAttributes) GetHostFilters() []string {
if o == nil || o.HostFilters == nil {
Expand Down Expand Up @@ -261,6 +292,9 @@ func (o GCPSTSServiceAccountAttributes) MarshalJSON() ([]byte, error) {
if o.ClientEmail != nil {
toSerialize["client_email"] = o.ClientEmail
}
if o.CloudRunRevisionFilters != nil {
toSerialize["cloud_run_revision_filters"] = o.CloudRunRevisionFilters
}
if o.HostFilters != nil {
toSerialize["host_filters"] = o.HostFilters
}
Expand All @@ -286,6 +320,7 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error)
AccountTags []string `json:"account_tags,omitempty"`
Automute *bool `json:"automute,omitempty"`
ClientEmail *string `json:"client_email,omitempty"`
CloudRunRevisionFilters []string `json:"cloud_run_revision_filters,omitempty"`
HostFilters []string `json:"host_filters,omitempty"`
IsCspmEnabled *bool `json:"is_cspm_enabled,omitempty"`
IsSecurityCommandCenterEnabled *bool `json:"is_security_command_center_enabled,omitempty"`
Expand All @@ -296,13 +331,14 @@ func (o *GCPSTSServiceAccountAttributes) UnmarshalJSON(bytes []byte) (err error)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"})
datadog.DeleteKeys(additionalProperties, &[]string{"account_tags", "automute", "client_email", "cloud_run_revision_filters", "host_filters", "is_cspm_enabled", "is_security_command_center_enabled", "resource_collection_enabled"})
} else {
return err
}
o.AccountTags = all.AccountTags
o.Automute = all.Automute
o.ClientEmail = all.ClientEmail
o.CloudRunRevisionFilters = all.CloudRunRevisionFilters
o.HostFilters = all.HostFilters
o.IsCspmEnabled = all.IsCspmEnabled
o.IsSecurityCommandCenterEnabled = all.IsSecurityCommandCenterEnabled
Expand Down
15 changes: 9 additions & 6 deletions examples/v1/gcp-integration/CreateGCPIntegration.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ import (

func main() {
body := datadogV1.GCPAccount{
AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"),
AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"),
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"),
ClientId: datadog.PtrString("163662907116366290710"),
ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"),
HostFilters: datadog.PtrString("key:value,filter:example"),
AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"),
AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"),
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"),
ClientId: datadog.PtrString("163662907116366290710"),
ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"),
HostFilters: datadog.PtrString("key:value,filter:example"),
CloudRunRevisionFilters: []string{
"dr:dre",
},
IsCspmEnabled: datadog.PtrBool(true),
IsSecurityCommandCenterEnabled: datadog.PtrBool(true),
PrivateKey: datadog.PtrString("private_key"),
Expand Down
48 changes: 48 additions & 0 deletions examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Update a GCP integration cloud run revision filters returns "OK" response

package main

import (
"context"
"encoding/json"
"fmt"
"os"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
body := datadogV1.GCPAccount{
AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"),
AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"),
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"),
ClientId: datadog.PtrString("163662907116366290710"),
ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"),
HostFilters: datadog.PtrString("key:value,filter:example"),
CloudRunRevisionFilters: []string{
"merp:derp",
},
IsCspmEnabled: datadog.PtrBool(true),
IsSecurityCommandCenterEnabled: datadog.PtrBool(true),
PrivateKey: datadog.PtrString("private_key"),
PrivateKeyId: datadog.PtrString("123456789abcdefghi123456789abcdefghijklm"),
ProjectId: datadog.PtrString("datadog-apitest"),
ResourceCollectionEnabled: datadog.PtrBool(true),
TokenUri: datadog.PtrString("https://accounts.google.com/o/oauth2/token"),
Type: datadog.PtrString("service_account"),
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewGCPIntegrationApi(apiClient)
resp, r, err := api.UpdateGCPIntegration(ctx, body)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPIntegration`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPIntegration`:\n%s\n", responseContent)
}
41 changes: 41 additions & 0 deletions examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Create a new entry for your service account with cloud run revision filters enabled returns "OK" response

package main

import (
"context"
"encoding/json"
"fmt"
"os"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
body := datadogV2.GCPSTSServiceAccountCreateRequest{
Data: &datadogV2.GCPSTSServiceAccountData{
Attributes: &datadogV2.GCPSTSServiceAccountAttributes{
CloudRunRevisionFilters: []string{
"meh:bleh",
},
ClientEmail: datadog.PtrString("252bf553ef04b351@test-project.iam.gserviceaccount.com"),
HostFilters: []string{},
},
Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(),
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewGCPIntegrationApi(apiClient)
resp, r, err := api.CreateGCPSTSAccount(ctx, body)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n", responseContent)
}
44 changes: 44 additions & 0 deletions examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Update STS Service Account returns "OK" response with cloud run revision filters

package main

import (
"context"
"encoding/json"
"fmt"
"os"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
// there is a valid "gcp_sts_account" in the system
GcpStsAccountDataID := os.Getenv("GCP_STS_ACCOUNT_DATA_ID")

body := datadogV2.GCPSTSServiceAccountUpdateRequest{
Data: &datadogV2.GCPSTSServiceAccountUpdateRequestData{
Attributes: &datadogV2.GCPSTSServiceAccountAttributes{
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"),
CloudRunRevisionFilters: []string{
"merp:derp",
},
},
Id: datadog.PtrString(GcpStsAccountDataID),
Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(),
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewGCPIntegrationApi(apiClient)
resp, r, err := api.UpdateGCPSTSAccount(ctx, GcpStsAccountDataID, body)

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n", responseContent)
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-12-20T13:18:07.717Z
2024-01-31T21:16:03.254Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"}
{"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","auth_uri":"https://accounts.google.com/o/oauth2/auth","client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL","cloud_run_revision_filters":["dr:dre"],"host_filters":"key:value,filter:example","is_cspm_enabled":true,"is_security_command_center_enabled":true,"private_key":"private_key","private_key_id":"123456789abcdefghi123456789abcdefghijklm","project_id":"datadog-apitest","resource_collection_enabled":true,"token_uri":"https://accounts.google.com/o/oauth2/token","type":"service_account"}
form: {}
headers:
Accept:
Expand All @@ -23,7 +23,7 @@ interactions:
status: 200 OK
- request:
body: |
{"client_email":"e5bbc86fb86ab202@example.com","client_id":"170307828717030782870","project_id":"datadog-apitest"}
{"client_email":"3af93b0f1c973838@example.com","client_id":"170673576317067357630","project_id":"datadog-apitest"}
form: {}
headers:
Accept:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-01-31T21:16:03.829Z
Loading

0 comments on commit f26a195

Please sign in to comment.