v1_service_level_objectives_DeleteSLOTimeframeInBulk/
v1_service-level-objectives_DeleteSLOTimeframeInBulk.rs

1// Bulk Delete SLO Timeframes returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI;
4use datadog_api_client::datadogV1::model::SLOTimeframe;
5use std::collections::BTreeMap;
6
7#[tokio::main]
8async fn main() {
9    let body = BTreeMap::from([
10        (
11            "id1".to_string(),
12            vec![SLOTimeframe::SEVEN_DAYS, SLOTimeframe::THIRTY_DAYS],
13        ),
14        (
15            "id2".to_string(),
16            vec![SLOTimeframe::SEVEN_DAYS, SLOTimeframe::THIRTY_DAYS],
17        ),
18    ]);
19    let configuration = datadog::Configuration::new();
20    let api = ServiceLevelObjectivesAPI::with_config(configuration);
21    let resp = api.delete_slo_timeframe_in_bulk(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}