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

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions examples/v2_incidents_CreateIncidentAttachment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Create incident attachment returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateIncidentAttachmentOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::AttachmentDataAttributesAttachmentType;
use datadog_api_client::datadogV2::model::CreateAttachmentRequest;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestData;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributes;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributesAttachment;
use datadog_api_client::datadogV2::model::IncidentAttachmentType;

#[tokio::main]
async fn main() {
let body = CreateAttachmentRequest::new().data(
CreateAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS)
.attributes(
CreateAttachmentRequestDataAttributes::new()
.attachment(
CreateAttachmentRequestDataAttributesAttachment::new()
.document_url(
"https://app.datadoghq.com/notebook/123/Postmortem-IR-123"
.to_string(),
)
.title("Postmortem-IR-123".to_string()),
)
.attachment_type(AttachmentDataAttributesAttachmentType::POSTMORTEM),
)
.id("00000000-0000-0000-0000-000000000000".to_string()),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateIncidentAttachment", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.create_incident_attachment(
"incident_id".to_string(),
body,
CreateIncidentAttachmentOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
22 changes: 22 additions & 0 deletions examples/v2_incidents_DeleteIncidentAttachment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Delete incident attachment returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use serde_json::Value;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteIncidentAttachment", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.delete_incident_attachment(
"incident_id".to_string(),
Value::from("00000000-0000-0000-0000-000000000002"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
2 changes: 1 addition & 1 deletion examples/v2_incidents_ListIncidentAttachments.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Get a list of attachments returns "OK" response
// List incident attachments returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams;
Expand Down
24 changes: 0 additions & 24 deletions examples/v2_incidents_ListIncidentAttachments_2457735435.rs

This file was deleted.

41 changes: 41 additions & 0 deletions examples/v2_incidents_UpdateIncidentAttachment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Update incident attachment returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentAttachmentType;
use datadog_api_client::datadogV2::model::PatchAttachmentRequest;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestData;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributes;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributesAttachment;
use serde_json::Value;

#[tokio::main]
async fn main() {
let body = PatchAttachmentRequest::new().data(
PatchAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS).attributes(
PatchAttachmentRequestDataAttributes::new().attachment(
PatchAttachmentRequestDataAttributesAttachment::new()
.document_url(
"https://app.datadoghq.com/notebook/124/Postmortem-IR-124".to_string(),
)
.title("Postmortem-IR-124".to_string()),
),
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachment", true);
let api = IncidentsAPI::with_config(configuration);
let resp = api
.update_incident_attachment(
"incident_id".to_string(),
Value::from("00000000-0000-0000-0000-000000000002"),
body,
UpdateIncidentAttachmentOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
61 changes: 0 additions & 61 deletions examples/v2_incidents_UpdateIncidentAttachments.rs

This file was deleted.

46 changes: 0 additions & 46 deletions examples/v2_incidents_UpdateIncidentAttachments_3881702075.rs

This file was deleted.

4 changes: 3 additions & 1 deletion src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,15 @@ impl Default for Configuration {
("v2.update_deployment_gate".to_owned(), false),
("v2.update_deployment_rule".to_owned(), false),
("v2.create_incident".to_owned(), false),
("v2.create_incident_attachment".to_owned(), false),
("v2.create_incident_impact".to_owned(), false),
("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_todo".to_owned(), false),
("v2.create_incident_type".to_owned(), false),
("v2.delete_incident".to_owned(), false),
("v2.delete_incident_attachment".to_owned(), false),
("v2.delete_incident_impact".to_owned(), false),
("v2.delete_incident_integration".to_owned(), false),
("v2.delete_incident_notification_rule".to_owned(), false),
Expand All @@ -214,7 +216,7 @@ impl Default for Configuration {
("v2.list_incident_types".to_owned(), false),
("v2.search_incidents".to_owned(), false),
("v2.update_incident".to_owned(), false),
("v2.update_incident_attachments".to_owned(), false),
("v2.update_incident_attachment".to_owned(), false),
("v2.update_incident_integration".to_owned(), false),
("v2.update_incident_notification_rule".to_owned(), false),
("v2.update_incident_notification_template".to_owned(), false),
Expand Down
Loading