aws_sdk_imagebuilder/operation/import_component/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::import_component::_import_component_output::ImportComponentOutputBuilder;
3
4pub use crate::operation::import_component::_import_component_input::ImportComponentInputBuilder;
5
6impl crate::operation::import_component::builders::ImportComponentInputBuilder {
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::import_component::ImportComponentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::import_component::ImportComponentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.import_component();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ImportComponent`.
24///
25/// <p>Imports a component and transforms its data into a component document.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ImportComponentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::import_component::builders::ImportComponentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::import_component::ImportComponentOutput,
35        crate::operation::import_component::ImportComponentError,
36    > for ImportComponentFluentBuilder
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::import_component::ImportComponentOutput,
44            crate::operation::import_component::ImportComponentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ImportComponentFluentBuilder {
51    /// Creates a new `ImportComponentFluentBuilder`.
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 ImportComponent as a reference.
60    pub fn as_input(&self) -> &crate::operation::import_component::builders::ImportComponentInputBuilder {
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::import_component::ImportComponentOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::import_component::ImportComponentError,
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::import_component::ImportComponent::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::import_component::ImportComponent::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::import_component::ImportComponentOutput,
97        crate::operation::import_component::ImportComponentError,
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 component.</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 component.</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 component.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
126    /// <p>The semantic version has four nodes: <major>
127    /// .
128    /// <minor>
129    /// .
130    /// <patch>
131    /// /
132    /// <build>
133    /// . You can assign values for the first three, and can filter on all of them.
134    /// </build>
135    /// </patch>
136    /// </minor>
137    /// </major></p>
138    /// <p><b>Filtering:</b> With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.</p>
139    /// </note>
140    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.semantic_version(input.into());
142        self
143    }
144    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
145    /// <p>The semantic version has four nodes: <major>
146    /// .
147    /// <minor>
148    /// .
149    /// <patch>
150    /// /
151    /// <build>
152    /// . You can assign values for the first three, and can filter on all of them.
153    /// </build>
154    /// </patch>
155    /// </minor>
156    /// </major></p>
157    /// <p><b>Filtering:</b> With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.</p>
158    /// </note>
159    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_semantic_version(input);
161        self
162    }
163    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
164    /// <p>The semantic version has four nodes: <major>
165    /// .
166    /// <minor>
167    /// .
168    /// <patch>
169    /// /
170    /// <build>
171    /// . You can assign values for the first three, and can filter on all of them.
172    /// </build>
173    /// </patch>
174    /// </minor>
175    /// </major></p>
176    /// <p><b>Filtering:</b> With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.</p>
177    /// </note>
178    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_semantic_version()
180    }
181    /// <p>The description of the component. Describes the contents of the component.</p>
182    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.description(input.into());
184        self
185    }
186    /// <p>The description of the component. Describes the contents of the component.</p>
187    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_description(input);
189        self
190    }
191    /// <p>The description of the component. Describes the contents of the component.</p>
192    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_description()
194    }
195    /// <p>The change description of the component. This description indicates the change that has been made in this version, or what makes this version different from other versions of the component.</p>
196    pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.change_description(input.into());
198        self
199    }
200    /// <p>The change description of the component. This description indicates the change that has been made in this version, or what makes this version different from other versions of the component.</p>
201    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_change_description(input);
203        self
204    }
205    /// <p>The change description of the component. This description indicates the change that has been made in this version, or what makes this version different from other versions of the component.</p>
206    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_change_description()
208    }
209    /// <p>The type of the component denotes whether the component is used to build the image, or only to test it.</p>
210    pub fn r#type(mut self, input: crate::types::ComponentType) -> Self {
211        self.inner = self.inner.r#type(input);
212        self
213    }
214    /// <p>The type of the component denotes whether the component is used to build the image, or only to test it.</p>
215    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ComponentType>) -> Self {
216        self.inner = self.inner.set_type(input);
217        self
218    }
219    /// <p>The type of the component denotes whether the component is used to build the image, or only to test it.</p>
220    pub fn get_type(&self) -> &::std::option::Option<crate::types::ComponentType> {
221        self.inner.get_type()
222    }
223    /// <p>The format of the resource that you want to import as a component.</p>
224    pub fn format(mut self, input: crate::types::ComponentFormat) -> Self {
225        self.inner = self.inner.format(input);
226        self
227    }
228    /// <p>The format of the resource that you want to import as a component.</p>
229    pub fn set_format(mut self, input: ::std::option::Option<crate::types::ComponentFormat>) -> Self {
230        self.inner = self.inner.set_format(input);
231        self
232    }
233    /// <p>The format of the resource that you want to import as a component.</p>
234    pub fn get_format(&self) -> &::std::option::Option<crate::types::ComponentFormat> {
235        self.inner.get_format()
236    }
237    /// <p>The platform of the component.</p>
238    pub fn platform(mut self, input: crate::types::Platform) -> Self {
239        self.inner = self.inner.platform(input);
240        self
241    }
242    /// <p>The platform of the component.</p>
243    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
244        self.inner = self.inner.set_platform(input);
245        self
246    }
247    /// <p>The platform of the component.</p>
248    pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
249        self.inner.get_platform()
250    }
251    /// <p>The data of the component. Used to specify the data inline. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
252    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253        self.inner = self.inner.data(input.into());
254        self
255    }
256    /// <p>The data of the component. Used to specify the data inline. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
257    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258        self.inner = self.inner.set_data(input);
259        self
260    }
261    /// <p>The data of the component. Used to specify the data inline. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
262    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
263        self.inner.get_data()
264    }
265    /// <p>The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
266    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.inner = self.inner.uri(input.into());
268        self
269    }
270    /// <p>The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
271    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.inner = self.inner.set_uri(input);
273        self
274    }
275    /// <p>The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. Either <code>data</code> or <code>uri</code> can be used to specify the data within the component.</p>
276    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
277        self.inner.get_uri()
278    }
279    /// <p>The ID of the KMS key that should be used to encrypt this component.</p>
280    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.inner = self.inner.kms_key_id(input.into());
282        self
283    }
284    /// <p>The ID of the KMS key that should be used to encrypt this component.</p>
285    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286        self.inner = self.inner.set_kms_key_id(input);
287        self
288    }
289    /// <p>The ID of the KMS key that should be used to encrypt this component.</p>
290    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
291        self.inner.get_kms_key_id()
292    }
293    ///
294    /// Adds a key-value pair to `tags`.
295    ///
296    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
297    ///
298    /// <p>The tags of the component.</p>
299    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.inner = self.inner.tags(k.into(), v.into());
301        self
302    }
303    /// <p>The tags of the component.</p>
304    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
305        self.inner = self.inner.set_tags(input);
306        self
307    }
308    /// <p>The tags of the component.</p>
309    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
310        self.inner.get_tags()
311    }
312    /// <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>
313    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314        self.inner = self.inner.client_token(input.into());
315        self
316    }
317    /// <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>
318    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
319        self.inner = self.inner.set_client_token(input);
320        self
321    }
322    /// <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>
323    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
324        self.inner.get_client_token()
325    }
326}