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 /// <p>Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is <code>DryRunOperationException</code>.</p>
45 pub dry_run: ::std::option::Option<bool>,
46}
47impl CreateComponentInput {
48 /// <p>The name of the component.</p>
49 pub fn name(&self) -> ::std::option::Option<&str> {
50 self.name.as_deref()
51 }
52 /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
53 /// <p>The semantic version has four nodes: <major>
54 /// .
55 /// <minor>
56 /// .
57 /// <patch>
58 /// /
59 /// <build>
60 /// . You can assign values for the first three, and can filter on all of them.
61 /// </build>
62 /// </patch>
63 /// </minor>
64 /// </major></p>
65 /// <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>
66 /// <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>
67 /// </note>
68 pub fn semantic_version(&self) -> ::std::option::Option<&str> {
69 self.semantic_version.as_deref()
70 }
71 /// <p>Describes the contents of the component.</p>
72 pub fn description(&self) -> ::std::option::Option<&str> {
73 self.description.as_deref()
74 }
75 /// <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>
76 pub fn change_description(&self) -> ::std::option::Option<&str> {
77 self.change_description.as_deref()
78 }
79 /// <p>The operating system platform of the component.</p>
80 pub fn platform(&self) -> ::std::option::Option<&crate::types::Platform> {
81 self.platform.as_ref()
82 }
83 /// <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>
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 `.supported_os_versions.is_none()`.
86 pub fn supported_os_versions(&self) -> &[::std::string::String] {
87 self.supported_os_versions.as_deref().unwrap_or_default()
88 }
89 /// <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>
90 pub fn data(&self) -> ::std::option::Option<&str> {
91 self.data.as_deref()
92 }
93 /// <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>
94 /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
95 pub fn uri(&self) -> ::std::option::Option<&str> {
96 self.uri.as_deref()
97 }
98 /// <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>
99 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
100 self.kms_key_id.as_deref()
101 }
102 /// <p>The tags that apply to the component.</p>
103 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
104 self.tags.as_ref()
105 }
106 /// <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>
107 pub fn client_token(&self) -> ::std::option::Option<&str> {
108 self.client_token.as_deref()
109 }
110 /// <p>Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is <code>DryRunOperationException</code>.</p>
111 pub fn dry_run(&self) -> ::std::option::Option<bool> {
112 self.dry_run
113 }
114}
115impl CreateComponentInput {
116 /// Creates a new builder-style object to manufacture [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
117 pub fn builder() -> crate::operation::create_component::builders::CreateComponentInputBuilder {
118 crate::operation::create_component::builders::CreateComponentInputBuilder::default()
119 }
120}
121
122/// A builder for [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
123#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
124#[non_exhaustive]
125pub struct CreateComponentInputBuilder {
126 pub(crate) name: ::std::option::Option<::std::string::String>,
127 pub(crate) semantic_version: ::std::option::Option<::std::string::String>,
128 pub(crate) description: ::std::option::Option<::std::string::String>,
129 pub(crate) change_description: ::std::option::Option<::std::string::String>,
130 pub(crate) platform: ::std::option::Option<crate::types::Platform>,
131 pub(crate) supported_os_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
132 pub(crate) data: ::std::option::Option<::std::string::String>,
133 pub(crate) uri: ::std::option::Option<::std::string::String>,
134 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
135 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
136 pub(crate) client_token: ::std::option::Option<::std::string::String>,
137 pub(crate) dry_run: ::std::option::Option<bool>,
138}
139impl CreateComponentInputBuilder {
140 /// <p>The name of the component.</p>
141 /// This field is required.
142 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.name = ::std::option::Option::Some(input.into());
144 self
145 }
146 /// <p>The name of the component.</p>
147 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.name = input;
149 self
150 }
151 /// <p>The name of the component.</p>
152 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
153 &self.name
154 }
155 /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
156 /// <p>The semantic version has four nodes: <major>
157 /// .
158 /// <minor>
159 /// .
160 /// <patch>
161 /// /
162 /// <build>
163 /// . You can assign values for the first three, and can filter on all of them.
164 /// </build>
165 /// </patch>
166 /// </minor>
167 /// </major></p>
168 /// <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>
169 /// <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>
170 /// </note>
171 /// This field is required.
172 pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.semantic_version = ::std::option::Option::Some(input.into());
174 self
175 }
176 /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
177 /// <p>The semantic version has four nodes: <major>
178 /// .
179 /// <minor>
180 /// .
181 /// <patch>
182 /// /
183 /// <build>
184 /// . You can assign values for the first three, and can filter on all of them.
185 /// </build>
186 /// </patch>
187 /// </minor>
188 /// </major></p>
189 /// <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>
190 /// <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>
191 /// </note>
192 pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.semantic_version = input;
194 self
195 }
196 /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
197 /// <p>The semantic version has four nodes: <major>
198 /// .
199 /// <minor>
200 /// .
201 /// <patch>
202 /// /
203 /// <build>
204 /// . You can assign values for the first three, and can filter on all of them.
205 /// </build>
206 /// </patch>
207 /// </minor>
208 /// </major></p>
209 /// <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>
210 /// <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>
211 /// </note>
212 pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
213 &self.semantic_version
214 }
215 /// <p>Describes the contents of the component.</p>
216 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.description = ::std::option::Option::Some(input.into());
218 self
219 }
220 /// <p>Describes the contents of the component.</p>
221 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.description = input;
223 self
224 }
225 /// <p>Describes the contents of the component.</p>
226 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
227 &self.description
228 }
229 /// <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>
230 pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231 self.change_description = ::std::option::Option::Some(input.into());
232 self
233 }
234 /// <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>
235 pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236 self.change_description = input;
237 self
238 }
239 /// <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>
240 pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
241 &self.change_description
242 }
243 /// <p>The operating system platform of the component.</p>
244 /// This field is required.
245 pub fn platform(mut self, input: crate::types::Platform) -> Self {
246 self.platform = ::std::option::Option::Some(input);
247 self
248 }
249 /// <p>The operating system platform of the component.</p>
250 pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
251 self.platform = input;
252 self
253 }
254 /// <p>The operating system platform of the component.</p>
255 pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
256 &self.platform
257 }
258 /// Appends an item to `supported_os_versions`.
259 ///
260 /// To override the contents of this collection use [`set_supported_os_versions`](Self::set_supported_os_versions).
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 supported_os_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264 let mut v = self.supported_os_versions.unwrap_or_default();
265 v.push(input.into());
266 self.supported_os_versions = ::std::option::Option::Some(v);
267 self
268 }
269 /// <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>
270 pub fn set_supported_os_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
271 self.supported_os_versions = input;
272 self
273 }
274 /// <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>
275 pub fn get_supported_os_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
276 &self.supported_os_versions
277 }
278 /// <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>
279 pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280 self.data = ::std::option::Option::Some(input.into());
281 self
282 }
283 /// <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>
284 pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
285 self.data = input;
286 self
287 }
288 /// <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>
289 pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
290 &self.data
291 }
292 /// <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>
293 /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
294 pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
295 self.uri = ::std::option::Option::Some(input.into());
296 self
297 }
298 /// <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>
299 /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
300 pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301 self.uri = input;
302 self
303 }
304 /// <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>
305 /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
306 pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
307 &self.uri
308 }
309 /// <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>
310 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311 self.kms_key_id = ::std::option::Option::Some(input.into());
312 self
313 }
314 /// <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>
315 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316 self.kms_key_id = input;
317 self
318 }
319 /// <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>
320 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
321 &self.kms_key_id
322 }
323 /// Adds a key-value pair to `tags`.
324 ///
325 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
326 ///
327 /// <p>The tags that apply to the component.</p>
328 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
329 let mut hash_map = self.tags.unwrap_or_default();
330 hash_map.insert(k.into(), v.into());
331 self.tags = ::std::option::Option::Some(hash_map);
332 self
333 }
334 /// <p>The tags that apply to the component.</p>
335 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
336 self.tags = input;
337 self
338 }
339 /// <p>The tags that apply to the component.</p>
340 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
341 &self.tags
342 }
343 /// <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>
344 /// This field is required.
345 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346 self.client_token = ::std::option::Option::Some(input.into());
347 self
348 }
349 /// <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>
350 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351 self.client_token = input;
352 self
353 }
354 /// <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>
355 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
356 &self.client_token
357 }
358 /// <p>Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is <code>DryRunOperationException</code>.</p>
359 pub fn dry_run(mut self, input: bool) -> Self {
360 self.dry_run = ::std::option::Option::Some(input);
361 self
362 }
363 /// <p>Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is <code>DryRunOperationException</code>.</p>
364 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
365 self.dry_run = input;
366 self
367 }
368 /// <p>Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is <code>DryRunOperationException</code>.</p>
369 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
370 &self.dry_run
371 }
372 /// Consumes the builder and constructs a [`CreateComponentInput`](crate::operation::create_component::CreateComponentInput).
373 pub fn build(
374 self,
375 ) -> ::std::result::Result<crate::operation::create_component::CreateComponentInput, ::aws_smithy_types::error::operation::BuildError> {
376 ::std::result::Result::Ok(crate::operation::create_component::CreateComponentInput {
377 name: self.name,
378 semantic_version: self.semantic_version,
379 description: self.description,
380 change_description: self.change_description,
381 platform: self.platform,
382 supported_os_versions: self.supported_os_versions,
383 data: self.data,
384 uri: self.uri,
385 kms_key_id: self.kms_key_id,
386 tags: self.tags,
387 client_token: self.client_token,
388 dry_run: self.dry_run,
389 })
390 }
391}