Skip to content

Commit a1fade3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9b4bbcf of spec repo
1 parent e72bde0 commit a1fade3

32 files changed

+3834
-14
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 441 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Synthetics: Create a test suite returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
4+
use datadog_api_client::datadogV2::model::SuiteCreateEdit;
5+
use datadog_api_client::datadogV2::model::SuiteCreateEditRequest;
6+
use datadog_api_client::datadogV2::model::SyntheticsSuite;
7+
use datadog_api_client::datadogV2::model::SyntheticsSuiteOptions;
8+
use datadog_api_client::datadogV2::model::SyntheticsSuiteType;
9+
use datadog_api_client::datadogV2::model::SyntheticsSuiteTypes;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = SuiteCreateEditRequest::new(SuiteCreateEdit::new(
14+
SyntheticsSuite::new(
15+
"Notification message".to_string(),
16+
"Example suite name".to_string(),
17+
SyntheticsSuiteOptions::new(),
18+
vec![],
19+
SyntheticsSuiteType::SUITE,
20+
)
21+
.tags(vec!["env:production".to_string()]),
22+
SyntheticsSuiteTypes::SUITES,
23+
));
24+
let configuration = datadog::Configuration::new();
25+
let api = SyntheticsAPI::with_config(configuration);
26+
let resp = api.create_synthetics_suite(body).await;
27+
if let Ok(value) = resp {
28+
println!("{:#?}", value);
29+
} else {
30+
println!("{:#?}", resp.unwrap_err());
31+
}
32+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Synthetics: Bulk delete suites returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
4+
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDelete;
5+
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDeleteAttributes;
6+
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDeleteRequest;
7+
use datadog_api_client::datadogV2::model::DeletedSuitesRequestType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = DeletedSuitesRequestDeleteRequest::new(
12+
DeletedSuitesRequestDelete::new(DeletedSuitesRequestDeleteAttributes::new(vec![
13+
"".to_string()
14+
]))
15+
.type_(DeletedSuitesRequestType::DELETE_SUITES_REQUEST),
16+
);
17+
let configuration = datadog::Configuration::new();
18+
let api = SyntheticsAPI::with_config(configuration);
19+
let resp = api.delete_synthetics_suites(body).await;
20+
if let Ok(value) = resp {
21+
println!("{:#?}", value);
22+
} else {
23+
println!("{:#?}", resp.unwrap_err());
24+
}
25+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Synthetics: edit a test suite returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
4+
use datadog_api_client::datadogV2::model::SuiteCreateEdit;
5+
use datadog_api_client::datadogV2::model::SuiteCreateEditRequest;
6+
use datadog_api_client::datadogV2::model::SyntheticsSuite;
7+
use datadog_api_client::datadogV2::model::SyntheticsSuiteOptions;
8+
use datadog_api_client::datadogV2::model::SyntheticsSuiteTest;
9+
use datadog_api_client::datadogV2::model::SyntheticsSuiteTestAlertingCriticality;
10+
use datadog_api_client::datadogV2::model::SyntheticsSuiteType;
11+
use datadog_api_client::datadogV2::model::SyntheticsSuiteTypes;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body = SuiteCreateEditRequest::new(SuiteCreateEdit::new(
16+
SyntheticsSuite::new(
17+
"Notification message".to_string(),
18+
"Example suite name".to_string(),
19+
SyntheticsSuiteOptions::new(),
20+
vec![SyntheticsSuiteTest::new("".to_string())
21+
.alerting_criticality(SyntheticsSuiteTestAlertingCriticality::CRITICAL)],
22+
SyntheticsSuiteType::SUITE,
23+
)
24+
.tags(vec!["env:production".to_string()]),
25+
SyntheticsSuiteTypes::SUITES,
26+
));
27+
let configuration = datadog::Configuration::new();
28+
let api = SyntheticsAPI::with_config(configuration);
29+
let resp = api
30+
.edit_synthetics_suite("public_id".to_string(), body)
31+
.await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Synthetics: Get a suite returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = SyntheticsAPI::with_config(configuration);
9+
let resp = api.get_synthetics_suite("public_id".to_string()).await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Search Synthetics suites returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_synthetics::SearchSuitesOptionalParams;
4+
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = SyntheticsAPI::with_config(configuration);
10+
let resp = api
11+
.search_suites(SearchSuitesOptionalParams::default())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}

0 commit comments

Comments
 (0)