From 5ebd07fc43ac8537f3aa41e82eee4b74e4ff6ead Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Oct 2025 20:51:59 +0000 Subject: [PATCH] Regenerate client from commit 05ffea6 of spec repo --- .generator/schemas/v2/openapi.yaml | 17 +++++++- .../model_gcp_metric_namespace_config.go | 41 +++++++++++++++++-- .../features/v2/gcp_integration.feature | 8 ++-- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 364018c47d5..47cd948788a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20406,9 +20406,20 @@ components: to this GCP metric namespace. example: true type: boolean + filters: + description: When enabled, Datadog applies these additional filters to limit + metric collection. A metric is collected only if it does not match all + exclusion filters and matches at least one allow filter. + example: + - snapshot.* + - '!*_by_region' + items: + description: A metric namespace filter + type: string + type: array id: description: The id of the GCP metric namespace. - example: aiplatform + example: pubsub type: string type: object GCPMonitoredResourceConfig: @@ -20570,6 +20581,10 @@ components: example: - disabled: true id: aiplatform + - filters: + - snapshot.* + - '!*_by_region' + id: pubsub items: $ref: '#/components/schemas/GCPMetricNamespaceConfig' type: array diff --git a/api/datadogV2/model_gcp_metric_namespace_config.go b/api/datadogV2/model_gcp_metric_namespace_config.go index a3cbee0326e..6afda211eab 100644 --- a/api/datadogV2/model_gcp_metric_namespace_config.go +++ b/api/datadogV2/model_gcp_metric_namespace_config.go @@ -12,6 +12,8 @@ import ( type GCPMetricNamespaceConfig struct { // When disabled, Datadog does not collect metrics that are related to this GCP metric namespace. Disabled *bool `json:"disabled,omitempty"` + // When enabled, Datadog applies these additional filters to limit metric collection. A metric is collected only if it does not match all exclusion filters and matches at least one allow filter. + Filters []string `json:"filters,omitempty"` // The id of the GCP metric namespace. Id *string `json:"id,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -68,6 +70,34 @@ func (o *GCPMetricNamespaceConfig) SetDisabled(v bool) { o.Disabled = &v } +// GetFilters returns the Filters field value if set, zero value otherwise. +func (o *GCPMetricNamespaceConfig) GetFilters() []string { + if o == nil || o.Filters == nil { + var ret []string + return ret + } + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GCPMetricNamespaceConfig) GetFiltersOk() (*[]string, bool) { + if o == nil || o.Filters == nil { + return nil, false + } + return &o.Filters, true +} + +// HasFilters returns a boolean if a field has been set. +func (o *GCPMetricNamespaceConfig) HasFilters() bool { + return o != nil && o.Filters != nil +} + +// SetFilters gets a reference to the given []string and assigns it to the Filters field. +func (o *GCPMetricNamespaceConfig) SetFilters(v []string) { + o.Filters = v +} + // GetId returns the Id field value if set, zero value otherwise. func (o *GCPMetricNamespaceConfig) GetId() string { if o == nil || o.Id == nil { @@ -105,6 +135,9 @@ func (o GCPMetricNamespaceConfig) MarshalJSON() ([]byte, error) { if o.Disabled != nil { toSerialize["disabled"] = o.Disabled } + if o.Filters != nil { + toSerialize["filters"] = o.Filters + } if o.Id != nil { toSerialize["id"] = o.Id } @@ -118,19 +151,21 @@ func (o GCPMetricNamespaceConfig) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *GCPMetricNamespaceConfig) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Disabled *bool `json:"disabled,omitempty"` - Id *string `json:"id,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Filters []string `json:"filters,omitempty"` + Id *string `json:"id,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"disabled", "id"}) + datadog.DeleteKeys(additionalProperties, &[]string{"disabled", "filters", "id"}) } else { return err } o.Disabled = all.Disabled + o.Filters = all.Filters o.Id = all.Id if len(additionalProperties) > 0 { diff --git a/tests/scenarios/features/v2/gcp_integration.feature b/tests/scenarios/features/v2/gcp_integration.feature index 935adb2d93b..6d47a1508eb 100644 --- a/tests/scenarios/features/v2/gcp_integration.feature +++ b/tests/scenarios/features/v2/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -151,7 +151,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -159,7 +159,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found