aws_sdk_swf/operation/respond_decision_task_completed/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::respond_decision_task_completed::_respond_decision_task_completed_output::RespondDecisionTaskCompletedOutputBuilder;
3
4pub use crate::operation::respond_decision_task_completed::_respond_decision_task_completed_input::RespondDecisionTaskCompletedInputBuilder;
5
6impl crate::operation::respond_decision_task_completed::builders::RespondDecisionTaskCompletedInputBuilder {
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::respond_decision_task_completed::RespondDecisionTaskCompletedOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.respond_decision_task_completed();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RespondDecisionTaskCompleted`.
24///
25/// <p>Used by deciders to tell the service that the <code>DecisionTask</code> identified by the <code>taskToken</code> has successfully completed. The <code>decisions</code> argument specifies the list of decisions made while processing the task.</p>
26/// <p>A <code>DecisionTaskCompleted</code> event is added to the workflow history. The <code>executionContext</code> specified is attached to the event in the workflow execution history.</p>
27/// <p><b>Access Control</b></p>
28/// <p>If an IAM policy grants permission to use <code>RespondDecisionTaskCompleted</code>, it can express permissions for the list of decisions in the <code>decisions</code> parameter. Each of the decisions has one or more parameters, much like a regular API call. To allow for policies to be as readable as possible, you can express permissions on decisions as if they were actual API calls, including applying conditions to some parameters. For more information, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct RespondDecisionTaskCompletedFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::respond_decision_task_completed::builders::RespondDecisionTaskCompletedInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedOutput,
38        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedError,
39    > for RespondDecisionTaskCompletedFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedOutput,
47            crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl RespondDecisionTaskCompletedFluentBuilder {
54    /// Creates a new `RespondDecisionTaskCompletedFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the RespondDecisionTaskCompleted as a reference.
63    pub fn as_input(&self) -> &crate::operation::respond_decision_task_completed::builders::RespondDecisionTaskCompletedInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::respond_decision_task_completed::RespondDecisionTaskCompleted::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompleted::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedOutput,
100        crate::operation::respond_decision_task_completed::RespondDecisionTaskCompletedError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The <code>taskToken</code> from the <code>DecisionTask</code>.</p><important>
115    /// <p><code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p>
116    /// </important>
117    pub fn task_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.task_token(input.into());
119        self
120    }
121    /// <p>The <code>taskToken</code> from the <code>DecisionTask</code>.</p><important>
122    /// <p><code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p>
123    /// </important>
124    pub fn set_task_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_task_token(input);
126        self
127    }
128    /// <p>The <code>taskToken</code> from the <code>DecisionTask</code>.</p><important>
129    /// <p><code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p>
130    /// </important>
131    pub fn get_task_token(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_task_token()
133    }
134    ///
135    /// Appends an item to `decisions`.
136    ///
137    /// To override the contents of this collection use [`set_decisions`](Self::set_decisions).
138    ///
139    /// <p>The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the <code>Decision</code> structure for details.</p>
140    pub fn decisions(mut self, input: crate::types::Decision) -> Self {
141        self.inner = self.inner.decisions(input);
142        self
143    }
144    /// <p>The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the <code>Decision</code> structure for details.</p>
145    pub fn set_decisions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Decision>>) -> Self {
146        self.inner = self.inner.set_decisions(input);
147        self
148    }
149    /// <p>The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the <code>Decision</code> structure for details.</p>
150    pub fn get_decisions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Decision>> {
151        self.inner.get_decisions()
152    }
153    /// <p>User defined context to add to workflow execution.</p>
154    pub fn execution_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.execution_context(input.into());
156        self
157    }
158    /// <p>User defined context to add to workflow execution.</p>
159    pub fn set_execution_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_execution_context(input);
161        self
162    }
163    /// <p>User defined context to add to workflow execution.</p>
164    pub fn get_execution_context(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_execution_context()
166    }
167    /// <p>The task list to use for the future decision tasks of this workflow execution. This list overrides the original task list you specified while starting the workflow execution.</p>
168    pub fn task_list(mut self, input: crate::types::TaskList) -> Self {
169        self.inner = self.inner.task_list(input);
170        self
171    }
172    /// <p>The task list to use for the future decision tasks of this workflow execution. This list overrides the original task list you specified while starting the workflow execution.</p>
173    pub fn set_task_list(mut self, input: ::std::option::Option<crate::types::TaskList>) -> Self {
174        self.inner = self.inner.set_task_list(input);
175        self
176    }
177    /// <p>The task list to use for the future decision tasks of this workflow execution. This list overrides the original task list you specified while starting the workflow execution.</p>
178    pub fn get_task_list(&self) -> &::std::option::Option<crate::types::TaskList> {
179        self.inner.get_task_list()
180    }
181    /// <p>Specifies a timeout (in seconds) for the task list override. When this parameter is missing, the task list override is permanent. This parameter makes it possible to temporarily override the task list. If a decision task scheduled on the override task list is not started within the timeout, the decision task will time out. Amazon SWF will revert the override and schedule a new decision task to the original task list.</p>
182    /// <p>If a decision task scheduled on the override task list is started within the timeout, but not completed within the start-to-close timeout, Amazon SWF will also revert the override and schedule a new decision task to the original task list.</p>
183    pub fn task_list_schedule_to_start_timeout(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.task_list_schedule_to_start_timeout(input.into());
185        self
186    }
187    /// <p>Specifies a timeout (in seconds) for the task list override. When this parameter is missing, the task list override is permanent. This parameter makes it possible to temporarily override the task list. If a decision task scheduled on the override task list is not started within the timeout, the decision task will time out. Amazon SWF will revert the override and schedule a new decision task to the original task list.</p>
188    /// <p>If a decision task scheduled on the override task list is started within the timeout, but not completed within the start-to-close timeout, Amazon SWF will also revert the override and schedule a new decision task to the original task list.</p>
189    pub fn set_task_list_schedule_to_start_timeout(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_task_list_schedule_to_start_timeout(input);
191        self
192    }
193    /// <p>Specifies a timeout (in seconds) for the task list override. When this parameter is missing, the task list override is permanent. This parameter makes it possible to temporarily override the task list. If a decision task scheduled on the override task list is not started within the timeout, the decision task will time out. Amazon SWF will revert the override and schedule a new decision task to the original task list.</p>
194    /// <p>If a decision task scheduled on the override task list is started within the timeout, but not completed within the start-to-close timeout, Amazon SWF will also revert the override and schedule a new decision task to the original task list.</p>
195    pub fn get_task_list_schedule_to_start_timeout(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_task_list_schedule_to_start_timeout()
197    }
198}