v1_synthetics_TriggerTests/
v1_synthetics_TriggerTests.rs1use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4use datadog_api_client::datadogV1::model::SyntheticsTriggerBody;
5use datadog_api_client::datadogV1::model::SyntheticsTriggerTest;
6
7#[tokio::main]
8async fn main() {
9 let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
11 let body = SyntheticsTriggerBody::new(vec![SyntheticsTriggerTest::new(
12 synthetics_api_test_public_id.clone(),
13 )]);
14 let configuration = datadog::Configuration::new();
15 let api = SyntheticsAPI::with_config(configuration);
16 let resp = api.trigger_tests(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}