v2_case_management_DeleteCaseCustomAttribute/
v2_case-management_DeleteCaseCustomAttribute.rs

1// Delete custom attribute from case returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
4
5#[tokio::main]
6async fn main() {
7    // there is a valid "case" with a custom "case_type" in the system
8    let case_with_type_id = std::env::var("CASE_WITH_TYPE_ID").unwrap();
9
10    // there is a valid "custom_attribute" in the system
11    let custom_attribute_attributes_key = std::env::var("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY").unwrap();
12    let configuration = datadog::Configuration::new();
13    let api = CaseManagementAPI::with_config(configuration);
14    let resp = api
15        .delete_case_custom_attribute(
16            case_with_type_id.clone(),
17            custom_attribute_attributes_key.clone(),
18        )
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}