Skip to content
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
429 changes: 404 additions & 25 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions examples/v2_status-pages_CreateBackfilledMaintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,32 @@ async fn main() {
"Past Database Maintenance".to_string(),
vec![
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
status_page_data_attributes_components_0_components_0_id.clone(),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE,
)
],
"Database maintenance is in progress.".to_string(),
DateTime::parse_from_rfc3339("2021-11-11T10:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::IN_PROGRESS,
),
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
).components_affected(
vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
status_page_data_attributes_components_0_components_0_id.clone(),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE,
)
],
),
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
"Database maintenance has been completed successfully.".to_string(),
DateTime::parse_from_rfc3339("2021-11-11T11:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::COMPLETED,
).components_affected(
vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
status_page_data_attributes_components_0_components_0_id.clone(),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
)
],
)
],
),
Expand Down
14 changes: 7 additions & 7 deletions examples/v2_status-pages_CreateMaintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ async fn main() {
.expect("Failed to parse datetime")
.with_timezone(&Utc),
"We have completed maintenance on the API to improve performance.".to_string(),
vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
Uuid::parse_str("1234abcd-12ab-34cd-56ef-123456abcdef").expect("invalid UUID"),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
),
],
"We are currently performing maintenance on the API to improve performance."
.to_string(),
"We will be performing maintenance on the API to improve performance.".to_string(),
DateTime::parse_from_rfc3339("2026-02-18T19:21:13.332360+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
"API Maintenance".to_string(),
),
)
.components_affected(vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
Uuid::parse_str("1234abcd-12ab-34cd-56ef-123456abcdef").expect("invalid UUID"),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
),
]),
PatchMaintenanceRequestDataType::MAINTENANCES,
));
let configuration = datadog::Configuration::new();
Expand Down
14 changes: 7 additions & 7 deletions examples/v2_status-pages_CreateMaintenance_2202276054.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ async fn main() {
.expect("Failed to parse datetime")
.with_timezone(&Utc),
"We have completed maintenance on the API to improve performance.".to_string(),
vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
status_page_data_attributes_components_0_components_0_id.clone(),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
),
],
"We are currently performing maintenance on the API to improve performance."
.to_string(),
"We will be performing maintenance on the API to improve performance.".to_string(),
DateTime::parse_from_rfc3339("2021-11-11T12:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
"API Maintenance".to_string(),
),
)
.components_affected(vec![
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
status_page_data_attributes_components_0_components_0_id.clone(),
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
),
]),
PatchMaintenanceRequestDataType::MAINTENANCES,
));
let configuration = datadog::Configuration::new();
Expand Down
44 changes: 44 additions & 0 deletions examples/v2_status-pages_EditDegradationUpdate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Edit degradation update returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_status_pages::EditDegradationUpdateOptionalParams;
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequest;
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestData;
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataAttributes;
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataAttributesStatus;
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body = PatchDegradationUpdateRequest::new().data(
PatchDegradationUpdateRequestData::new(
PatchDegradationUpdateRequestDataType::DEGRADATION_UPDATES,
)
.attributes(
PatchDegradationUpdateRequestDataAttributes::new()
.description(
"We've identified the source of the latency increase and are deploying a fix."
.to_string(),
)
.status(PatchDegradationUpdateRequestDataAttributesStatus::IDENTIFIED),
)
.id("00000000-0000-0000-0000-000000000000".to_string()),
);
let configuration = datadog::Configuration::new();
let api = StatusPagesAPI::with_config(configuration);
let resp = api
.edit_degradation_update(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
body,
EditDegradationUpdateOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
22 changes: 22 additions & 0 deletions examples/v2_status-pages_SoftDeleteDegradationUpdate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Soft delete degradation update returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = StatusPagesAPI::with_config(configuration);
let resp = api
.soft_delete_degradation_update(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading