Skip to content

Commit 73d6a77

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c89b78d of spec repo
1 parent debc7d5 commit 73d6a77

67 files changed

Lines changed: 9598 additions & 77 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 1678 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Mitigate governance detections returns "Accepted" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
4+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionResourceType;
5+
use datadog_api_client::datadogV2::model::GovernanceMitigationRequest;
6+
use datadog_api_client::datadogV2::model::GovernanceMitigationRequestAttributes;
7+
use datadog_api_client::datadogV2::model::GovernanceMitigationRequestData;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = GovernanceMitigationRequest::new(
12+
GovernanceMitigationRequestData::new(
13+
GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
14+
)
15+
.attributes(
16+
GovernanceMitigationRequestAttributes::new()
17+
.detection_ids(vec!["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d".to_string()])
18+
.detection_type("unused_api_keys".to_string())
19+
.mitigation_type("revoke_api_key".to_string()),
20+
),
21+
);
22+
let mut configuration = datadog::Configuration::new();
23+
configuration.set_unstable_operation_enabled("v2.CreateGovernanceMitigation", true);
24+
let api = GovernanceControlsAPI::with_config(configuration);
25+
let resp = api.create_governance_mitigation(body).await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Get a governance control detection returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetGovernanceControlDetection", true);
9+
let api = GovernanceControlsAPI::with_config(configuration);
10+
let resp = api
11+
.get_governance_control_detection("detection_type".to_string(), "detection_id".to_string())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Get governance control notification settings returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration
9+
.set_unstable_operation_enabled("v2.GetGovernanceControlNotificationSettings", true);
10+
let api = GovernanceControlsAPI::with_config(configuration);
11+
let resp = api
12+
.get_governance_control_notification_settings("detection_type".to_string())
13+
.await;
14+
if let Ok(value) = resp {
15+
println!("{:#?}", value);
16+
} else {
17+
println!("{:#?}", resp.unwrap_err());
18+
}
19+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// List governance control detections returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
4+
use datadog_api_client::datadogV2::api_governance_controls::ListGovernanceControlDetectionsOptionalParams;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.ListGovernanceControlDetections", true);
10+
let api = GovernanceControlsAPI::with_config(configuration);
11+
let resp = api
12+
.list_governance_control_detections(
13+
"detection_type".to_string(),
14+
ListGovernanceControlDetectionsOptionalParams::default(),
15+
)
16+
.await;
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Update a governance control detection returns "OK" response
2+
use chrono::{DateTime, Utc};
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
5+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionResourceType;
6+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateAttributes;
7+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateData;
8+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateRequest;
9+
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateState;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = GovernanceControlDetectionUpdateRequest::new(
14+
GovernanceControlDetectionUpdateData::new(
15+
GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
16+
)
17+
.attributes(
18+
GovernanceControlDetectionUpdateAttributes::new()
19+
.assigned_team("platform-security".to_string())
20+
.assigned_to("11111111-2222-3333-4444-555555555555".to_string())
21+
.mitigate_after(
22+
DateTime::parse_from_rfc3339("2024-03-15T00:00:00+00:00")
23+
.expect("Failed to parse datetime")
24+
.with_timezone(&Utc),
25+
)
26+
.state(GovernanceControlDetectionUpdateState::EXCEPTION),
27+
),
28+
);
29+
let mut configuration = datadog::Configuration::new();
30+
configuration.set_unstable_operation_enabled("v2.UpdateGovernanceControlDetection", true);
31+
let api = GovernanceControlsAPI::with_config(configuration);
32+
let resp = api
33+
.update_governance_control_detection(
34+
"detection_type".to_string(),
35+
"detection_id".to_string(),
36+
body,
37+
)
38+
.await;
39+
if let Ok(value) = resp {
40+
println!("{:#?}", value);
41+
} else {
42+
println!("{:#?}", resp.unwrap_err());
43+
}
44+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Update governance control notification settings returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
4+
use datadog_api_client::datadogV2::model::ControlNotificationEventSetting;
5+
use datadog_api_client::datadogV2::model::ControlNotificationSettingsResourceType;
6+
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateAttributes;
7+
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateData;
8+
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateRequest;
9+
use datadog_api_client::datadogV2::model::ControlNotificationTarget;
10+
use datadog_api_client::datadogV2::model::ControlNotificationTargetType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = ControlNotificationSettingsUpdateRequest::new(
15+
ControlNotificationSettingsUpdateData::new(
16+
ControlNotificationSettingsResourceType::CONTROL_NOTIFICATION_SETTINGS,
17+
)
18+
.attributes(
19+
ControlNotificationSettingsUpdateAttributes::new().event_settings(vec![
20+
ControlNotificationEventSetting::new(
21+
true,
22+
"new_detection".to_string(),
23+
vec![ControlNotificationTarget::new(
24+
"#governance-alerts".to_string(),
25+
ControlNotificationTargetType::SLACK,
26+
)],
27+
),
28+
]),
29+
),
30+
);
31+
let mut configuration = datadog::Configuration::new();
32+
configuration
33+
.set_unstable_operation_enabled("v2.UpdateGovernanceControlNotificationSettings", true);
34+
let api = GovernanceControlsAPI::with_config(configuration);
35+
let resp = api
36+
.update_governance_control_notification_settings("detection_type".to_string(), body)
37+
.await;
38+
if let Ok(value) = resp {
39+
println!("{:#?}", value);
40+
} else {
41+
println!("{:#?}", resp.unwrap_err());
42+
}
43+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Get the governance console configuration returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetGovernanceConfig", true);
9+
let api = GovernanceSettingsAPI::with_config(configuration);
10+
let resp = api.get_governance_config().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Get governance notification settings returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetGovernanceNotificationSettings", true);
9+
let api = GovernanceSettingsAPI::with_config(configuration);
10+
let resp = api.get_governance_notification_settings().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// List governance limits returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.ListGovernanceLimits", true);
9+
let api = GovernanceSettingsAPI::with_config(configuration);
10+
let resp = api.list_governance_limits().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}

0 commit comments

Comments
 (0)