aws_sdk_sfn/operation/start_execution/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_execution::_start_execution_output::StartExecutionOutputBuilder;
3
4pub use crate::operation::start_execution::_start_execution_input::StartExecutionInputBuilder;
5
6impl crate::operation::start_execution::builders::StartExecutionInputBuilder {
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::start_execution::StartExecutionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_execution::StartExecutionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_execution();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartExecution`.
24///
25/// <p>Starts a state machine execution.</p>
26/// <p>A qualified state machine ARN can either refer to a <i>Distributed Map state</i> defined within a state machine, a version ARN, or an alias ARN.</p>
27/// <p>The following are some examples of qualified and unqualified state machine ARNs:</p>
28/// <ul>
29/// <li>
30/// <p>The following qualified state machine ARN refers to a <i>Distributed Map state</i> with a label <code>mapStateLabel</code> in a state machine named <code>myStateMachine</code>.</p>
31/// <p><code>arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel</code></p><note>
32/// <p>If you provide a qualified state machine ARN that refers to a <i>Distributed Map state</i>, the request fails with <code>ValidationException</code>.</p>
33/// </note></li>
34/// <li>
35/// <p>The following qualified state machine ARN refers to an alias named <code>PROD</code>.</p>
36/// <p><code>arn:<partition>
37/// :states:
38/// <region>
39/// :
40/// <account-id>
41/// :stateMachine:
42/// <mystatemachine:prod></mystatemachine:prod>
43/// </account-id>
44/// </region>
45/// </partition></code></p><note>
46/// <p>If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias.</p>
47/// </note></li>
48/// <li>
49/// <p>The following unqualified state machine ARN refers to a state machine named <code>myStateMachine</code>.</p>
50/// <p><code>arn:<partition>
51/// :states:
52/// <region>
53/// :
54/// <account-id>
55/// :stateMachine:
56/// <mystatemachine></mystatemachine>
57/// </account-id>
58/// </region>
59/// </partition></code></p></li>
60/// </ul>
61/// <p>If you start an execution with an unqualified state machine ARN, Step Functions uses the latest revision of the state machine for the execution.</p>
62/// <p>To start executions of a state machine <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">version</a>, call <code>StartExecution</code> and provide the version ARN or the ARN of an <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html">alias</a> that points to the version.</p><note>
63/// <p><code>StartExecution</code> is idempotent for <code>STANDARD</code> workflows. For a <code>STANDARD</code> workflow, if you call <code>StartExecution</code> with the same name and input as a running execution, the call succeeds and return the same response as the original request. If the execution is closed or if the input is different, it returns a <code>400 ExecutionAlreadyExists</code> error. You can reuse names after 90 days.</p>
64/// <p><code>StartExecution</code> isn't idempotent for <code>EXPRESS</code> workflows.</p>
65/// </note>
66#[derive(::std::clone::Clone, ::std::fmt::Debug)]
67pub struct StartExecutionFluentBuilder {
68 handle: ::std::sync::Arc<crate::client::Handle>,
69 inner: crate::operation::start_execution::builders::StartExecutionInputBuilder,
70 config_override: ::std::option::Option<crate::config::Builder>,
71}
72impl
73 crate::client::customize::internal::CustomizableSend<
74 crate::operation::start_execution::StartExecutionOutput,
75 crate::operation::start_execution::StartExecutionError,
76 > for StartExecutionFluentBuilder
77{
78 fn send(
79 self,
80 config_override: crate::config::Builder,
81 ) -> crate::client::customize::internal::BoxFuture<
82 crate::client::customize::internal::SendResult<
83 crate::operation::start_execution::StartExecutionOutput,
84 crate::operation::start_execution::StartExecutionError,
85 >,
86 > {
87 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
88 }
89}
90impl StartExecutionFluentBuilder {
91 /// Creates a new `StartExecutionFluentBuilder`.
92 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
93 Self {
94 handle,
95 inner: ::std::default::Default::default(),
96 config_override: ::std::option::Option::None,
97 }
98 }
99 /// Access the StartExecution as a reference.
100 pub fn as_input(&self) -> &crate::operation::start_execution::builders::StartExecutionInputBuilder {
101 &self.inner
102 }
103 /// Sends the request and returns the response.
104 ///
105 /// If an error occurs, an `SdkError` will be returned with additional details that
106 /// can be matched against.
107 ///
108 /// By default, any retryable failures will be retried twice. Retry behavior
109 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
110 /// set when configuring the client.
111 pub async fn send(
112 self,
113 ) -> ::std::result::Result<
114 crate::operation::start_execution::StartExecutionOutput,
115 ::aws_smithy_runtime_api::client::result::SdkError<
116 crate::operation::start_execution::StartExecutionError,
117 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
118 >,
119 > {
120 let input = self
121 .inner
122 .build()
123 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
124 let runtime_plugins = crate::operation::start_execution::StartExecution::operation_runtime_plugins(
125 self.handle.runtime_plugins.clone(),
126 &self.handle.conf,
127 self.config_override,
128 );
129 crate::operation::start_execution::StartExecution::orchestrate(&runtime_plugins, input).await
130 }
131
132 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
133 pub fn customize(
134 self,
135 ) -> crate::client::customize::CustomizableOperation<
136 crate::operation::start_execution::StartExecutionOutput,
137 crate::operation::start_execution::StartExecutionError,
138 Self,
139 > {
140 crate::client::customize::CustomizableOperation::new(self)
141 }
142 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
143 self.set_config_override(::std::option::Option::Some(config_override.into()));
144 self
145 }
146
147 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
148 self.config_override = config_override;
149 self
150 }
151 /// <p>The Amazon Resource Name (ARN) of the state machine to execute.</p>
152 /// <p>The <code>stateMachineArn</code> parameter accepts one of the following inputs:</p>
153 /// <ul>
154 /// <li>
155 /// <p><b>An unqualified state machine ARN</b> – Refers to a state machine ARN that isn't qualified with a version or alias ARN. The following is an example of an unqualified state machine ARN.</p>
156 /// <p><code>arn:<partition>
157 /// :states:
158 /// <region>
159 /// :
160 /// <account-id>
161 /// :stateMachine:
162 /// <mystatemachine></mystatemachine>
163 /// </account-id>
164 /// </region>
165 /// </partition></code></p>
166 /// <p>Step Functions doesn't associate state machine executions that you start with an unqualified ARN with a version. This is true even if that version uses the same revision that the execution used.</p></li>
167 /// <li>
168 /// <p><b>A state machine version ARN</b> – Refers to a version ARN, which is a combination of state machine ARN and the version number separated by a colon (:). The following is an example of the ARN for version 10.</p>
169 /// <p><code>arn:<partition>
170 /// :states:
171 /// <region>
172 /// :
173 /// <account-id>
174 /// :stateMachine:
175 /// <mystatemachine>
176 /// :10
177 /// </mystatemachine>
178 /// </account-id>
179 /// </region>
180 /// </partition></code></p>
181 /// <p>Step Functions doesn't associate executions that you start with a version ARN with any aliases that point to that version.</p></li>
182 /// <li>
183 /// <p><b>A state machine alias ARN</b> – Refers to an alias ARN, which is a combination of state machine ARN and the alias name separated by a colon (:). The following is an example of the ARN for an alias named <code>PROD</code>.</p>
184 /// <p><code>arn:<partition>
185 /// :states:
186 /// <region>
187 /// :
188 /// <account-id>
189 /// :stateMachine:
190 /// <mystatemachine:prod></mystatemachine:prod>
191 /// </account-id>
192 /// </region>
193 /// </partition></code></p>
194 /// <p>Step Functions associates executions that you start with an alias ARN with that alias and the state machine version used for that execution.</p></li>
195 /// </ul>
196 pub fn state_machine_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.state_machine_arn(input.into());
198 self
199 }
200 /// <p>The Amazon Resource Name (ARN) of the state machine to execute.</p>
201 /// <p>The <code>stateMachineArn</code> parameter accepts one of the following inputs:</p>
202 /// <ul>
203 /// <li>
204 /// <p><b>An unqualified state machine ARN</b> – Refers to a state machine ARN that isn't qualified with a version or alias ARN. The following is an example of an unqualified state machine ARN.</p>
205 /// <p><code>arn:<partition>
206 /// :states:
207 /// <region>
208 /// :
209 /// <account-id>
210 /// :stateMachine:
211 /// <mystatemachine></mystatemachine>
212 /// </account-id>
213 /// </region>
214 /// </partition></code></p>
215 /// <p>Step Functions doesn't associate state machine executions that you start with an unqualified ARN with a version. This is true even if that version uses the same revision that the execution used.</p></li>
216 /// <li>
217 /// <p><b>A state machine version ARN</b> – Refers to a version ARN, which is a combination of state machine ARN and the version number separated by a colon (:). The following is an example of the ARN for version 10.</p>
218 /// <p><code>arn:<partition>
219 /// :states:
220 /// <region>
221 /// :
222 /// <account-id>
223 /// :stateMachine:
224 /// <mystatemachine>
225 /// :10
226 /// </mystatemachine>
227 /// </account-id>
228 /// </region>
229 /// </partition></code></p>
230 /// <p>Step Functions doesn't associate executions that you start with a version ARN with any aliases that point to that version.</p></li>
231 /// <li>
232 /// <p><b>A state machine alias ARN</b> – Refers to an alias ARN, which is a combination of state machine ARN and the alias name separated by a colon (:). The following is an example of the ARN for an alias named <code>PROD</code>.</p>
233 /// <p><code>arn:<partition>
234 /// :states:
235 /// <region>
236 /// :
237 /// <account-id>
238 /// :stateMachine:
239 /// <mystatemachine:prod></mystatemachine:prod>
240 /// </account-id>
241 /// </region>
242 /// </partition></code></p>
243 /// <p>Step Functions associates executions that you start with an alias ARN with that alias and the state machine version used for that execution.</p></li>
244 /// </ul>
245 pub fn set_state_machine_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246 self.inner = self.inner.set_state_machine_arn(input);
247 self
248 }
249 /// <p>The Amazon Resource Name (ARN) of the state machine to execute.</p>
250 /// <p>The <code>stateMachineArn</code> parameter accepts one of the following inputs:</p>
251 /// <ul>
252 /// <li>
253 /// <p><b>An unqualified state machine ARN</b> – Refers to a state machine ARN that isn't qualified with a version or alias ARN. The following is an example of an unqualified state machine ARN.</p>
254 /// <p><code>arn:<partition>
255 /// :states:
256 /// <region>
257 /// :
258 /// <account-id>
259 /// :stateMachine:
260 /// <mystatemachine></mystatemachine>
261 /// </account-id>
262 /// </region>
263 /// </partition></code></p>
264 /// <p>Step Functions doesn't associate state machine executions that you start with an unqualified ARN with a version. This is true even if that version uses the same revision that the execution used.</p></li>
265 /// <li>
266 /// <p><b>A state machine version ARN</b> – Refers to a version ARN, which is a combination of state machine ARN and the version number separated by a colon (:). The following is an example of the ARN for version 10.</p>
267 /// <p><code>arn:<partition>
268 /// :states:
269 /// <region>
270 /// :
271 /// <account-id>
272 /// :stateMachine:
273 /// <mystatemachine>
274 /// :10
275 /// </mystatemachine>
276 /// </account-id>
277 /// </region>
278 /// </partition></code></p>
279 /// <p>Step Functions doesn't associate executions that you start with a version ARN with any aliases that point to that version.</p></li>
280 /// <li>
281 /// <p><b>A state machine alias ARN</b> – Refers to an alias ARN, which is a combination of state machine ARN and the alias name separated by a colon (:). The following is an example of the ARN for an alias named <code>PROD</code>.</p>
282 /// <p><code>arn:<partition>
283 /// :states:
284 /// <region>
285 /// :
286 /// <account-id>
287 /// :stateMachine:
288 /// <mystatemachine:prod></mystatemachine:prod>
289 /// </account-id>
290 /// </region>
291 /// </partition></code></p>
292 /// <p>Step Functions associates executions that you start with an alias ARN with that alias and the state machine version used for that execution.</p></li>
293 /// </ul>
294 pub fn get_state_machine_arn(&self) -> &::std::option::Option<::std::string::String> {
295 self.inner.get_state_machine_arn()
296 }
297 /// <p>Optional name of the execution. This name must be unique for your Amazon Web Services account, Region, and state machine 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>
298 /// <p>If you don't provide a name for the execution, Step Functions automatically generates a universally unique identifier (UUID) as the execution name.</p>
299 /// <p>A name must <i>not</i> contain:</p>
300 /// <ul>
301 /// <li>
302 /// <p>white space</p></li>
303 /// <li>
304 /// <p>brackets <code>< > { } \[ \]</code></p></li>
305 /// <li>
306 /// <p>wildcard characters <code>? *</code></p></li>
307 /// <li>
308 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
309 /// <li>
310 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
311 /// <li>
312 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
313 /// <li>
314 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
315 /// </ul>
316 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
317 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
318 self.inner = self.inner.name(input.into());
319 self
320 }
321 /// <p>Optional name of the execution. This name must be unique for your Amazon Web Services account, Region, and state machine 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>
322 /// <p>If you don't provide a name for the execution, Step Functions automatically generates a universally unique identifier (UUID) as the execution name.</p>
323 /// <p>A name must <i>not</i> contain:</p>
324 /// <ul>
325 /// <li>
326 /// <p>white space</p></li>
327 /// <li>
328 /// <p>brackets <code>< > { } \[ \]</code></p></li>
329 /// <li>
330 /// <p>wildcard characters <code>? *</code></p></li>
331 /// <li>
332 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
333 /// <li>
334 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
335 /// <li>
336 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
337 /// <li>
338 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
339 /// </ul>
340 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
341 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
342 self.inner = self.inner.set_name(input);
343 self
344 }
345 /// <p>Optional name of the execution. This name must be unique for your Amazon Web Services account, Region, and state machine 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>
346 /// <p>If you don't provide a name for the execution, Step Functions automatically generates a universally unique identifier (UUID) as the execution name.</p>
347 /// <p>A name must <i>not</i> contain:</p>
348 /// <ul>
349 /// <li>
350 /// <p>white space</p></li>
351 /// <li>
352 /// <p>brackets <code>< > { } \[ \]</code></p></li>
353 /// <li>
354 /// <p>wildcard characters <code>? *</code></p></li>
355 /// <li>
356 /// <p>special characters <code>" # % \ ^ | ~ ` $ & , ; : /</code></p></li>
357 /// <li>
358 /// <p>control characters (<code>U+0000-001F</code>, <code>U+007F-009F</code>, <code>U+FFFE-FFFF</code>)</p></li>
359 /// <li>
360 /// <p>surrogates (<code>U+D800-DFFF</code>)</p></li>
361 /// <li>
362 /// <p>invalid characters (<code> U+10FFFF</code>)</p></li>
363 /// </ul>
364 /// <p>To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.</p>
365 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
366 self.inner.get_name()
367 }
368 /// <p>The string that contains the JSON input data for the execution, for example:</p>
369 /// <p><code>"{\"first_name\" : \"Alejandro\"}"</code></p><note>
370 /// <p>If you don't include any JSON input data, you still must include the two braces, for example: <code>"{}"</code></p>
371 /// </note>
372 /// <p>Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.</p>
373 pub fn input(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
374 self.inner = self.inner.input(input.into());
375 self
376 }
377 /// <p>The string that contains the JSON input data for the execution, for example:</p>
378 /// <p><code>"{\"first_name\" : \"Alejandro\"}"</code></p><note>
379 /// <p>If you don't include any JSON input data, you still must include the two braces, for example: <code>"{}"</code></p>
380 /// </note>
381 /// <p>Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.</p>
382 pub fn set_input(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
383 self.inner = self.inner.set_input(input);
384 self
385 }
386 /// <p>The string that contains the JSON input data for the execution, for example:</p>
387 /// <p><code>"{\"first_name\" : \"Alejandro\"}"</code></p><note>
388 /// <p>If you don't include any JSON input data, you still must include the two braces, for example: <code>"{}"</code></p>
389 /// </note>
390 /// <p>Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.</p>
391 pub fn get_input(&self) -> &::std::option::Option<::std::string::String> {
392 self.inner.get_input()
393 }
394 /// <p>Passes the X-Ray trace header. The trace header can also be passed in the request payload.</p><note>
395 /// <p>For X-Ray traces, all Amazon Web Services services use the <code>X-Amzn-Trace-Id</code> header from the HTTP request. Using the header is the preferred mechanism to identify a trace. <code>StartExecution</code> and <code>StartSyncExecution</code> API operations can also use <code>traceHeader</code> from the body of the request payload. If <b>both</b> sources are provided, Step Functions will use the <b>header value</b> (preferred) over the value in the request body.</p>
396 /// </note>
397 pub fn trace_header(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
398 self.inner = self.inner.trace_header(input.into());
399 self
400 }
401 /// <p>Passes the X-Ray trace header. The trace header can also be passed in the request payload.</p><note>
402 /// <p>For X-Ray traces, all Amazon Web Services services use the <code>X-Amzn-Trace-Id</code> header from the HTTP request. Using the header is the preferred mechanism to identify a trace. <code>StartExecution</code> and <code>StartSyncExecution</code> API operations can also use <code>traceHeader</code> from the body of the request payload. If <b>both</b> sources are provided, Step Functions will use the <b>header value</b> (preferred) over the value in the request body.</p>
403 /// </note>
404 pub fn set_trace_header(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
405 self.inner = self.inner.set_trace_header(input);
406 self
407 }
408 /// <p>Passes the X-Ray trace header. The trace header can also be passed in the request payload.</p><note>
409 /// <p>For X-Ray traces, all Amazon Web Services services use the <code>X-Amzn-Trace-Id</code> header from the HTTP request. Using the header is the preferred mechanism to identify a trace. <code>StartExecution</code> and <code>StartSyncExecution</code> API operations can also use <code>traceHeader</code> from the body of the request payload. If <b>both</b> sources are provided, Step Functions will use the <b>header value</b> (preferred) over the value in the request body.</p>
410 /// </note>
411 pub fn get_trace_header(&self) -> &::std::option::Option<::std::string::String> {
412 self.inner.get_trace_header()
413 }
414}