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