aws_sdk_sfn/operation/create_activity/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_activity::_create_activity_output::CreateActivityOutputBuilder;
3
4pub use crate::operation::create_activity::_create_activity_input::CreateActivityInputBuilder;
5
6impl crate::operation::create_activity::builders::CreateActivityInputBuilder {
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_activity::CreateActivityOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_activity::CreateActivityError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_activity();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateActivity`.
24///
25/// <p>Creates an activity. An activity is a task that you write in any programming language and host on any machine that has access to Step Functions. Activities must poll Step Functions using the <code>GetActivityTask</code> API action and respond using <code>SendTask*</code> API actions. This function lets Step Functions know the existence of your activity and returns an identifier for use in a state machine and when polling from the activity.</p><note>
26/// <p>This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.</p>
27/// </note> <note>
28/// <p><code>CreateActivity</code> is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. <code>CreateActivity</code>'s idempotency check is based on the activity <code>name</code>. If a following request has different <code>tags</code> values, Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, <code>tags</code> will not be updated, even if they are different.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateActivityFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::create_activity::builders::CreateActivityInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::create_activity::CreateActivityOutput,
39        crate::operation::create_activity::CreateActivityError,
40    > for CreateActivityFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::create_activity::CreateActivityOutput,
48            crate::operation::create_activity::CreateActivityError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl CreateActivityFluentBuilder {
55    /// Creates a new `CreateActivityFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the CreateActivity as a reference.
64    pub fn as_input(&self) -> &crate::operation::create_activity::builders::CreateActivityInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::create_activity::CreateActivityOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::create_activity::CreateActivityError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::create_activity::CreateActivity::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::create_activity::CreateActivity::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_activity::CreateActivityOutput,
101        crate::operation::create_activity::CreateActivityError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The name of the activity to create. This name must be unique for your Amazon Web Services account and region for 90 days. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions"> Limits Related to State Machine Executions</a> in the <i>Step Functions Developer Guide</i>.</p>
116    /// <p>A name must <i>not</i> contain:</p>
117    /// <ul>
118    /// <li>
119    /// <p>white space</p></li>
120    /// <li>
121    /// <p>brackets <code>&lt; &gt; { } \[ \]</code></p></li>
122    /// <li>
123    /// <p>wildcard characters <code>? *</code></p></li>
124    /// <li>
125    /// <p>special characters <code>" # % \ ^ | ~ ` $ &amp; , ; : /</code></p></li>
126    /// <li>
127    /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
128    /// <li>
129    /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
130    /// <li>
131    /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
132    /// </ul>
133    /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
134    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.name(input.into());
136        self
137    }
138    /// <p>The name of the activity to create. This name must be unique for your Amazon Web Services account and region for 90 days. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions"> Limits Related to State Machine Executions</a> in the <i>Step Functions Developer Guide</i>.</p>
139    /// <p>A name must <i>not</i> contain:</p>
140    /// <ul>
141    /// <li>
142    /// <p>white space</p></li>
143    /// <li>
144    /// <p>brackets <code>&lt; &gt; { } \[ \]</code></p></li>
145    /// <li>
146    /// <p>wildcard characters <code>? *</code></p></li>
147    /// <li>
148    /// <p>special characters <code>" # % \ ^ | ~ ` $ &amp; , ; : /</code></p></li>
149    /// <li>
150    /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
151    /// <li>
152    /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
153    /// <li>
154    /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
155    /// </ul>
156    /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
157    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_name(input);
159        self
160    }
161    /// <p>The name of the activity to create. This name must be unique for your Amazon Web Services account and region for 90 days. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions"> Limits Related to State Machine Executions</a> in the <i>Step Functions Developer Guide</i>.</p>
162    /// <p>A name must <i>not</i> contain:</p>
163    /// <ul>
164    /// <li>
165    /// <p>white space</p></li>
166    /// <li>
167    /// <p>brackets <code>&lt; &gt; { } \[ \]</code></p></li>
168    /// <li>
169    /// <p>wildcard characters <code>? *</code></p></li>
170    /// <li>
171    /// <p>special characters <code>" # % \ ^ | ~ ` $ &amp; , ; : /</code></p></li>
172    /// <li>
173    /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
174    /// <li>
175    /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
176    /// <li>
177    /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
178    /// </ul>
179    /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
180    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_name()
182    }
183    ///
184    /// Appends an item to `tags`.
185    ///
186    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
187    ///
188    /// <p>The list of tags to add to a resource.</p>
189    /// <p>An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>, and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
190    /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
191    pub fn tags(mut self, input: crate::types::Tag) -> Self {
192        self.inner = self.inner.tags(input);
193        self
194    }
195    /// <p>The list of tags to add to a resource.</p>
196    /// <p>An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>, and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
197    /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
198    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
199        self.inner = self.inner.set_tags(input);
200        self
201    }
202    /// <p>The list of tags to add to a resource.</p>
203    /// <p>An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>, and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
204    /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
205    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
206        self.inner.get_tags()
207    }
208    /// <p>Settings to configure server-side encryption.</p>
209    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
210        self.inner = self.inner.encryption_configuration(input);
211        self
212    }
213    /// <p>Settings to configure server-side encryption.</p>
214    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
215        self.inner = self.inner.set_encryption_configuration(input);
216        self
217    }
218    /// <p>Settings to configure server-side encryption.</p>
219    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
220        self.inner.get_encryption_configuration()
221    }
222}