Skip to main content

aws_sdk_lambda/operation/invoke/
_invoke_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct InvokeInput {
6    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
7    /// <p class="title"><b>Name formats</b></p>
8    /// <ul>
9    /// <li>
10    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
11    /// <li>
12    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
13    /// <li>
14    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
15    /// </ul>
16    /// <p>You can append a version number or alias to any of the formats. 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>
17    pub function_name: ::std::option::Option<::std::string::String>,
18    /// <p>Choose from the following options.</p>
19    /// <ul>
20    /// <li>
21    /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.</p></li>
22    /// <li>
23    /// <p><code>Event</code> – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.</p></li>
24    /// <li>
25    /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
26    /// </ul>
27    pub invocation_type: ::std::option::Option<crate::types::InvocationType>,
28    /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
29    pub log_type: ::std::option::Option<crate::types::LogType>,
30    /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the <code>ClientContext</code> object to your function for synchronous invocations only.</p>
31    pub client_context: ::std::option::Option<::std::string::String>,
32    /// <p>A unique name for the durable execution. If you invoke a durable function using a name that already exists with the same payload, Lambda returns the existing execution instead of creating a duplicate. If the payload differs, Lambda returns a <code>DurableExecutionAlreadyStartedException</code> error.</p>
33    /// <p>If not specified, Lambda generates a unique identifier automatically. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names">Execution names</a>.</p>
34    pub durable_execution_name: ::std::option::Option<::std::string::String>,
35    /// <p>The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.</p>
36    /// <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>
37    pub payload: ::std::option::Option<::aws_smithy_types::Blob>,
38    /// <p>Specify a version or alias to invoke a published version of the function.</p>
39    pub qualifier: ::std::option::Option<::std::string::String>,
40    /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
41    pub tenant_id: ::std::option::Option<::std::string::String>,
42}
43impl InvokeInput {
44    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
45    /// <p class="title"><b>Name formats</b></p>
46    /// <ul>
47    /// <li>
48    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
49    /// <li>
50    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
51    /// <li>
52    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
53    /// </ul>
54    /// <p>You can append a version number or alias to any of the formats. 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>
55    pub fn function_name(&self) -> ::std::option::Option<&str> {
56        self.function_name.as_deref()
57    }
58    /// <p>Choose from the following options.</p>
59    /// <ul>
60    /// <li>
61    /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.</p></li>
62    /// <li>
63    /// <p><code>Event</code> – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.</p></li>
64    /// <li>
65    /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
66    /// </ul>
67    pub fn invocation_type(&self) -> ::std::option::Option<&crate::types::InvocationType> {
68        self.invocation_type.as_ref()
69    }
70    /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
71    pub fn log_type(&self) -> ::std::option::Option<&crate::types::LogType> {
72        self.log_type.as_ref()
73    }
74    /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the <code>ClientContext</code> object to your function for synchronous invocations only.</p>
75    pub fn client_context(&self) -> ::std::option::Option<&str> {
76        self.client_context.as_deref()
77    }
78    /// <p>A unique name for the durable execution. If you invoke a durable function using a name that already exists with the same payload, Lambda returns the existing execution instead of creating a duplicate. If the payload differs, Lambda returns a <code>DurableExecutionAlreadyStartedException</code> error.</p>
79    /// <p>If not specified, Lambda generates a unique identifier automatically. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names">Execution names</a>.</p>
80    pub fn durable_execution_name(&self) -> ::std::option::Option<&str> {
81        self.durable_execution_name.as_deref()
82    }
83    /// <p>The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.</p>
84    /// <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>
85    pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
86        self.payload.as_ref()
87    }
88    /// <p>Specify a version or alias to invoke a published version of the function.</p>
89    pub fn qualifier(&self) -> ::std::option::Option<&str> {
90        self.qualifier.as_deref()
91    }
92    /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
93    pub fn tenant_id(&self) -> ::std::option::Option<&str> {
94        self.tenant_id.as_deref()
95    }
96}
97impl ::std::fmt::Debug for InvokeInput {
98    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
99        let mut formatter = f.debug_struct("InvokeInput");
100        formatter.field("function_name", &self.function_name);
101        formatter.field("invocation_type", &self.invocation_type);
102        formatter.field("log_type", &self.log_type);
103        formatter.field("client_context", &self.client_context);
104        formatter.field("durable_execution_name", &self.durable_execution_name);
105        formatter.field("payload", &"*** Sensitive Data Redacted ***");
106        formatter.field("qualifier", &self.qualifier);
107        formatter.field("tenant_id", &self.tenant_id);
108        formatter.finish()
109    }
110}
111impl InvokeInput {
112    /// Creates a new builder-style object to manufacture [`InvokeInput`](crate::operation::invoke::InvokeInput).
113    pub fn builder() -> crate::operation::invoke::builders::InvokeInputBuilder {
114        crate::operation::invoke::builders::InvokeInputBuilder::default()
115    }
116}
117
118/// A builder for [`InvokeInput`](crate::operation::invoke::InvokeInput).
119#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
120#[non_exhaustive]
121pub struct InvokeInputBuilder {
122    pub(crate) function_name: ::std::option::Option<::std::string::String>,
123    pub(crate) invocation_type: ::std::option::Option<crate::types::InvocationType>,
124    pub(crate) log_type: ::std::option::Option<crate::types::LogType>,
125    pub(crate) client_context: ::std::option::Option<::std::string::String>,
126    pub(crate) durable_execution_name: ::std::option::Option<::std::string::String>,
127    pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
128    pub(crate) qualifier: ::std::option::Option<::std::string::String>,
129    pub(crate) tenant_id: ::std::option::Option<::std::string::String>,
130}
131impl InvokeInputBuilder {
132    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
133    /// <p class="title"><b>Name formats</b></p>
134    /// <ul>
135    /// <li>
136    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</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>You can append a version number or alias to any of the formats. 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    /// This field is required.
144    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.function_name = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
149    /// <p class="title"><b>Name formats</b></p>
150    /// <ul>
151    /// <li>
152    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
153    /// <li>
154    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
155    /// <li>
156    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
157    /// </ul>
158    /// <p>You can append a version number or alias to any of the formats. 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>
159    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.function_name = input;
161        self
162    }
163    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
164    /// <p class="title"><b>Name formats</b></p>
165    /// <ul>
166    /// <li>
167    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
168    /// <li>
169    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
170    /// <li>
171    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
172    /// </ul>
173    /// <p>You can append a version number or alias to any of the formats. 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>
174    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
175        &self.function_name
176    }
177    /// <p>Choose from the following options.</p>
178    /// <ul>
179    /// <li>
180    /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.</p></li>
181    /// <li>
182    /// <p><code>Event</code> – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.</p></li>
183    /// <li>
184    /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
185    /// </ul>
186    pub fn invocation_type(mut self, input: crate::types::InvocationType) -> Self {
187        self.invocation_type = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Choose from the following options.</p>
191    /// <ul>
192    /// <li>
193    /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.</p></li>
194    /// <li>
195    /// <p><code>Event</code> – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.</p></li>
196    /// <li>
197    /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
198    /// </ul>
199    pub fn set_invocation_type(mut self, input: ::std::option::Option<crate::types::InvocationType>) -> Self {
200        self.invocation_type = input;
201        self
202    }
203    /// <p>Choose from the following options.</p>
204    /// <ul>
205    /// <li>
206    /// <p><code>RequestResponse</code> (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.</p></li>
207    /// <li>
208    /// <p><code>Event</code> – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.</p></li>
209    /// <li>
210    /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
211    /// </ul>
212    pub fn get_invocation_type(&self) -> &::std::option::Option<crate::types::InvocationType> {
213        &self.invocation_type
214    }
215    /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
216    pub fn log_type(mut self, input: crate::types::LogType) -> Self {
217        self.log_type = ::std::option::Option::Some(input);
218        self
219    }
220    /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
221    pub fn set_log_type(mut self, input: ::std::option::Option<crate::types::LogType>) -> Self {
222        self.log_type = input;
223        self
224    }
225    /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
226    pub fn get_log_type(&self) -> &::std::option::Option<crate::types::LogType> {
227        &self.log_type
228    }
229    /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the <code>ClientContext</code> object to your function for synchronous invocations only.</p>
230    pub fn client_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.client_context = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the <code>ClientContext</code> object to your function for synchronous invocations only.</p>
235    pub fn set_client_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.client_context = input;
237        self
238    }
239    /// <p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the <code>ClientContext</code> object to your function for synchronous invocations only.</p>
240    pub fn get_client_context(&self) -> &::std::option::Option<::std::string::String> {
241        &self.client_context
242    }
243    /// <p>A unique name for the durable execution. If you invoke a durable function using a name that already exists with the same payload, Lambda returns the existing execution instead of creating a duplicate. If the payload differs, Lambda returns a <code>DurableExecutionAlreadyStartedException</code> error.</p>
244    /// <p>If not specified, Lambda generates a unique identifier automatically. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names">Execution names</a>.</p>
245    pub fn durable_execution_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246        self.durable_execution_name = ::std::option::Option::Some(input.into());
247        self
248    }
249    /// <p>A unique name for the durable execution. If you invoke a durable function using a name that already exists with the same payload, Lambda returns the existing execution instead of creating a duplicate. If the payload differs, Lambda returns a <code>DurableExecutionAlreadyStartedException</code> error.</p>
250    /// <p>If not specified, Lambda generates a unique identifier automatically. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names">Execution names</a>.</p>
251    pub fn set_durable_execution_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252        self.durable_execution_name = input;
253        self
254    }
255    /// <p>A unique name for the durable execution. If you invoke a durable function using a name that already exists with the same payload, Lambda returns the existing execution instead of creating a duplicate. If the payload differs, Lambda returns a <code>DurableExecutionAlreadyStartedException</code> error.</p>
256    /// <p>If not specified, Lambda generates a unique identifier automatically. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names">Execution names</a>.</p>
257    pub fn get_durable_execution_name(&self) -> &::std::option::Option<::std::string::String> {
258        &self.durable_execution_name
259    }
260    /// <p>The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.</p>
261    /// <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>
262    pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
263        self.payload = ::std::option::Option::Some(input);
264        self
265    }
266    /// <p>The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.</p>
267    /// <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>
268    pub fn set_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
269        self.payload = input;
270        self
271    }
272    /// <p>The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.</p>
273    /// <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>
274    pub fn get_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
275        &self.payload
276    }
277    /// <p>Specify a version or alias to invoke a published version of the function.</p>
278    pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
279        self.qualifier = ::std::option::Option::Some(input.into());
280        self
281    }
282    /// <p>Specify a version or alias to invoke a published version of the function.</p>
283    pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284        self.qualifier = input;
285        self
286    }
287    /// <p>Specify a version or alias to invoke a published version of the function.</p>
288    pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
289        &self.qualifier
290    }
291    /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
292    pub fn tenant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.tenant_id = ::std::option::Option::Some(input.into());
294        self
295    }
296    /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
297    pub fn set_tenant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.tenant_id = input;
299        self
300    }
301    /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
302    pub fn get_tenant_id(&self) -> &::std::option::Option<::std::string::String> {
303        &self.tenant_id
304    }
305    /// Consumes the builder and constructs a [`InvokeInput`](crate::operation::invoke::InvokeInput).
306    pub fn build(self) -> ::std::result::Result<crate::operation::invoke::InvokeInput, ::aws_smithy_types::error::operation::BuildError> {
307        ::std::result::Result::Ok(crate::operation::invoke::InvokeInput {
308            function_name: self.function_name,
309            invocation_type: self.invocation_type,
310            log_type: self.log_type,
311            client_context: self.client_context,
312            durable_execution_name: self.durable_execution_name,
313            payload: self.payload,
314            qualifier: self.qualifier,
315            tenant_id: self.tenant_id,
316        })
317    }
318}
319impl ::std::fmt::Debug for InvokeInputBuilder {
320    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
321        let mut formatter = f.debug_struct("InvokeInputBuilder");
322        formatter.field("function_name", &self.function_name);
323        formatter.field("invocation_type", &self.invocation_type);
324        formatter.field("log_type", &self.log_type);
325        formatter.field("client_context", &self.client_context);
326        formatter.field("durable_execution_name", &self.durable_execution_name);
327        formatter.field("payload", &"*** Sensitive Data Redacted ***");
328        formatter.field("qualifier", &self.qualifier);
329        formatter.field("tenant_id", &self.tenant_id);
330        formatter.finish()
331    }
332}