Skip to content

Commit 2020af3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8fbe29a of spec repo
1 parent 7bbc37c commit 2020af3

36 files changed

+3807
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 523 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Get a Bits AI investigation returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_bits_ai::BitsAIAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetInvestigation", true);
9+
let api = BitsAIAPI::with_config(configuration);
10+
let resp = api.get_investigation("id".to_string()).await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// List Bits AI investigations returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_bits_ai::BitsAIAPI;
4+
use datadog_api_client::datadogV2::api_bits_ai::ListInvestigationsOptionalParams;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.ListInvestigations", true);
10+
let api = BitsAIAPI::with_config(configuration);
11+
let resp = api
12+
.list_investigations(ListInvestigationsOptionalParams::default())
13+
.await;
14+
if let Ok(value) = resp {
15+
println!("{:#?}", value);
16+
} else {
17+
println!("{:#?}", resp.unwrap_err());
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// List Bits AI investigations returns "OK" response with pagination
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_bits_ai::BitsAIAPI;
4+
use datadog_api_client::datadogV2::api_bits_ai::ListInvestigationsOptionalParams;
5+
use futures_util::pin_mut;
6+
use futures_util::stream::StreamExt;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.ListInvestigations", true);
12+
let api = BitsAIAPI::with_config(configuration);
13+
let response =
14+
api.list_investigations_with_pagination(ListInvestigationsOptionalParams::default());
15+
pin_mut!(response);
16+
while let Some(resp) = response.next().await {
17+
if let Ok(value) = resp {
18+
println!("{:#?}", value);
19+
} else {
20+
println!("{:#?}", resp.unwrap_err());
21+
}
22+
}
23+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Trigger a Bits AI investigation returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_bits_ai::BitsAIAPI;
4+
use datadog_api_client::datadogV2::model::MonitorAlertTriggerAttributes;
5+
use datadog_api_client::datadogV2::model::TriggerAttributes;
6+
use datadog_api_client::datadogV2::model::TriggerInvestigationRequest;
7+
use datadog_api_client::datadogV2::model::TriggerInvestigationRequestData;
8+
use datadog_api_client::datadogV2::model::TriggerInvestigationRequestDataAttributes;
9+
use datadog_api_client::datadogV2::model::TriggerInvestigationRequestType;
10+
use datadog_api_client::datadogV2::model::TriggerType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = TriggerInvestigationRequest::new(TriggerInvestigationRequestData::new(
15+
TriggerInvestigationRequestDataAttributes::new(TriggerAttributes::new(
16+
MonitorAlertTriggerAttributes::new(
17+
"1234567890123456789".to_string(),
18+
1700000000000,
19+
12345678,
20+
),
21+
TriggerType::MONITOR_ALERT_TRIGGER,
22+
)),
23+
TriggerInvestigationRequestType::TRIGGER_INVESTIGATION_REQUEST,
24+
));
25+
let mut configuration = datadog::Configuration::new();
26+
configuration.set_unstable_operation_enabled("v2.TriggerInvestigation", true);
27+
let api = BitsAIAPI::with_config(configuration);
28+
let resp = api.trigger_investigation(body).await;
29+
if let Ok(value) = resp {
30+
println!("{:#?}", value);
31+
} else {
32+
println!("{:#?}", resp.unwrap_err());
33+
}
34+
}

src/datadog/configuration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ 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.get_investigation".to_owned(), false),
145+
("v2.list_investigations".to_owned(), false),
146+
("v2.trigger_investigation".to_owned(), false),
144147
("v2.create_case_jira_issue".to_owned(), false),
145148
("v2.create_case_notebook".to_owned(), false),
146149
("v2.create_case_service_now_ticket".to_owned(), false),

0 commit comments

Comments
 (0)