aws_sdk_swf/operation/respond_activity_task_canceled/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::respond_activity_task_canceled::_respond_activity_task_canceled_output::RespondActivityTaskCanceledOutputBuilder;
3
4pub use crate::operation::respond_activity_task_canceled::_respond_activity_task_canceled_input::RespondActivityTaskCanceledInputBuilder;
5
6impl crate::operation::respond_activity_task_canceled::builders::RespondActivityTaskCanceledInputBuilder {
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_canceled::RespondActivityTaskCanceledOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.respond_activity_task_canceled();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RespondActivityTaskCanceled`.
24///
25/// <p>Used by workers to tell the service that the <code>ActivityTask</code> identified by the <code>taskToken</code> was successfully canceled. Additional <code>details</code> can be provided using the <code>details</code> argument.</p>
26/// <p>These <code>details</code> (if provided) appear in the <code>ActivityTaskCanceled</code> event added to the workflow history.</p><important>
27/// <p>Only use this operation if the <code>canceled</code> flag of a <code>RecordActivityTaskHeartbeat</code> request returns <code>true</code> and if the activity can be safely undone or abandoned.</p>
28/// </important>
29/// <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>, RespondActivityTaskCanceled, <code>RespondActivityTaskFailed</code>, 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>
30/// <p><b>Access Control</b></p>
31/// <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
32/// <ul>
33/// <li>
34/// <p>Use a <code>Resource</code> element with the domain name to limit the action to only specified domains.</p></li>
35/// <li>
36/// <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p></li>
37/// <li>
38/// <p>You cannot use an IAM policy to constrain this action's parameters.</p></li>
39/// </ul>
40/// <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>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct RespondActivityTaskCanceledFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::respond_activity_task_canceled::builders::RespondActivityTaskCanceledInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledOutput,
50        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledError,
51    > for RespondActivityTaskCanceledFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledOutput,
59            crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl RespondActivityTaskCanceledFluentBuilder {
66    /// Creates a new `RespondActivityTaskCanceledFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the RespondActivityTaskCanceled as a reference.
75    pub fn as_input(&self) -> &crate::operation::respond_activity_task_canceled::builders::RespondActivityTaskCanceledInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceled::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceled::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledOutput,
112        crate::operation::respond_activity_task_canceled::RespondActivityTaskCanceledError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
127    /// <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>
128    /// </important>
129    pub fn task_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.task_token(input.into());
131        self
132    }
133    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
134    /// <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>
135    /// </important>
136    pub fn set_task_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_task_token(input);
138        self
139    }
140    /// <p>The <code>taskToken</code> of the <code>ActivityTask</code>.</p><important>
141    /// <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>
142    /// </important>
143    pub fn get_task_token(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_task_token()
145    }
146    /// <p>Information about the cancellation.</p>
147    pub fn details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.details(input.into());
149        self
150    }
151    /// <p>Information about the cancellation.</p>
152    pub fn set_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_details(input);
154        self
155    }
156    /// <p>Information about the cancellation.</p>
157    pub fn get_details(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_details()
159    }
160}