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
472 changes: 472 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions examples/v2_incidents_CreateIncidentTimestampOverride.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Create a timestamp override for an incident returns "Created" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateIncidentTimestampOverrideOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTimestampOverrideCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentTimestampOverrideCreateData;
use datadog_api_client::datadogV2::model::IncidentTimestampOverrideCreateRequest;
use datadog_api_client::datadogV2::model::IncidentsTimestampOverridesType;
use datadog_api_client::datadogV2::model::TimestampType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body =
IncidentTimestampOverrideCreateRequest::new(IncidentTimestampOverrideCreateData::new(
IncidentTimestampOverrideCreateAttributes::new(
TimestampType::CREATED,
DateTime::parse_from_rfc3339("2024-12-29T10:00:00+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
),
IncidentsTimestampOverridesType::INCIDENTS_TIMESTAMP_OVERRIDES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateIncidentTimestampOverride", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.create_incident_timestamp_override(
Uuid::parse_str("9cecfde8-e35d-4387-8985-9b30dcb9cb1c").expect("invalid UUID"),
body,
CreateIncidentTimestampOverrideOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
22 changes: 22 additions & 0 deletions examples/v2_incidents_DeleteIncidentTimestampOverride.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Delete a timestamp override for an incident returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteIncidentTimestampOverride", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.delete_incident_timestamp_override(
Uuid::parse_str("9cecfde8-e35d-4387-8985-9b30dcb9cb1c").expect("invalid UUID"),
Uuid::parse_str("6f48a86f-9a39-4bcf-a76b-9a1b20188995").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
23 changes: 23 additions & 0 deletions examples/v2_incidents_ListIncidentTimestampOverrides.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// List timestamp overrides for an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentTimestampOverridesOptionalParams;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListIncidentTimestampOverrides", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.list_incident_timestamp_overrides(
Uuid::parse_str("9cecfde8-e35d-4387-8985-9b30dcb9cb1c").expect("invalid UUID"),
ListIncidentTimestampOverridesOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
38 changes: 38 additions & 0 deletions examples/v2_incidents_UpdateIncidentTimestampOverride.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Update a timestamp override for an incident returns "OK" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentTimestampOverrideOptionalParams;
use datadog_api_client::datadogV2::model::IncidentTimestampOverridePatchAttributes;
use datadog_api_client::datadogV2::model::IncidentTimestampOverridePatchData;
use datadog_api_client::datadogV2::model::IncidentTimestampOverridePatchRequest;
use datadog_api_client::datadogV2::model::IncidentsTimestampOverridesType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body = IncidentTimestampOverridePatchRequest::new(IncidentTimestampOverridePatchData::new(
IncidentTimestampOverridePatchAttributes::new(
DateTime::parse_from_rfc3339("2024-12-29T11:00:00+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
),
IncidentsTimestampOverridesType::INCIDENTS_TIMESTAMP_OVERRIDES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateIncidentTimestampOverride", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.update_incident_timestamp_override(
Uuid::parse_str("9cecfde8-e35d-4387-8985-9b30dcb9cb1c").expect("invalid UUID"),
Uuid::parse_str("6f48a86f-9a39-4bcf-a76b-9a1b20188995").expect("invalid UUID"),
body,
UpdateIncidentTimestampOverrideOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
4 changes: 4 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl Default for Configuration {
("v2.create_incident_notification_template".to_owned(), false),
("v2.create_incident_postmortem_attachment".to_owned(), false),
("v2.create_incident_postmortem_template".to_owned(), false),
("v2.create_incident_timestamp_override".to_owned(), false),
("v2.create_incident_todo".to_owned(), false),
("v2.create_incident_type".to_owned(), false),
("v2.delete_global_incident_handle".to_owned(), false),
Expand All @@ -205,6 +206,7 @@ impl Default for Configuration {
("v2.delete_incident_notification_rule".to_owned(), false),
("v2.delete_incident_notification_template".to_owned(), false),
("v2.delete_incident_postmortem_template".to_owned(), false),
("v2.delete_incident_timestamp_override".to_owned(), false),
("v2.delete_incident_todo".to_owned(), false),
("v2.delete_incident_type".to_owned(), false),
("v2.get_global_incident_settings".to_owned(), false),
Expand All @@ -222,6 +224,7 @@ impl Default for Configuration {
("v2.list_incident_notification_templates".to_owned(), false),
("v2.list_incident_postmortem_templates".to_owned(), false),
("v2.list_incidents".to_owned(), false),
("v2.list_incident_timestamp_overrides".to_owned(), false),
("v2.list_incident_todos".to_owned(), false),
("v2.list_incident_types".to_owned(), false),
("v2.search_incidents".to_owned(), false),
Expand All @@ -233,6 +236,7 @@ impl Default for Configuration {
("v2.update_incident_notification_rule".to_owned(), false),
("v2.update_incident_notification_template".to_owned(), false),
("v2.update_incident_postmortem_template".to_owned(), false),
("v2.update_incident_timestamp_override".to_owned(), false),
("v2.update_incident_todo".to_owned(), false),
("v2.update_incident_type".to_owned(), false),
("v2.create_jira_issue_template".to_owned(), false),
Expand Down
Loading