// Delete an API key returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_key_management::KeyManagementAPI;
#[tokio::main]
async fn main() {
// there is a valid "api_key" in the system
let api_key_data_id = std::env::var("API_KEY_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = KeyManagementAPI::with_config(configuration);
let resp = api.delete_api_key(api_key_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}