#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EAuthSessionGuardType {
    Unknown = 0,
    None = 1,
    EmailCode = 2,
    DeviceCode = 3,
    DeviceConfirmation = 4,
    EmailConfirmation = 5,
    MachineToken = 6,
    LegacyMachineAuth = 7,
}

impl EAuthSessionGuardType {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Unknown as i32 => Some(Self::Unknown),
            x if x == Self::None as i32 => Some(Self::None),
            x if x == Self::EmailCode as i32 => Some(Self::EmailCode),
            x if x == Self::DeviceCode as i32 => Some(Self::DeviceCode),
            x if x == Self::DeviceConfirmation as i32 => Some(Self::DeviceConfirmation),
            x if x == Self::EmailConfirmation as i32 => Some(Self::EmailConfirmation),
            x if x == Self::MachineToken as i32 => Some(Self::MachineToken),
            x if x == Self::LegacyMachineAuth as i32 => Some(Self::LegacyMachineAuth),
            _ => None,
        }
    }
}
