#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EAppCloudStatus {
    Invalid = 0,
    Disabled = 1,
    Unknown = 2,
    Synchronized = 3,
    Checking = 4,
    OutOfSync = 5,
    Uploading = 6,
    Downloading = 7,
    SyncFailed = 8,
    Conflict = 9,
    PendingElsewhere = 10,
}

impl EAppCloudStatus {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::Disabled as i32 => Some(Self::Disabled),
            x if x == Self::Unknown as i32 => Some(Self::Unknown),
            x if x == Self::Synchronized as i32 => Some(Self::Synchronized),
            x if x == Self::Checking as i32 => Some(Self::Checking),
            x if x == Self::OutOfSync as i32 => Some(Self::OutOfSync),
            x if x == Self::Uploading as i32 => Some(Self::Uploading),
            x if x == Self::Downloading as i32 => Some(Self::Downloading),
            x if x == Self::SyncFailed as i32 => Some(Self::SyncFailed),
            x if x == Self::Conflict as i32 => Some(Self::Conflict),
            x if x == Self::PendingElsewhere as i32 => Some(Self::PendingElsewhere),
            _ => None,
        }
    }
}
