#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EChatRoomGroupPermissions {
    Default = 0,
    Valid = 1,
    CanInvite = 2,
    CanKick = 4,
    CanBan = 8,
    CanAdminChannel = 16,
}

impl EChatRoomGroupPermissions {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Default as i32 => Some(Self::Default),
            x if x == Self::Valid as i32 => Some(Self::Valid),
            x if x == Self::CanInvite as i32 => Some(Self::CanInvite),
            x if x == Self::CanKick as i32 => Some(Self::CanKick),
            x if x == Self::CanBan as i32 => Some(Self::CanBan),
            x if x == Self::CanAdminChannel as i32 => Some(Self::CanAdminChannel),
            _ => None,
        }
    }
}
