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>Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.</p>
33 pub durable_execution_name: ::std::option::Option<::std::string::String>,
34 /// <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>
35 /// <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>
36 pub payload: ::std::option::Option<::aws_smithy_types::Blob>,
37 /// <p>Specify a version or alias to invoke a published version of the function.</p>
38 pub qualifier: ::std::option::Option<::std::string::String>,
39 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
40 pub tenant_id: ::std::option::Option<::std::string::String>,
41}
42impl InvokeInput {
43 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
44 /// <p class="title"><b>Name formats</b></p>
45 /// <ul>
46 /// <li>
47 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
48 /// <li>
49 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
50 /// <li>
51 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
52 /// </ul>
53 /// <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>
54 pub fn function_name(&self) -> ::std::option::Option<&str> {
55 self.function_name.as_deref()
56 }
57 /// <p>Choose from the following options.</p>
58 /// <ul>
59 /// <li>
60 /// <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>
61 /// <li>
62 /// <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>
63 /// <li>
64 /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
65 /// </ul>
66 pub fn invocation_type(&self) -> ::std::option::Option<&crate::types::InvocationType> {
67 self.invocation_type.as_ref()
68 }
69 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
70 pub fn log_type(&self) -> ::std::option::Option<&crate::types::LogType> {
71 self.log_type.as_ref()
72 }
73 /// <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>
74 pub fn client_context(&self) -> ::std::option::Option<&str> {
75 self.client_context.as_deref()
76 }
77 /// <p>Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.</p>
78 pub fn durable_execution_name(&self) -> ::std::option::Option<&str> {
79 self.durable_execution_name.as_deref()
80 }
81 /// <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>
82 /// <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>
83 pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
84 self.payload.as_ref()
85 }
86 /// <p>Specify a version or alias to invoke a published version of the function.</p>
87 pub fn qualifier(&self) -> ::std::option::Option<&str> {
88 self.qualifier.as_deref()
89 }
90 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
91 pub fn tenant_id(&self) -> ::std::option::Option<&str> {
92 self.tenant_id.as_deref()
93 }
94}
95impl ::std::fmt::Debug for InvokeInput {
96 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
97 let mut formatter = f.debug_struct("InvokeInput");
98 formatter.field("function_name", &self.function_name);
99 formatter.field("invocation_type", &self.invocation_type);
100 formatter.field("log_type", &self.log_type);
101 formatter.field("client_context", &self.client_context);
102 formatter.field("durable_execution_name", &self.durable_execution_name);
103 formatter.field("payload", &"*** Sensitive Data Redacted ***");
104 formatter.field("qualifier", &self.qualifier);
105 formatter.field("tenant_id", &self.tenant_id);
106 formatter.finish()
107 }
108}
109impl InvokeInput {
110 /// Creates a new builder-style object to manufacture [`InvokeInput`](crate::operation::invoke::InvokeInput).
111 pub fn builder() -> crate::operation::invoke::builders::InvokeInputBuilder {
112 crate::operation::invoke::builders::InvokeInputBuilder::default()
113 }
114}
115
116/// A builder for [`InvokeInput`](crate::operation::invoke::InvokeInput).
117#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
118#[non_exhaustive]
119pub struct InvokeInputBuilder {
120 pub(crate) function_name: ::std::option::Option<::std::string::String>,
121 pub(crate) invocation_type: ::std::option::Option<crate::types::InvocationType>,
122 pub(crate) log_type: ::std::option::Option<crate::types::LogType>,
123 pub(crate) client_context: ::std::option::Option<::std::string::String>,
124 pub(crate) durable_execution_name: ::std::option::Option<::std::string::String>,
125 pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
126 pub(crate) qualifier: ::std::option::Option<::std::string::String>,
127 pub(crate) tenant_id: ::std::option::Option<::std::string::String>,
128}
129impl InvokeInputBuilder {
130 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
131 /// <p class="title"><b>Name formats</b></p>
132 /// <ul>
133 /// <li>
134 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
135 /// <li>
136 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
137 /// <li>
138 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
139 /// </ul>
140 /// <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>
141 /// This field is required.
142 pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.function_name = ::std::option::Option::Some(input.into());
144 self
145 }
146 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
147 /// <p class="title"><b>Name formats</b></p>
148 /// <ul>
149 /// <li>
150 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
151 /// <li>
152 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
153 /// <li>
154 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
155 /// </ul>
156 /// <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>
157 pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.function_name = input;
159 self
160 }
161 /// <p>The name or ARN of the Lambda function, version, or alias.</p>
162 /// <p class="title"><b>Name formats</b></p>
163 /// <ul>
164 /// <li>
165 /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
166 /// <li>
167 /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
168 /// <li>
169 /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
170 /// </ul>
171 /// <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>
172 pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
173 &self.function_name
174 }
175 /// <p>Choose from the following options.</p>
176 /// <ul>
177 /// <li>
178 /// <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>
179 /// <li>
180 /// <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>
181 /// <li>
182 /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
183 /// </ul>
184 pub fn invocation_type(mut self, input: crate::types::InvocationType) -> Self {
185 self.invocation_type = ::std::option::Option::Some(input);
186 self
187 }
188 /// <p>Choose from the following options.</p>
189 /// <ul>
190 /// <li>
191 /// <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>
192 /// <li>
193 /// <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>
194 /// <li>
195 /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
196 /// </ul>
197 pub fn set_invocation_type(mut self, input: ::std::option::Option<crate::types::InvocationType>) -> Self {
198 self.invocation_type = input;
199 self
200 }
201 /// <p>Choose from the following options.</p>
202 /// <ul>
203 /// <li>
204 /// <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>
205 /// <li>
206 /// <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>
207 /// <li>
208 /// <p><code>DryRun</code> – Validate parameter values and verify that the user or role has permission to invoke the function.</p></li>
209 /// </ul>
210 pub fn get_invocation_type(&self) -> &::std::option::Option<crate::types::InvocationType> {
211 &self.invocation_type
212 }
213 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
214 pub fn log_type(mut self, input: crate::types::LogType) -> Self {
215 self.log_type = ::std::option::Option::Some(input);
216 self
217 }
218 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
219 pub fn set_log_type(mut self, input: ::std::option::Option<crate::types::LogType>) -> Self {
220 self.log_type = input;
221 self
222 }
223 /// <p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>
224 pub fn get_log_type(&self) -> &::std::option::Option<crate::types::LogType> {
225 &self.log_type
226 }
227 /// <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>
228 pub fn client_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.client_context = ::std::option::Option::Some(input.into());
230 self
231 }
232 /// <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>
233 pub fn set_client_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.client_context = input;
235 self
236 }
237 /// <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>
238 pub fn get_client_context(&self) -> &::std::option::Option<::std::string::String> {
239 &self.client_context
240 }
241 /// <p>Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.</p>
242 pub fn durable_execution_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243 self.durable_execution_name = ::std::option::Option::Some(input.into());
244 self
245 }
246 /// <p>Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.</p>
247 pub fn set_durable_execution_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248 self.durable_execution_name = input;
249 self
250 }
251 /// <p>Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.</p>
252 pub fn get_durable_execution_name(&self) -> &::std::option::Option<::std::string::String> {
253 &self.durable_execution_name
254 }
255 /// <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>
256 /// <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>
257 pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
258 self.payload = ::std::option::Option::Some(input);
259 self
260 }
261 /// <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>
262 /// <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>
263 pub fn set_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
264 self.payload = input;
265 self
266 }
267 /// <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>
268 /// <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>
269 pub fn get_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
270 &self.payload
271 }
272 /// <p>Specify a version or alias to invoke a published version of the function.</p>
273 pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274 self.qualifier = ::std::option::Option::Some(input.into());
275 self
276 }
277 /// <p>Specify a version or alias to invoke a published version of the function.</p>
278 pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
279 self.qualifier = input;
280 self
281 }
282 /// <p>Specify a version or alias to invoke a published version of the function.</p>
283 pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
284 &self.qualifier
285 }
286 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
287 pub fn tenant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288 self.tenant_id = ::std::option::Option::Some(input.into());
289 self
290 }
291 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
292 pub fn set_tenant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
293 self.tenant_id = input;
294 self
295 }
296 /// <p>The identifier of the tenant in a multi-tenant Lambda function.</p>
297 pub fn get_tenant_id(&self) -> &::std::option::Option<::std::string::String> {
298 &self.tenant_id
299 }
300 /// Consumes the builder and constructs a [`InvokeInput`](crate::operation::invoke::InvokeInput).
301 pub fn build(self) -> ::std::result::Result<crate::operation::invoke::InvokeInput, ::aws_smithy_types::error::operation::BuildError> {
302 ::std::result::Result::Ok(crate::operation::invoke::InvokeInput {
303 function_name: self.function_name,
304 invocation_type: self.invocation_type,
305 log_type: self.log_type,
306 client_context: self.client_context,
307 durable_execution_name: self.durable_execution_name,
308 payload: self.payload,
309 qualifier: self.qualifier,
310 tenant_id: self.tenant_id,
311 })
312 }
313}
314impl ::std::fmt::Debug for InvokeInputBuilder {
315 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
316 let mut formatter = f.debug_struct("InvokeInputBuilder");
317 formatter.field("function_name", &self.function_name);
318 formatter.field("invocation_type", &self.invocation_type);
319 formatter.field("log_type", &self.log_type);
320 formatter.field("client_context", &self.client_context);
321 formatter.field("durable_execution_name", &self.durable_execution_name);
322 formatter.field("payload", &"*** Sensitive Data Redacted ***");
323 formatter.field("qualifier", &self.qualifier);
324 formatter.field("tenant_id", &self.tenant_id);
325 formatter.finish()
326 }
327}