aws-sdk-iotfleetwise 1.106.0

AWS SDK for AWS IoT FleetWise
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, ::std::fmt::Debug)]
pub struct GetEncryptionConfigurationOutput {
    /// <p>The ID of the KMS key that is used for encryption.</p>
    pub kms_key_id: ::std::option::Option<::std::string::String>,
    /// <p>The encryption status.</p>
    pub encryption_status: crate::types::EncryptionStatus,
    /// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use a KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
    pub encryption_type: crate::types::EncryptionType,
    /// <p>The error message that describes why encryption settings couldn't be configured, if applicable.</p>
    pub error_message: ::std::option::Option<::std::string::String>,
    /// <p>The time when encryption was configured in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when encryption was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEncryptionConfigurationOutput {
    /// <p>The ID of the KMS key that is used for encryption.</p>
    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
    /// <p>The encryption status.</p>
    pub fn encryption_status(&self) -> &crate::types::EncryptionStatus {
        &self.encryption_status
    }
    /// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use a KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
    pub fn encryption_type(&self) -> &crate::types::EncryptionType {
        &self.encryption_type
    }
    /// <p>The error message that describes why encryption settings couldn't be configured, if applicable.</p>
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// <p>The time when encryption was configured in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The time when encryption was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn last_modification_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modification_time.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetEncryptionConfigurationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEncryptionConfigurationOutput {
    /// Creates a new builder-style object to manufacture [`GetEncryptionConfigurationOutput`](crate::operation::get_encryption_configuration::GetEncryptionConfigurationOutput).
    pub fn builder() -> crate::operation::get_encryption_configuration::builders::GetEncryptionConfigurationOutputBuilder {
        crate::operation::get_encryption_configuration::builders::GetEncryptionConfigurationOutputBuilder::default()
    }
}

/// A builder for [`GetEncryptionConfigurationOutput`](crate::operation::get_encryption_configuration::GetEncryptionConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEncryptionConfigurationOutputBuilder {
    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
    pub(crate) encryption_status: ::std::option::Option<crate::types::EncryptionStatus>,
    pub(crate) encryption_type: ::std::option::Option<crate::types::EncryptionType>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEncryptionConfigurationOutputBuilder {
    /// <p>The ID of the KMS key that is used for encryption.</p>
    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the KMS key that is used for encryption.</p>
    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// <p>The ID of the KMS key that is used for encryption.</p>
    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_id
    }
    /// <p>The encryption status.</p>
    /// This field is required.
    pub fn encryption_status(mut self, input: crate::types::EncryptionStatus) -> Self {
        self.encryption_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The encryption status.</p>
    pub fn set_encryption_status(mut self, input: ::std::option::Option<crate::types::EncryptionStatus>) -> Self {
        self.encryption_status = input;
        self
    }
    /// <p>The encryption status.</p>
    pub fn get_encryption_status(&self) -> &::std::option::Option<crate::types::EncryptionStatus> {
        &self.encryption_status
    }
    /// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use a KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
    /// This field is required.
    pub fn encryption_type(mut self, input: crate::types::EncryptionType) -> Self {
        self.encryption_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use a KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
    pub fn set_encryption_type(mut self, input: ::std::option::Option<crate::types::EncryptionType>) -> Self {
        self.encryption_type = input;
        self
    }
    /// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use a KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
    pub fn get_encryption_type(&self) -> &::std::option::Option<crate::types::EncryptionType> {
        &self.encryption_type
    }
    /// <p>The error message that describes why encryption settings couldn't be configured, if applicable.</p>
    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The error message that describes why encryption settings couldn't be configured, if applicable.</p>
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// <p>The error message that describes why encryption settings couldn't be configured, if applicable.</p>
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// <p>The time when encryption was configured in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when encryption was configured in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The time when encryption was configured in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The time when encryption was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn last_modification_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modification_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when encryption was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn set_last_modification_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modification_time = input;
        self
    }
    /// <p>The time when encryption was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
    pub fn get_last_modification_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modification_time
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetEncryptionConfigurationOutput`](crate::operation::get_encryption_configuration::GetEncryptionConfigurationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`encryption_status`](crate::operation::get_encryption_configuration::builders::GetEncryptionConfigurationOutputBuilder::encryption_status)
    /// - [`encryption_type`](crate::operation::get_encryption_configuration::builders::GetEncryptionConfigurationOutputBuilder::encryption_type)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_encryption_configuration::GetEncryptionConfigurationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::get_encryption_configuration::GetEncryptionConfigurationOutput {
            kms_key_id: self.kms_key_id,
            encryption_status: self.encryption_status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "encryption_status",
                    "encryption_status was not specified but it is required when building GetEncryptionConfigurationOutput",
                )
            })?,
            encryption_type: self.encryption_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "encryption_type",
                    "encryption_type was not specified but it is required when building GetEncryptionConfigurationOutput",
                )
            })?,
            error_message: self.error_message,
            creation_time: self.creation_time,
            last_modification_time: self.last_modification_time,
            _request_id: self._request_id,
        })
    }
}