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

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions examples/v2_incidents_CreateIncidentPostmortem.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Create postmortem for an incident returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateIncidentPostmortemOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateData;
use datadog_api_client::datadogV2::model::IncidentPostmortemCreateRequest;
use datadog_api_client::datadogV2::model::IncidentPostmortemType;

#[tokio::main]
async fn main() {
// there is a valid "incident" in the system
let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
let body = IncidentPostmortemCreateRequest::new(IncidentPostmortemCreateData::new(
IncidentPostmortemCreateAttributes::new(
"https://app.datadoghq.com/notebook/123".to_string(),
"Postmortem for IR-123".to_string(),
),
IncidentPostmortemType::INCIDENT_POSTMORTEMS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateIncidentPostmortem", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.create_incident_postmortem(
incident_data_id.clone(),
body,
CreateIncidentPostmortemOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_incidents_DeleteIncidentPostmortem.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Delete postmortem for an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
// there is a valid "postmortem" in the system
let postmortem_data_relationships_incident_data_id =
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteIncidentPostmortem", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.delete_incident_postmortem(postmortem_data_relationships_incident_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
25 changes: 25 additions & 0 deletions examples/v2_incidents_GetIncidentPostmortem.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get postmortem for an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentPostmortemOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
// there is a valid "postmortem" in the system
let postmortem_data_relationships_incident_data_id =
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetIncidentPostmortem", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.get_incident_postmortem(
postmortem_data_relationships_incident_data_id.clone(),
GetIncidentPostmortemOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
37 changes: 37 additions & 0 deletions examples/v2_incidents_UpdateIncidentPostmortem.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Update postmortem 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::UpdateIncidentPostmortemOptionalParams;
use datadog_api_client::datadogV2::model::IncidentPostmortemType;
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateAttributes;
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateData;
use datadog_api_client::datadogV2::model::IncidentPostmortemUpdateRequest;
use datadog_api_client::datadogV2::model::PostmortemStatus;

#[tokio::main]
async fn main() {
// there is a valid "postmortem" in the system
let postmortem_data_id = std::env::var("POSTMORTEM_DATA_ID").unwrap();
let postmortem_data_relationships_incident_data_id =
std::env::var("POSTMORTEM_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
let body = IncidentPostmortemUpdateRequest::new(IncidentPostmortemUpdateData::new(
IncidentPostmortemUpdateAttributes::new().status(PostmortemStatus::IN_REVIEW),
postmortem_data_id.clone(),
IncidentPostmortemType::INCIDENT_POSTMORTEMS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateIncidentPostmortem", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.update_incident_postmortem(
postmortem_data_relationships_incident_data_id.clone(),
body,
UpdateIncidentPostmortemOptionalParams::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 @@ -590,6 +590,7 @@ impl Default for Configuration {
("v2.create_incident_integration".to_owned(), false),
("v2.create_incident_notification_rule".to_owned(), false),
("v2.create_incident_notification_template".to_owned(), false),
("v2.create_incident_postmortem".to_owned(), false),
("v2.create_incident_postmortem_attachment".to_owned(), false),
("v2.create_incident_postmortem_template".to_owned(), false),
("v2.create_incident_todo".to_owned(), false),
Expand All @@ -601,6 +602,7 @@ impl Default for Configuration {
("v2.delete_incident_integration".to_owned(), false),
("v2.delete_incident_notification_rule".to_owned(), false),
("v2.delete_incident_notification_template".to_owned(), false),
("v2.delete_incident_postmortem".to_owned(), false),
("v2.delete_incident_postmortem_template".to_owned(), false),
("v2.delete_incident_todo".to_owned(), false),
("v2.delete_incident_type".to_owned(), false),
Expand All @@ -610,6 +612,7 @@ impl Default for Configuration {
("v2.get_incident_integration".to_owned(), false),
("v2.get_incident_notification_rule".to_owned(), false),
("v2.get_incident_notification_template".to_owned(), false),
("v2.get_incident_postmortem".to_owned(), false),
("v2.get_incident_postmortem_template".to_owned(), false),
("v2.get_incident_todo".to_owned(), false),
("v2.get_incident_type".to_owned(), false),
Expand All @@ -633,6 +636,7 @@ impl Default for Configuration {
("v2.update_incident_integration".to_owned(), false),
("v2.update_incident_notification_rule".to_owned(), false),
("v2.update_incident_notification_template".to_owned(), false),
("v2.update_incident_postmortem".to_owned(), false),
("v2.update_incident_postmortem_template".to_owned(), false),
("v2.update_incident_todo".to_owned(), false),
("v2.update_incident_type".to_owned(), false),
Expand Down
Loading
Loading