aws-sdk-lambda 1.119.0

AWS SDK for AWS Lambda
Documentation
// 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()
    }
}