#[non_exhaustive]pub struct GetMonitorOptionalParams {
pub group_states: Option<String>,
pub with_downtimes: Option<bool>,
}
Expand description
GetMonitorOptionalParams is a struct for passing parameters to the method MonitorsAPI::get_monitor
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.group_states: Option<String>
When specified, shows additional information about the group states. Choose one or more from all
, alert
, warn
, and no data
.
with_downtimes: Option<bool>
If this argument is set to true, then the returned data includes all current active downtimes for the monitor.
Implementations§
Source§impl GetMonitorOptionalParams
impl GetMonitorOptionalParams
Sourcepub fn group_states(self, value: String) -> Self
pub fn group_states(self, value: String) -> Self
When specified, shows additional information about the group states. Choose one or more from all
, alert
, warn
, and no data
.
Sourcepub fn with_downtimes(self, value: bool) -> Self
pub fn with_downtimes(self, value: bool) -> Self
If this argument is set to true, then the returned data includes all current active downtimes for the monitor.
Examples found in repository?
examples/v1_monitors_GetMonitor.rs (line 15)
7async fn main() {
8 // there is a valid "monitor" in the system
9 let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = MonitorsAPI::with_config(configuration);
12 let resp = api
13 .get_monitor(
14 monitor_id.clone(),
15 GetMonitorOptionalParams::default().with_downtimes(true),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
More examples
examples/v1_monitors_GetMonitor_2200114573.rs (line 15)
7async fn main() {
8 // there is a valid "monitor" in the system
9 let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = MonitorsAPI::with_config(configuration);
12 let resp = api
13 .get_monitor(
14 monitor_id.clone(),
15 GetMonitorOptionalParams::default().with_downtimes(true),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Trait Implementations§
Source§impl Clone for GetMonitorOptionalParams
impl Clone for GetMonitorOptionalParams
Source§fn clone(&self) -> GetMonitorOptionalParams
fn clone(&self) -> GetMonitorOptionalParams
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GetMonitorOptionalParams
impl Debug for GetMonitorOptionalParams
Source§impl Default for GetMonitorOptionalParams
impl Default for GetMonitorOptionalParams
Source§fn default() -> GetMonitorOptionalParams
fn default() -> GetMonitorOptionalParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GetMonitorOptionalParams
impl RefUnwindSafe for GetMonitorOptionalParams
impl Send for GetMonitorOptionalParams
impl Sync for GetMonitorOptionalParams
impl Unpin for GetMonitorOptionalParams
impl UnwindSafe for GetMonitorOptionalParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more