aws_sdk_sfn/operation/create_state_machine/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_state_machine::_create_state_machine_output::CreateStateMachineOutputBuilder;
3
4pub use crate::operation::create_state_machine::_create_state_machine_input::CreateStateMachineInputBuilder;
5
6impl crate::operation::create_state_machine::builders::CreateStateMachineInputBuilder {
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_state_machine::CreateStateMachineOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_state_machine::CreateStateMachineError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_state_machine();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateStateMachine`.
24///
25/// <p>Creates a state machine. A state machine consists of a collection of states that can do work (<code>Task</code> states), determine to which states to transition next (<code>Choice</code> states), stop an execution with an error (<code>Fail</code> states), and so on. State machines are specified using a JSON-based, structured language. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> in the Step Functions User Guide.</p>
26/// <p>If you set the <code>publish</code> parameter of this API action to <code>true</code>, it publishes version <code>1</code> as the first revision of the state machine.</p>
27/// <p>For additional control over security, you can encrypt your data using a <b>customer-managed key</b> for Step Functions state machines. You can configure a symmetric KMS key and data key reuse period when creating or updating a <b>State Machine</b>. The execution history and state machine definition will be encrypted with the key applied to the State Machine.</p><note>
28/// <p>This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.</p>
29/// </note> <note>
30/// <p><code>CreateStateMachine</code> is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. <code>CreateStateMachine</code>'s idempotency check is based on the state machine <code>name</code>, <code>definition</code>, <code>type</code>, <code>LoggingConfiguration</code>, <code>TracingConfiguration</code>, and <code>EncryptionConfiguration</code> The check is also based on the <code>publish</code> and <code>versionDescription</code> parameters. If a following request has a different <code>roleArn</code> or <code>tags</code>, Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, <code>roleArn</code> and <code>tags</code> will not be updated, even if they are different.</p>
31/// </note>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateStateMachineFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::create_state_machine::builders::CreateStateMachineInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::create_state_machine::CreateStateMachineOutput,
41 crate::operation::create_state_machine::CreateStateMachineError,
42 > for CreateStateMachineFluentBuilder
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_state_machine::CreateStateMachineOutput,
50 crate::operation::create_state_machine::CreateStateMachineError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl CreateStateMachineFluentBuilder {
57 /// Creates a new `CreateStateMachineFluentBuilder`.
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 CreateStateMachine as a reference.
66 pub fn as_input(&self) -> &crate::operation::create_state_machine::builders::CreateStateMachineInputBuilder {
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_state_machine::CreateStateMachineOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::create_state_machine::CreateStateMachineError,
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_state_machine::CreateStateMachine::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::create_state_machine::CreateStateMachine::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_state_machine::CreateStateMachineOutput,
103 crate::operation::create_state_machine::CreateStateMachineError,
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 state machine.</p>
118 /// <p>A name must <i>not</i> contain:</p>
119 /// <ul>
120 /// <li>
121 /// <p>white space</p></li>
122 /// <li>
123 /// <p>brackets <code>< > { } \[ \]</code></p></li>
124 /// <li>
125 /// <p>wildcard characters <code>? *</code></p></li>
126 /// <li>
127 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
128 /// <li>
129 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
130 /// <li>
131 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
132 /// <li>
133 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
134 /// </ul>
135 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
136 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.name(input.into());
138 self
139 }
140 /// <p>The name of the state machine.</p>
141 /// <p>A name must <i>not</i> contain:</p>
142 /// <ul>
143 /// <li>
144 /// <p>white space</p></li>
145 /// <li>
146 /// <p>brackets <code>< > { } \[ \]</code></p></li>
147 /// <li>
148 /// <p>wildcard characters <code>? *</code></p></li>
149 /// <li>
150 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
151 /// <li>
152 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
153 /// <li>
154 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
155 /// <li>
156 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
157 /// </ul>
158 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
159 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.inner = self.inner.set_name(input);
161 self
162 }
163 /// <p>The name of the state machine.</p>
164 /// <p>A name must <i>not</i> contain:</p>
165 /// <ul>
166 /// <li>
167 /// <p>white space</p></li>
168 /// <li>
169 /// <p>brackets <code>< > { } \[ \]</code></p></li>
170 /// <li>
171 /// <p>wildcard characters <code>? *</code></p></li>
172 /// <li>
173 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
174 /// <li>
175 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
176 /// <li>
177 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
178 /// <li>
179 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
180 /// </ul>
181 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
182 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
183 self.inner.get_name()
184 }
185 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
186 pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.inner = self.inner.definition(input.into());
188 self
189 }
190 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
191 pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.inner = self.inner.set_definition(input);
193 self
194 }
195 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
196 pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
197 self.inner.get_definition()
198 }
199 /// <p>The Amazon Resource Name (ARN) of the IAM role to use for this state machine.</p>
200 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201 self.inner = self.inner.role_arn(input.into());
202 self
203 }
204 /// <p>The Amazon Resource Name (ARN) of the IAM role to use for this state machine.</p>
205 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.inner = self.inner.set_role_arn(input);
207 self
208 }
209 /// <p>The Amazon Resource Name (ARN) of the IAM role to use for this state machine.</p>
210 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
211 self.inner.get_role_arn()
212 }
213 /// <p>Determines whether a Standard or Express state machine is created. The default is <code>STANDARD</code>. You cannot update the <code>type</code> of a state machine once it has been created.</p>
214 pub fn r#type(mut self, input: crate::types::StateMachineType) -> Self {
215 self.inner = self.inner.r#type(input);
216 self
217 }
218 /// <p>Determines whether a Standard or Express state machine is created. The default is <code>STANDARD</code>. You cannot update the <code>type</code> of a state machine once it has been created.</p>
219 pub fn set_type(mut self, input: ::std::option::Option<crate::types::StateMachineType>) -> Self {
220 self.inner = self.inner.set_type(input);
221 self
222 }
223 /// <p>Determines whether a Standard or Express state machine is created. The default is <code>STANDARD</code>. You cannot update the <code>type</code> of a state machine once it has been created.</p>
224 pub fn get_type(&self) -> &::std::option::Option<crate::types::StateMachineType> {
225 self.inner.get_type()
226 }
227 /// <p>Defines what execution history events are logged and where they are logged.</p><note>
228 /// <p>By default, the <code>level</code> is set to <code>OFF</code>. For more information see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html">Log Levels</a> in the Step Functions User Guide.</p>
229 /// </note>
230 pub fn logging_configuration(mut self, input: crate::types::LoggingConfiguration) -> Self {
231 self.inner = self.inner.logging_configuration(input);
232 self
233 }
234 /// <p>Defines what execution history events are logged and where they are logged.</p><note>
235 /// <p>By default, the <code>level</code> is set to <code>OFF</code>. For more information see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html">Log Levels</a> in the Step Functions User Guide.</p>
236 /// </note>
237 pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::LoggingConfiguration>) -> Self {
238 self.inner = self.inner.set_logging_configuration(input);
239 self
240 }
241 /// <p>Defines what execution history events are logged and where they are logged.</p><note>
242 /// <p>By default, the <code>level</code> is set to <code>OFF</code>. For more information see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html">Log Levels</a> in the Step Functions User Guide.</p>
243 /// </note>
244 pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::LoggingConfiguration> {
245 self.inner.get_logging_configuration()
246 }
247 ///
248 /// Appends an item to `tags`.
249 ///
250 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
251 ///
252 /// <p>Tags to be added when creating a state machine.</p>
253 /// <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>
254 /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
255 pub fn tags(mut self, input: crate::types::Tag) -> Self {
256 self.inner = self.inner.tags(input);
257 self
258 }
259 /// <p>Tags to be added when creating a state machine.</p>
260 /// <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>
261 /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
262 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
263 self.inner = self.inner.set_tags(input);
264 self
265 }
266 /// <p>Tags to be added when creating a state machine.</p>
267 /// <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>
268 /// <p>Tags may only contain Unicode letters, digits, white space, or these symbols: <code>_ . : / = + - @</code>.</p>
269 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
270 self.inner.get_tags()
271 }
272 /// <p>Selects whether X-Ray tracing is enabled.</p>
273 pub fn tracing_configuration(mut self, input: crate::types::TracingConfiguration) -> Self {
274 self.inner = self.inner.tracing_configuration(input);
275 self
276 }
277 /// <p>Selects whether X-Ray tracing is enabled.</p>
278 pub fn set_tracing_configuration(mut self, input: ::std::option::Option<crate::types::TracingConfiguration>) -> Self {
279 self.inner = self.inner.set_tracing_configuration(input);
280 self
281 }
282 /// <p>Selects whether X-Ray tracing is enabled.</p>
283 pub fn get_tracing_configuration(&self) -> &::std::option::Option<crate::types::TracingConfiguration> {
284 self.inner.get_tracing_configuration()
285 }
286 /// <p>Set to <code>true</code> to publish the first version of the state machine during creation. The default is <code>false</code>.</p>
287 pub fn publish(mut self, input: bool) -> Self {
288 self.inner = self.inner.publish(input);
289 self
290 }
291 /// <p>Set to <code>true</code> to publish the first version of the state machine during creation. The default is <code>false</code>.</p>
292 pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
293 self.inner = self.inner.set_publish(input);
294 self
295 }
296 /// <p>Set to <code>true</code> to publish the first version of the state machine during creation. The default is <code>false</code>.</p>
297 pub fn get_publish(&self) -> &::std::option::Option<bool> {
298 self.inner.get_publish()
299 }
300 /// <p>Sets description about the state machine version. You can only set the description if the <code>publish</code> parameter is set to <code>true</code>. Otherwise, if you set <code>versionDescription</code>, but <code>publish</code> to <code>false</code>, this API action throws <code>ValidationException</code>.</p>
301 pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
302 self.inner = self.inner.version_description(input.into());
303 self
304 }
305 /// <p>Sets description about the state machine version. You can only set the description if the <code>publish</code> parameter is set to <code>true</code>. Otherwise, if you set <code>versionDescription</code>, but <code>publish</code> to <code>false</code>, this API action throws <code>ValidationException</code>.</p>
306 pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
307 self.inner = self.inner.set_version_description(input);
308 self
309 }
310 /// <p>Sets description about the state machine version. You can only set the description if the <code>publish</code> parameter is set to <code>true</code>. Otherwise, if you set <code>versionDescription</code>, but <code>publish</code> to <code>false</code>, this API action throws <code>ValidationException</code>.</p>
311 pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
312 self.inner.get_version_description()
313 }
314 /// <p>Settings to configure server-side encryption.</p>
315 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
316 self.inner = self.inner.encryption_configuration(input);
317 self
318 }
319 /// <p>Settings to configure server-side encryption.</p>
320 pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
321 self.inner = self.inner.set_encryption_configuration(input);
322 self
323 }
324 /// <p>Settings to configure server-side encryption.</p>
325 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
326 self.inner.get_encryption_configuration()
327 }
328}