aws_sdk_lambda/operation/invoke_with_response_stream/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_input::InvokeWithResponseStreamInputBuilder;
3
4pub use crate::operation::invoke_with_response_stream::_invoke_with_response_stream_output::InvokeWithResponseStreamOutputBuilder;
5
6impl crate::operation::invoke_with_response_stream::builders::InvokeWithResponseStreamInputBuilder {
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_with_response_stream::InvokeWithResponseStreamOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.invoke_with_response_stream();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `InvokeWithResponseStream`.
24///
25/// <p>Configure your Lambda functions to stream response payloads back to clients. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html">Configuring a Lambda function to stream responses</a>.</p>
26/// <p>This operation requires permission for the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html">lambda:InvokeFunction</a> action. For details on how to set up permissions for cross-account invocations, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountinvoke">Granting function access to other accounts</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct InvokeWithResponseStreamFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::invoke_with_response_stream::builders::InvokeWithResponseStreamInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamOutput,
36 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
37 > for InvokeWithResponseStreamFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamOutput,
45 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl InvokeWithResponseStreamFluentBuilder {
52 /// Creates a new `InvokeWithResponseStreamFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the InvokeWithResponseStream as a reference.
61 pub fn as_input(&self) -> &crate::operation::invoke_with_response_stream::builders::InvokeWithResponseStreamInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::invoke_with_response_stream::InvokeWithResponseStream::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::invoke_with_response_stream::InvokeWithResponseStream::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamOutput,
98 crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The name or ARN of the Lambda function.</p>
113 /// <p class="title"><b>Name formats</b></p>
114 /// <ul>
115 /// <li>
116 /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
117 /// <li>
118 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
119 /// <li>
120 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
121 /// </ul>
122 /// <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>
123 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.function_name(input.into());
125 self
126 }
127 /// <p>The name or ARN of the Lambda function.</p>
128 /// <p class="title"><b>Name formats</b></p>
129 /// <ul>
130 /// <li>
131 /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
132 /// <li>
133 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
134 /// <li>
135 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
136 /// </ul>
137 /// <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>
138 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_function_name(input);
140 self
141 }
142 /// <p>The name or ARN of the Lambda function.</p>
143 /// <p class="title"><b>Name formats</b></p>
144 /// <ul>
145 /// <li>
146 /// <p><b>Function name</b> – <code>my-function</code>.</p></li>
147 /// <li>
148 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
149 /// <li>
150 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
151 /// </ul>
152 /// <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>
153 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_function_name()
155 }
156 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
157 pub fn log_type(mut self, input: crate::types::LogType) -> Self {
158 self.inner = self.inner.log_type(input);
159 self
160 }
161 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
162 pub fn set_log_type(mut self, input: ::std::option::Option<crate::types::LogType>) -> Self {
163 self.inner = self.inner.set_log_type(input);
164 self
165 }
166 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
167 pub fn get_log_type(&self) -> &::std::option::Option<crate::types::LogType> {
168 self.inner.get_log_type()
169 }
170 /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.</p>
171 pub fn client_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.client_context(input.into());
173 self
174 }
175 /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.</p>
176 pub fn set_client_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.inner = self.inner.set_client_context(input);
178 self
179 }
180 /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.</p>
181 pub fn get_client_context(&self) -> &::std::option::Option<::std::string::String> {
182 self.inner.get_client_context()
183 }
184 /// <p>The alias name.</p>
185 pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.qualifier(input.into());
187 self
188 }
189 /// <p>The alias name.</p>
190 pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.inner = self.inner.set_qualifier(input);
192 self
193 }
194 /// <p>The alias name.</p>
195 pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
196 self.inner.get_qualifier()
197 }
198 /// <p>The JSON that you want to provide to your Lambda function as input.</p>
199 /// <p>You can enter the JSON directly. For example, <code>--payload '{ "key": "value" }'</code>. You can also specify a file path. For example, <code>--payload file://payload.json</code>.</p>
200 pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
201 self.inner = self.inner.payload(input);
202 self
203 }
204 /// <p>The JSON that you want to provide to your Lambda function as input.</p>
205 /// <p>You can enter the JSON directly. For example, <code>--payload '{ "key": "value" }'</code>. You can also specify a file path. For example, <code>--payload file://payload.json</code>.</p>
206 pub fn set_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
207 self.inner = self.inner.set_payload(input);
208 self
209 }
210 /// <p>The JSON that you want to provide to your Lambda function as input.</p>
211 /// <p>You can enter the JSON directly. For example, <code>--payload '{ "key": "value" }'</code>. You can also specify a file path. For example, <code>--payload file://payload.json</code>.</p>
212 pub fn get_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
213 self.inner.get_payload()
214 }
215 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
216 pub fn tenant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.inner = self.inner.tenant_id(input.into());
218 self
219 }
220 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
221 pub fn set_tenant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.inner = self.inner.set_tenant_id(input);
223 self
224 }
225 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
226 pub fn get_tenant_id(&self) -> &::std::option::Option<::std::string::String> {
227 self.inner.get_tenant_id()
228 }
229 /// <p>Use one of the following options:</p>
230 /// <ul>
231 /// <li>
232 /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.</p></li>
233 /// <li>
234 /// <p><code>DryRun</code> – Validate parameter values and verify that the IAM user or role has permission to invoke the function.</p></li>
235 /// </ul>
236 pub fn invocation_type(mut self, input: crate::types::ResponseStreamingInvocationType) -> Self {
237 self.inner = self.inner.invocation_type(input);
238 self
239 }
240 /// <p>Use one of the following options:</p>
241 /// <ul>
242 /// <li>
243 /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.</p></li>
244 /// <li>
245 /// <p><code>DryRun</code> – Validate parameter values and verify that the IAM user or role has permission to invoke the function.</p></li>
246 /// </ul>
247 pub fn set_invocation_type(mut self, input: ::std::option::Option<crate::types::ResponseStreamingInvocationType>) -> Self {
248 self.inner = self.inner.set_invocation_type(input);
249 self
250 }
251 /// <p>Use one of the following options:</p>
252 /// <ul>
253 /// <li>
254 /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.</p></li>
255 /// <li>
256 /// <p><code>DryRun</code> – Validate parameter values and verify that the IAM user or role has permission to invoke the function.</p></li>
257 /// </ul>
258 pub fn get_invocation_type(&self) -> &::std::option::Option<crate::types::ResponseStreamingInvocationType> {
259 self.inner.get_invocation_type()
260 }
261}