v2_gcp_integration_CreateGCPSTSAccount_4235664992/
v2_gcp-integration_CreateGCPSTSAccount_4235664992.rs1use datadog_api_client::datadog;
4use datadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI;
5use datadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes;
6use datadog_api_client::datadogV2::model::GCPSTSServiceAccountCreateRequest;
7use datadog_api_client::datadogV2::model::GCPSTSServiceAccountData;
8use datadog_api_client::datadogV2::model::GCPServiceAccountType;
9
10#[tokio::main]
11async fn main() {
12 let body = GCPSTSServiceAccountCreateRequest::new().data(
13 GCPSTSServiceAccountData::new()
14 .attributes(
15 GCPSTSServiceAccountAttributes::new()
16 .client_email(
17 "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com".to_string(),
18 )
19 .host_filters(vec![])
20 .is_cspm_enabled(true)
21 .resource_collection_enabled(true),
22 )
23 .type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),
24 );
25 let configuration = datadog::Configuration::new();
26 let api = GCPIntegrationAPI::with_config(configuration);
27 let resp = api.create_gcpsts_account(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}