v2_logs_custom_destinations_DeleteLogsCustomDestination/
v2_logs-custom-destinations_DeleteLogsCustomDestination.rs

1// Delete a custom destination returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
4
5#[tokio::main]
6async fn main() {
7    // there is a valid "custom_destination" in the system
8    let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = LogsCustomDestinationsAPI::with_config(configuration);
11    let resp = api
12        .delete_logs_custom_destination(custom_destination_data_id.clone())
13        .await;
14    if let Ok(value) = resp {
15        println!("{:#?}", value);
16    } else {
17        println!("{:#?}", resp.unwrap_err());
18    }
19}