1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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 }
}
}