Skip to content

Commit 99ccde3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2ffcae8 of spec repo
1 parent 5b467e3 commit 99ccde3

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23536,6 +23536,13 @@ components:
2353623536
product for this service account. Note: This requires resource_collection_enabled
2353723537
to be set to true.'
2353823538
type: boolean
23539+
is_global_location_enabled:
23540+
default: true
23541+
description: When enabled, Datadog collects metrics where location is explicitly
23542+
stated as "global" or where location information cannot be deduced from
23543+
GCP labels.
23544+
example: true
23545+
type: boolean
2353923546
is_per_project_quota_enabled:
2354023547
default: false
2354123548
description: When enabled, Datadog applies the `X-Goog-User-Project` header,
@@ -23577,6 +23584,18 @@ components:
2357723584
items:
2357823585
$ref: '#/components/schemas/GCPMonitoredResourceConfig'
2357923586
type: array
23587+
region_filter_configs:
23588+
description: Configurations for GCP location filtering, such as region,
23589+
multi-region, or zone. Only monitored resources that match the specified
23590+
regions are imported into Datadog. By default, Datadog collects from all
23591+
locations.
23592+
example:
23593+
- nam4
23594+
- europe-north1
23595+
items:
23596+
description: Region Filter Configs
23597+
type: string
23598+
type: array
2358023599
resource_collection_enabled:
2358123600
description: When enabled, Datadog scans for all resources in your GCP environment.
2358223601
type: boolean

src/datadogV2/model/model_gcpsts_service_account_attributes.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub struct GCPSTSServiceAccountAttributes {
3535
/// 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.
3636
#[serde(rename = "is_cspm_enabled")]
3737
pub is_cspm_enabled: Option<bool>,
38+
/// When enabled, Datadog collects metrics where location is explicitly stated as "global" or where location information cannot be deduced from GCP labels.
39+
#[serde(rename = "is_global_location_enabled")]
40+
pub is_global_location_enabled: Option<bool>,
3841
/// 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.
3942
#[serde(rename = "is_per_project_quota_enabled")]
4043
pub is_per_project_quota_enabled: Option<bool>,
@@ -51,6 +54,9 @@ pub struct GCPSTSServiceAccountAttributes {
5154
#[serde(rename = "monitored_resource_configs")]
5255
pub monitored_resource_configs:
5356
Option<Vec<crate::datadogV2::model::GCPMonitoredResourceConfig>>,
57+
/// Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations.
58+
#[serde(rename = "region_filter_configs")]
59+
pub region_filter_configs: Option<Vec<String>>,
5460
/// When enabled, Datadog scans for all resources in your GCP environment.
5561
#[serde(rename = "resource_collection_enabled")]
5662
pub resource_collection_enabled: Option<bool>,
@@ -71,11 +77,13 @@ impl GCPSTSServiceAccountAttributes {
7177
cloud_run_revision_filters: None,
7278
host_filters: None,
7379
is_cspm_enabled: None,
80+
is_global_location_enabled: None,
7481
is_per_project_quota_enabled: None,
7582
is_resource_change_collection_enabled: None,
7683
is_security_command_center_enabled: None,
7784
metric_namespace_configs: None,
7885
monitored_resource_configs: None,
86+
region_filter_configs: None,
7987
resource_collection_enabled: None,
8088
additional_properties: std::collections::BTreeMap::new(),
8189
_unparsed: false,
@@ -118,6 +126,12 @@ impl GCPSTSServiceAccountAttributes {
118126
self
119127
}
120128

129+
#[allow(deprecated)]
130+
pub fn is_global_location_enabled(mut self, value: bool) -> Self {
131+
self.is_global_location_enabled = Some(value);
132+
self
133+
}
134+
121135
#[allow(deprecated)]
122136
pub fn is_per_project_quota_enabled(mut self, value: bool) -> Self {
123137
self.is_per_project_quota_enabled = Some(value);
@@ -154,6 +168,12 @@ impl GCPSTSServiceAccountAttributes {
154168
self
155169
}
156170

171+
#[allow(deprecated)]
172+
pub fn region_filter_configs(mut self, value: Vec<String>) -> Self {
173+
self.region_filter_configs = Some(value);
174+
self
175+
}
176+
157177
#[allow(deprecated)]
158178
pub fn resource_collection_enabled(mut self, value: bool) -> Self {
159179
self.resource_collection_enabled = Some(value);
@@ -198,6 +218,7 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
198218
let mut cloud_run_revision_filters: Option<Vec<String>> = None;
199219
let mut host_filters: Option<Vec<String>> = None;
200220
let mut is_cspm_enabled: Option<bool> = None;
221+
let mut is_global_location_enabled: Option<bool> = None;
201222
let mut is_per_project_quota_enabled: Option<bool> = None;
202223
let mut is_resource_change_collection_enabled: Option<bool> = None;
203224
let mut is_security_command_center_enabled: Option<bool> = None;
@@ -207,6 +228,7 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
207228
let mut monitored_resource_configs: Option<
208229
Vec<crate::datadogV2::model::GCPMonitoredResourceConfig>,
209230
> = None;
231+
let mut region_filter_configs: Option<Vec<String>> = None;
210232
let mut resource_collection_enabled: Option<bool> = None;
211233
let mut additional_properties: std::collections::BTreeMap<
212234
String,
@@ -257,6 +279,13 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
257279
is_cspm_enabled =
258280
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
259281
}
282+
"is_global_location_enabled" => {
283+
if v.is_null() {
284+
continue;
285+
}
286+
is_global_location_enabled =
287+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
288+
}
260289
"is_per_project_quota_enabled" => {
261290
if v.is_null() {
262291
continue;
@@ -292,6 +321,13 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
292321
monitored_resource_configs =
293322
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
294323
}
324+
"region_filter_configs" => {
325+
if v.is_null() {
326+
continue;
327+
}
328+
region_filter_configs =
329+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
330+
}
295331
"resource_collection_enabled" => {
296332
if v.is_null() {
297333
continue;
@@ -315,11 +351,13 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
315351
cloud_run_revision_filters,
316352
host_filters,
317353
is_cspm_enabled,
354+
is_global_location_enabled,
318355
is_per_project_quota_enabled,
319356
is_resource_change_collection_enabled,
320357
is_security_command_center_enabled,
321358
metric_namespace_configs,
322359
monitored_resource_configs,
360+
region_filter_configs,
323361
resource_collection_enabled,
324362
additional_properties,
325363
_unparsed,

tests/scenarios/features/v2/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": ["$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"}}
37+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "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"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}}
44+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "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"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}}
154+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "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"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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": ["$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"}}
162+
And body with value {"data": {"attributes": {"account_tags": [], "client_email": "[email protected]", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "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"}], "region_filter_configs": ["nam4", "europe-north1"]}, "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)