Skip to content

Update GCP API Spec to support is_resource_change_collection_enabled #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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": "2024-10-07 14:32:07.351355",
"spec_repo_commit": "ef7c2778"
"regenerated": "2024-10-07 20:45:03.163395",
"spec_repo_commit": "5b4f9ebe"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-07 14:32:07.365583",
"spec_repo_commit": "ef7c2778"
"regenerated": "2024-10-07 20:45:03.181753",
"spec_repo_commit": "5b4f9ebe"
}
}
}
6 changes: 6 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3314,6 +3314,12 @@ components:
to be set to true.'
example: true
type: boolean
is_resource_change_collection_enabled:
default: false
description: When enabled, Datadog scans for all resource change data in
your Google Cloud environment.
example: true
type: boolean
is_security_command_center_enabled:
default: false
description: 'When enabled, Datadog will attempt to collect Security Command
Expand Down
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9566,6 +9566,12 @@ components:
product for this service account. Note: This requires resource_collection_enabled
to be set to true.'
type: boolean
is_resource_change_collection_enabled:
default: false
description: When enabled, Datadog scans for all resource change data in
your Google Cloud environment.
example: true
type: boolean
is_security_command_center_enabled:
default: false
description: 'When enabled, Datadog will attempt to collect Security Command
Expand Down
1 change: 1 addition & 0 deletions examples/v1_gcp-integration_CreateGCPIntegration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async fn main() {
.cloud_run_revision_filters(vec!["dr:dre".to_string()])
.host_filters("key:value,filter:example".to_string())
.is_cspm_enabled(true)
.is_resource_change_collection_enabled(true)
.is_security_command_center_enabled(true)
.private_key("private_key".to_string())
.private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
Expand Down
1 change: 1 addition & 0 deletions examples/v1_gcp-integration_UpdateGCPIntegration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ async fn main() {
)
.host_filters("key:value,filter:example".to_string())
.is_cspm_enabled(true)
.is_resource_change_collection_enabled(true)
.is_security_command_center_enabled(true)
.private_key("private_key".to_string())
.private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async fn main() {
.cloud_run_revision_filters(vec!["merp:derp".to_string()])
.host_filters("key:value,filter:example".to_string())
.is_cspm_enabled(true)
.is_resource_change_collection_enabled(true)
.is_security_command_center_enabled(true)
.private_key("private_key".to_string())
.private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async fn main() {
"[email protected]".to_string(),
)
.host_filters(vec![])
.is_resource_change_collection_enabled(true)
.is_security_command_center_enabled(true),
)
.type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),
Expand Down
18 changes: 18 additions & 0 deletions src/datadogV1/model/model_gcp_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ pub struct GCPAccount {
/// 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.
#[serde(rename = "is_cspm_enabled")]
pub is_cspm_enabled: Option<bool>,
/// When enabled, Datadog scans for all resource change data in your Google Cloud environment.
#[serde(rename = "is_resource_change_collection_enabled")]
pub is_resource_change_collection_enabled: Option<bool>,
/// When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
#[serde(rename = "is_security_command_center_enabled")]
pub is_security_command_center_enabled: Option<bool>,
Expand Down Expand Up @@ -85,6 +88,7 @@ impl GCPAccount {
errors: None,
host_filters: None,
is_cspm_enabled: None,
is_resource_change_collection_enabled: None,
is_security_command_center_enabled: None,
private_key: None,
private_key_id: None,
Expand Down Expand Up @@ -147,6 +151,11 @@ impl GCPAccount {
self
}

pub fn is_resource_change_collection_enabled(mut self, value: bool) -> Self {
self.is_resource_change_collection_enabled = Some(value);
self
}

pub fn is_security_command_center_enabled(mut self, value: bool) -> Self {
self.is_security_command_center_enabled = Some(value);
self
Expand Down Expand Up @@ -224,6 +233,7 @@ impl<'de> Deserialize<'de> for GCPAccount {
let mut errors: Option<Vec<String>> = None;
let mut host_filters: Option<String> = None;
let mut is_cspm_enabled: Option<bool> = None;
let mut is_resource_change_collection_enabled: Option<bool> = None;
let mut is_security_command_center_enabled: Option<bool> = None;
let mut private_key: Option<String> = None;
let mut private_key_id: Option<String> = None;
Expand Down Expand Up @@ -305,6 +315,13 @@ impl<'de> Deserialize<'de> for GCPAccount {
is_cspm_enabled =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"is_resource_change_collection_enabled" => {
if v.is_null() {
continue;
}
is_resource_change_collection_enabled =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"is_security_command_center_enabled" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -370,6 +387,7 @@ impl<'de> Deserialize<'de> for GCPAccount {
errors,
host_filters,
is_cspm_enabled,
is_resource_change_collection_enabled,
is_security_command_center_enabled,
private_key,
private_key_id,
Expand Down
18 changes: 18 additions & 0 deletions src/datadogV2/model/model_gcpsts_service_account_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub struct 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.
#[serde(rename = "is_cspm_enabled")]
pub is_cspm_enabled: Option<bool>,
/// When enabled, Datadog scans for all resource change data in your Google Cloud environment.
#[serde(rename = "is_resource_change_collection_enabled")]
pub is_resource_change_collection_enabled: Option<bool>,
/// When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
#[serde(rename = "is_security_command_center_enabled")]
pub is_security_command_center_enabled: Option<bool>,
Expand All @@ -52,6 +55,7 @@ impl GCPSTSServiceAccountAttributes {
cloud_run_revision_filters: None,
host_filters: None,
is_cspm_enabled: None,
is_resource_change_collection_enabled: None,
is_security_command_center_enabled: None,
resource_collection_enabled: None,
additional_properties: std::collections::BTreeMap::new(),
Expand Down Expand Up @@ -89,6 +93,11 @@ impl GCPSTSServiceAccountAttributes {
self
}

pub fn is_resource_change_collection_enabled(mut self, value: bool) -> Self {
self.is_resource_change_collection_enabled = Some(value);
self
}

pub fn is_security_command_center_enabled(mut self, value: bool) -> Self {
self.is_security_command_center_enabled = Some(value);
self
Expand Down Expand Up @@ -137,6 +146,7 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
let mut cloud_run_revision_filters: Option<Vec<String>> = None;
let mut host_filters: Option<Vec<String>> = None;
let mut is_cspm_enabled: Option<bool> = None;
let mut is_resource_change_collection_enabled: Option<bool> = None;
let mut is_security_command_center_enabled: Option<bool> = None;
let mut resource_collection_enabled: Option<bool> = None;
let mut additional_properties: std::collections::BTreeMap<
Expand Down Expand Up @@ -188,6 +198,13 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
is_cspm_enabled =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"is_resource_change_collection_enabled" => {
if v.is_null() {
continue;
}
is_resource_change_collection_enabled =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"is_security_command_center_enabled" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -217,6 +234,7 @@ impl<'de> Deserialize<'de> for GCPSTSServiceAccountAttributes {
cloud_run_revision_filters,
host_filters,
is_cspm_enabled,
is_resource_change_collection_enabled,
is_security_command_center_enabled,
resource_collection_enabled,
additional_properties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-01-31T21:16:03.254Z
2024-10-07T20:24:57.651Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"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\"}",
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"f28619c1be385271@example.com\",\"client_id\":\"172833269717283326970\",\"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_resource_change_collection_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\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Wed, 31 Jan 2024 21:16:03 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:24:57 GMT"
},
{
"request": {
"body": {
"string": "{\"client_email\":\"3af93b0f1c973838@example.com\",\"client_id\":\"170673576317067357630\",\"project_id\":\"datadog-apitest\"}",
"string": "{\"client_email\":\"f28619c1be385271@example.com\",\"client_id\":\"172833269717283326970\",\"project_id\":\"datadog-apitest\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -66,7 +66,7 @@
"message": "OK"
}
},
"recorded_at": "Wed, 31 Jan 2024 21:16:03 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:24:57 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-12-20T13:20:18.421Z
2024-10-07T20:30:09.400Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"40c7bfeef7b52e04@example.com\",\"client_id\":\"170307841817030784180\",\"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\"}",
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"8c747ddd32fcd610@example.com\",\"client_id\":\"172833300917283330090\",\"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_resource_change_collection_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\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Wed, 20 Dec 2023 13:20:18 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:09 GMT"
},
{
"request": {
"body": {
"string": "{\"client_email\":\"40c7bfeef7b52e04@example.com\",\"client_id\":\"170307841817030784180\",\"project_id\":\"datadog-apitest\"}",
"string": "{\"client_email\":\"8c747ddd32fcd610@example.com\",\"client_id\":\"172833300917283330090\",\"project_id\":\"datadog-apitest\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -66,12 +66,12 @@
"message": "OK"
}
},
"recorded_at": "Wed, 20 Dec 2023 13:20:18 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:09 GMT"
},
{
"request": {
"body": {
"string": "{\"client_email\":\"40c7bfeef7b52e04@example.com\",\"client_id\":\"170307841817030784180\",\"project_id\":\"datadog-apitest\"}",
"string": "{\"client_email\":\"8c747ddd32fcd610@example.com\",\"client_id\":\"172833300917283330090\",\"project_id\":\"datadog-apitest\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -100,7 +100,7 @@
"message": "OK"
}
},
"recorded_at": "Wed, 20 Dec 2023 13:20:18 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:09 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-01-31T21:16:03.829Z
2024-10-07T20:30:10.415Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"edcdf6542ac6e6b6@example.com\",\"client_id\":\"170673576317067357630\",\"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\"}",
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"0a9b348679053531@example.com\",\"client_id\":\"172833301017283330100\",\"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_resource_change_collection_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\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Wed, 31 Jan 2024 21:16:03 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:10 GMT"
},
{
"request": {
"body": {
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"edcdf6542ac6e6b6@example.com\",\"client_id\":\"170673576317067357630\",\"client_x509_cert_url\":\"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL\",\"cloud_run_revision_filters\":[\"merp:derp\"],\"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\"}",
"string": "{\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_email\":\"0a9b348679053531@example.com\",\"client_id\":\"172833301017283330100\",\"client_x509_cert_url\":\"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL\",\"cloud_run_revision_filters\":[\"merp:derp\"],\"host_filters\":\"key:value,filter:example\",\"is_cspm_enabled\":true,\"is_resource_change_collection_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\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -66,12 +66,12 @@
"message": "OK"
}
},
"recorded_at": "Wed, 31 Jan 2024 21:16:03 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:10 GMT"
},
{
"request": {
"body": {
"string": "{\"client_email\":\"edcdf6542ac6e6b6@example.com\",\"client_id\":\"170673576317067357630\",\"project_id\":\"datadog-apitest\"}",
"string": "{\"client_email\":\"0a9b348679053531@example.com\",\"client_id\":\"172833301017283330100\",\"project_id\":\"datadog-apitest\"}",
"encoding": null
},
"headers": {
Expand Down Expand Up @@ -100,7 +100,7 @@
"message": "OK"
}
},
"recorded_at": "Wed, 31 Jan 2024 21:16:03 GMT"
"recorded_at": "Mon, 07 Oct 2024 20:30:10 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-12-20T13:43:40.420Z
2024-10-07T20:30:11.373Z
Loading
Loading