aws_sdk_swf/operation/poll_for_decision_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::poll_for_decision_task::_poll_for_decision_task_output::PollForDecisionTaskOutputBuilder;
3
4pub use crate::operation::poll_for_decision_task::_poll_for_decision_task_input::PollForDecisionTaskInputBuilder;
5
6impl crate::operation::poll_for_decision_task::builders::PollForDecisionTaskInputBuilder {
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::poll_for_decision_task::PollForDecisionTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::poll_for_decision_task::PollForDecisionTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.poll_for_decision_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `PollForDecisionTask`.
24///
25/// <p>Used by deciders to get a <code>DecisionTask</code> from the specified decision <code>taskList</code>. A decision task may be returned for any open workflow execution that is using the specified task list. The task includes a paginated view of the history of the workflow execution. The decider should use the workflow type and the history to determine how to properly handle the task.</p>
26/// <p>This action initiates a long poll, where the service holds the HTTP connection open and responds as soon a task becomes available. If no decision task is available in the specified task list before the timeout of 60 seconds expires, an empty result is returned. An empty result, in this context, means that a DecisionTask is returned, but that the value of taskToken is an empty string.</p><important>
27/// <p>Deciders should set their client side socket timeout to at least 70 seconds (10 seconds higher than the timeout).</p>
28/// </important> <important>
29/// <p>Because the number of workflow history events for a single workflow execution might be very large, the result returned might be split up across a number of pages. To retrieve subsequent pages, make additional calls to <code>PollForDecisionTask</code> using the <code>nextPageToken</code> returned by the initial call. Note that you do <i>not</i> call <code>GetWorkflowExecutionHistory</code> with this <code>nextPageToken</code>. Instead, call <code>PollForDecisionTask</code> again.</p>
30/// </important>
31/// <p><b>Access Control</b></p>
32/// <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
33/// <ul>
34/// <li>
35/// <p>Use a <code>Resource</code> element with the domain name to limit the action to only specified domains.</p></li>
36/// <li>
37/// <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p></li>
38/// <li>
39/// <p>Constrain the <code>taskList.name</code> parameter by using a <code>Condition</code> element with the <code>swf:taskList.name</code> key to allow the action to access only certain task lists.</p></li>
40/// </ul>
41/// <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>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct PollForDecisionTaskFluentBuilder {
44 handle: ::std::sync::Arc<crate::client::Handle>,
45 inner: crate::operation::poll_for_decision_task::builders::PollForDecisionTaskInputBuilder,
46 config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49 crate::client::customize::internal::CustomizableSend<
50 crate::operation::poll_for_decision_task::PollForDecisionTaskOutput,
51 crate::operation::poll_for_decision_task::PollForDecisionTaskError,
52 > for PollForDecisionTaskFluentBuilder
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::poll_for_decision_task::PollForDecisionTaskOutput,
60 crate::operation::poll_for_decision_task::PollForDecisionTaskError,
61 >,
62 > {
63 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64 }
65}
66impl PollForDecisionTaskFluentBuilder {
67 /// Creates a new `PollForDecisionTaskFluentBuilder`.
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 PollForDecisionTask as a reference.
76 pub fn as_input(&self) -> &crate::operation::poll_for_decision_task::builders::PollForDecisionTaskInputBuilder {
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::poll_for_decision_task::PollForDecisionTaskOutput,
91 ::aws_smithy_runtime_api::client::result::SdkError<
92 crate::operation::poll_for_decision_task::PollForDecisionTaskError,
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::poll_for_decision_task::PollForDecisionTask::operation_runtime_plugins(
101 self.handle.runtime_plugins.clone(),
102 &self.handle.conf,
103 self.config_override,
104 );
105 crate::operation::poll_for_decision_task::PollForDecisionTask::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::poll_for_decision_task::PollForDecisionTaskOutput,
113 crate::operation::poll_for_decision_task::PollForDecisionTaskError,
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 /// Create a paginator for this request
128 ///
129 /// Paginators are used by calling [`send().await`](crate::operation::poll_for_decision_task::paginator::PollForDecisionTaskPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
130 pub fn into_paginator(self) -> crate::operation::poll_for_decision_task::paginator::PollForDecisionTaskPaginator {
131 crate::operation::poll_for_decision_task::paginator::PollForDecisionTaskPaginator::new(self.handle, self.inner)
132 }
133 /// <p>The name of the domain containing the task lists to poll.</p>
134 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.domain(input.into());
136 self
137 }
138 /// <p>The name of the domain containing the task lists to poll.</p>
139 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_domain(input);
141 self
142 }
143 /// <p>The name of the domain containing the task lists to poll.</p>
144 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_domain()
146 }
147 /// <p>Specifies the task list to poll for decision tasks.</p>
148 /// <p>The specified string must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (<code>\u0000-\u001f</code> | <code>\u007f-\u009f</code>). Also, it must <i>not</i> be the literal string <code>arn</code>.</p>
149 pub fn task_list(mut self, input: crate::types::TaskList) -> Self {
150 self.inner = self.inner.task_list(input);
151 self
152 }
153 /// <p>Specifies the task list to poll for decision tasks.</p>
154 /// <p>The specified string must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (<code>\u0000-\u001f</code> | <code>\u007f-\u009f</code>). Also, it must <i>not</i> be the literal string <code>arn</code>.</p>
155 pub fn set_task_list(mut self, input: ::std::option::Option<crate::types::TaskList>) -> Self {
156 self.inner = self.inner.set_task_list(input);
157 self
158 }
159 /// <p>Specifies the task list to poll for decision tasks.</p>
160 /// <p>The specified string must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (<code>\u0000-\u001f</code> | <code>\u007f-\u009f</code>). Also, it must <i>not</i> be the literal string <code>arn</code>.</p>
161 pub fn get_task_list(&self) -> &::std::option::Option<crate::types::TaskList> {
162 self.inner.get_task_list()
163 }
164 /// <p>Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.</p>
165 pub fn identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.inner = self.inner.identity(input.into());
167 self
168 }
169 /// <p>Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.</p>
170 pub fn set_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.inner = self.inner.set_identity(input);
172 self
173 }
174 /// <p>Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.</p>
175 pub fn get_identity(&self) -> &::std::option::Option<::std::string::String> {
176 self.inner.get_identity()
177 }
178 /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
179 /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p><note>
180 /// <p>The <code>nextPageToken</code> returned by this action cannot be used with <code>GetWorkflowExecutionHistory</code> to get the next page. You must call <code>PollForDecisionTask</code> again (with the <code>nextPageToken</code>) to retrieve the next page of history records. Calling <code>PollForDecisionTask</code> with a <code>nextPageToken</code> doesn't return a new decision task.</p>
181 /// </note>
182 pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.next_page_token(input.into());
184 self
185 }
186 /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
187 /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p><note>
188 /// <p>The <code>nextPageToken</code> returned by this action cannot be used with <code>GetWorkflowExecutionHistory</code> to get the next page. You must call <code>PollForDecisionTask</code> again (with the <code>nextPageToken</code>) to retrieve the next page of history records. Calling <code>PollForDecisionTask</code> with a <code>nextPageToken</code> doesn't return a new decision task.</p>
189 /// </note>
190 pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.inner = self.inner.set_next_page_token(input);
192 self
193 }
194 /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
195 /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p><note>
196 /// <p>The <code>nextPageToken</code> returned by this action cannot be used with <code>GetWorkflowExecutionHistory</code> to get the next page. You must call <code>PollForDecisionTask</code> again (with the <code>nextPageToken</code>) to retrieve the next page of history records. Calling <code>PollForDecisionTask</code> with a <code>nextPageToken</code> doesn't return a new decision task.</p>
197 /// </note>
198 pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_next_page_token()
200 }
201 /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
202 /// <p>This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.</p>
203 pub fn maximum_page_size(mut self, input: i32) -> Self {
204 self.inner = self.inner.maximum_page_size(input);
205 self
206 }
207 /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
208 /// <p>This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.</p>
209 pub fn set_maximum_page_size(mut self, input: ::std::option::Option<i32>) -> Self {
210 self.inner = self.inner.set_maximum_page_size(input);
211 self
212 }
213 /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
214 /// <p>This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.</p>
215 pub fn get_maximum_page_size(&self) -> &::std::option::Option<i32> {
216 self.inner.get_maximum_page_size()
217 }
218 /// <p>When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimestamp</code> of the events.</p>
219 pub fn reverse_order(mut self, input: bool) -> Self {
220 self.inner = self.inner.reverse_order(input);
221 self
222 }
223 /// <p>When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimestamp</code> of the events.</p>
224 pub fn set_reverse_order(mut self, input: ::std::option::Option<bool>) -> Self {
225 self.inner = self.inner.set_reverse_order(input);
226 self
227 }
228 /// <p>When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimestamp</code> of the events.</p>
229 pub fn get_reverse_order(&self) -> &::std::option::Option<bool> {
230 self.inner.get_reverse_order()
231 }
232 /// <p>When set to <code>true</code>, returns the events with <code>eventTimestamp</code> greater than or equal to <code>eventTimestamp</code> of the most recent <code>DecisionTaskStarted</code> event. By default, this parameter is set to <code>false</code>.</p>
233 pub fn start_at_previous_started_event(mut self, input: bool) -> Self {
234 self.inner = self.inner.start_at_previous_started_event(input);
235 self
236 }
237 /// <p>When set to <code>true</code>, returns the events with <code>eventTimestamp</code> greater than or equal to <code>eventTimestamp</code> of the most recent <code>DecisionTaskStarted</code> event. By default, this parameter is set to <code>false</code>.</p>
238 pub fn set_start_at_previous_started_event(mut self, input: ::std::option::Option<bool>) -> Self {
239 self.inner = self.inner.set_start_at_previous_started_event(input);
240 self
241 }
242 /// <p>When set to <code>true</code>, returns the events with <code>eventTimestamp</code> greater than or equal to <code>eventTimestamp</code> of the most recent <code>DecisionTaskStarted</code> event. By default, this parameter is set to <code>false</code>.</p>
243 pub fn get_start_at_previous_started_event(&self) -> &::std::option::Option<bool> {
244 self.inner.get_start_at_previous_started_event()
245 }
246}