aws_sdk_imagebuilder/operation/create_container_recipe/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_container_recipe::_create_container_recipe_output::CreateContainerRecipeOutputBuilder;
3
4pub use crate::operation::create_container_recipe::_create_container_recipe_input::CreateContainerRecipeInputBuilder;
5
6impl crate::operation::create_container_recipe::builders::CreateContainerRecipeInputBuilder {
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_container_recipe::CreateContainerRecipeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_container_recipe::CreateContainerRecipeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_container_recipe();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateContainerRecipe`.
24///
25/// <p>Creates a new container recipe. Container recipes define how images are configured, tested, and assessed.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateContainerRecipeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_container_recipe::builders::CreateContainerRecipeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_container_recipe::CreateContainerRecipeOutput,
35        crate::operation::create_container_recipe::CreateContainerRecipeError,
36    > for CreateContainerRecipeFluentBuilder
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_container_recipe::CreateContainerRecipeOutput,
44            crate::operation::create_container_recipe::CreateContainerRecipeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateContainerRecipeFluentBuilder {
51    /// Creates a new `CreateContainerRecipeFluentBuilder`.
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 CreateContainerRecipe as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_container_recipe::builders::CreateContainerRecipeInputBuilder {
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_container_recipe::CreateContainerRecipeOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_container_recipe::CreateContainerRecipeError,
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_container_recipe::CreateContainerRecipe::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_container_recipe::CreateContainerRecipe::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_container_recipe::CreateContainerRecipeOutput,
97        crate::operation::create_container_recipe::CreateContainerRecipeError,
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 type of container to create.</p>
112    pub fn container_type(mut self, input: crate::types::ContainerType) -> Self {
113        self.inner = self.inner.container_type(input);
114        self
115    }
116    /// <p>The type of container to create.</p>
117    pub fn set_container_type(mut self, input: ::std::option::Option<crate::types::ContainerType>) -> Self {
118        self.inner = self.inner.set_container_type(input);
119        self
120    }
121    /// <p>The type of container to create.</p>
122    pub fn get_container_type(&self) -> &::std::option::Option<crate::types::ContainerType> {
123        self.inner.get_container_type()
124    }
125    /// <p>The name of the container recipe.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>The name of the container recipe.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>The name of the container recipe.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>The description of the container recipe.</p>
140    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.description(input.into());
142        self
143    }
144    /// <p>The description of the container recipe.</p>
145    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_description(input);
147        self
148    }
149    /// <p>The description of the container recipe.</p>
150    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_description()
152    }
153    /// <p>The semantic version of the container recipe. This version follows the semantic version syntax.</p><note>
154    /// <p>The semantic version has four nodes: <major>
155    /// .
156    /// <minor>
157    /// .
158    /// <patch>
159    /// /
160    /// <build>
161    /// . You can assign values for the first three, and can filter on all of them.
162    /// </build>
163    /// </patch>
164    /// </minor>
165    /// </major></p>
166    /// <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>
167    /// <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>
168    /// </note>
169    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.semantic_version(input.into());
171        self
172    }
173    /// <p>The semantic version of the container recipe. This version follows the semantic version syntax.</p><note>
174    /// <p>The semantic version has four nodes: <major>
175    /// .
176    /// <minor>
177    /// .
178    /// <patch>
179    /// /
180    /// <build>
181    /// . You can assign values for the first three, and can filter on all of them.
182    /// </build>
183    /// </patch>
184    /// </minor>
185    /// </major></p>
186    /// <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>
187    /// <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>
188    /// </note>
189    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_semantic_version(input);
191        self
192    }
193    /// <p>The semantic version of the container recipe. This version follows the semantic version syntax.</p><note>
194    /// <p>The semantic version has four nodes: <major>
195    /// .
196    /// <minor>
197    /// .
198    /// <patch>
199    /// /
200    /// <build>
201    /// . You can assign values for the first three, and can filter on all of them.
202    /// </build>
203    /// </patch>
204    /// </minor>
205    /// </major></p>
206    /// <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>
207    /// <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>
208    /// </note>
209    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_semantic_version()
211    }
212    ///
213    /// Appends an item to `components`.
214    ///
215    /// To override the contents of this collection use [`set_components`](Self::set_components).
216    ///
217    /// <p>Components for build and test that are included in the container recipe. Recipes require a minimum of one build component, and can have a maximum of 20 build and test components in any combination.</p>
218    pub fn components(mut self, input: crate::types::ComponentConfiguration) -> Self {
219        self.inner = self.inner.components(input);
220        self
221    }
222    /// <p>Components for build and test that are included in the container recipe. Recipes require a minimum of one build component, and can have a maximum of 20 build and test components in any combination.</p>
223    pub fn set_components(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComponentConfiguration>>) -> Self {
224        self.inner = self.inner.set_components(input);
225        self
226    }
227    /// <p>Components for build and test that are included in the container recipe. Recipes require a minimum of one build component, and can have a maximum of 20 build and test components in any combination.</p>
228    pub fn get_components(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComponentConfiguration>> {
229        self.inner.get_components()
230    }
231    /// <p>A group of options that can be used to configure an instance for building and testing container images.</p>
232    pub fn instance_configuration(mut self, input: crate::types::InstanceConfiguration) -> Self {
233        self.inner = self.inner.instance_configuration(input);
234        self
235    }
236    /// <p>A group of options that can be used to configure an instance for building and testing container images.</p>
237    pub fn set_instance_configuration(mut self, input: ::std::option::Option<crate::types::InstanceConfiguration>) -> Self {
238        self.inner = self.inner.set_instance_configuration(input);
239        self
240    }
241    /// <p>A group of options that can be used to configure an instance for building and testing container images.</p>
242    pub fn get_instance_configuration(&self) -> &::std::option::Option<crate::types::InstanceConfiguration> {
243        self.inner.get_instance_configuration()
244    }
245    /// <p>The Dockerfile template used to build your image as an inline data blob.</p>
246    pub fn dockerfile_template_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.inner = self.inner.dockerfile_template_data(input.into());
248        self
249    }
250    /// <p>The Dockerfile template used to build your image as an inline data blob.</p>
251    pub fn set_dockerfile_template_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252        self.inner = self.inner.set_dockerfile_template_data(input);
253        self
254    }
255    /// <p>The Dockerfile template used to build your image as an inline data blob.</p>
256    pub fn get_dockerfile_template_data(&self) -> &::std::option::Option<::std::string::String> {
257        self.inner.get_dockerfile_template_data()
258    }
259    /// <p>The Amazon S3 URI for the Dockerfile that will be used to build your container image.</p>
260    pub fn dockerfile_template_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261        self.inner = self.inner.dockerfile_template_uri(input.into());
262        self
263    }
264    /// <p>The Amazon S3 URI for the Dockerfile that will be used to build your container image.</p>
265    pub fn set_dockerfile_template_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266        self.inner = self.inner.set_dockerfile_template_uri(input);
267        self
268    }
269    /// <p>The Amazon S3 URI for the Dockerfile that will be used to build your container image.</p>
270    pub fn get_dockerfile_template_uri(&self) -> &::std::option::Option<::std::string::String> {
271        self.inner.get_dockerfile_template_uri()
272    }
273    /// <p>Specifies the operating system platform when you use a custom base image.</p>
274    pub fn platform_override(mut self, input: crate::types::Platform) -> Self {
275        self.inner = self.inner.platform_override(input);
276        self
277    }
278    /// <p>Specifies the operating system platform when you use a custom base image.</p>
279    pub fn set_platform_override(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
280        self.inner = self.inner.set_platform_override(input);
281        self
282    }
283    /// <p>Specifies the operating system platform when you use a custom base image.</p>
284    pub fn get_platform_override(&self) -> &::std::option::Option<crate::types::Platform> {
285        self.inner.get_platform_override()
286    }
287    /// <p>Specifies the operating system version for the base image.</p>
288    pub fn image_os_version_override(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.inner = self.inner.image_os_version_override(input.into());
290        self
291    }
292    /// <p>Specifies the operating system version for the base image.</p>
293    pub fn set_image_os_version_override(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294        self.inner = self.inner.set_image_os_version_override(input);
295        self
296    }
297    /// <p>Specifies the operating system version for the base image.</p>
298    pub fn get_image_os_version_override(&self) -> &::std::option::Option<::std::string::String> {
299        self.inner.get_image_os_version_override()
300    }
301    /// <p>The base image for the container recipe.</p>
302    pub fn parent_image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.inner = self.inner.parent_image(input.into());
304        self
305    }
306    /// <p>The base image for the container recipe.</p>
307    pub fn set_parent_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308        self.inner = self.inner.set_parent_image(input);
309        self
310    }
311    /// <p>The base image for the container recipe.</p>
312    pub fn get_parent_image(&self) -> &::std::option::Option<::std::string::String> {
313        self.inner.get_parent_image()
314    }
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>Tags that are attached to the container recipe.</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        self.inner = self.inner.tags(k.into(), v.into());
323        self
324    }
325    /// <p>Tags that are attached to the container recipe.</p>
326    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
327        self.inner = self.inner.set_tags(input);
328        self
329    }
330    /// <p>Tags that are attached to the container recipe.</p>
331    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
332        self.inner.get_tags()
333    }
334    /// <p>The working directory for use during build and test workflows.</p>
335    pub fn working_directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
336        self.inner = self.inner.working_directory(input.into());
337        self
338    }
339    /// <p>The working directory for use during build and test workflows.</p>
340    pub fn set_working_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
341        self.inner = self.inner.set_working_directory(input);
342        self
343    }
344    /// <p>The working directory for use during build and test workflows.</p>
345    pub fn get_working_directory(&self) -> &::std::option::Option<::std::string::String> {
346        self.inner.get_working_directory()
347    }
348    /// <p>The destination repository for the container image.</p>
349    pub fn target_repository(mut self, input: crate::types::TargetContainerRepository) -> Self {
350        self.inner = self.inner.target_repository(input);
351        self
352    }
353    /// <p>The destination repository for the container image.</p>
354    pub fn set_target_repository(mut self, input: ::std::option::Option<crate::types::TargetContainerRepository>) -> Self {
355        self.inner = self.inner.set_target_repository(input);
356        self
357    }
358    /// <p>The destination repository for the container image.</p>
359    pub fn get_target_repository(&self) -> &::std::option::Option<crate::types::TargetContainerRepository> {
360        self.inner.get_target_repository()
361    }
362    /// <p>Identifies which KMS key is used to encrypt the Dockerfile template.</p>
363    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
364        self.inner = self.inner.kms_key_id(input.into());
365        self
366    }
367    /// <p>Identifies which KMS key is used to encrypt the Dockerfile template.</p>
368    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
369        self.inner = self.inner.set_kms_key_id(input);
370        self
371    }
372    /// <p>Identifies which KMS key is used to encrypt the Dockerfile template.</p>
373    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
374        self.inner.get_kms_key_id()
375    }
376    /// <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>
377    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
378        self.inner = self.inner.client_token(input.into());
379        self
380    }
381    /// <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>
382    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
383        self.inner = self.inner.set_client_token(input);
384        self
385    }
386    /// <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>
387    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
388        self.inner.get_client_token()
389    }
390}