Skip to content

Commit c143bba

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 91098ba of spec repo
1 parent b314617 commit c143bba

34 files changed

Lines changed: 3782 additions & 52 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 451 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Create postmortem for an incident returns "CREATED" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::CreateIncidentPostmortemOptionalParams;
4+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
5+
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateAttributes;
6+
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateData;
7+
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateRequest;
8+
use datadog_api_client::datadogV2::model::IncidentPostmortemType;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
// there is a valid "incident" in the system
13+
let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
14+
let body = IncidentPostmortemCreateRequest::new(IncidentPostmortemCreateData::new(
15+
IncidentPostmortemCreateAttributes::new(
16+
"https://app.datadoghq.com/notebook/123".to_string(),
17+
"Postmortem for IR-123".to_string(),
18+
),
19+
IncidentPostmortemType::INCIDENT_POSTMORTEMS,
20+
));
21+
let mut configuration = datadog::Configuration::new();
22+
configuration.set_unstable_operation_enabled("v2.CreateIncidentPostmortem", true);
23+
let api = IncidentsAPI::with_config(configuration);
24+
let resp = api
25+
.create_incident_postmortem(
26+
incident_data_id.clone(),
27+
body,
28+
CreateIncidentPostmortemOptionalParams::default(),
29+
)
30+
.await;
31+
if let Ok(value) = resp {
32+
println!("{:#?}", value);
33+
} else {
34+
println!("{:#?}", resp.unwrap_err());
35+
}
36+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Delete postmortem for an incident returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "postmortem" in the system
8+
let postmortem_data_relationships_incident_data_id =
9+
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.DeleteIncidentPostmortem", true);
12+
let api = IncidentsAPI::with_config(configuration);
13+
let resp = api
14+
.delete_incident_postmortem(postmortem_data_relationships_incident_data_id.clone())
15+
.await;
16+
if let Ok(value) = resp {
17+
println!("{:#?}", value);
18+
} else {
19+
println!("{:#?}", resp.unwrap_err());
20+
}
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get postmortem for an incident returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::GetIncidentPostmortemOptionalParams;
4+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "postmortem" in the system
9+
let postmortem_data_relationships_incident_data_id =
10+
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
11+
let mut configuration = datadog::Configuration::new();
12+
configuration.set_unstable_operation_enabled("v2.GetIncidentPostmortem", true);
13+
let api = IncidentsAPI::with_config(configuration);
14+
let resp = api
15+
.get_incident_postmortem(
16+
postmortem_data_relationships_incident_data_id.clone(),
17+
GetIncidentPostmortemOptionalParams::default(),
18+
)
19+
.await;
20+
if let Ok(value) = resp {
21+
println!("{:#?}", value);
22+
} else {
23+
println!("{:#?}", resp.unwrap_err());
24+
}
25+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Update postmortem for an incident returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
4+
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentPostmortemOptionalParams;
5+
use datadog_api_client::datadogV2::model::IncidentPostmortemType;
6+
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateAttributes;
7+
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateData;
8+
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateRequest;
9+
use datadog_api_client::datadogV2::model::PostmortemStatus;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
// there is a valid "postmortem" in the system
14+
let postmortem_data_id = std::env::var("POSTMORTEM_DATA_ID").unwrap();
15+
let postmortem_data_relationships_incident_data_id =
16+
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
17+
let body = IncidentPostmortemUpdateRequest::new(IncidentPostmortemUpdateData::new(
18+
IncidentPostmortemUpdateAttributes::new().status(PostmortemStatus::IN_REVIEW),
19+
postmortem_data_id.clone(),
20+
IncidentPostmortemType::INCIDENT_POSTMORTEMS,
21+
));
22+
let mut configuration = datadog::Configuration::new();
23+
configuration.set_unstable_operation_enabled("v2.UpdateIncidentPostmortem", true);
24+
let api = IncidentsAPI::with_config(configuration);
25+
let resp = api
26+
.update_incident_postmortem(
27+
postmortem_data_relationships_incident_data_id.clone(),
28+
body,
29+
UpdateIncidentPostmortemOptionalParams::default(),
30+
)
31+
.await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}

src/datadog/configuration.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ impl Default for Configuration {
590590
("v2.create_incident_integration".to_owned(), false),
591591
("v2.create_incident_notification_rule".to_owned(), false),
592592
("v2.create_incident_notification_template".to_owned(), false),
593+
("v2.create_incident_postmortem".to_owned(), false),
593594
("v2.create_incident_postmortem_attachment".to_owned(), false),
594595
("v2.create_incident_postmortem_template".to_owned(), false),
595596
("v2.create_incident_todo".to_owned(), false),
@@ -601,6 +602,7 @@ impl Default for Configuration {
601602
("v2.delete_incident_integration".to_owned(), false),
602603
("v2.delete_incident_notification_rule".to_owned(), false),
603604
("v2.delete_incident_notification_template".to_owned(), false),
605+
("v2.delete_incident_postmortem".to_owned(), false),
604606
("v2.delete_incident_postmortem_template".to_owned(), false),
605607
("v2.delete_incident_todo".to_owned(), false),
606608
("v2.delete_incident_type".to_owned(), false),
@@ -610,6 +612,7 @@ impl Default for Configuration {
610612
("v2.get_incident_integration".to_owned(), false),
611613
("v2.get_incident_notification_rule".to_owned(), false),
612614
("v2.get_incident_notification_template".to_owned(), false),
615+
("v2.get_incident_postmortem".to_owned(), false),
613616
("v2.get_incident_postmortem_template".to_owned(), false),
614617
("v2.get_incident_todo".to_owned(), false),
615618
("v2.get_incident_type".to_owned(), false),
@@ -633,6 +636,7 @@ impl Default for Configuration {
633636
("v2.update_incident_integration".to_owned(), false),
634637
("v2.update_incident_notification_rule".to_owned(), false),
635638
("v2.update_incident_notification_template".to_owned(), false),
639+
("v2.update_incident_postmortem".to_owned(), false),
636640
("v2.update_incident_postmortem_template".to_owned(), false),
637641
("v2.update_incident_todo".to_owned(), false),
638642
("v2.update_incident_type".to_owned(), false),

0 commit comments

Comments
 (0)