#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EBillingType {
    NoCost = 0,
    BillOnceOnly = 1,
    BillMonthly = 2,
    ProofOfPrepurchaseOnly = 3,
    GuestPass = 4,
    HardwarePromo = 5,
    Gift = 6,
    AutoGrant = 7,
    OEMTicket = 8,
    RecurringOption = 9,
    BillOnceOrCDKey = 10,
    Repurchaseable = 11,
    FreeOnDemand = 12,
    Rental = 13,
    CommercialLicense = 14,
    FreeCommercialLicense = 15,
    NumBillingTypes = 16,
}

impl EBillingType {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::NoCost as i32 => Some(Self::NoCost),
            x if x == Self::BillOnceOnly as i32 => Some(Self::BillOnceOnly),
            x if x == Self::BillMonthly as i32 => Some(Self::BillMonthly),
            x if x == Self::ProofOfPrepurchaseOnly as i32 => Some(Self::ProofOfPrepurchaseOnly),
            x if x == Self::GuestPass as i32 => Some(Self::GuestPass),
            x if x == Self::HardwarePromo as i32 => Some(Self::HardwarePromo),
            x if x == Self::Gift as i32 => Some(Self::Gift),
            x if x == Self::AutoGrant as i32 => Some(Self::AutoGrant),
            x if x == Self::OEMTicket as i32 => Some(Self::OEMTicket),
            x if x == Self::RecurringOption as i32 => Some(Self::RecurringOption),
            x if x == Self::BillOnceOrCDKey as i32 => Some(Self::BillOnceOrCDKey),
            x if x == Self::Repurchaseable as i32 => Some(Self::Repurchaseable),
            x if x == Self::FreeOnDemand as i32 => Some(Self::FreeOnDemand),
            x if x == Self::Rental as i32 => Some(Self::Rental),
            x if x == Self::CommercialLicense as i32 => Some(Self::CommercialLicense),
            x if x == Self::FreeCommercialLicense as i32 => Some(Self::FreeCommercialLicense),
            x if x == Self::NumBillingTypes as i32 => Some(Self::NumBillingTypes),
            _ => None,
        }
    }
}
