aws_sdk_lambda/operation/invoke_async/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::invoke_async::_invoke_async_output::InvokeAsyncOutputBuilder;
3
4pub use crate::operation::invoke_async::_invoke_async_input::InvokeAsyncInputBuilder;
5
6impl crate::operation::invoke_async::builders::InvokeAsyncInputBuilder {
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_async::InvokeAsyncOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::invoke_async::InvokeAsyncError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.invoke_async();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `InvokeAsync`.
24///
25/// <note>
26/// <p>For asynchronous function invocation, use <code>Invoke</code>.</p>
27/// </note>
28/// <p>Invokes a function asynchronously.</p><note>
29/// <p>The payload limit is 256KB. For larger payloads, for up to 1MB, use <code>Invoke</code>.</p>
30/// </note> <note>
31/// <p>If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not propagated to the function, even if X-Ray active tracing is turned on.</p>
32/// </note>
33#[deprecated]
34#[derive(::std::fmt::Debug)]
35pub struct InvokeAsyncFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::invoke_async::builders::InvokeAsyncInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::invoke_async::InvokeAsyncOutput,
43        crate::operation::invoke_async::InvokeAsyncError,
44    > for InvokeAsyncFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::invoke_async::InvokeAsyncOutput,
52            crate::operation::invoke_async::InvokeAsyncError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl InvokeAsyncFluentBuilder {
59    /// Creates a new `InvokeAsyncFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the InvokeAsync as a reference.
68    pub fn as_input(&self) -> &crate::operation::invoke_async::builders::InvokeAsyncInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::invoke_async::InvokeAsyncOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::invoke_async::InvokeAsyncError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::invoke_async::InvokeAsync::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::invoke_async::InvokeAsync::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::invoke_async::InvokeAsyncOutput,
105        crate::operation::invoke_async::InvokeAsyncError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The name or ARN of the Lambda function.</p>
120    /// <p class="title"><b>Name formats</b></p>
121    /// <ul>
122    /// <li>
123    /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
124    /// <li>
125    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
126    /// <li>
127    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
128    /// </ul>
129    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
130    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.function_name(input.into());
132        self
133    }
134    /// <p>The name or ARN of the Lambda function.</p>
135    /// <p class="title"><b>Name formats</b></p>
136    /// <ul>
137    /// <li>
138    /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
139    /// <li>
140    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
141    /// <li>
142    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
143    /// </ul>
144    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
145    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_function_name(input);
147        self
148    }
149    /// <p>The name or ARN of the Lambda function.</p>
150    /// <p class="title"><b>Name formats</b></p>
151    /// <ul>
152    /// <li>
153    /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
154    /// <li>
155    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
156    /// <li>
157    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
158    /// </ul>
159    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
160    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_function_name()
162    }
163    /// <p>The JSON that you want to provide to your Lambda function as input.</p>
164    pub fn invoke_args(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
165        self.inner = self.inner.invoke_args(input);
166        self
167    }
168    /// <p>The JSON that you want to provide to your Lambda function as input.</p>
169    pub fn set_invoke_args(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
170        self.inner = self.inner.set_invoke_args(input);
171        self
172    }
173    /// <p>The JSON that you want to provide to your Lambda function as input.</p>
174    pub fn get_invoke_args(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
175        self.inner.get_invoke_args()
176    }
177}