Skip to content
Open
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
1,680 changes: 1,679 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions examples/v2_governance-controls_CreateGovernanceMitigation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Mitigate governance detections returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionResourceType;
use datadog_api_client::datadogV2::model::GovernanceMitigationRequest;
use datadog_api_client::datadogV2::model::GovernanceMitigationRequestAttributes;
use datadog_api_client::datadogV2::model::GovernanceMitigationRequestData;

#[tokio::main]
async fn main() {
let body = GovernanceMitigationRequest::new(
GovernanceMitigationRequestData::new(
GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
)
.attributes(
GovernanceMitigationRequestAttributes::new()
.detection_ids(vec!["3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d".to_string()])
.detection_type("unused_api_keys".to_string())
.mitigation_type("revoke_api_key".to_string()),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateGovernanceMitigation", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api.create_governance_mitigation(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get a governance control detection returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetGovernanceControlDetection", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api
.get_governance_control_detection("detection_type".to_string(), "detection_id".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Get governance control notification settings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration
.set_unstable_operation_enabled("v2.GetGovernanceControlNotificationSettings", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api
.get_governance_control_notification_settings("detection_type".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// List governance control detections returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
use datadog_api_client::datadogV2::api_governance_controls::ListGovernanceControlDetectionsOptionalParams;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListGovernanceControlDetections", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api
.list_governance_control_detections(
"detection_type".to_string(),
ListGovernanceControlDetectionsOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Update a governance control detection returns "OK" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionResourceType;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateAttributes;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateData;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateRequest;
use datadog_api_client::datadogV2::model::GovernanceControlDetectionUpdateState;

#[tokio::main]
async fn main() {
let body = GovernanceControlDetectionUpdateRequest::new(
GovernanceControlDetectionUpdateData::new(
GovernanceControlDetectionResourceType::GOVERNANCE_CONTROL_DETECTION,
)
.attributes(
GovernanceControlDetectionUpdateAttributes::new()
.assigned_team("platform-security".to_string())
.assigned_to("11111111-2222-3333-4444-555555555555".to_string())
.mitigate_after(
DateTime::parse_from_rfc3339("2024-03-15T00:00:00+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
)
.state(GovernanceControlDetectionUpdateState::EXCEPTION),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateGovernanceControlDetection", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api
.update_governance_control_detection(
"detection_type".to_string(),
"detection_id".to_string(),
body,
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Update governance control notification settings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_controls::GovernanceControlsAPI;
use datadog_api_client::datadogV2::model::ControlNotificationEventSetting;
use datadog_api_client::datadogV2::model::ControlNotificationSettingsResourceType;
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateAttributes;
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateData;
use datadog_api_client::datadogV2::model::ControlNotificationSettingsUpdateRequest;
use datadog_api_client::datadogV2::model::ControlNotificationTarget;
use datadog_api_client::datadogV2::model::ControlNotificationTargetType;

#[tokio::main]
async fn main() {
let body = ControlNotificationSettingsUpdateRequest::new(
ControlNotificationSettingsUpdateData::new(
ControlNotificationSettingsResourceType::CONTROL_NOTIFICATION_SETTINGS,
)
.attributes(
ControlNotificationSettingsUpdateAttributes::new().event_settings(vec![
ControlNotificationEventSetting::new(
true,
"new_detection".to_string(),
vec![ControlNotificationTarget::new(
"#governance-alerts".to_string(),
ControlNotificationTargetType::SLACK,
)],
),
]),
),
);
let mut configuration = datadog::Configuration::new();
configuration
.set_unstable_operation_enabled("v2.UpdateGovernanceControlNotificationSettings", true);
let api = GovernanceControlsAPI::with_config(configuration);
let resp = api
.update_governance_control_notification_settings("detection_type".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
16 changes: 16 additions & 0 deletions examples/v2_governance-settings_GetGovernanceConfig.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Get the governance console configuration returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetGovernanceConfig", true);
let api = GovernanceSettingsAPI::with_config(configuration);
let resp = api.get_governance_config().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Get governance notification settings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetGovernanceNotificationSettings", true);
let api = GovernanceSettingsAPI::with_config(configuration);
let resp = api.get_governance_notification_settings().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
16 changes: 16 additions & 0 deletions examples/v2_governance-settings_ListGovernanceLimits.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// List governance limits returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListGovernanceLimits", true);
let api = GovernanceSettingsAPI::with_config(configuration);
let resp = api.list_governance_limits().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
16 changes: 16 additions & 0 deletions examples/v2_governance-settings_ListGovernanceResourceLimits.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// List governance resource limits returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListGovernanceResourceLimits", true);
let api = GovernanceSettingsAPI::with_config(configuration);
let resp = api.list_governance_resource_limits().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Update governance notification settings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_governance_settings::GovernanceSettingsAPI;
use datadog_api_client::datadogV2::model::GovernanceNotificationSettingsResourceType;
use datadog_api_client::datadogV2::model::GovernanceNotificationSettingsUpdateAttributes;
use datadog_api_client::datadogV2::model::GovernanceNotificationSettingsUpdateData;
use datadog_api_client::datadogV2::model::GovernanceNotificationSettingsUpdateRequest;

#[tokio::main]
async fn main() {
let body = GovernanceNotificationSettingsUpdateRequest::new(
GovernanceNotificationSettingsUpdateData::new(
GovernanceNotificationSettingsResourceType::GOVERNANCE_NOTIFICATION_SETTINGS,
)
.attributes(
GovernanceNotificationSettingsUpdateAttributes::new()
.assignment_notifications_enabled(true),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateGovernanceNotificationSettings", true);
let api = GovernanceSettingsAPI::with_config(configuration);
let resp = api.update_governance_notification_settings(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
20 changes: 20 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,29 @@ impl Default for Configuration {
("v2.upsert_and_publish_form_version".to_owned(), false),
("v2.upsert_form_version".to_owned(), false),
("v2.update_org_saml_configurations".to_owned(), false),
("v2.get_governance_config".to_owned(), false),
("v2.get_governance_notification_settings".to_owned(), false),
("v2.list_governance_limits".to_owned(), false),
("v2.list_governance_resource_limits".to_owned(), false),
(
"v2.update_governance_notification_settings".to_owned(),
false,
),
("v2.create_governance_mitigation".to_owned(), false),
("v2.get_governance_control".to_owned(), false),
("v2.get_governance_control_detection".to_owned(), false),
(
"v2.get_governance_control_notification_settings".to_owned(),
false,
),
("v2.list_governance_control_detections".to_owned(), false),
("v2.list_governance_controls".to_owned(), false),
("v2.update_governance_control".to_owned(), false),
("v2.update_governance_control_detection".to_owned(), false),
(
"v2.update_governance_control_notification_settings".to_owned(),
false,
),
("v2.list_governance_insights".to_owned(), false),
("v2.create_hamr_org_connection".to_owned(), false),
("v2.get_hamr_org_connection".to_owned(), false),
Expand Down
Loading
Loading