1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct UpdateFunctionCodeInput {
/// <p>The name or ARN of the Lambda function.</p>
/// <p class="title"><b>Name formats</b></p>
/// <ul>
/// <li>
/// <p><b>Function name</b> – <code>my-function</code>.</p></li>
/// <li>
/// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
/// <li>
/// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
/// </ul>
/// <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>
pub function_name: ::std::option::Option<::std::string::String>,
/// <p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p>
pub zip_file: ::std::option::Option<::aws_smithy_types::Blob>,
/// <p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p>
pub s3_bucket: ::std::option::Option<::std::string::String>,
/// <p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p>
pub s3_key: ::std::option::Option<::std::string::String>,
/// <p>For versioned objects, the version of the deployment package object to use.</p>
pub s3_object_version: ::std::option::Option<::std::string::String>,
/// <p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p>
pub image_uri: ::std::option::Option<::std::string::String>,
/// <p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p>
pub publish: ::std::option::Option<bool>,
/// <p>Set to true to validate the request parameters and access permissions without modifying the function code.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p>
pub revision_id: ::std::option::Option<::std::string::String>,
/// <p>The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is <code>x86_64</code>.</p>
pub architectures: ::std::option::Option<::std::vec::Vec<crate::types::Architecture>>,
/// <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
pub source_kms_key_arn: ::std::option::Option<::std::string::String>,
/// <p>Specifies where to publish the function version or configuration.</p>
pub publish_to: ::std::option::Option<crate::types::FunctionVersionLatestPublished>,
}
impl UpdateFunctionCodeInput {
/// <p>The name or ARN of the Lambda function.</p>
/// <p class="title"><b>Name formats</b></p>
/// <ul>
/// <li>
/// <p><b>Function name</b> – <code>my-function</code>.</p></li>
/// <li>
/// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
/// <li>
/// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
/// </ul>
/// <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>
pub fn function_name(&self) -> ::std::option::Option<&str> {
self.function_name.as_deref()
}
/// <p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn zip_file(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.zip_file.as_ref()
}
/// <p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn s3_bucket(&self) -> ::std::option::Option<&str> {
self.s3_bucket.as_deref()
}
/// <p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn s3_key(&self) -> ::std::option::Option<&str> {
self.s3_key.as_deref()
}
/// <p>For versioned objects, the version of the deployment package object to use.</p>
pub fn s3_object_version(&self) -> ::std::option::Option<&str> {
self.s3_object_version.as_deref()
}
/// <p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p>
pub fn image_uri(&self) -> ::std::option::Option<&str> {
self.image_uri.as_deref()
}
/// <p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p>
pub fn publish(&self) -> ::std::option::Option<bool> {
self.publish
}
/// <p>Set to true to validate the request parameters and access permissions without modifying the function code.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p>
pub fn revision_id(&self) -> ::std::option::Option<&str> {
self.revision_id.as_deref()
}
/// <p>The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is <code>x86_64</code>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.architectures.is_none()`.
pub fn architectures(&self) -> &[crate::types::Architecture] {
self.architectures.as_deref().unwrap_or_default()
}
/// <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
pub fn source_kms_key_arn(&self) -> ::std::option::Option<&str> {
self.source_kms_key_arn.as_deref()
}
/// <p>Specifies where to publish the function version or configuration.</p>
pub fn publish_to(&self) -> ::std::option::Option<&crate::types::FunctionVersionLatestPublished> {
self.publish_to.as_ref()
}
}
impl ::std::fmt::Debug for UpdateFunctionCodeInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("UpdateFunctionCodeInput");
formatter.field("function_name", &self.function_name);
formatter.field("zip_file", &"*** Sensitive Data Redacted ***");
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_key", &self.s3_key);
formatter.field("s3_object_version", &self.s3_object_version);
formatter.field("image_uri", &self.image_uri);
formatter.field("publish", &self.publish);
formatter.field("dry_run", &self.dry_run);
formatter.field("revision_id", &self.revision_id);
formatter.field("architectures", &self.architectures);
formatter.field("source_kms_key_arn", &self.source_kms_key_arn);
formatter.field("publish_to", &self.publish_to);
formatter.finish()
}
}
impl UpdateFunctionCodeInput {
/// Creates a new builder-style object to manufacture [`UpdateFunctionCodeInput`](crate::operation::update_function_code::UpdateFunctionCodeInput).
pub fn builder() -> crate::operation::update_function_code::builders::UpdateFunctionCodeInputBuilder {
crate::operation::update_function_code::builders::UpdateFunctionCodeInputBuilder::default()
}
}
/// A builder for [`UpdateFunctionCodeInput`](crate::operation::update_function_code::UpdateFunctionCodeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct UpdateFunctionCodeInputBuilder {
pub(crate) function_name: ::std::option::Option<::std::string::String>,
pub(crate) zip_file: ::std::option::Option<::aws_smithy_types::Blob>,
pub(crate) s3_bucket: ::std::option::Option<::std::string::String>,
pub(crate) s3_key: ::std::option::Option<::std::string::String>,
pub(crate) s3_object_version: ::std::option::Option<::std::string::String>,
pub(crate) image_uri: ::std::option::Option<::std::string::String>,
pub(crate) publish: ::std::option::Option<bool>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) revision_id: ::std::option::Option<::std::string::String>,
pub(crate) architectures: ::std::option::Option<::std::vec::Vec<crate::types::Architecture>>,
pub(crate) source_kms_key_arn: ::std::option::Option<::std::string::String>,
pub(crate) publish_to: ::std::option::Option<crate::types::FunctionVersionLatestPublished>,
}
impl UpdateFunctionCodeInputBuilder {
/// <p>The name or ARN of the Lambda function.</p>
/// <p class="title"><b>Name formats</b></p>
/// <ul>
/// <li>
/// <p><b>Function name</b> – <code>my-function</code>.</p></li>
/// <li>
/// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
/// <li>
/// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
/// </ul>
/// <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>
/// This field is required.
pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.function_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name or ARN of the Lambda function.</p>
/// <p class="title"><b>Name formats</b></p>
/// <ul>
/// <li>
/// <p><b>Function name</b> – <code>my-function</code>.</p></li>
/// <li>
/// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
/// <li>
/// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
/// </ul>
/// <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>
pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.function_name = input;
self
}
/// <p>The name or ARN of the Lambda function.</p>
/// <p class="title"><b>Name formats</b></p>
/// <ul>
/// <li>
/// <p><b>Function name</b> – <code>my-function</code>.</p></li>
/// <li>
/// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
/// <li>
/// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
/// </ul>
/// <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>
pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
&self.function_name
}
/// <p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn zip_file(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.zip_file = ::std::option::Option::Some(input);
self
}
/// <p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn set_zip_file(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.zip_file = input;
self
}
/// <p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn get_zip_file(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.zip_file
}
/// <p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn s3_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.s3_bucket = ::std::option::Option::Some(input.into());
self
}
/// <p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn set_s3_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.s3_bucket = input;
self
}
/// <p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn get_s3_bucket(&self) -> &::std::option::Option<::std::string::String> {
&self.s3_bucket
}
/// <p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn s3_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.s3_key = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn set_s3_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.s3_key = input;
self
}
/// <p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p>
pub fn get_s3_key(&self) -> &::std::option::Option<::std::string::String> {
&self.s3_key
}
/// <p>For versioned objects, the version of the deployment package object to use.</p>
pub fn s3_object_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.s3_object_version = ::std::option::Option::Some(input.into());
self
}
/// <p>For versioned objects, the version of the deployment package object to use.</p>
pub fn set_s3_object_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.s3_object_version = input;
self
}
/// <p>For versioned objects, the version of the deployment package object to use.</p>
pub fn get_s3_object_version(&self) -> &::std::option::Option<::std::string::String> {
&self.s3_object_version
}
/// <p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p>
pub fn image_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.image_uri = ::std::option::Option::Some(input.into());
self
}
/// <p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p>
pub fn set_image_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.image_uri = input;
self
}
/// <p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p>
pub fn get_image_uri(&self) -> &::std::option::Option<::std::string::String> {
&self.image_uri
}
/// <p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p>
pub fn publish(mut self, input: bool) -> Self {
self.publish = ::std::option::Option::Some(input);
self
}
/// <p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p>
pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
self.publish = input;
self
}
/// <p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p>
pub fn get_publish(&self) -> &::std::option::Option<bool> {
&self.publish
}
/// <p>Set to true to validate the request parameters and access permissions without modifying the function code.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Set to true to validate the request parameters and access permissions without modifying the function code.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Set to true to validate the request parameters and access permissions without modifying the function code.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p>
pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.revision_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p>
pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.revision_id = input;
self
}
/// <p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p>
pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
&self.revision_id
}
/// Appends an item to `architectures`.
///
/// To override the contents of this collection use [`set_architectures`](Self::set_architectures).
///
/// <p>The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is <code>x86_64</code>.</p>
pub fn architectures(mut self, input: crate::types::Architecture) -> Self {
let mut v = self.architectures.unwrap_or_default();
v.push(input);
self.architectures = ::std::option::Option::Some(v);
self
}
/// <p>The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is <code>x86_64</code>.</p>
pub fn set_architectures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Architecture>>) -> Self {
self.architectures = input;
self
}
/// <p>The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is <code>x86_64</code>.</p>
pub fn get_architectures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Architecture>> {
&self.architectures
}
/// <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
pub fn source_kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_kms_key_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
pub fn set_source_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_kms_key_arn = input;
self
}
/// <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
pub fn get_source_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.source_kms_key_arn
}
/// <p>Specifies where to publish the function version or configuration.</p>
pub fn publish_to(mut self, input: crate::types::FunctionVersionLatestPublished) -> Self {
self.publish_to = ::std::option::Option::Some(input);
self
}
/// <p>Specifies where to publish the function version or configuration.</p>
pub fn set_publish_to(mut self, input: ::std::option::Option<crate::types::FunctionVersionLatestPublished>) -> Self {
self.publish_to = input;
self
}
/// <p>Specifies where to publish the function version or configuration.</p>
pub fn get_publish_to(&self) -> &::std::option::Option<crate::types::FunctionVersionLatestPublished> {
&self.publish_to
}
/// Consumes the builder and constructs a [`UpdateFunctionCodeInput`](crate::operation::update_function_code::UpdateFunctionCodeInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_function_code::UpdateFunctionCodeInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::update_function_code::UpdateFunctionCodeInput {
function_name: self.function_name,
zip_file: self.zip_file,
s3_bucket: self.s3_bucket,
s3_key: self.s3_key,
s3_object_version: self.s3_object_version,
image_uri: self.image_uri,
publish: self.publish,
dry_run: self.dry_run,
revision_id: self.revision_id,
architectures: self.architectures,
source_kms_key_arn: self.source_kms_key_arn,
publish_to: self.publish_to,
})
}
}
impl ::std::fmt::Debug for UpdateFunctionCodeInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("UpdateFunctionCodeInputBuilder");
formatter.field("function_name", &self.function_name);
formatter.field("zip_file", &"*** Sensitive Data Redacted ***");
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_key", &self.s3_key);
formatter.field("s3_object_version", &self.s3_object_version);
formatter.field("image_uri", &self.image_uri);
formatter.field("publish", &self.publish);
formatter.field("dry_run", &self.dry_run);
formatter.field("revision_id", &self.revision_id);
formatter.field("architectures", &self.architectures);
formatter.field("source_kms_key_arn", &self.source_kms_key_arn);
formatter.field("publish_to", &self.publish_to);
formatter.finish()
}
}