aws_sdk_imagebuilder/operation/create_workflow/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_workflow::_create_workflow_output::CreateWorkflowOutputBuilder;
3
4pub use crate::operation::create_workflow::_create_workflow_input::CreateWorkflowInputBuilder;
5
6impl crate::operation::create_workflow::builders::CreateWorkflowInputBuilder {
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_workflow::CreateWorkflowOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_workflow::CreateWorkflowError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_workflow();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateWorkflow`.
24///
25/// <p>Create a new workflow or a new version of an existing workflow.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateWorkflowFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_workflow::builders::CreateWorkflowInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_workflow::CreateWorkflowOutput,
35        crate::operation::create_workflow::CreateWorkflowError,
36    > for CreateWorkflowFluentBuilder
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_workflow::CreateWorkflowOutput,
44            crate::operation::create_workflow::CreateWorkflowError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateWorkflowFluentBuilder {
51    /// Creates a new `CreateWorkflowFluentBuilder`.
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 CreateWorkflow as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_workflow::builders::CreateWorkflowInputBuilder {
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_workflow::CreateWorkflowOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_workflow::CreateWorkflowError,
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_workflow::CreateWorkflow::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_workflow::CreateWorkflow::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_workflow::CreateWorkflowOutput,
97        crate::operation::create_workflow::CreateWorkflowError,
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 workflow to create.</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 workflow to create.</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 workflow to create.</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 this workflow resource. The semantic version syntax adheres to the following rules.</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>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>
139    /// <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>
140    /// </note>
141    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.semantic_version(input.into());
143        self
144    }
145    /// <p>The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.</p><note>
146    /// <p>The semantic version has four nodes: <major>
147    /// .
148    /// <minor>
149    /// .
150    /// <patch>
151    /// /
152    /// <build>
153    /// . You can assign values for the first three, and can filter on all of them.
154    /// </build>
155    /// </patch>
156    /// </minor>
157    /// </major></p>
158    /// <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>
159    /// <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>
160    /// </note>
161    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_semantic_version(input);
163        self
164    }
165    /// <p>The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.</p><note>
166    /// <p>The semantic version has four nodes: <major>
167    /// .
168    /// <minor>
169    /// .
170    /// <patch>
171    /// /
172    /// <build>
173    /// . You can assign values for the first three, and can filter on all of them.
174    /// </build>
175    /// </patch>
176    /// </minor>
177    /// </major></p>
178    /// <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>
179    /// <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>
180    /// </note>
181    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_semantic_version()
183    }
184    /// <p>Describes the workflow.</p>
185    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.description(input.into());
187        self
188    }
189    /// <p>Describes the workflow.</p>
190    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_description(input);
192        self
193    }
194    /// <p>Describes the workflow.</p>
195    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_description()
197    }
198    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
199    pub fn change_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.change_description(input.into());
201        self
202    }
203    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
204    pub fn set_change_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_change_description(input);
206        self
207    }
208    /// <p>Describes what change has been made in this version of the workflow, or what makes this version different from other versions of the workflow.</p>
209    pub fn get_change_description(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_change_description()
211    }
212    /// <p>Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
213    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.data(input.into());
215        self
216    }
217    /// <p>Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
218    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_data(input);
220        self
221    }
222    /// <p>Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the <code>uri</code> of a YAML document file stored in Amazon S3. However, you cannot specify both properties.</p>
223    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_data()
225    }
226    /// <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>
227    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
228    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.inner = self.inner.uri(input.into());
230        self
231    }
232    /// <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>
233    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
234    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_uri(input);
236        self
237    }
238    /// <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>
239    /// <p>Alternatively, you can specify the YAML document inline, using the component <code>data</code> property. You cannot specify both properties.</p>
240    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
241        self.inner.get_uri()
242    }
243    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this workflow resource. 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>
244    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.inner = self.inner.kms_key_id(input.into());
246        self
247    }
248    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this workflow resource. 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>
249    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.inner = self.inner.set_kms_key_id(input);
251        self
252    }
253    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this workflow resource. 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>
254    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
255        self.inner.get_kms_key_id()
256    }
257    ///
258    /// Adds a key-value pair to `tags`.
259    ///
260    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
261    ///
262    /// <p>Tags that apply to the workflow resource.</p>
263    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.inner = self.inner.tags(k.into(), v.into());
265        self
266    }
267    /// <p>Tags that apply to the workflow resource.</p>
268    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
269        self.inner = self.inner.set_tags(input);
270        self
271    }
272    /// <p>Tags that apply to the workflow resource.</p>
273    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
274        self.inner.get_tags()
275    }
276    /// <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>
277    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.inner = self.inner.client_token(input.into());
279        self
280    }
281    /// <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>
282    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.inner = self.inner.set_client_token(input);
284        self
285    }
286    /// <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>
287    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
288        self.inner.get_client_token()
289    }
290    /// <p>The phase in the image build process for which the workflow resource is responsible.</p>
291    pub fn r#type(mut self, input: crate::types::WorkflowType) -> Self {
292        self.inner = self.inner.r#type(input);
293        self
294    }
295    /// <p>The phase in the image build process for which the workflow resource is responsible.</p>
296    pub fn set_type(mut self, input: ::std::option::Option<crate::types::WorkflowType>) -> Self {
297        self.inner = self.inner.set_type(input);
298        self
299    }
300    /// <p>The phase in the image build process for which the workflow resource is responsible.</p>
301    pub fn get_type(&self) -> &::std::option::Option<crate::types::WorkflowType> {
302        self.inner.get_type()
303    }
304}