aws_sdk_honeycode/operation/invoke_screen_automation/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::invoke_screen_automation::_invoke_screen_automation_output::InvokeScreenAutomationOutputBuilder;
3
4pub use crate::operation::invoke_screen_automation::_invoke_screen_automation_input::InvokeScreenAutomationInputBuilder;
5
6impl crate::operation::invoke_screen_automation::builders::InvokeScreenAutomationInputBuilder {
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::invoke_screen_automation::InvokeScreenAutomationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::invoke_screen_automation::InvokeScreenAutomationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.invoke_screen_automation();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `InvokeScreenAutomation`.
24///
25/// <p>The InvokeScreenAutomation API allows invoking an action defined in a screen in a Honeycode app. The API allows setting local variables, which can then be used in the automation being invoked. This allows automating the Honeycode app interactions to write, update or delete data in the workbook.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct InvokeScreenAutomationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::invoke_screen_automation::builders::InvokeScreenAutomationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::invoke_screen_automation::InvokeScreenAutomationOutput,
35        crate::operation::invoke_screen_automation::InvokeScreenAutomationError,
36    > for InvokeScreenAutomationFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::invoke_screen_automation::InvokeScreenAutomationOutput,
44            crate::operation::invoke_screen_automation::InvokeScreenAutomationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl InvokeScreenAutomationFluentBuilder {
51    /// Creates a new `InvokeScreenAutomationFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the InvokeScreenAutomation as a reference.
60    pub fn as_input(&self) -> &crate::operation::invoke_screen_automation::builders::InvokeScreenAutomationInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::invoke_screen_automation::InvokeScreenAutomationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::invoke_screen_automation::InvokeScreenAutomationError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::invoke_screen_automation::InvokeScreenAutomation::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::invoke_screen_automation::InvokeScreenAutomation::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::invoke_screen_automation::InvokeScreenAutomationOutput,
97        crate::operation::invoke_screen_automation::InvokeScreenAutomationError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ID of the workbook that contains the screen automation.</p>
112    pub fn workbook_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.workbook_id(input.into());
114        self
115    }
116    /// <p>The ID of the workbook that contains the screen automation.</p>
117    pub fn set_workbook_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_workbook_id(input);
119        self
120    }
121    /// <p>The ID of the workbook that contains the screen automation.</p>
122    pub fn get_workbook_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_workbook_id()
124    }
125    /// <p>The ID of the app that contains the screen automation.</p>
126    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.app_id(input.into());
128        self
129    }
130    /// <p>The ID of the app that contains the screen automation.</p>
131    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_app_id(input);
133        self
134    }
135    /// <p>The ID of the app that contains the screen automation.</p>
136    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_app_id()
138    }
139    /// <p>The ID of the screen that contains the screen automation.</p>
140    pub fn screen_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.screen_id(input.into());
142        self
143    }
144    /// <p>The ID of the screen that contains the screen automation.</p>
145    pub fn set_screen_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_screen_id(input);
147        self
148    }
149    /// <p>The ID of the screen that contains the screen automation.</p>
150    pub fn get_screen_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_screen_id()
152    }
153    /// <p>The ID of the automation action to be performed.</p>
154    pub fn screen_automation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.screen_automation_id(input.into());
156        self
157    }
158    /// <p>The ID of the automation action to be performed.</p>
159    pub fn set_screen_automation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_screen_automation_id(input);
161        self
162    }
163    /// <p>The ID of the automation action to be performed.</p>
164    pub fn get_screen_automation_id(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_screen_automation_id()
166    }
167    ///
168    /// Adds a key-value pair to `variables`.
169    ///
170    /// To override the contents of this collection use [`set_variables`](Self::set_variables).
171    ///
172    /// <p>Variables are specified as a map where the key is the name of the variable as defined on the screen. The value is an object which currently has only one property, rawValue, which holds the value of the variable to be passed to the screen. Any variables defined in a screen are required to be passed in the call.</p>
173    pub fn variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::VariableValue) -> Self {
174        self.inner = self.inner.variables(k.into(), v);
175        self
176    }
177    /// <p>Variables are specified as a map where the key is the name of the variable as defined on the screen. The value is an object which currently has only one property, rawValue, which holds the value of the variable to be passed to the screen. Any variables defined in a screen are required to be passed in the call.</p>
178    pub fn set_variables(
179        mut self,
180        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::VariableValue>>,
181    ) -> Self {
182        self.inner = self.inner.set_variables(input);
183        self
184    }
185    /// <p>Variables are specified as a map where the key is the name of the variable as defined on the screen. The value is an object which currently has only one property, rawValue, which holds the value of the variable to be passed to the screen. Any variables defined in a screen are required to be passed in the call.</p>
186    pub fn get_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::VariableValue>> {
187        self.inner.get_variables()
188    }
189    /// <p>The row ID for the automation if the automation is defined inside a block with source or list.</p>
190    pub fn row_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.row_id(input.into());
192        self
193    }
194    /// <p>The row ID for the automation if the automation is defined inside a block with source or list.</p>
195    pub fn set_row_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_row_id(input);
197        self
198    }
199    /// <p>The row ID for the automation if the automation is defined inside a block with source or list.</p>
200    pub fn get_row_id(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_row_id()
202    }
203    /// <p>The request token for performing the automation action. Request tokens help to identify duplicate requests. If a call times out or fails due to a transient error like a failed network connection, you can retry the call with the same request token. The service ensures that if the first call using that request token is successfully performed, the second call will return the response of the previous call rather than performing the action again.</p>
204    /// <p>Note that request tokens are valid only for a few minutes. You cannot use request tokens to dedupe requests spanning hours or days.</p>
205    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.inner = self.inner.client_request_token(input.into());
207        self
208    }
209    /// <p>The request token for performing the automation action. Request tokens help to identify duplicate requests. If a call times out or fails due to a transient error like a failed network connection, you can retry the call with the same request token. The service ensures that if the first call using that request token is successfully performed, the second call will return the response of the previous call rather than performing the action again.</p>
210    /// <p>Note that request tokens are valid only for a few minutes. You cannot use request tokens to dedupe requests spanning hours or days.</p>
211    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_client_request_token(input);
213        self
214    }
215    /// <p>The request token for performing the automation action. Request tokens help to identify duplicate requests. If a call times out or fails due to a transient error like a failed network connection, you can retry the call with the same request token. The service ensures that if the first call using that request token is successfully performed, the second call will return the response of the previous call rather than performing the action again.</p>
216    /// <p>Note that request tokens are valid only for a few minutes. You cannot use request tokens to dedupe requests spanning hours or days.</p>
217    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_client_request_token()
219    }
220}