#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EChatActionResult {
    Success = 1,
    Error = 2,
    NotPermitted = 3,
    NotAllowedOnClanMember = 4,
    NotAllowedOnBannedUser = 5,
    NotAllowedOnChatOwner = 6,
    NotAllowedOnSelf = 7,
    ChatDoesntExist = 8,
    ChatFull = 9,
    VoiceSlotsFull = 10,
}

impl EChatActionResult {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Success as i32 => Some(Self::Success),
            x if x == Self::Error as i32 => Some(Self::Error),
            x if x == Self::NotPermitted as i32 => Some(Self::NotPermitted),
            x if x == Self::NotAllowedOnClanMember as i32 => Some(Self::NotAllowedOnClanMember),
            x if x == Self::NotAllowedOnBannedUser as i32 => Some(Self::NotAllowedOnBannedUser),
            x if x == Self::NotAllowedOnChatOwner as i32 => Some(Self::NotAllowedOnChatOwner),
            x if x == Self::NotAllowedOnSelf as i32 => Some(Self::NotAllowedOnSelf),
            x if x == Self::ChatDoesntExist as i32 => Some(Self::ChatDoesntExist),
            x if x == Self::ChatFull as i32 => Some(Self::ChatFull),
            x if x == Self::VoiceSlotsFull as i32 => Some(Self::VoiceSlotsFull),
            _ => None,
        }
    }
}
