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