aws_sdk_imagebuilder/operation/create_component/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_component::_create_component_output::CreateComponentOutputBuilder;
3
4pub use crate::operation::create_component::_create_component_input::CreateComponentInputBuilder;
5
6impl crate::operation::create_component::builders::CreateComponentInputBuilder {
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_component::CreateComponentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_component::CreateComponentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_component();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateComponent`.
24///
25/// <p>Creates a new component that can be used to build, validate, test, and assess your image. The component is based on a YAML document that you specify using exactly one of the following methods:</p>
26/// <ul>
27/// <li>
28/// <p>Inline, using the <code>data</code> property in the request body.</p></li>
29/// <li>
30/// <p>A URL that points to a YAML document file stored in Amazon S3, using the <code>uri</code> property in the request body.</p></li>
31/// </ul>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateComponentFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::create_component::builders::CreateComponentInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::create_component::CreateComponentOutput,
41        crate::operation::create_component::CreateComponentError,
42    > for CreateComponentFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::create_component::CreateComponentOutput,
50            crate::operation::create_component::CreateComponentError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl CreateComponentFluentBuilder {
57    /// Creates a new `CreateComponentFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the CreateComponent as a reference.
66    pub fn as_input(&self) -> &crate::operation::create_component::builders::CreateComponentInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::create_component::CreateComponentOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::create_component::CreateComponentError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::create_component::CreateComponent::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::create_component::CreateComponent::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::create_component::CreateComponentOutput,
103        crate::operation::create_component::CreateComponentError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The name of the component.</p>
118    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.name(input.into());
120        self
121    }
122    /// <p>The name of the component.</p>
123    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_name(input);
125        self
126    }
127    /// <p>The name of the component.</p>
128    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_name()
130    }
131    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
132    /// <p>The semantic version has four nodes: <major>
133    /// .
134    /// <minor>
135    /// .
136    /// <patch>
137    /// /
138    /// <build>
139    /// . You can assign values for the first three, and can filter on all of them.
140    /// </build>
141    /// </patch>
142    /// </minor>
143    /// </major></p>
144    /// <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>
145    /// <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>
146    /// </note>
147    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.semantic_version(input.into());
149        self
150    }
151    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
152    /// <p>The semantic version has four nodes: <major>
153    /// .
154    /// <minor>
155    /// .
156    /// <patch>
157    /// /
158    /// <build>
159    /// . You can assign values for the first three, and can filter on all of them.
160    /// </build>
161    /// </patch>
162    /// </minor>
163    /// </major></p>
164    /// <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>
165    /// <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>
166    /// </note>
167    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_semantic_version(input);
169        self
170    }
171    /// <p>The semantic version of the component. This version follows the semantic version syntax.</p><note>
172    /// <p>The semantic version has four nodes: <major>
173    /// .
174    /// <minor>
175    /// .
176    /// <patch>
177    /// /
178    /// <build>
179    /// . You can assign values for the first three, and can filter on all of them.
180    /// </build>
181    /// </patch>
182    /// </minor>
183    /// </major></p>
184    /// <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>
185    /// <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>
186    /// </note>
187    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_semantic_version()
189    }
190    /// <p>Describes the contents of the component.</p>
191    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.description(input.into());
193        self
194    }
195    /// <p>Describes the contents of the component.</p>
196    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_description(input);
198        self
199    }
200    /// <p>Describes the contents of the component.</p>
201    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_description()
203    }
204    /// <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>
205    pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.inner = self.inner.change_description(input.into());
207        self
208    }
209    /// <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>
210    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.inner = self.inner.set_change_description(input);
212        self
213    }
214    /// <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>
215    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
216        self.inner.get_change_description()
217    }
218    /// <p>The operating system platform of the component.</p>
219    pub fn platform(mut self, input: crate::types::Platform) -> Self {
220        self.inner = self.inner.platform(input);
221        self
222    }
223    /// <p>The operating system platform of the component.</p>
224    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
225        self.inner = self.inner.set_platform(input);
226        self
227    }
228    /// <p>The operating system platform of the component.</p>
229    pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
230        self.inner.get_platform()
231    }
232    ///
233    /// Appends an item to `supportedOsVersions`.
234    ///
235    /// To override the contents of this collection use [`set_supported_os_versions`](Self::set_supported_os_versions).
236    ///
237    /// <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>
238    pub fn supported_os_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.supported_os_versions(input.into());
240        self
241    }
242    /// <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>
243    pub fn set_supported_os_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
244        self.inner = self.inner.set_supported_os_versions(input);
245        self
246    }
247    /// <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>
248    pub fn get_supported_os_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
249        self.inner.get_supported_os_versions()
250    }
251    /// <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>
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>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>
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>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>
262    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
263        self.inner.get_data()
264    }
265    /// <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>
266    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
267    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.inner = self.inner.uri(input.into());
269        self
270    }
271    /// <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>
272    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
273    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.inner = self.inner.set_uri(input);
275        self
276    }
277    /// <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>
278    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
279    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
280        self.inner.get_uri()
281    }
282    /// <p>The ID of the KMS key that is used to encrypt this component.</p>
283    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284        self.inner = self.inner.kms_key_id(input.into());
285        self
286    }
287    /// <p>The ID of the KMS key that is used to encrypt this component.</p>
288    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289        self.inner = self.inner.set_kms_key_id(input);
290        self
291    }
292    /// <p>The ID of the KMS key that is used to encrypt this component.</p>
293    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
294        self.inner.get_kms_key_id()
295    }
296    ///
297    /// Adds a key-value pair to `tags`.
298    ///
299    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
300    ///
301    /// <p>The tags that apply to the component.</p>
302    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.inner = self.inner.tags(k.into(), v.into());
304        self
305    }
306    /// <p>The tags that apply to the component.</p>
307    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
308        self.inner = self.inner.set_tags(input);
309        self
310    }
311    /// <p>The tags that apply to the component.</p>
312    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
313        self.inner.get_tags()
314    }
315    /// <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>
316    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
317        self.inner = self.inner.client_token(input.into());
318        self
319    }
320    /// <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>
321    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322        self.inner = self.inner.set_client_token(input);
323        self
324    }
325    /// <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>
326    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
327        self.inner.get_client_token()
328    }
329}