Skip to content

Commit 6459214

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
datadog_integration_gcp_sts Add Support for IsPerProjectQuotaEnabled for GCP STS Service Accounts (#2817)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 9545470 commit 6459214

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-17 13:26:18.289754",
8-
"spec_repo_commit": "12ab5180"
7+
"regenerated": "2025-04-22 18:28:01.898109",
8+
"spec_repo_commit": "2b6fa951"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-17 13:26:18.308287",
13-
"spec_repo_commit": "12ab5180"
12+
"regenerated": "2025-04-22 18:28:01.931795",
13+
"spec_repo_commit": "2b6fa951"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14676,6 +14676,13 @@ components:
1467614676
product for this service account. Note: This requires resource_collection_enabled
1467714677
to be set to true.'
1467814678
type: boolean
14679+
is_per_project_quota_enabled:
14680+
default: false
14681+
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
14682+
attributing Google Cloud billing and quota usage to the project being
14683+
monitored rather than the default service account project.
14684+
example: true
14685+
type: boolean
1467914686
is_resource_change_collection_enabled:
1468014687
default: false
1468114688
description: When enabled, Datadog scans for all resource change data in

src/main/java/com/datadog/api/client/v2/model/GCPSTSServiceAccountAttributes.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
GCPSTSServiceAccountAttributes.JSON_PROPERTY_CLOUD_RUN_REVISION_FILTERS,
2727
GCPSTSServiceAccountAttributes.JSON_PROPERTY_HOST_FILTERS,
2828
GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_CSPM_ENABLED,
29+
GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_PER_PROJECT_QUOTA_ENABLED,
2930
GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_RESOURCE_CHANGE_COLLECTION_ENABLED,
3031
GCPSTSServiceAccountAttributes.JSON_PROPERTY_IS_SECURITY_COMMAND_CENTER_ENABLED,
3132
GCPSTSServiceAccountAttributes.JSON_PROPERTY_METRIC_NAMESPACE_CONFIGS,
@@ -54,6 +55,10 @@ public class GCPSTSServiceAccountAttributes {
5455
public static final String JSON_PROPERTY_IS_CSPM_ENABLED = "is_cspm_enabled";
5556
private Boolean isCspmEnabled;
5657

58+
public static final String JSON_PROPERTY_IS_PER_PROJECT_QUOTA_ENABLED =
59+
"is_per_project_quota_enabled";
60+
private Boolean isPerProjectQuotaEnabled = false;
61+
5762
public static final String JSON_PROPERTY_IS_RESOURCE_CHANGE_COLLECTION_ENABLED =
5863
"is_resource_change_collection_enabled";
5964
private Boolean isResourceChangeCollectionEnabled = false;
@@ -223,6 +228,29 @@ public void setIsCspmEnabled(Boolean isCspmEnabled) {
223228
this.isCspmEnabled = isCspmEnabled;
224229
}
225230

231+
public GCPSTSServiceAccountAttributes isPerProjectQuotaEnabled(Boolean isPerProjectQuotaEnabled) {
232+
this.isPerProjectQuotaEnabled = isPerProjectQuotaEnabled;
233+
return this;
234+
}
235+
236+
/**
237+
* When enabled, Datadog applies the <code>X-Goog-User-Project</code> header, attributing Google
238+
* Cloud billing and quota usage to the project being monitored rather than the default service
239+
* account project.
240+
*
241+
* @return isPerProjectQuotaEnabled
242+
*/
243+
@jakarta.annotation.Nullable
244+
@JsonProperty(JSON_PROPERTY_IS_PER_PROJECT_QUOTA_ENABLED)
245+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
246+
public Boolean getIsPerProjectQuotaEnabled() {
247+
return isPerProjectQuotaEnabled;
248+
}
249+
250+
public void setIsPerProjectQuotaEnabled(Boolean isPerProjectQuotaEnabled) {
251+
this.isPerProjectQuotaEnabled = isPerProjectQuotaEnabled;
252+
}
253+
226254
public GCPSTSServiceAccountAttributes isResourceChangeCollectionEnabled(
227255
Boolean isResourceChangeCollectionEnabled) {
228256
this.isResourceChangeCollectionEnabled = isResourceChangeCollectionEnabled;
@@ -389,6 +417,8 @@ public boolean equals(Object o) {
389417
this.cloudRunRevisionFilters, gcpstsServiceAccountAttributes.cloudRunRevisionFilters)
390418
&& Objects.equals(this.hostFilters, gcpstsServiceAccountAttributes.hostFilters)
391419
&& Objects.equals(this.isCspmEnabled, gcpstsServiceAccountAttributes.isCspmEnabled)
420+
&& Objects.equals(
421+
this.isPerProjectQuotaEnabled, gcpstsServiceAccountAttributes.isPerProjectQuotaEnabled)
392422
&& Objects.equals(
393423
this.isResourceChangeCollectionEnabled,
394424
gcpstsServiceAccountAttributes.isResourceChangeCollectionEnabled)
@@ -413,6 +443,7 @@ public int hashCode() {
413443
cloudRunRevisionFilters,
414444
hostFilters,
415445
isCspmEnabled,
446+
isPerProjectQuotaEnabled,
416447
isResourceChangeCollectionEnabled,
417448
isSecurityCommandCenterEnabled,
418449
metricNamespaceConfigs,
@@ -432,6 +463,9 @@ public String toString() {
432463
.append("\n");
433464
sb.append(" hostFilters: ").append(toIndentedString(hostFilters)).append("\n");
434465
sb.append(" isCspmEnabled: ").append(toIndentedString(isCspmEnabled)).append("\n");
466+
sb.append(" isPerProjectQuotaEnabled: ")
467+
.append(toIndentedString(isPerProjectQuotaEnabled))
468+
.append("\n");
435469
sb.append(" isResourceChangeCollectionEnabled: ")
436470
.append(toIndentedString(isResourceChangeCollectionEnabled))
437471
.append("\n");

src/test/resources/com/datadog/api/client/v2/api/gcp_integration.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ Feature: GCP Integration
3434
@generated @skip @team:DataDog/gcp-integrations
3535
Scenario: Create a new entry for your service account returns "Bad Request" response
3636
Given new "CreateGCPSTSAccount" request
37-
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"}}
37+
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"}}
3838
When the request is sent
3939
Then the response status is 400 Bad Request
4040

4141
@generated @skip @team:DataDog/gcp-integrations
4242
Scenario: Create a new entry for your service account returns "Conflict" response
4343
Given new "CreateGCPSTSAccount" request
44-
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"}}
44+
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"}}
4545
When the request is sent
4646
Then the response status is 409 Conflict
4747

@@ -151,15 +151,15 @@ Feature: GCP Integration
151151
Scenario: Update STS Service Account returns "Bad Request" response
152152
Given new "UpdateGCPSTSAccount" request
153153
And request contains "account_id" parameter from "REPLACE.ME"
154-
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"}}
154+
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"}}
155155
When the request is sent
156156
Then the response status is 400 Bad Request
157157

158158
@generated @skip @team:DataDog/gcp-integrations
159159
Scenario: Update STS Service Account returns "Not Found" response
160160
Given new "UpdateGCPSTSAccount" request
161161
And request contains "account_id" parameter from "REPLACE.ME"
162-
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"}}
162+
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"}}
163163
When the request is sent
164164
Then the response status is 404 Not Found
165165

0 commit comments

Comments
 (0)