#[non_exhaustive]pub struct AlertStrategy {
pub notification_rate_limit: Option<NotificationRateLimit>,
pub notification_prompts: Vec<NotificationPrompt>,
pub auto_close: Option<Duration>,
pub notification_channel_strategy: Vec<NotificationChannelStrategy>,
/* private fields */
}Expand description
Control over how the notification channels in notification_channels
are notified when this alert fires.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.notification_rate_limit: Option<NotificationRateLimit>Required for log-based alerting policies, i.e. policies with a LogMatch
condition.
This limit is not implemented for alerting policies that do not have a LogMatch condition.
notification_prompts: Vec<NotificationPrompt>For log-based alert policies, the notification prompts is always [OPENED]. For non log-based alert policies, the notification prompts can be [OPENED] or [OPENED, CLOSED].
auto_close: Option<Duration>If an alerting policy that was active has no data for this long, any open incidents will close
notification_channel_strategy: Vec<NotificationChannelStrategy>Control how notifications will be sent out, on a per-channel basis.
Implementations§
Source§impl AlertStrategy
impl AlertStrategy
pub fn new() -> Self
Sourcepub fn set_notification_rate_limit<T>(self, v: T) -> Selfwhere
T: Into<NotificationRateLimit>,
pub fn set_notification_rate_limit<T>(self, v: T) -> Selfwhere
T: Into<NotificationRateLimit>,
Sets the value of notification_rate_limit.
§Example
use google_cloud_monitoring_v3::model::alert_policy::alert_strategy::NotificationRateLimit;
let x = AlertStrategy::new().set_notification_rate_limit(NotificationRateLimit::default()/* use setters */);Sourcepub fn set_or_clear_notification_rate_limit<T>(self, v: Option<T>) -> Selfwhere
T: Into<NotificationRateLimit>,
pub fn set_or_clear_notification_rate_limit<T>(self, v: Option<T>) -> Selfwhere
T: Into<NotificationRateLimit>,
Sets or clears the value of notification_rate_limit.
§Example
use google_cloud_monitoring_v3::model::alert_policy::alert_strategy::NotificationRateLimit;
let x = AlertStrategy::new().set_or_clear_notification_rate_limit(Some(NotificationRateLimit::default()/* use setters */));
let x = AlertStrategy::new().set_or_clear_notification_rate_limit(None::<NotificationRateLimit>);Sourcepub fn set_notification_prompts<T, V>(self, v: T) -> Self
pub fn set_notification_prompts<T, V>(self, v: T) -> Self
Sets the value of notification_prompts.
§Example
use google_cloud_monitoring_v3::model::alert_policy::alert_strategy::NotificationPrompt;
let x = AlertStrategy::new().set_notification_prompts([
NotificationPrompt::Opened,
NotificationPrompt::Closed,
]);Sourcepub fn set_auto_close<T>(self, v: T) -> Self
pub fn set_auto_close<T>(self, v: T) -> Self
Sets the value of auto_close.
§Example
use wkt::Duration;
let x = AlertStrategy::new().set_auto_close(Duration::default()/* use setters */);Sourcepub fn set_or_clear_auto_close<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_auto_close<T>(self, v: Option<T>) -> Self
Sets or clears the value of auto_close.
§Example
use wkt::Duration;
let x = AlertStrategy::new().set_or_clear_auto_close(Some(Duration::default()/* use setters */));
let x = AlertStrategy::new().set_or_clear_auto_close(None::<Duration>);Sourcepub fn set_notification_channel_strategy<T, V>(self, v: T) -> Self
pub fn set_notification_channel_strategy<T, V>(self, v: T) -> Self
Sets the value of notification_channel_strategy.
§Example
use google_cloud_monitoring_v3::model::alert_policy::alert_strategy::NotificationChannelStrategy;
let x = AlertStrategy::new()
.set_notification_channel_strategy([
NotificationChannelStrategy::default()/* use setters */,
NotificationChannelStrategy::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for AlertStrategy
impl Clone for AlertStrategy
Source§fn clone(&self) -> AlertStrategy
fn clone(&self) -> AlertStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more