aws_sdk_sfn/operation/redrive_execution/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::redrive_execution::_redrive_execution_output::RedriveExecutionOutputBuilder;
3
4pub use crate::operation::redrive_execution::_redrive_execution_input::RedriveExecutionInputBuilder;
5
6impl crate::operation::redrive_execution::builders::RedriveExecutionInputBuilder {
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::redrive_execution::RedriveExecutionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::redrive_execution::RedriveExecutionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.redrive_execution();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RedriveExecution`.
24///
25/// <p>Restarts unsuccessful executions of Standard workflows that didn't complete successfully in the last 14 days. These include failed, aborted, or timed out executions. When you <a href="https://docs.aws.amazon.com/step-functions/latest/dg/redrive-executions.html">redrive</a> an execution, it continues the failed execution from the unsuccessful step and uses the same input. Step Functions preserves the results and execution history of the successful steps, and doesn't rerun these steps when you redrive an execution. Redriven executions use the same state machine definition and execution ARN as the original execution attempt.</p>
26/// <p>For workflows that include an <a href="https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html">Inline Map</a> or <a href="https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html">Parallel</a> state, <code>RedriveExecution</code> API action reschedules and redrives only the iterations and branches that failed or aborted.</p>
27/// <p>To redrive a workflow that includes a Distributed Map state whose Map Run failed, you must redrive the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/use-dist-map-orchestrate-large-scale-parallel-workloads.html#dist-map-orchestrate-parallel-workloads-key-terms">parent workflow</a>. The parent workflow redrives all the unsuccessful states, including a failed Map Run. If a Map Run was not started in the original execution attempt, the redriven parent workflow starts the Map Run.</p><note>
28/// <p>This API action is not supported by <code>EXPRESS</code> state machines.</p>
29/// <p>However, you can restart the unsuccessful executions of Express child workflows in a Distributed Map by redriving its Map Run. When you redrive a Map Run, the Express child workflows are rerun using the <code>StartExecution</code> API action. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/redrive-map-run.html">Redriving Map Runs</a>.</p>
30/// </note>
31/// <p>You can redrive executions if your original execution meets the following conditions:</p>
32/// <ul>
33/// <li>
34/// <p>The execution status isn't <code>SUCCEEDED</code>.</p></li>
35/// <li>
36/// <p>Your workflow execution has not exceeded the redrivable period of 14 days. Redrivable period refers to the time during which you can redrive a given execution. This period starts from the day a state machine completes its execution.</p></li>
37/// <li>
38/// <p>The workflow execution has not exceeded the maximum open time of one year. For more information about state machine quotas, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html#service-limits-state-machine-executions">Quotas related to state machine executions</a>.</p></li>
39/// <li>
40/// <p>The execution event history count is less than 24,999. Redriven executions append their event history to the existing event history. Make sure your workflow execution contains less than 24,999 events to accommodate the <code>ExecutionRedriven</code> history event and at least one other history event.</p></li>
41/// </ul>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct RedriveExecutionFluentBuilder {
44 handle: ::std::sync::Arc<crate::client::Handle>,
45 inner: crate::operation::redrive_execution::builders::RedriveExecutionInputBuilder,
46 config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49 crate::client::customize::internal::CustomizableSend<
50 crate::operation::redrive_execution::RedriveExecutionOutput,
51 crate::operation::redrive_execution::RedriveExecutionError,
52 > for RedriveExecutionFluentBuilder
53{
54 fn send(
55 self,
56 config_override: crate::config::Builder,
57 ) -> crate::client::customize::internal::BoxFuture<
58 crate::client::customize::internal::SendResult<
59 crate::operation::redrive_execution::RedriveExecutionOutput,
60 crate::operation::redrive_execution::RedriveExecutionError,
61 >,
62 > {
63 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64 }
65}
66impl RedriveExecutionFluentBuilder {
67 /// Creates a new `RedriveExecutionFluentBuilder`.
68 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69 Self {
70 handle,
71 inner: ::std::default::Default::default(),
72 config_override: ::std::option::Option::None,
73 }
74 }
75 /// Access the RedriveExecution as a reference.
76 pub fn as_input(&self) -> &crate::operation::redrive_execution::builders::RedriveExecutionInputBuilder {
77 &self.inner
78 }
79 /// Sends the request and returns the response.
80 ///
81 /// If an error occurs, an `SdkError` will be returned with additional details that
82 /// can be matched against.
83 ///
84 /// By default, any retryable failures will be retried twice. Retry behavior
85 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86 /// set when configuring the client.
87 pub async fn send(
88 self,
89 ) -> ::std::result::Result<
90 crate::operation::redrive_execution::RedriveExecutionOutput,
91 ::aws_smithy_runtime_api::client::result::SdkError<
92 crate::operation::redrive_execution::RedriveExecutionError,
93 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94 >,
95 > {
96 let input = self
97 .inner
98 .build()
99 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100 let runtime_plugins = crate::operation::redrive_execution::RedriveExecution::operation_runtime_plugins(
101 self.handle.runtime_plugins.clone(),
102 &self.handle.conf,
103 self.config_override,
104 );
105 crate::operation::redrive_execution::RedriveExecution::orchestrate(&runtime_plugins, input).await
106 }
107
108 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109 pub fn customize(
110 self,
111 ) -> crate::client::customize::CustomizableOperation<
112 crate::operation::redrive_execution::RedriveExecutionOutput,
113 crate::operation::redrive_execution::RedriveExecutionError,
114 Self,
115 > {
116 crate::client::customize::CustomizableOperation::new(self)
117 }
118 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119 self.set_config_override(::std::option::Option::Some(config_override.into()));
120 self
121 }
122
123 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124 self.config_override = config_override;
125 self
126 }
127 /// <p>The Amazon Resource Name (ARN) of the execution to be redriven.</p>
128 pub fn execution_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.execution_arn(input.into());
130 self
131 }
132 /// <p>The Amazon Resource Name (ARN) of the execution to be redriven.</p>
133 pub fn set_execution_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_execution_arn(input);
135 self
136 }
137 /// <p>The Amazon Resource Name (ARN) of the execution to be redriven.</p>
138 pub fn get_execution_arn(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_execution_arn()
140 }
141 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency. The API will return idempotent responses for the last 10 client tokens used to successfully redrive the execution. These client tokens are valid for up to 15 minutes after they are first used.</p>
142 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.client_token(input.into());
144 self
145 }
146 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency. The API will return idempotent responses for the last 10 client tokens used to successfully redrive the execution. These client tokens are valid for up to 15 minutes after they are first used.</p>
147 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_client_token(input);
149 self
150 }
151 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency. The API will return idempotent responses for the last 10 client tokens used to successfully redrive the execution. These client tokens are valid for up to 15 minutes after they are first used.</p>
152 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_client_token()
154 }
155}