aws-sdk-cloudwatch 1.111.0

AWS SDK for Amazon CloudWatch
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines the schedule configuration for an alarm mute rule.</p>
/// <p>The rule contains a schedule that specifies when and how long alarms should be muted. The schedule can be a recurring pattern using cron expressions or a one-time mute window using at expressions.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Rule {
    /// <p>The schedule configuration that defines when the mute rule activates and how long it remains active.</p>
    pub schedule: ::std::option::Option<crate::types::Schedule>,
}
impl Rule {
    /// <p>The schedule configuration that defines when the mute rule activates and how long it remains active.</p>
    pub fn schedule(&self) -> ::std::option::Option<&crate::types::Schedule> {
        self.schedule.as_ref()
    }
}
impl Rule {
    /// Creates a new builder-style object to manufacture [`Rule`](crate::types::Rule).
    pub fn builder() -> crate::types::builders::RuleBuilder {
        crate::types::builders::RuleBuilder::default()
    }
}

/// A builder for [`Rule`](crate::types::Rule).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RuleBuilder {
    pub(crate) schedule: ::std::option::Option<crate::types::Schedule>,
}
impl RuleBuilder {
    /// <p>The schedule configuration that defines when the mute rule activates and how long it remains active.</p>
    /// This field is required.
    pub fn schedule(mut self, input: crate::types::Schedule) -> Self {
        self.schedule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The schedule configuration that defines when the mute rule activates and how long it remains active.</p>
    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::Schedule>) -> Self {
        self.schedule = input;
        self
    }
    /// <p>The schedule configuration that defines when the mute rule activates and how long it remains active.</p>
    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::Schedule> {
        &self.schedule
    }
    /// Consumes the builder and constructs a [`Rule`](crate::types::Rule).
    pub fn build(self) -> crate::types::Rule {
        crate::types::Rule { schedule: self.schedule }
    }
}