v2_monitors_GetMonitorNotificationRule/
v2_monitors_GetMonitorNotificationRule.rs

1// Get a monitor notification rule returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_monitors::GetMonitorNotificationRuleOptionalParams;
4use datadog_api_client::datadogV2::api_monitors::MonitorsAPI;
5
6#[tokio::main]
7async fn main() {
8    // there is a valid "monitor_notification_rule" in the system
9    let monitor_notification_rule_data_id =
10        std::env::var("MONITOR_NOTIFICATION_RULE_DATA_ID").unwrap();
11    let configuration = datadog::Configuration::new();
12    let api = MonitorsAPI::with_config(configuration);
13    let resp = api
14        .get_monitor_notification_rule(
15            monitor_notification_rule_data_id.clone(),
16            GetMonitorNotificationRuleOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}