Skip to content

Commit a3d531b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4cb0cd4 of spec repo
1 parent 087f7f5 commit a3d531b

31 files changed

Lines changed: 4084 additions & 250 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 551 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Create Jira issue for case returns "Accepted" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::JiraIssueCreateAttributes;
5+
use datadog_api_client::datadogV2::model::JiraIssueCreateData;
6+
use datadog_api_client::datadogV2::model::JiraIssueCreateRequest;
7+
use datadog_api_client::datadogV2::model::JiraIssueResourceType;
8+
use std::collections::BTreeMap;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = JiraIssueCreateRequest::new(JiraIssueCreateData::new(
13+
JiraIssueCreateAttributes::new("10001".to_string(), "1234".to_string(), "5678".to_string())
14+
.fields(BTreeMap::from([])),
15+
JiraIssueResourceType::ISSUES,
16+
));
17+
let mut configuration = datadog::Configuration::new();
18+
configuration.set_unstable_operation_enabled("v2.CreateCaseJiraIssue", true);
19+
let api = CaseManagementAPI::with_config(configuration);
20+
let resp = api
21+
.create_case_jira_issue("case_id".to_string(), body)
22+
.await;
23+
if let Ok(value) = resp {
24+
println!("{:#?}", value);
25+
} else {
26+
println!("{:#?}", resp.unwrap_err());
27+
}
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Create investigation notebook for case returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::NotebookCreateData;
5+
use datadog_api_client::datadogV2::model::NotebookCreateRequest;
6+
use datadog_api_client::datadogV2::model::NotebookResourceType;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let body = NotebookCreateRequest::new(NotebookCreateData::new(NotebookResourceType::NOTEBOOK));
11+
let mut configuration = datadog::Configuration::new();
12+
configuration.set_unstable_operation_enabled("v2.CreateCaseNotebook", true);
13+
let api = CaseManagementAPI::with_config(configuration);
14+
let resp = api.create_case_notebook("case_id".to_string(), body).await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Create ServiceNow ticket for case returns "Accepted" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateAttributes;
5+
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateData;
6+
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateRequest;
7+
use datadog_api_client::datadogV2::model::ServiceNowTicketResourceType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = ServiceNowTicketCreateRequest::new(ServiceNowTicketCreateData::new(
12+
ServiceNowTicketCreateAttributes::new("my-instance".to_string())
13+
.assignment_group("IT Support".to_string()),
14+
ServiceNowTicketResourceType::TICKETS,
15+
));
16+
let mut configuration = datadog::Configuration::new();
17+
configuration.set_unstable_operation_enabled("v2.CreateCaseServiceNowTicket", true);
18+
let api = CaseManagementAPI::with_config(configuration);
19+
let resp = api
20+
.create_case_service_now_ticket("case_id".to_string(), body)
21+
.await;
22+
if let Ok(value) = resp {
23+
println!("{:#?}", value);
24+
} else {
25+
println!("{:#?}", resp.unwrap_err());
26+
}
27+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Link incident to case returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::IncidentRelationshipData;
5+
use datadog_api_client::datadogV2::model::IncidentResourceType;
6+
use datadog_api_client::datadogV2::model::RelationshipToIncidentRequest;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let body = RelationshipToIncidentRequest::new(IncidentRelationshipData::new(
11+
"00000000-0000-0000-0000-000000000000".to_string(),
12+
IncidentResourceType::INCIDENTS,
13+
));
14+
let mut configuration = datadog::Configuration::new();
15+
configuration.set_unstable_operation_enabled("v2.LinkIncident", true);
16+
let api = CaseManagementAPI::with_config(configuration);
17+
let resp = api.link_incident("case_id".to_string(), body).await;
18+
if let Ok(value) = resp {
19+
println!("{:#?}", value);
20+
} else {
21+
println!("{:#?}", resp.unwrap_err());
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Link existing Jira issue to case returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::JiraIssueLinkAttributes;
5+
use datadog_api_client::datadogV2::model::JiraIssueLinkData;
6+
use datadog_api_client::datadogV2::model::JiraIssueLinkRequest;
7+
use datadog_api_client::datadogV2::model::JiraIssueResourceType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = JiraIssueLinkRequest::new(JiraIssueLinkData::new(
12+
JiraIssueLinkAttributes::new("https://jira.example.com/browse/PROJ-123".to_string()),
13+
JiraIssueResourceType::ISSUES,
14+
));
15+
let mut configuration = datadog::Configuration::new();
16+
configuration.set_unstable_operation_enabled("v2.LinkJiraIssueToCase", true);
17+
let api = CaseManagementAPI::with_config(configuration);
18+
let resp = api
19+
.link_jira_issue_to_case("case_id".to_string(), body)
20+
.await;
21+
if let Ok(value) = resp {
22+
println!("{:#?}", value);
23+
} else {
24+
println!("{:#?}", resp.unwrap_err());
25+
}
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Update case project returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
use datadog_api_client::datadogV2::model::ProjectRelationship;
5+
use datadog_api_client::datadogV2::model::ProjectRelationshipData;
6+
use datadog_api_client::datadogV2::model::ProjectResourceType;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let body = ProjectRelationship::new(ProjectRelationshipData::new(
11+
"e555e290-ed65-49bd-ae18-8acbfcf18db7".to_string(),
12+
ProjectResourceType::PROJECT,
13+
));
14+
let mut configuration = datadog::Configuration::new();
15+
configuration.set_unstable_operation_enabled("v2.MoveCaseToProject", true);
16+
let api = CaseManagementAPI::with_config(configuration);
17+
let resp = api.move_case_to_project("case_id".to_string(), body).await;
18+
if let Ok(value) = resp {
19+
println!("{:#?}", value);
20+
} else {
21+
println!("{:#?}", resp.unwrap_err());
22+
}
23+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Remove Jira issue link from case returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.UnlinkJiraIssue", true);
9+
let api = CaseManagementAPI::with_config(configuration);
10+
let resp = api.unlink_jira_issue("case_id".to_string()).await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}

src/datadog/configuration.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ impl Default for Configuration {
141141
("v2.get_open_api".to_owned(), false),
142142
("v2.list_apis".to_owned(), false),
143143
("v2.update_open_api".to_owned(), false),
144+
("v2.create_case_jira_issue".to_owned(), false),
145+
("v2.create_case_notebook".to_owned(), false),
146+
("v2.create_case_service_now_ticket".to_owned(), false),
147+
("v2.link_incident".to_owned(), false),
148+
("v2.link_jira_issue_to_case".to_owned(), false),
149+
("v2.move_case_to_project".to_owned(), false),
150+
("v2.unlink_jira_issue".to_owned(), false),
144151
("v2.cancel_threat_hunting_job".to_owned(), false),
145152
("v2.convert_job_result_to_signal".to_owned(), false),
146153
("v2.delete_threat_hunting_job".to_owned(), false),

0 commit comments

Comments
 (0)