v1_synthetics_DeleteTests/
v1_synthetics_DeleteTests.rs

1// Delete tests returns "OK." response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4use datadog_api_client::datadogV1::model::SyntheticsDeleteTestsPayload;
5
6#[tokio::main]
7async fn main() {
8    // there is a valid "synthetics_api_test" in the system
9    let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
10    let body =
11        SyntheticsDeleteTestsPayload::new().public_ids(vec![synthetics_api_test_public_id.clone()]);
12    let configuration = datadog::Configuration::new();
13    let api = SyntheticsAPI::with_config(configuration);
14    let resp = api.delete_tests(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}