aws_sdk_imagebuilder/operation/create_image_recipe/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_image_recipe::_create_image_recipe_output::CreateImageRecipeOutputBuilder;
3
4pub use crate::operation::create_image_recipe::_create_image_recipe_input::CreateImageRecipeInputBuilder;
5
6impl crate::operation::create_image_recipe::builders::CreateImageRecipeInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_image_recipe::CreateImageRecipeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_image_recipe::CreateImageRecipeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_image_recipe();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateImageRecipe`.
24///
25/// <p>Creates a new image recipe. Image recipes define how images are configured, tested, and assessed.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateImageRecipeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_image_recipe::builders::CreateImageRecipeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_image_recipe::CreateImageRecipeOutput,
35        crate::operation::create_image_recipe::CreateImageRecipeError,
36    > for CreateImageRecipeFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_image_recipe::CreateImageRecipeOutput,
44            crate::operation::create_image_recipe::CreateImageRecipeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateImageRecipeFluentBuilder {
51    /// Creates a new `CreateImageRecipeFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateImageRecipe as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_image_recipe::builders::CreateImageRecipeInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_image_recipe::CreateImageRecipeOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_image_recipe::CreateImageRecipeError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_image_recipe::CreateImageRecipe::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_image_recipe::CreateImageRecipe::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_image_recipe::CreateImageRecipeOutput,
97        crate::operation::create_image_recipe::CreateImageRecipeError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of the image recipe.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>The name of the image recipe.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>The name of the image recipe.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The description of the image recipe.</p>
126    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.description(input.into());
128        self
129    }
130    /// <p>The description of the image recipe.</p>
131    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_description(input);
133        self
134    }
135    /// <p>The description of the image recipe.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_description()
138    }
139    /// <p>The semantic version of the image recipe. This version follows the semantic version syntax.</p><note>
140    /// <p>The semantic version has four nodes: <major>
141    /// .
142    /// <minor>
143    /// .
144    /// <patch>
145    /// /
146    /// <build>
147    /// . You can assign values for the first three, and can filter on all of them.
148    /// </build>
149    /// </patch>
150    /// </minor>
151    /// </major></p>
152    /// <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>
153    /// <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>
154    /// </note>
155    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.semantic_version(input.into());
157        self
158    }
159    /// <p>The semantic version of the image recipe. This version follows the semantic version syntax.</p><note>
160    /// <p>The semantic version has four nodes: <major>
161    /// .
162    /// <minor>
163    /// .
164    /// <patch>
165    /// /
166    /// <build>
167    /// . You can assign values for the first three, and can filter on all of them.
168    /// </build>
169    /// </patch>
170    /// </minor>
171    /// </major></p>
172    /// <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>
173    /// <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>
174    /// </note>
175    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_semantic_version(input);
177        self
178    }
179    /// <p>The semantic version of the image recipe. This version follows the semantic version syntax.</p><note>
180    /// <p>The semantic version has four nodes: <major>
181    /// .
182    /// <minor>
183    /// .
184    /// <patch>
185    /// /
186    /// <build>
187    /// . You can assign values for the first three, and can filter on all of them.
188    /// </build>
189    /// </patch>
190    /// </minor>
191    /// </major></p>
192    /// <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>
193    /// <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>
194    /// </note>
195    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_semantic_version()
197    }
198    ///
199    /// Appends an item to `components`.
200    ///
201    /// To override the contents of this collection use [`set_components`](Self::set_components).
202    ///
203    /// <p>The components included in the image recipe.</p>
204    pub fn components(mut self, input: crate::types::ComponentConfiguration) -> Self {
205        self.inner = self.inner.components(input);
206        self
207    }
208    /// <p>The components included in the image recipe.</p>
209    pub fn set_components(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComponentConfiguration>>) -> Self {
210        self.inner = self.inner.set_components(input);
211        self
212    }
213    /// <p>The components included in the image recipe.</p>
214    pub fn get_components(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComponentConfiguration>> {
215        self.inner.get_components()
216    }
217    /// <p>The base image for customizations specified in the image recipe. You can specify the parent image using one of the following options:</p>
218    /// <ul>
219    /// <li>
220    /// <p>AMI ID</p></li>
221    /// <li>
222    /// <p>Image Builder image Amazon Resource Name (ARN)</p></li>
223    /// <li>
224    /// <p>Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p></li>
225    /// <li>
226    /// <p>Amazon Web Services Marketplace product ID</p></li>
227    /// </ul>
228    /// <p>If you enter an AMI ID or an SSM parameter that contains the AMI ID, you must have access to the AMI, and the AMI must be in the source Region.</p>
229    pub fn parent_image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.parent_image(input.into());
231        self
232    }
233    /// <p>The base image for customizations specified in the image recipe. You can specify the parent image using one of the following options:</p>
234    /// <ul>
235    /// <li>
236    /// <p>AMI ID</p></li>
237    /// <li>
238    /// <p>Image Builder image Amazon Resource Name (ARN)</p></li>
239    /// <li>
240    /// <p>Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p></li>
241    /// <li>
242    /// <p>Amazon Web Services Marketplace product ID</p></li>
243    /// </ul>
244    /// <p>If you enter an AMI ID or an SSM parameter that contains the AMI ID, you must have access to the AMI, and the AMI must be in the source Region.</p>
245    pub fn set_parent_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_parent_image(input);
247        self
248    }
249    /// <p>The base image for customizations specified in the image recipe. You can specify the parent image using one of the following options:</p>
250    /// <ul>
251    /// <li>
252    /// <p>AMI ID</p></li>
253    /// <li>
254    /// <p>Image Builder image Amazon Resource Name (ARN)</p></li>
255    /// <li>
256    /// <p>Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p></li>
257    /// <li>
258    /// <p>Amazon Web Services Marketplace product ID</p></li>
259    /// </ul>
260    /// <p>If you enter an AMI ID or an SSM parameter that contains the AMI ID, you must have access to the AMI, and the AMI must be in the source Region.</p>
261    pub fn get_parent_image(&self) -> &::std::option::Option<::std::string::String> {
262        self.inner.get_parent_image()
263    }
264    ///
265    /// Appends an item to `blockDeviceMappings`.
266    ///
267    /// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
268    ///
269    /// <p>The block device mappings of the image recipe.</p>
270    pub fn block_device_mappings(mut self, input: crate::types::InstanceBlockDeviceMapping) -> Self {
271        self.inner = self.inner.block_device_mappings(input);
272        self
273    }
274    /// <p>The block device mappings of the image recipe.</p>
275    pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceBlockDeviceMapping>>) -> Self {
276        self.inner = self.inner.set_block_device_mappings(input);
277        self
278    }
279    /// <p>The block device mappings of the image recipe.</p>
280    pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceBlockDeviceMapping>> {
281        self.inner.get_block_device_mappings()
282    }
283    ///
284    /// Adds a key-value pair to `tags`.
285    ///
286    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
287    ///
288    /// <p>The tags of the image recipe.</p>
289    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
290        self.inner = self.inner.tags(k.into(), v.into());
291        self
292    }
293    /// <p>The tags of the image recipe.</p>
294    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
295        self.inner = self.inner.set_tags(input);
296        self
297    }
298    /// <p>The tags of the image recipe.</p>
299    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
300        self.inner.get_tags()
301    }
302    /// <p>The working directory used during build and test workflows.</p>
303    pub fn working_directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
304        self.inner = self.inner.working_directory(input.into());
305        self
306    }
307    /// <p>The working directory used during build and test workflows.</p>
308    pub fn set_working_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309        self.inner = self.inner.set_working_directory(input);
310        self
311    }
312    /// <p>The working directory used during build and test workflows.</p>
313    pub fn get_working_directory(&self) -> &::std::option::Option<::std::string::String> {
314        self.inner.get_working_directory()
315    }
316    /// <p>Specify additional settings and launch scripts for your build instances.</p>
317    pub fn additional_instance_configuration(mut self, input: crate::types::AdditionalInstanceConfiguration) -> Self {
318        self.inner = self.inner.additional_instance_configuration(input);
319        self
320    }
321    /// <p>Specify additional settings and launch scripts for your build instances.</p>
322    pub fn set_additional_instance_configuration(mut self, input: ::std::option::Option<crate::types::AdditionalInstanceConfiguration>) -> Self {
323        self.inner = self.inner.set_additional_instance_configuration(input);
324        self
325    }
326    /// <p>Specify additional settings and launch scripts for your build instances.</p>
327    pub fn get_additional_instance_configuration(&self) -> &::std::option::Option<crate::types::AdditionalInstanceConfiguration> {
328        self.inner.get_additional_instance_configuration()
329    }
330    ///
331    /// Adds a key-value pair to `amiTags`.
332    ///
333    /// To override the contents of this collection use [`set_ami_tags`](Self::set_ami_tags).
334    ///
335    /// <p>Tags that are applied to the AMI that Image Builder creates during the Build phase prior to image distribution.</p>
336    pub fn ami_tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
337        self.inner = self.inner.ami_tags(k.into(), v.into());
338        self
339    }
340    /// <p>Tags that are applied to the AMI that Image Builder creates during the Build phase prior to image distribution.</p>
341    pub fn set_ami_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
342        self.inner = self.inner.set_ami_tags(input);
343        self
344    }
345    /// <p>Tags that are applied to the AMI that Image Builder creates during the Build phase prior to image distribution.</p>
346    pub fn get_ami_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
347        self.inner.get_ami_tags()
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 client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
351        self.inner = self.inner.client_token(input.into());
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 set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
356        self.inner = self.inner.set_client_token(input);
357        self
358    }
359    /// <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>
360    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
361        self.inner.get_client_token()
362    }
363}