aws-sdk-mgn 1.101.0

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

/// <p>A checksum structure used to verify data integrity.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Checksum {
    /// <p>The encryption algorithm used to generate the checksum.</p>
    pub encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithm>,
    /// <p>The hash value of the checksum.</p>
    pub hash: ::std::option::Option<::std::string::String>,
}
impl Checksum {
    /// <p>The encryption algorithm used to generate the checksum.</p>
    pub fn encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithm> {
        self.encryption_algorithm.as_ref()
    }
    /// <p>The hash value of the checksum.</p>
    pub fn hash(&self) -> ::std::option::Option<&str> {
        self.hash.as_deref()
    }
}
impl Checksum {
    /// Creates a new builder-style object to manufacture [`Checksum`](crate::types::Checksum).
    pub fn builder() -> crate::types::builders::ChecksumBuilder {
        crate::types::builders::ChecksumBuilder::default()
    }
}

/// A builder for [`Checksum`](crate::types::Checksum).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ChecksumBuilder {
    pub(crate) encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithm>,
    pub(crate) hash: ::std::option::Option<::std::string::String>,
}
impl ChecksumBuilder {
    /// <p>The encryption algorithm used to generate the checksum.</p>
    pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithm) -> Self {
        self.encryption_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// <p>The encryption algorithm used to generate the checksum.</p>
    pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithm>) -> Self {
        self.encryption_algorithm = input;
        self
    }
    /// <p>The encryption algorithm used to generate the checksum.</p>
    pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithm> {
        &self.encryption_algorithm
    }
    /// <p>The hash value of the checksum.</p>
    pub fn hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hash = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The hash value of the checksum.</p>
    pub fn set_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hash = input;
        self
    }
    /// <p>The hash value of the checksum.</p>
    pub fn get_hash(&self) -> &::std::option::Option<::std::string::String> {
        &self.hash
    }
    /// Consumes the builder and constructs a [`Checksum`](crate::types::Checksum).
    pub fn build(self) -> crate::types::Checksum {
        crate::types::Checksum {
            encryption_algorithm: self.encryption_algorithm,
            hash: self.hash,
        }
    }
}