#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum ESOMsg {
    Create = 21,
    Update = 22,
    Destroy = 23,
    CacheSubscribed = 24,
    CacheUnsubscribed = 25,
    UpdateMultiple = 26,
    CacheSubscriptionCheck = 27,
    CacheSubscriptionRefresh = 28,
}

impl ESOMsg {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Create as i32 => Some(Self::Create),
            x if x == Self::Update as i32 => Some(Self::Update),
            x if x == Self::Destroy as i32 => Some(Self::Destroy),
            x if x == Self::CacheSubscribed as i32 => Some(Self::CacheSubscribed),
            x if x == Self::CacheUnsubscribed as i32 => Some(Self::CacheUnsubscribed),
            x if x == Self::UpdateMultiple as i32 => Some(Self::UpdateMultiple),
            x if x == Self::CacheSubscriptionCheck as i32 => Some(Self::CacheSubscriptionCheck),
            x if x == Self::CacheSubscriptionRefresh as i32 => Some(Self::CacheSubscriptionRefresh),
            _ => None,
        }
    }
}
