Skip to content

Commit 3ca3c49

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3f857fb of spec repo
1 parent 045f3e1 commit 3ca3c49

35 files changed

+3874
-16
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 450 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+
}

src/datadog/configuration.rs

Lines changed: 3 additions & 0 deletions
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_impact".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_impact".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),
@@ -206,6 +208,7 @@ impl Default for Configuration {
206208
("v2.get_incident_todo".to_owned(), false),
207209
("v2.get_incident_type".to_owned(), false),
208210
("v2.list_incident_attachments".to_owned(), false),
211+
("v2.list_incident_impacts".to_owned(), false),
209212
("v2.list_incident_integrations".to_owned(), false),
210213
("v2.list_incident_notification_rules".to_owned(), false),
211214
("v2.list_incident_notification_templates".to_owned(), false),

src/datadogV2/api/api_incidents.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,14 @@ impl IncidentsAPI {
901901
> {
902902
let local_configuration = &self.config;
903903
let operation_id = "v2.create_incident_impact";
904+
if local_configuration.is_unstable_operation_enabled(operation_id) {
905+
warn!("Using unstable operation {operation_id}");
906+
} else {
907+
let local_error = datadog::UnstableOperationDisabledError {
908+
msg: "Operation 'v2.create_incident_impact' is not enabled".to_string(),
909+
};
910+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
911+
}
904912

905913
// unbox and build optional parameters
906914
let include = params.include;
@@ -1987,6 +1995,14 @@ impl IncidentsAPI {
19871995
) -> Result<datadog::ResponseContent<()>, datadog::Error<DeleteIncidentImpactError>> {
19881996
let local_configuration = &self.config;
19891997
let operation_id = "v2.delete_incident_impact";
1998+
if local_configuration.is_unstable_operation_enabled(operation_id) {
1999+
warn!("Using unstable operation {operation_id}");
2000+
} else {
2001+
let local_error = datadog::UnstableOperationDisabledError {
2002+
msg: "Operation 'v2.delete_incident_impact' is not enabled".to_string(),
2003+
};
2004+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
2005+
}
19902006

19912007
let local_client = &self.client;
19922008

@@ -3521,6 +3537,14 @@ impl IncidentsAPI {
35213537
> {
35223538
let local_configuration = &self.config;
35233539
let operation_id = "v2.list_incident_impacts";
3540+
if local_configuration.is_unstable_operation_enabled(operation_id) {
3541+
warn!("Using unstable operation {operation_id}");
3542+
} else {
3543+
let local_error = datadog::UnstableOperationDisabledError {
3544+
msg: "Operation 'v2.list_incident_impacts' is not enabled".to_string(),
3545+
};
3546+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
3547+
}
35243548

35253549
// unbox and build optional parameters
35263550
let include = params.include;

0 commit comments

Comments
 (0)