Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "2025-04-17 13:26:11.488046",
"spec_repo_commit": "12ab5180"
"regenerated": "2025-04-22 18:27:58.806312",
"spec_repo_commit": "2b6fa951"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-17 13:26:11.504561",
"spec_repo_commit": "12ab5180"
"regenerated": "2025-04-22 18:27:58.824076",
"spec_repo_commit": "2b6fa951"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14676,6 +14676,13 @@ components:
product for this service account. Note: This requires resource_collection_enabled
to be set to true.'
type: boolean
is_per_project_quota_enabled:
default: false
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
attributing Google Cloud billing and quota usage to the project being
monitored rather than the default service account project.
example: true
type: boolean
is_resource_change_collection_enabled:
default: false
description: When enabled, Datadog scans for all resource change data in
Expand Down
8 changes: 4 additions & 4 deletions features/v2/gcp_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "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": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "type": "gcp_service_account"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down Expand Up @@ -151,15 +151,15 @@ 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": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/gcp-integrations
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": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": [], "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"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down
6 changes: 2 additions & 4 deletions lib/datadog_api_client/v2/model_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _deserialize(type, value)
# generic array, return directly
value
when :UUID
value
value.to_s
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
Expand Down Expand Up @@ -255,9 +255,7 @@ def find_and_cast_into_type(klass, data)
when 'Object' # "type: object"
return data if data.instance_of?(Hash)
when 'UUID'
raise TypeError, "Expected String, got #{uuid_string.class.name} instead." unless uuid_string.kind_of?(String)
raise ArgumentError, "Invalid UUID format." unless /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/.match?(data)
return data
return UUIDTools::UUID.parse(data)
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
if data.instance_of?(Array)
sub_type = Regexp.last_match[:sub_type]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class GCPSTSServiceAccountAttributes
# 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.
attr_accessor :is_cspm_enabled

# When enabled, Datadog applies the `X-Goog-User-Project` header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project.
attr_accessor :is_per_project_quota_enabled

# When enabled, Datadog scans for all resource change data in your Google Cloud environment.
attr_accessor :is_resource_change_collection_enabled

Expand All @@ -64,6 +67,7 @@ def self.attribute_map
:'cloud_run_revision_filters' => :'cloud_run_revision_filters',
:'host_filters' => :'host_filters',
:'is_cspm_enabled' => :'is_cspm_enabled',
:'is_per_project_quota_enabled' => :'is_per_project_quota_enabled',
:'is_resource_change_collection_enabled' => :'is_resource_change_collection_enabled',
:'is_security_command_center_enabled' => :'is_security_command_center_enabled',
:'metric_namespace_configs' => :'metric_namespace_configs',
Expand All @@ -81,6 +85,7 @@ def self.openapi_types
:'cloud_run_revision_filters' => :'Array<String>',
:'host_filters' => :'Array<String>',
:'is_cspm_enabled' => :'Boolean',
:'is_per_project_quota_enabled' => :'Boolean',
:'is_resource_change_collection_enabled' => :'Boolean',
:'is_security_command_center_enabled' => :'Boolean',
:'metric_namespace_configs' => :'Array<GCPMetricNamespaceConfig>',
Expand Down Expand Up @@ -136,6 +141,10 @@ def initialize(attributes = {})
self.is_cspm_enabled = attributes[:'is_cspm_enabled']
end

if attributes.key?(:'is_per_project_quota_enabled')
self.is_per_project_quota_enabled = attributes[:'is_per_project_quota_enabled']
end

if attributes.key?(:'is_resource_change_collection_enabled')
self.is_resource_change_collection_enabled = attributes[:'is_resource_change_collection_enabled']
end
Expand Down Expand Up @@ -187,6 +196,7 @@ def ==(o)
cloud_run_revision_filters == o.cloud_run_revision_filters &&
host_filters == o.host_filters &&
is_cspm_enabled == o.is_cspm_enabled &&
is_per_project_quota_enabled == o.is_per_project_quota_enabled &&
is_resource_change_collection_enabled == o.is_resource_change_collection_enabled &&
is_security_command_center_enabled == o.is_security_command_center_enabled &&
metric_namespace_configs == o.metric_namespace_configs &&
Expand All @@ -198,7 +208,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[account_tags, automute, client_email, cloud_run_revision_filters, host_filters, is_cspm_enabled, is_resource_change_collection_enabled, is_security_command_center_enabled, metric_namespace_configs, resource_collection_enabled, additional_properties].hash
[account_tags, automute, client_email, cloud_run_revision_filters, host_filters, is_cspm_enabled, is_per_project_quota_enabled, is_resource_change_collection_enabled, is_security_command_center_enabled, metric_namespace_configs, resource_collection_enabled, additional_properties].hash
end
end
end
Loading