Skip to content

Commit 7019303

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 79b52be of spec repo
1 parent 0773181 commit 7019303

File tree

44 files changed

+2165
-1361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2165
-1361
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 338 additions & 307 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Create incident attachment returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::CreateIncidentAttachmentOptionalParams;
4+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
5+
use datadog_api_client::datadogV2::model::AttachmentDataAttributesAttachmentType;
6+
use datadog_api_client::datadogV2::model::CreateAttachmentRequest;
7+
use datadog_api_client::datadogV2::model::CreateAttachmentRequestData;
8+
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributes;
9+
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributesAttachment;
10+
use datadog_api_client::datadogV2::model::IncidentAttachmentType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = CreateAttachmentRequest::new().data(
15+
CreateAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS)
16+
.attributes(
17+
CreateAttachmentRequestDataAttributes::new()
18+
.attachment(
19+
CreateAttachmentRequestDataAttributesAttachment::new()
20+
.document_url(
21+
"https://app.datadoghq.com/notebook/123/Postmortem-IR-123"
22+
.to_string(),
23+
)
24+
.title("Postmortem-IR-123".to_string()),
25+
)
26+
.attachment_type(AttachmentDataAttributesAttachmentType::POSTMORTEM),
27+
)
28+
.id("00000000-0000-0000-0000-000000000000".to_string()),
29+
);
30+
let mut configuration = datadog::Configuration::new();
31+
configuration.set_unstable_operation_enabled("v2.CreateIncidentAttachment", true);
32+
let api = IncidentsAPI::with_config(configuration);
33+
let resp = api
34+
.create_incident_attachment(
35+
"incident_id".to_string(),
36+
body,
37+
CreateIncidentAttachmentOptionalParams::default(),
38+
)
39+
.await;
40+
if let Ok(value) = resp {
41+
println!("{:#?}", value);
42+
} else {
43+
println!("{:#?}", resp.unwrap_err());
44+
}
45+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Delete incident attachment returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
4+
use serde_json::Value;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.DeleteIncidentAttachment", true);
10+
let api = IncidentsAPI::with_config(configuration);
11+
let resp = api
12+
.delete_incident_attachment(
13+
"incident_id".to_string(),
14+
Value::from("00000000-0000-0000-0000-000000000002"),
15+
)
16+
.await;
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}

examples/v2_incidents_ListIncidentAttachments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Get a list of attachments returns "OK" response
1+
// List incident attachments returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
44
use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams;

examples/v2_incidents_ListIncidentAttachments_2457735435.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Update incident attachment 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::UpdateIncidentAttachmentOptionalParams;
5+
use datadog_api_client::datadogV2::model::IncidentAttachmentType;
6+
use datadog_api_client::datadogV2::model::PatchAttachmentRequest;
7+
use datadog_api_client::datadogV2::model::PatchAttachmentRequestData;
8+
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributes;
9+
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributesAttachment;
10+
use serde_json::Value;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = PatchAttachmentRequest::new().data(
15+
PatchAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS).attributes(
16+
PatchAttachmentRequestDataAttributes::new().attachment(
17+
PatchAttachmentRequestDataAttributesAttachment::new()
18+
.document_url(
19+
"https://app.datadoghq.com/notebook/124/Postmortem-IR-124".to_string(),
20+
)
21+
.title("Postmortem-IR-124".to_string()),
22+
),
23+
),
24+
);
25+
let mut configuration = datadog::Configuration::new();
26+
configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachment", true);
27+
let api = IncidentsAPI::with_config(configuration);
28+
let resp = api
29+
.update_incident_attachment(
30+
"incident_id".to_string(),
31+
Value::from("00000000-0000-0000-0000-000000000002"),
32+
body,
33+
UpdateIncidentAttachmentOptionalParams::default(),
34+
)
35+
.await;
36+
if let Ok(value) = resp {
37+
println!("{:#?}", value);
38+
} else {
39+
println!("{:#?}", resp.unwrap_err());
40+
}
41+
}

examples/v2_incidents_UpdateIncidentAttachments.rs

Lines changed: 0 additions & 61 deletions
This file was deleted.

examples/v2_incidents_UpdateIncidentAttachments_3881702075.rs

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/datadog/configuration.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,14 @@ impl Default for Configuration {
188188
("v2.update_deployment_gate".to_owned(), false),
189189
("v2.update_deployment_rule".to_owned(), false),
190190
("v2.create_incident".to_owned(), false),
191+
("v2.create_incident_attachment".to_owned(), false),
191192
("v2.create_incident_integration".to_owned(), false),
192193
("v2.create_incident_notification_rule".to_owned(), false),
193194
("v2.create_incident_notification_template".to_owned(), false),
194195
("v2.create_incident_todo".to_owned(), false),
195196
("v2.create_incident_type".to_owned(), false),
196197
("v2.delete_incident".to_owned(), false),
198+
("v2.delete_incident_attachment".to_owned(), false),
197199
("v2.delete_incident_integration".to_owned(), false),
198200
("v2.delete_incident_notification_rule".to_owned(), false),
199201
("v2.delete_incident_notification_template".to_owned(), false),
@@ -214,7 +216,7 @@ impl Default for Configuration {
214216
("v2.list_incident_types".to_owned(), false),
215217
("v2.search_incidents".to_owned(), false),
216218
("v2.update_incident".to_owned(), false),
217-
("v2.update_incident_attachments".to_owned(), false),
219+
("v2.update_incident_attachment".to_owned(), false),
218220
("v2.update_incident_integration".to_owned(), false),
219221
("v2.update_incident_notification_rule".to_owned(), false),
220222
("v2.update_incident_notification_template".to_owned(), false),

0 commit comments

Comments
 (0)