Skip to main content

aws_sdk_imagebuilder/types/
_workflow.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Defines a process that Image Builder uses to build and test images during the image creation process.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Workflow {
7    /// <p>The Amazon Resource Name (ARN) of the workflow resource.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the workflow resource.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The workflow resource version. Workflow resources are immutable. To make a change, you can clone a workflow or create a new version.</p>
12    pub version: ::std::option::Option<::std::string::String>,
13    /// <p>The description of the workflow.</p>
14    pub description: ::std::option::Option<::std::string::String>,
15    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
16    pub change_description: ::std::option::Option<::std::string::String>,
17    /// <p>Specifies the image creation stage that the workflow applies to. Image Builder currently supports build and test workflows.</p>
18    pub r#type: ::std::option::Option<crate::types::WorkflowType>,
19    /// <p>Describes the current status of the workflow and the reason for that status.</p>
20    pub state: ::std::option::Option<crate::types::WorkflowState>,
21    /// <p>The owner of the workflow resource.</p>
22    pub owner: ::std::option::Option<::std::string::String>,
23    /// <p>Contains the YAML document content for the workflow.</p>
24    pub data: ::std::option::Option<::std::string::String>,
25    /// <p>The KMS key identifier used to encrypt the workflow resource. This can be either the Key ARN or the Alias ARN. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
26    pub kms_key_id: ::std::option::Option<::std::string::String>,
27    /// <p>The timestamp when Image Builder created the workflow resource.</p>
28    pub date_created: ::std::option::Option<::std::string::String>,
29    /// <p>The tags that apply to the workflow resource</p>
30    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31    /// <p>An array of input parameters that that the image workflow uses to control actions or configure settings.</p>
32    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowParameterDetail>>,
33}
34impl Workflow {
35    /// <p>The Amazon Resource Name (ARN) of the workflow resource.</p>
36    pub fn arn(&self) -> ::std::option::Option<&str> {
37        self.arn.as_deref()
38    }
39    /// <p>The name of the workflow resource.</p>
40    pub fn name(&self) -> ::std::option::Option<&str> {
41        self.name.as_deref()
42    }
43    /// <p>The workflow resource version. Workflow resources are immutable. To make a change, you can clone a workflow or create a new version.</p>
44    pub fn version(&self) -> ::std::option::Option<&str> {
45        self.version.as_deref()
46    }
47    /// <p>The description of the workflow.</p>
48    pub fn description(&self) -> ::std::option::Option<&str> {
49        self.description.as_deref()
50    }
51    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
52    pub fn change_description(&self) -> ::std::option::Option<&str> {
53        self.change_description.as_deref()
54    }
55    /// <p>Specifies the image creation stage that the workflow applies to. Image Builder currently supports build and test workflows.</p>
56    pub fn r#type(&self) -> ::std::option::Option<&crate::types::WorkflowType> {
57        self.r#type.as_ref()
58    }
59    /// <p>Describes the current status of the workflow and the reason for that status.</p>
60    pub fn state(&self) -> ::std::option::Option<&crate::types::WorkflowState> {
61        self.state.as_ref()
62    }
63    /// <p>The owner of the workflow resource.</p>
64    pub fn owner(&self) -> ::std::option::Option<&str> {
65        self.owner.as_deref()
66    }
67    /// <p>Contains the YAML document content for the workflow.</p>
68    pub fn data(&self) -> ::std::option::Option<&str> {
69        self.data.as_deref()
70    }
71    /// <p>The KMS key identifier used to encrypt the workflow resource. This can be either the Key ARN or the Alias ARN. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
72    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
73        self.kms_key_id.as_deref()
74    }
75    /// <p>The timestamp when Image Builder created the workflow resource.</p>
76    pub fn date_created(&self) -> ::std::option::Option<&str> {
77        self.date_created.as_deref()
78    }
79    /// <p>The tags that apply to the workflow resource</p>
80    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
81        self.tags.as_ref()
82    }
83    /// <p>An array of input parameters that that the image workflow uses to control actions or configure settings.</p>
84    ///
85    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
86    pub fn parameters(&self) -> &[crate::types::WorkflowParameterDetail] {
87        self.parameters.as_deref().unwrap_or_default()
88    }
89}
90impl Workflow {
91    /// Creates a new builder-style object to manufacture [`Workflow`](crate::types::Workflow).
92    pub fn builder() -> crate::types::builders::WorkflowBuilder {
93        crate::types::builders::WorkflowBuilder::default()
94    }
95}
96
97/// A builder for [`Workflow`](crate::types::Workflow).
98#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
99#[non_exhaustive]
100pub struct WorkflowBuilder {
101    pub(crate) arn: ::std::option::Option<::std::string::String>,
102    pub(crate) name: ::std::option::Option<::std::string::String>,
103    pub(crate) version: ::std::option::Option<::std::string::String>,
104    pub(crate) description: ::std::option::Option<::std::string::String>,
105    pub(crate) change_description: ::std::option::Option<::std::string::String>,
106    pub(crate) r#type: ::std::option::Option<crate::types::WorkflowType>,
107    pub(crate) state: ::std::option::Option<crate::types::WorkflowState>,
108    pub(crate) owner: ::std::option::Option<::std::string::String>,
109    pub(crate) data: ::std::option::Option<::std::string::String>,
110    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
111    pub(crate) date_created: ::std::option::Option<::std::string::String>,
112    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
113    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowParameterDetail>>,
114}
115impl WorkflowBuilder {
116    /// <p>The Amazon Resource Name (ARN) of the workflow resource.</p>
117    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.arn = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The Amazon Resource Name (ARN) of the workflow resource.</p>
122    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.arn = input;
124        self
125    }
126    /// <p>The Amazon Resource Name (ARN) of the workflow resource.</p>
127    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
128        &self.arn
129    }
130    /// <p>The name of the workflow resource.</p>
131    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The name of the workflow resource.</p>
136    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.name = input;
138        self
139    }
140    /// <p>The name of the workflow resource.</p>
141    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.name
143    }
144    /// <p>The workflow resource version. Workflow resources are immutable. To make a change, you can clone a workflow or create a new version.</p>
145    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.version = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The workflow resource version. Workflow resources are immutable. To make a change, you can clone a workflow or create a new version.</p>
150    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.version = input;
152        self
153    }
154    /// <p>The workflow resource version. Workflow resources are immutable. To make a change, you can clone a workflow or create a new version.</p>
155    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
156        &self.version
157    }
158    /// <p>The description of the workflow.</p>
159    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.description = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>The description of the workflow.</p>
164    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.description = input;
166        self
167    }
168    /// <p>The description of the workflow.</p>
169    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
170        &self.description
171    }
172    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
173    pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.change_description = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
178    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.change_description = input;
180        self
181    }
182    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
183    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
184        &self.change_description
185    }
186    /// <p>Specifies the image creation stage that the workflow applies to. Image Builder currently supports build and test workflows.</p>
187    pub fn r#type(mut self, input: crate::types::WorkflowType) -> Self {
188        self.r#type = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>Specifies the image creation stage that the workflow applies to. Image Builder currently supports build and test workflows.</p>
192    pub fn set_type(mut self, input: ::std::option::Option<crate::types::WorkflowType>) -> Self {
193        self.r#type = input;
194        self
195    }
196    /// <p>Specifies the image creation stage that the workflow applies to. Image Builder currently supports build and test workflows.</p>
197    pub fn get_type(&self) -> &::std::option::Option<crate::types::WorkflowType> {
198        &self.r#type
199    }
200    /// <p>Describes the current status of the workflow and the reason for that status.</p>
201    pub fn state(mut self, input: crate::types::WorkflowState) -> Self {
202        self.state = ::std::option::Option::Some(input);
203        self
204    }
205    /// <p>Describes the current status of the workflow and the reason for that status.</p>
206    pub fn set_state(mut self, input: ::std::option::Option<crate::types::WorkflowState>) -> Self {
207        self.state = input;
208        self
209    }
210    /// <p>Describes the current status of the workflow and the reason for that status.</p>
211    pub fn get_state(&self) -> &::std::option::Option<crate::types::WorkflowState> {
212        &self.state
213    }
214    /// <p>The owner of the workflow resource.</p>
215    pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.owner = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The owner of the workflow resource.</p>
220    pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.owner = input;
222        self
223    }
224    /// <p>The owner of the workflow resource.</p>
225    pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
226        &self.owner
227    }
228    /// <p>Contains the YAML document content for the workflow.</p>
229    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.data = ::std::option::Option::Some(input.into());
231        self
232    }
233    /// <p>Contains the YAML document content for the workflow.</p>
234    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.data = input;
236        self
237    }
238    /// <p>Contains the YAML document content for the workflow.</p>
239    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
240        &self.data
241    }
242    /// <p>The KMS key identifier used to encrypt the workflow resource. This can be either the Key ARN or the Alias ARN. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
243    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.kms_key_id = ::std::option::Option::Some(input.into());
245        self
246    }
247    /// <p>The KMS key identifier used to encrypt the workflow resource. This can be either the Key ARN or the Alias ARN. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
248    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249        self.kms_key_id = input;
250        self
251    }
252    /// <p>The KMS key identifier used to encrypt the workflow resource. This can be either the Key ARN or the Alias ARN. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">Key identifiers (KeyId)</a> in the <i>Key Management Service Developer Guide</i>.</p>
253    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
254        &self.kms_key_id
255    }
256    /// <p>The timestamp when Image Builder created the workflow resource.</p>
257    pub fn date_created(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.date_created = ::std::option::Option::Some(input.into());
259        self
260    }
261    /// <p>The timestamp when Image Builder created the workflow resource.</p>
262    pub fn set_date_created(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263        self.date_created = input;
264        self
265    }
266    /// <p>The timestamp when Image Builder created the workflow resource.</p>
267    pub fn get_date_created(&self) -> &::std::option::Option<::std::string::String> {
268        &self.date_created
269    }
270    /// Adds a key-value pair to `tags`.
271    ///
272    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
273    ///
274    /// <p>The tags that apply to the workflow resource</p>
275    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
276        let mut hash_map = self.tags.unwrap_or_default();
277        hash_map.insert(k.into(), v.into());
278        self.tags = ::std::option::Option::Some(hash_map);
279        self
280    }
281    /// <p>The tags that apply to the workflow resource</p>
282    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
283        self.tags = input;
284        self
285    }
286    /// <p>The tags that apply to the workflow resource</p>
287    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
288        &self.tags
289    }
290    /// Appends an item to `parameters`.
291    ///
292    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
293    ///
294    /// <p>An array of input parameters that that the image workflow uses to control actions or configure settings.</p>
295    pub fn parameters(mut self, input: crate::types::WorkflowParameterDetail) -> Self {
296        let mut v = self.parameters.unwrap_or_default();
297        v.push(input);
298        self.parameters = ::std::option::Option::Some(v);
299        self
300    }
301    /// <p>An array of input parameters that that the image workflow uses to control actions or configure settings.</p>
302    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowParameterDetail>>) -> Self {
303        self.parameters = input;
304        self
305    }
306    /// <p>An array of input parameters that that the image workflow uses to control actions or configure settings.</p>
307    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkflowParameterDetail>> {
308        &self.parameters
309    }
310    /// Consumes the builder and constructs a [`Workflow`](crate::types::Workflow).
311    pub fn build(self) -> crate::types::Workflow {
312        crate::types::Workflow {
313            arn: self.arn,
314            name: self.name,
315            version: self.version,
316            description: self.description,
317            change_description: self.change_description,
318            r#type: self.r#type,
319            state: self.state,
320            owner: self.owner,
321            data: self.data,
322            kms_key_id: self.kms_key_id,
323            date_created: self.date_created,
324            tags: self.tags,
325            parameters: self.parameters,
326        }
327    }
328}