#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum ELicenseFlags {
    None = 0,
    Renew = 0x01,
    RenewalFailed = 0x02,
    Pending = 0x04,
    Expired = 0x08,
    CancelledByUser = 0x10,
    CancelledByAdmin = 0x20,
    LowViolenceContent = 0x40,
    ImportedFromSteam2 = 0x80,
    ForceRunRestriction = 0x100,
    RegionRestrictionExpired = 0x200,
    CancelledByFriendlyFraudLock = 0x400,
    NotActivated = 0x800,
    PendingRefund = 0x2000,
    Borrowed = 0x4000,
    ReleaseStateOverride = 0x8000,
    CancelledByPartner = 0x40000,
    NonPermanent = 0x80000,
    PreferredOwner = 0x100000,
}

impl ELicenseFlags {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::None as i32 => Some(Self::None),
            x if x == Self::Renew as i32 => Some(Self::Renew),
            x if x == Self::RenewalFailed as i32 => Some(Self::RenewalFailed),
            x if x == Self::Pending as i32 => Some(Self::Pending),
            x if x == Self::Expired as i32 => Some(Self::Expired),
            x if x == Self::CancelledByUser as i32 => Some(Self::CancelledByUser),
            x if x == Self::CancelledByAdmin as i32 => Some(Self::CancelledByAdmin),
            x if x == Self::LowViolenceContent as i32 => Some(Self::LowViolenceContent),
            x if x == Self::ImportedFromSteam2 as i32 => Some(Self::ImportedFromSteam2),
            x if x == Self::ForceRunRestriction as i32 => Some(Self::ForceRunRestriction),
            x if x == Self::RegionRestrictionExpired as i32 => Some(Self::RegionRestrictionExpired),
            x if x == Self::CancelledByFriendlyFraudLock as i32 => Some(Self::CancelledByFriendlyFraudLock),
            x if x == Self::NotActivated as i32 => Some(Self::NotActivated),
            x if x == Self::PendingRefund as i32 => Some(Self::PendingRefund),
            x if x == Self::Borrowed as i32 => Some(Self::Borrowed),
            x if x == Self::ReleaseStateOverride as i32 => Some(Self::ReleaseStateOverride),
            x if x == Self::CancelledByPartner as i32 => Some(Self::CancelledByPartner),
            x if x == Self::NonPermanent as i32 => Some(Self::NonPermanent),
            x if x == Self::PreferredOwner as i32 => Some(Self::PreferredOwner),
            _ => None,
        }
    }
}
