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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Configuration for scheduling when automation rules should execute, including timing and execution windows.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Schedule {
/// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
/// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
/// </note>
pub schedule_expression: ::std::option::Option<::std::string::String>,
/// <p>The timezone to use when interpreting the schedule expression.</p>
pub schedule_expression_timezone: ::std::option::Option<::std::string::String>,
/// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
pub execution_window_in_minutes: ::std::option::Option<i32>,
}
impl Schedule {
/// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
/// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
/// </note>
pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
self.schedule_expression.as_deref()
}
/// <p>The timezone to use when interpreting the schedule expression.</p>
pub fn schedule_expression_timezone(&self) -> ::std::option::Option<&str> {
self.schedule_expression_timezone.as_deref()
}
/// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
pub fn execution_window_in_minutes(&self) -> ::std::option::Option<i32> {
self.execution_window_in_minutes
}
}
impl Schedule {
/// Creates a new builder-style object to manufacture [`Schedule`](crate::types::Schedule).
pub fn builder() -> crate::types::builders::ScheduleBuilder {
crate::types::builders::ScheduleBuilder::default()
}
}
/// A builder for [`Schedule`](crate::types::Schedule).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScheduleBuilder {
pub(crate) schedule_expression: ::std::option::Option<::std::string::String>,
pub(crate) schedule_expression_timezone: ::std::option::Option<::std::string::String>,
pub(crate) execution_window_in_minutes: ::std::option::Option<i32>,
}
impl ScheduleBuilder {
/// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
/// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
/// </note>
pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.schedule_expression = ::std::option::Option::Some(input.into());
self
}
/// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
/// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
/// </note>
pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schedule_expression = input;
self
}
/// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
/// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
/// </note>
pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
&self.schedule_expression
}
/// <p>The timezone to use when interpreting the schedule expression.</p>
pub fn schedule_expression_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.schedule_expression_timezone = ::std::option::Option::Some(input.into());
self
}
/// <p>The timezone to use when interpreting the schedule expression.</p>
pub fn set_schedule_expression_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schedule_expression_timezone = input;
self
}
/// <p>The timezone to use when interpreting the schedule expression.</p>
pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> {
&self.schedule_expression_timezone
}
/// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
pub fn execution_window_in_minutes(mut self, input: i32) -> Self {
self.execution_window_in_minutes = ::std::option::Option::Some(input);
self
}
/// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
pub fn set_execution_window_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
self.execution_window_in_minutes = input;
self
}
/// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
pub fn get_execution_window_in_minutes(&self) -> &::std::option::Option<i32> {
&self.execution_window_in_minutes
}
/// Consumes the builder and constructs a [`Schedule`](crate::types::Schedule).
pub fn build(self) -> crate::types::Schedule {
crate::types::Schedule {
schedule_expression: self.schedule_expression,
schedule_expression_timezone: self.schedule_expression_timezone,
execution_window_in_minutes: self.execution_window_in_minutes,
}
}
}