aws_sdk_swf/operation/signal_workflow_execution/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::signal_workflow_execution::_signal_workflow_execution_output::SignalWorkflowExecutionOutputBuilder;
3
4pub use crate::operation::signal_workflow_execution::_signal_workflow_execution_input::SignalWorkflowExecutionInputBuilder;
5
6impl crate::operation::signal_workflow_execution::builders::SignalWorkflowExecutionInputBuilder {
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::signal_workflow_execution::SignalWorkflowExecutionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::signal_workflow_execution::SignalWorkflowExecutionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.signal_workflow_execution();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SignalWorkflowExecution`.
24///
25/// <p>Records a <code>WorkflowExecutionSignaled</code> event in the workflow execution history and creates a decision task for the workflow execution identified by the given domain, workflowId and runId. The event is recorded with the specified user defined signalName and input (if provided).</p><note>
26/// <p>If a runId isn't specified, then the <code>WorkflowExecutionSignaled</code> event is recorded in the history of the current open workflow with the matching workflowId in the domain.</p>
27/// </note> <note>
28/// <p>If the specified workflow execution isn't open, this method fails with <code>UnknownResource</code>.</p>
29/// </note>
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 SignalWorkflowExecutionFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::signal_workflow_execution::builders::SignalWorkflowExecutionInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::signal_workflow_execution::SignalWorkflowExecutionOutput,
50        crate::operation::signal_workflow_execution::SignalWorkflowExecutionError,
51    > for SignalWorkflowExecutionFluentBuilder
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::signal_workflow_execution::SignalWorkflowExecutionOutput,
59            crate::operation::signal_workflow_execution::SignalWorkflowExecutionError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl SignalWorkflowExecutionFluentBuilder {
66    /// Creates a new `SignalWorkflowExecutionFluentBuilder`.
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 SignalWorkflowExecution as a reference.
75    pub fn as_input(&self) -> &crate::operation::signal_workflow_execution::builders::SignalWorkflowExecutionInputBuilder {
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::signal_workflow_execution::SignalWorkflowExecutionOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::signal_workflow_execution::SignalWorkflowExecutionError,
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::signal_workflow_execution::SignalWorkflowExecution::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::signal_workflow_execution::SignalWorkflowExecution::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::signal_workflow_execution::SignalWorkflowExecutionOutput,
112        crate::operation::signal_workflow_execution::SignalWorkflowExecutionError,
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 name of the domain containing the workflow execution to signal.</p>
127    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.domain(input.into());
129        self
130    }
131    /// <p>The name of the domain containing the workflow execution to signal.</p>
132    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_domain(input);
134        self
135    }
136    /// <p>The name of the domain containing the workflow execution to signal.</p>
137    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_domain()
139    }
140    /// <p>The workflowId of the workflow execution to signal.</p>
141    pub fn workflow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.workflow_id(input.into());
143        self
144    }
145    /// <p>The workflowId of the workflow execution to signal.</p>
146    pub fn set_workflow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_workflow_id(input);
148        self
149    }
150    /// <p>The workflowId of the workflow execution to signal.</p>
151    pub fn get_workflow_id(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_workflow_id()
153    }
154    /// <p>The runId of the workflow execution to signal.</p>
155    pub fn run_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.run_id(input.into());
157        self
158    }
159    /// <p>The runId of the workflow execution to signal.</p>
160    pub fn set_run_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_run_id(input);
162        self
163    }
164    /// <p>The runId of the workflow execution to signal.</p>
165    pub fn get_run_id(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_run_id()
167    }
168    /// <p>The name of the signal. This name must be meaningful to the target workflow.</p>
169    pub fn signal_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.signal_name(input.into());
171        self
172    }
173    /// <p>The name of the signal. This name must be meaningful to the target workflow.</p>
174    pub fn set_signal_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_signal_name(input);
176        self
177    }
178    /// <p>The name of the signal. This name must be meaningful to the target workflow.</p>
179    pub fn get_signal_name(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_signal_name()
181    }
182    /// <p>Data to attach to the <code>WorkflowExecutionSignaled</code> event in the target workflow execution's history.</p>
183    pub fn input(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.input(input.into());
185        self
186    }
187    /// <p>Data to attach to the <code>WorkflowExecutionSignaled</code> event in the target workflow execution's history.</p>
188    pub fn set_input(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_input(input);
190        self
191    }
192    /// <p>Data to attach to the <code>WorkflowExecutionSignaled</code> event in the target workflow execution's history.</p>
193    pub fn get_input(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_input()
195    }
196}