aws-sdk-observabilityadmin 1.53.0

AWS SDK for CloudWatch Observability Admin Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines the encryption configuration for S3 Table integrations, including the encryption algorithm and KMS key settings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Encryption {
    /// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
    pub sse_algorithm: crate::types::SseAlgorithm,
    /// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
}
impl Encryption {
    /// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
    pub fn sse_algorithm(&self) -> &crate::types::SseAlgorithm {
        &self.sse_algorithm
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
}
impl Encryption {
    /// Creates a new builder-style object to manufacture [`Encryption`](crate::types::Encryption).
    pub fn builder() -> crate::types::builders::EncryptionBuilder {
        crate::types::builders::EncryptionBuilder::default()
    }
}

/// A builder for [`Encryption`](crate::types::Encryption).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EncryptionBuilder {
    pub(crate) sse_algorithm: ::std::option::Option<crate::types::SseAlgorithm>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
}
impl EncryptionBuilder {
    /// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
    /// This field is required.
    pub fn sse_algorithm(mut self, input: crate::types::SseAlgorithm) -> Self {
        self.sse_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
    pub fn set_sse_algorithm(mut self, input: ::std::option::Option<crate::types::SseAlgorithm>) -> Self {
        self.sse_algorithm = input;
        self
    }
    /// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
    pub fn get_sse_algorithm(&self) -> &::std::option::Option<crate::types::SseAlgorithm> {
        &self.sse_algorithm
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// Consumes the builder and constructs a [`Encryption`](crate::types::Encryption).
    /// This method will fail if any of the following fields are not set:
    /// - [`sse_algorithm`](crate::types::builders::EncryptionBuilder::sse_algorithm)
    pub fn build(self) -> ::std::result::Result<crate::types::Encryption, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Encryption {
            sse_algorithm: self.sse_algorithm.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sse_algorithm",
                    "sse_algorithm was not specified but it is required when building Encryption",
                )
            })?,
            kms_key_arn: self.kms_key_arn,
        })
    }
}