aws_sdk_imagebuilder/operation/create_component/
_create_component_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateComponentInput {
6    /// <p>The name of the component.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
9    /// <p>The semantic version has four nodes: <major>
10    /// .
11    /// <minor>
12    /// .
13    /// <patch>
14    /// /
15    /// <build>
16    /// . You can assign values for the first three, and can filter on all of them.
17    /// </build>
18    /// </patch>
19    /// </minor>
20    /// </major></p>
21    /// <p><b>Assignment:</b> For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.</p>
22    /// <p><b>Patterns:</b> You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.</p>
23    /// </note>
24    pub semantic_version: ::std::option::Option<::std::string::String>,
25    /// <p>Describes the contents of the component.</p>
26    pub description: ::std::option::Option<::std::string::String>,
27    /// <p>The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.</p>
28    pub change_description: ::std::option::Option<::std::string::String>,
29    /// <p>The operating system platform of the component.</p>
30    pub platform: ::std::option::Option<crate::types::Platform>,
31    /// <p>The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.</p>
32    pub supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
33    /// <p>Component <code>data</code> contains inline YAML document content for the component. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
34    pub data: ::std::option::Option<::std::string::String>,
35    /// <p>The <code>uri</code> of a YAML component document file. This must be an S3 URL (<code>s3://bucket/key</code>), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.</p>
36    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
37    pub uri: ::std::option::Option<::std::string::String>,
38    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. 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>
39    pub kms_key_id: ::std::option::Option<::std::string::String>,
40    /// <p>The tags that apply to the component.</p>
41    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
42    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
43    pub client_token: ::std::option::Option<::std::string::String>,
44}
45impl CreateComponentInput {
46    /// <p>The name of the component.</p>
47    pub fn name(&self) -> ::std::option::Option<&str> {
48        self.name.as_deref()
49    }
50    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
51    /// <p>The semantic version has four nodes: <major>
52    /// .
53    /// <minor>
54    /// .
55    /// <patch>
56    /// /
57    /// <build>
58    /// . You can assign values for the first three, and can filter on all of them.
59    /// </build>
60    /// </patch>
61    /// </minor>
62    /// </major></p>
63    /// <p><b>Assignment:</b> For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.</p>
64    /// <p><b>Patterns:</b> You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.</p>
65    /// </note>
66    pub fn semantic_version(&self) -> ::std::option::Option<&str> {
67        self.semantic_version.as_deref()
68    }
69    /// <p>Describes the contents of the component.</p>
70    pub fn description(&self) -> ::std::option::Option<&str> {
71        self.description.as_deref()
72    }
73    /// <p>The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.</p>
74    pub fn change_description(&self) -> ::std::option::Option<&str> {
75        self.change_description.as_deref()
76    }
77    /// <p>The operating system platform of the component.</p>
78    pub fn platform(&self) -> ::std::option::Option<&crate::types::Platform> {
79        self.platform.as_ref()
80    }
81    /// <p>The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.</p>
82    ///
83    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_os_versions.is_none()`.
84    pub fn supported_os_versions(&self) -> &[::std::string::String] {
85        self.supported_os_versions.as_deref().unwrap_or_default()
86    }
87    /// <p>Component <code>data</code> contains inline YAML document content for the component. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
88    pub fn data(&self) -> ::std::option::Option<&str> {
89        self.data.as_deref()
90    }
91    /// <p>The <code>uri</code> of a YAML component document file. This must be an S3 URL (<code>s3://bucket/key</code>), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.</p>
92    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
93    pub fn uri(&self) -> ::std::option::Option<&str> {
94        self.uri.as_deref()
95    }
96    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. 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>
97    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
98        self.kms_key_id.as_deref()
99    }
100    /// <p>The tags that apply to the component.</p>
101    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
102        self.tags.as_ref()
103    }
104    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
105    pub fn client_token(&self) -> ::std::option::Option<&str> {
106        self.client_token.as_deref()
107    }
108}
109impl CreateComponentInput {
110    /// Creates a new builder-style object to manufacture [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
111    pub fn builder() -> crate::operation::create_component::builders::CreateComponentInputBuilder {
112        crate::operation::create_component::builders::CreateComponentInputBuilder::default()
113    }
114}
115
116/// A builder for [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
117#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
118#[non_exhaustive]
119pub struct CreateComponentInputBuilder {
120    pub(crate) name: ::std::option::Option<::std::string::String>,
121    pub(crate) semantic_version: ::std::option::Option<::std::string::String>,
122    pub(crate) description: ::std::option::Option<::std::string::String>,
123    pub(crate) change_description: ::std::option::Option<::std::string::String>,
124    pub(crate) platform: ::std::option::Option<crate::types::Platform>,
125    pub(crate) supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
126    pub(crate) data: ::std::option::Option<::std::string::String>,
127    pub(crate) uri: ::std::option::Option<::std::string::String>,
128    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
129    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
130    pub(crate) client_token: ::std::option::Option<::std::string::String>,
131}
132impl CreateComponentInputBuilder {
133    /// <p>The name of the component.</p>
134    /// This field is required.
135    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.name = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The name of the component.</p>
140    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.name = input;
142        self
143    }
144    /// <p>The name of the component.</p>
145    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
146        &self.name
147    }
148    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
149    /// <p>The semantic version has four nodes: <major>
150    /// .
151    /// <minor>
152    /// .
153    /// <patch>
154    /// /
155    /// <build>
156    /// . You can assign values for the first three, and can filter on all of them.
157    /// </build>
158    /// </patch>
159    /// </minor>
160    /// </major></p>
161    /// <p><b>Assignment:</b> For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.</p>
162    /// <p><b>Patterns:</b> You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.</p>
163    /// </note>
164    /// This field is required.
165    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.semantic_version = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
170    /// <p>The semantic version has four nodes: <major>
171    /// .
172    /// <minor>
173    /// .
174    /// <patch>
175    /// /
176    /// <build>
177    /// . You can assign values for the first three, and can filter on all of them.
178    /// </build>
179    /// </patch>
180    /// </minor>
181    /// </major></p>
182    /// <p><b>Assignment:</b> For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.</p>
183    /// <p><b>Patterns:</b> You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.</p>
184    /// </note>
185    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.semantic_version = input;
187        self
188    }
189    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
190    /// <p>The semantic version has four nodes: <major>
191    /// .
192    /// <minor>
193    /// .
194    /// <patch>
195    /// /
196    /// <build>
197    /// . You can assign values for the first three, and can filter on all of them.
198    /// </build>
199    /// </patch>
200    /// </minor>
201    /// </major></p>
202    /// <p><b>Assignment:</b> For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.</p>
203    /// <p><b>Patterns:</b> You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.</p>
204    /// </note>
205    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
206        &self.semantic_version
207    }
208    /// <p>Describes the contents of the component.</p>
209    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.description = ::std::option::Option::Some(input.into());
211        self
212    }
213    /// <p>Describes the contents of the component.</p>
214    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.description = input;
216        self
217    }
218    /// <p>Describes the contents of the component.</p>
219    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
220        &self.description
221    }
222    /// <p>The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.</p>
223    pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.change_description = ::std::option::Option::Some(input.into());
225        self
226    }
227    /// <p>The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.</p>
228    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.change_description = input;
230        self
231    }
232    /// <p>The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.</p>
233    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
234        &self.change_description
235    }
236    /// <p>The operating system platform of the component.</p>
237    /// This field is required.
238    pub fn platform(mut self, input: crate::types::Platform) -> Self {
239        self.platform = ::std::option::Option::Some(input);
240        self
241    }
242    /// <p>The operating system platform of the component.</p>
243    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
244        self.platform = input;
245        self
246    }
247    /// <p>The operating system platform of the component.</p>
248    pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
249        &self.platform
250    }
251    /// Appends an item to `supported_os_versions`.
252    ///
253    /// To override the contents of this collection use [`set_supported_os_versions`](Self::set_supported_os_versions).
254    ///
255    /// <p>The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.</p>
256    pub fn supported_os_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257        let mut v = self.supported_os_versions.unwrap_or_default();
258        v.push(input.into());
259        self.supported_os_versions = ::std::option::Option::Some(v);
260        self
261    }
262    /// <p>The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.</p>
263    pub fn set_supported_os_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
264        self.supported_os_versions = input;
265        self
266    }
267    /// <p>The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.</p>
268    pub fn get_supported_os_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
269        &self.supported_os_versions
270    }
271    /// <p>Component <code>data</code> contains inline YAML document content for the component. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
272    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.data = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <p>Component <code>data</code> contains inline YAML document content for the component. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
277    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.data = input;
279        self
280    }
281    /// <p>Component <code>data</code> contains inline YAML document content for the component. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
282    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
283        &self.data
284    }
285    /// <p>The <code>uri</code> of a YAML component document file. This must be an S3 URL (<code>s3://bucket/key</code>), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.</p>
286    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
287    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288        self.uri = ::std::option::Option::Some(input.into());
289        self
290    }
291    /// <p>The <code>uri</code> of a YAML component document file. This must be an S3 URL (<code>s3://bucket/key</code>), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.</p>
292    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
293    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294        self.uri = input;
295        self
296    }
297    /// <p>The <code>uri</code> of a YAML component document file. This must be an S3 URL (<code>s3://bucket/key</code>), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.</p>
298    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
299    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
300        &self.uri
301    }
302    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. 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>
303    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
304        self.kms_key_id = ::std::option::Option::Some(input.into());
305        self
306    }
307    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. 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>
308    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309        self.kms_key_id = input;
310        self
311    }
312    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. 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>
313    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
314        &self.kms_key_id
315    }
316    /// Adds a key-value pair to `tags`.
317    ///
318    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
319    ///
320    /// <p>The tags that apply to the component.</p>
321    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
322        let mut hash_map = self.tags.unwrap_or_default();
323        hash_map.insert(k.into(), v.into());
324        self.tags = ::std::option::Option::Some(hash_map);
325        self
326    }
327    /// <p>The tags that apply to the component.</p>
328    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
329        self.tags = input;
330        self
331    }
332    /// <p>The tags that apply to the component.</p>
333    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
334        &self.tags
335    }
336    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
337    /// This field is required.
338    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339        self.client_token = ::std::option::Option::Some(input.into());
340        self
341    }
342    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
343    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344        self.client_token = input;
345        self
346    }
347    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
348    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
349        &self.client_token
350    }
351    /// Consumes the builder and constructs a [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
352    pub fn build(
353        self,
354    ) -> ::std::result::Result<crate::operation::create_component::CreateComponentInput, ::aws_smithy_types::error::operation::BuildError> {
355        ::std::result::Result::Ok(crate::operation::create_component::CreateComponentInput {
356            name: self.name,
357            semantic_version: self.semantic_version,
358            description: self.description,
359            change_description: self.change_description,
360            platform: self.platform,
361            supported_os_versions: self.supported_os_versions,
362            data: self.data,
363            uri: self.uri,
364            kms_key_id: self.kms_key_id,
365            tags: self.tags,
366            client_token: self.client_token,
367        })
368    }
369}