Skip to content

Commit b37cb04

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Edit and Delete Notice Update and Slack icon support in API spec (#1769)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 49b8ab4 commit b37cb04

35 files changed

Lines changed: 3208 additions & 62 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 404 additions & 25 deletions
Large diffs are not rendered by default.

examples/v2_status-pages_CreateBackfilledMaintenance.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,32 @@ async fn main() {
3131
"Past Database Maintenance".to_string(),
3232
vec![
3333
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
34-
vec![
35-
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
36-
status_page_data_attributes_components_0_components_0_id.clone(),
37-
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE,
38-
)
39-
],
4034
"Database maintenance is in progress.".to_string(),
4135
DateTime::parse_from_rfc3339("2021-11-11T10:11:11+00:00")
4236
.expect("Failed to parse datetime")
4337
.with_timezone(&Utc),
4438
CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::IN_PROGRESS,
45-
),
46-
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
39+
).components_affected(
4740
vec![
4841
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
4942
status_page_data_attributes_components_0_components_0_id.clone(),
50-
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
43+
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE,
5144
)
5245
],
46+
),
47+
CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems::new(
5348
"Database maintenance has been completed successfully.".to_string(),
5449
DateTime::parse_from_rfc3339("2021-11-11T11:11:11+00:00")
5550
.expect("Failed to parse datetime")
5651
.with_timezone(&Utc),
5752
CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::COMPLETED,
53+
).components_affected(
54+
vec![
55+
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
56+
status_page_data_attributes_components_0_components_0_id.clone(),
57+
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
58+
)
59+
],
5860
)
5961
],
6062
),

examples/v2_status-pages_CreateMaintenance.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ async fn main() {
1919
.expect("Failed to parse datetime")
2020
.with_timezone(&Utc),
2121
"We have completed maintenance on the API to improve performance.".to_string(),
22-
vec![
23-
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
24-
Uuid::parse_str("1234abcd-12ab-34cd-56ef-123456abcdef").expect("invalid UUID"),
25-
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
26-
),
27-
],
2822
"We are currently performing maintenance on the API to improve performance."
2923
.to_string(),
3024
"We will be performing maintenance on the API to improve performance.".to_string(),
3125
DateTime::parse_from_rfc3339("2026-02-18T19:21:13.332360+00:00")
3226
.expect("Failed to parse datetime")
3327
.with_timezone(&Utc),
3428
"API Maintenance".to_string(),
35-
),
29+
)
30+
.components_affected(vec![
31+
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
32+
Uuid::parse_str("1234abcd-12ab-34cd-56ef-123456abcdef").expect("invalid UUID"),
33+
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
34+
),
35+
]),
3636
PatchMaintenanceRequestDataType::MAINTENANCES,
3737
));
3838
let configuration = datadog::Configuration::new();

examples/v2_status-pages_CreateMaintenance_2202276054.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ async fn main() {
2525
.expect("Failed to parse datetime")
2626
.with_timezone(&Utc),
2727
"We have completed maintenance on the API to improve performance.".to_string(),
28-
vec![
29-
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
30-
status_page_data_attributes_components_0_components_0_id.clone(),
31-
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
32-
),
33-
],
3428
"We are currently performing maintenance on the API to improve performance."
3529
.to_string(),
3630
"We will be performing maintenance on the API to improve performance.".to_string(),
3731
DateTime::parse_from_rfc3339("2021-11-11T12:11:11+00:00")
3832
.expect("Failed to parse datetime")
3933
.with_timezone(&Utc),
4034
"API Maintenance".to_string(),
41-
),
35+
)
36+
.components_affected(vec![
37+
CreateMaintenanceRequestDataAttributesComponentsAffectedItems::new(
38+
status_page_data_attributes_components_0_components_0_id.clone(),
39+
PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
40+
),
41+
]),
4242
PatchMaintenanceRequestDataType::MAINTENANCES,
4343
));
4444
let configuration = datadog::Configuration::new();
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Edit degradation update returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::EditDegradationUpdateOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequest;
6+
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestData;
7+
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataAttributes;
8+
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataAttributesStatus;
9+
use datadog_api_client::datadogV2::model::PatchDegradationUpdateRequestDataType;
10+
use uuid::Uuid;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = PatchDegradationUpdateRequest::new().data(
15+
PatchDegradationUpdateRequestData::new(
16+
PatchDegradationUpdateRequestDataType::DEGRADATION_UPDATES,
17+
)
18+
.attributes(
19+
PatchDegradationUpdateRequestDataAttributes::new()
20+
.description(
21+
"We've identified the source of the latency increase and are deploying a fix."
22+
.to_string(),
23+
)
24+
.status(PatchDegradationUpdateRequestDataAttributesStatus::IDENTIFIED),
25+
)
26+
.id("00000000-0000-0000-0000-000000000000".to_string()),
27+
);
28+
let configuration = datadog::Configuration::new();
29+
let api = StatusPagesAPI::with_config(configuration);
30+
let resp = api
31+
.edit_degradation_update(
32+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
33+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
34+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
35+
body,
36+
EditDegradationUpdateOptionalParams::default(),
37+
)
38+
.await;
39+
if let Ok(value) = resp {
40+
println!("{:#?}", value);
41+
} else {
42+
println!("{:#?}", resp.unwrap_err());
43+
}
44+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Soft delete degradation update returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
4+
use uuid::Uuid;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = StatusPagesAPI::with_config(configuration);
10+
let resp = api
11+
.soft_delete_degradation_update(
12+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
13+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
14+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
15+
)
16+
.await;
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}

0 commit comments

Comments
 (0)