// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The updated server-side encryption type for this object. The <code>UpdateObjectEncryption</code> operation supports the SSE-S3 and SSE-KMS encryption types.</p>
/// <p>Valid Values: <code>SSES3</code> | <code>SSEKMS</code></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum ObjectEncryption {
    /// <p>Specifies to update the object encryption type to server-side encryption with Key Management Service (KMS) keys (SSE-KMS).</p>
    Ssekms(crate::types::SsekmsEncryption),
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
    /// An unknown enum variant
    ///
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
    #[non_exhaustive]
    Unknown,
}
impl ObjectEncryption {
    #[allow(irrefutable_let_patterns)]
    /// Tries to convert the enum instance into [`Ssekms`](crate::types::ObjectEncryption::Ssekms), extracting the inner [`SsekmsEncryption`](crate::types::SsekmsEncryption).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_ssekms(&self) -> ::std::result::Result<&crate::types::SsekmsEncryption, &Self> {
        if let ObjectEncryption::Ssekms(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`Ssekms`](crate::types::ObjectEncryption::Ssekms).
    pub fn is_ssekms(&self) -> bool {
        self.as_ssekms().is_ok()
    }
    /// Returns true if the enum instance is the `Unknown` variant.
    pub fn is_unknown(&self) -> bool {
        matches!(self, Self::Unknown)
    }
}
