#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EChatRoomMemberStateChange {
    Invalid = 0,
    Joined = 1,
    Parted = 2,
    Kicked = 3,
    Invited = 4,
    RankChanged = 7,
    InviteDismissed = 8,
    Muted = 9,
    Banned = 10,
    RolesChanged = 12,
}

impl EChatRoomMemberStateChange {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::Joined as i32 => Some(Self::Joined),
            x if x == Self::Parted as i32 => Some(Self::Parted),
            x if x == Self::Kicked as i32 => Some(Self::Kicked),
            x if x == Self::Invited as i32 => Some(Self::Invited),
            x if x == Self::RankChanged as i32 => Some(Self::RankChanged),
            x if x == Self::InviteDismissed as i32 => Some(Self::InviteDismissed),
            x if x == Self::Muted as i32 => Some(Self::Muted),
            x if x == Self::Banned as i32 => Some(Self::Banned),
            x if x == Self::RolesChanged as i32 => Some(Self::RolesChanged),
            _ => None,
        }
    }
}
