aws_sdk_swf/operation/respond_activity_task_failed/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::respond_activity_task_failed::_respond_activity_task_failed_output::RespondActivityTaskFailedOutputBuilder;
3
4pub use crate::operation::respond_activity_task_failed::_respond_activity_task_failed_input::RespondActivityTaskFailedInputBuilder;
5
6impl crate::operation::respond_activity_task_failed::builders::RespondActivityTaskFailedInputBuilder {
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_activity_task_failed::RespondActivityTaskFailedOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::respond_activity_task_failed::RespondActivityTaskFailedError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.respond_activity_task_failed();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RespondActivityTaskFailed`.
24///
25/// <p>Used by workers to tell the service that the <code>ActivityTask</code> identified by the <code>taskToken</code> has failed with <code>reason</code> (if specified). The <code>reason</code> and <code>details</code> appear in the <code>ActivityTaskFailed</code> event added to the workflow history.</p>
26/// <p>A task is considered open from the time that it is scheduled until it is closed. Therefore a task is reported as open while a worker is processing it. A task is closed after it has been specified in a call to <code>RespondActivityTaskCompleted</code>, <code>RespondActivityTaskCanceled</code>, RespondActivityTaskFailed, or the task has <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-basic.html#swf-dev-timeout-types">timed out</a>.</p>
27/// <p><b>Access Control</b></p>
28/// <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
29/// <ul>
30/// <li>
31/// <p>Use a <code>Resource</code> element with the domain name to limit the action to only specified domains.</p></li>
32/// <li>
33/// <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p></li>
34/// <li>
35/// <p>You cannot use an IAM policy to constrain this action's parameters.</p></li>
36/// </ul>
37/// <p>If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>. For details and example IAM policies, 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>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct RespondActivityTaskFailedFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::respond_activity_task_failed::builders::RespondActivityTaskFailedInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::respond_activity_task_failed::RespondActivityTaskFailedOutput,
47        crate::operation::respond_activity_task_failed::RespondActivityTaskFailedError,
48    > for RespondActivityTaskFailedFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::respond_activity_task_failed::RespondActivityTaskFailedOutput,
56            crate::operation::respond_activity_task_failed::RespondActivityTaskFailedError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl RespondActivityTaskFailedFluentBuilder {
63    /// Creates a new `RespondActivityTaskFailedFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the RespondActivityTaskFailed as a reference.
72    pub fn as_input(&self) -> &crate::operation::respond_activity_task_failed::builders::RespondActivityTaskFailedInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::respond_activity_task_failed::RespondActivityTaskFailedOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::respond_activity_task_failed::RespondActivityTaskFailedError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::respond_activity_task_failed::RespondActivityTaskFailed::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::respond_activity_task_failed::RespondActivityTaskFailed::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::respond_activity_task_failed::RespondActivityTaskFailedOutput,
109        crate::operation::respond_activity_task_failed::RespondActivityTaskFailedError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
124    /// <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>
125    /// </important>
126    pub fn task_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.task_token(input.into());
128        self
129    }
130    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
131    /// <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>
132    /// </important>
133    pub fn set_task_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_task_token(input);
135        self
136    }
137    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
138    /// <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>
139    /// </important>
140    pub fn get_task_token(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_task_token()
142    }
143    /// <p>Description of the error that may assist in diagnostics.</p>
144    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.reason(input.into());
146        self
147    }
148    /// <p>Description of the error that may assist in diagnostics.</p>
149    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_reason(input);
151        self
152    }
153    /// <p>Description of the error that may assist in diagnostics.</p>
154    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_reason()
156    }
157    /// <p>Detailed information about the failure.</p>
158    pub fn details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.details(input.into());
160        self
161    }
162    /// <p>Detailed information about the failure.</p>
163    pub fn set_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_details(input);
165        self
166    }
167    /// <p>Detailed information about the failure.</p>
168    pub fn get_details(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_details()
170    }
171}