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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A schedule configures when and how often a pipeline will automatically create a new image.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Schedule {
/// <p>The cron expression determines how often EC2 Image Builder evaluates your <code>pipelineExecutionStartCondition</code>.</p>
/// <p>For information on how to format a cron expression in Image Builder, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html">Use cron expressions in EC2 Image Builder</a>.</p>
pub schedule_expression: ::std::option::Option<::std::string::String>,
/// <p>The timezone that applies to the scheduling expression. For example, "Etc/UTC", "America/Los_Angeles" in the <a href="https://www.joda.org/joda-time/timezones.html">IANA timezone format</a>. If not specified this defaults to UTC.</p>
pub timezone: ::std::option::Option<::std::string::String>,
/// <p>The start condition configures when the pipeline should trigger a new image build, as follows. If no value is set Image Builder defaults to <code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code>.</p>
/// <ul>
/// <li>
/// <p><code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code> (default) – When you use semantic version filters on the base image or components in your image recipe, EC2 Image Builder builds a new image only when there are new versions of the base image or components in your recipe that match the filter.</p><note>
/// <p>For semantic version syntax, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html">CreateComponent</a>.</p>
/// </note></li>
/// <li>
/// <p><code>EXPRESSION_MATCH_ONLY</code> – This condition builds a new image every time the CRON expression matches the current time.</p></li>
/// </ul>
pub pipeline_execution_start_condition: ::std::option::Option<crate::types::PipelineExecutionStartCondition>,
/// <p>The policy that configures when Image Builder should automatically disable a pipeline that is failing.</p>
pub auto_disable_policy: ::std::option::Option<crate::types::AutoDisablePolicy>,
}
impl Schedule {
/// <p>The cron expression determines how often EC2 Image Builder evaluates your <code>pipelineExecutionStartCondition</code>.</p>
/// <p>For information on how to format a cron expression in Image Builder, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html">Use cron expressions in EC2 Image Builder</a>.</p>
pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
self.schedule_expression.as_deref()
}
/// <p>The timezone that applies to the scheduling expression. For example, "Etc/UTC", "America/Los_Angeles" in the <a href="https://www.joda.org/joda-time/timezones.html">IANA timezone format</a>. If not specified this defaults to UTC.</p>
pub fn timezone(&self) -> ::std::option::Option<&str> {
self.timezone.as_deref()
}
/// <p>The start condition configures when the pipeline should trigger a new image build, as follows. If no value is set Image Builder defaults to <code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code>.</p>
/// <ul>
/// <li>
/// <p><code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code> (default) – When you use semantic version filters on the base image or components in your image recipe, EC2 Image Builder builds a new image only when there are new versions of the base image or components in your recipe that match the filter.</p><note>
/// <p>For semantic version syntax, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html">CreateComponent</a>.</p>
/// </note></li>
/// <li>
/// <p><code>EXPRESSION_MATCH_ONLY</code> – This condition builds a new image every time the CRON expression matches the current time.</p></li>
/// </ul>
pub fn pipeline_execution_start_condition(&self) -> ::std::option::Option<&crate::types::PipelineExecutionStartCondition> {
self.pipeline_execution_start_condition.as_ref()
}
/// <p>The policy that configures when Image Builder should automatically disable a pipeline that is failing.</p>
pub fn auto_disable_policy(&self) -> ::std::option::Option<&crate::types::AutoDisablePolicy> {
self.auto_disable_policy.as_ref()
}
}
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) timezone: ::std::option::Option<::std::string::String>,
pub(crate) pipeline_execution_start_condition: ::std::option::Option<crate::types::PipelineExecutionStartCondition>,
pub(crate) auto_disable_policy: ::std::option::Option<crate::types::AutoDisablePolicy>,
}
impl ScheduleBuilder {
/// <p>The cron expression determines how often EC2 Image Builder evaluates your <code>pipelineExecutionStartCondition</code>.</p>
/// <p>For information on how to format a cron expression in Image Builder, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html">Use cron expressions in EC2 Image Builder</a>.</p>
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 cron expression determines how often EC2 Image Builder evaluates your <code>pipelineExecutionStartCondition</code>.</p>
/// <p>For information on how to format a cron expression in Image Builder, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html">Use cron expressions in EC2 Image Builder</a>.</p>
pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schedule_expression = input;
self
}
/// <p>The cron expression determines how often EC2 Image Builder evaluates your <code>pipelineExecutionStartCondition</code>.</p>
/// <p>For information on how to format a cron expression in Image Builder, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html">Use cron expressions in EC2 Image Builder</a>.</p>
pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
&self.schedule_expression
}
/// <p>The timezone that applies to the scheduling expression. For example, "Etc/UTC", "America/Los_Angeles" in the <a href="https://www.joda.org/joda-time/timezones.html">IANA timezone format</a>. If not specified this defaults to UTC.</p>
pub fn timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.timezone = ::std::option::Option::Some(input.into());
self
}
/// <p>The timezone that applies to the scheduling expression. For example, "Etc/UTC", "America/Los_Angeles" in the <a href="https://www.joda.org/joda-time/timezones.html">IANA timezone format</a>. If not specified this defaults to UTC.</p>
pub fn set_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.timezone = input;
self
}
/// <p>The timezone that applies to the scheduling expression. For example, "Etc/UTC", "America/Los_Angeles" in the <a href="https://www.joda.org/joda-time/timezones.html">IANA timezone format</a>. If not specified this defaults to UTC.</p>
pub fn get_timezone(&self) -> &::std::option::Option<::std::string::String> {
&self.timezone
}
/// <p>The start condition configures when the pipeline should trigger a new image build, as follows. If no value is set Image Builder defaults to <code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code>.</p>
/// <ul>
/// <li>
/// <p><code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code> (default) – When you use semantic version filters on the base image or components in your image recipe, EC2 Image Builder builds a new image only when there are new versions of the base image or components in your recipe that match the filter.</p><note>
/// <p>For semantic version syntax, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html">CreateComponent</a>.</p>
/// </note></li>
/// <li>
/// <p><code>EXPRESSION_MATCH_ONLY</code> – This condition builds a new image every time the CRON expression matches the current time.</p></li>
/// </ul>
pub fn pipeline_execution_start_condition(mut self, input: crate::types::PipelineExecutionStartCondition) -> Self {
self.pipeline_execution_start_condition = ::std::option::Option::Some(input);
self
}
/// <p>The start condition configures when the pipeline should trigger a new image build, as follows. If no value is set Image Builder defaults to <code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code>.</p>
/// <ul>
/// <li>
/// <p><code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code> (default) – When you use semantic version filters on the base image or components in your image recipe, EC2 Image Builder builds a new image only when there are new versions of the base image or components in your recipe that match the filter.</p><note>
/// <p>For semantic version syntax, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html">CreateComponent</a>.</p>
/// </note></li>
/// <li>
/// <p><code>EXPRESSION_MATCH_ONLY</code> – This condition builds a new image every time the CRON expression matches the current time.</p></li>
/// </ul>
pub fn set_pipeline_execution_start_condition(mut self, input: ::std::option::Option<crate::types::PipelineExecutionStartCondition>) -> Self {
self.pipeline_execution_start_condition = input;
self
}
/// <p>The start condition configures when the pipeline should trigger a new image build, as follows. If no value is set Image Builder defaults to <code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code>.</p>
/// <ul>
/// <li>
/// <p><code>EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE</code> (default) – When you use semantic version filters on the base image or components in your image recipe, EC2 Image Builder builds a new image only when there are new versions of the base image or components in your recipe that match the filter.</p><note>
/// <p>For semantic version syntax, see <a href="https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_CreateComponent.html">CreateComponent</a>.</p>
/// </note></li>
/// <li>
/// <p><code>EXPRESSION_MATCH_ONLY</code> – This condition builds a new image every time the CRON expression matches the current time.</p></li>
/// </ul>
pub fn get_pipeline_execution_start_condition(&self) -> &::std::option::Option<crate::types::PipelineExecutionStartCondition> {
&self.pipeline_execution_start_condition
}
/// <p>The policy that configures when Image Builder should automatically disable a pipeline that is failing.</p>
pub fn auto_disable_policy(mut self, input: crate::types::AutoDisablePolicy) -> Self {
self.auto_disable_policy = ::std::option::Option::Some(input);
self
}
/// <p>The policy that configures when Image Builder should automatically disable a pipeline that is failing.</p>
pub fn set_auto_disable_policy(mut self, input: ::std::option::Option<crate::types::AutoDisablePolicy>) -> Self {
self.auto_disable_policy = input;
self
}
/// <p>The policy that configures when Image Builder should automatically disable a pipeline that is failing.</p>
pub fn get_auto_disable_policy(&self) -> &::std::option::Option<crate::types::AutoDisablePolicy> {
&self.auto_disable_policy
}
/// 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,
timezone: self.timezone,
pipeline_execution_start_condition: self.pipeline_execution_start_condition,
auto_disable_policy: self.auto_disable_policy,
}
}
}