aws-sdk-snowdevicemanagement 1.78.0

AWS SDK for AWS Snow Device Management
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The command given to the device to execute.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Command {
    /// <p>Reboots the device.</p>
    Reboot(crate::types::Reboot),
    /// <p>Unlocks the device.</p>
    Unlock(crate::types::Unlock),
    /// 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 Command {
    /// Tries to convert the enum instance into [`Reboot`](crate::types::Command::Reboot), extracting the inner [`Reboot`](crate::types::Reboot).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_reboot(&self) -> ::std::result::Result<&crate::types::Reboot, &Self> {
        if let Command::Reboot(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`Reboot`](crate::types::Command::Reboot).
    pub fn is_reboot(&self) -> bool {
        self.as_reboot().is_ok()
    }
    /// Tries to convert the enum instance into [`Unlock`](crate::types::Command::Unlock), extracting the inner [`Unlock`](crate::types::Unlock).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_unlock(&self) -> ::std::result::Result<&crate::types::Unlock, &Self> {
        if let Command::Unlock(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`Unlock`](crate::types::Command::Unlock).
    pub fn is_unlock(&self) -> bool {
        self.as_unlock().is_ok()
    }
    /// Returns true if the enum instance is the `Unknown` variant.
    pub fn is_unknown(&self) -> bool {
        matches!(self, Self::Unknown)
    }
}