steam-enums 0.1.2

Steam protocol enumerations (EResult, EMsg, EAccountType, etc.) for Rust.
Documentation
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EPurchaseResultDetail {
    NoDetail = 0,
    AVSFailure = 1,
    InsufficientFunds = 2,
    ContactSupport = 3,
    Timeout = 4,
    InvalidPackage = 5,
    InvalidPaymentMethod = 6,
    InvalidData = 7,
    OthersInProgress = 8,
    AlreadyPurchased = 9,
    WrongPrice = 10,
    FraudCheckFailed = 11,
    CancelledByUser = 12,
    RestrictedCountry = 13,
    BadActivationCode = 14,
    DuplicateActivationCode = 15,
    UseOtherPaymentMethod = 16,
    UseOtherFunctionSource = 17,
    InvalidShippingAddress = 18,
    RegionNotSupported = 19,
    AcctIsBlocked = 20,
    AcctNotVerified = 21,
    InvalidAccount = 22,
    StoreBillingCountryMismatch = 23,
    DoesNotOwnRequiredApp = 24,
    CanceledByNewTransaction = 25,
    ForceCanceledPending = 26,
    FailCurrencyTransProvider = 27,
    FailedCyberCafe = 28,
    NeedsPreApproval = 29,
    PreApprovalDenied = 30,
    WalletCurrencyMismatch = 31,
    EmailNotValidated = 32,
    ExpiredCard = 33,
    TransactionExpired = 34,
    WouldExceedMaxWallet = 35,
    MustLoginPS3AppForPurchase = 36,
    CannotShipToPOBox = 37,
    InsufficientInventory = 38,
    CannotGiftShippedGoods = 39,
    CannotShipInternationally = 40,
    BillingAgreementCancelled = 41,
    InvalidCoupon = 42,
    ExpiredCoupon = 43,
    AccountLocked = 44,
    OtherAbortableInProgress = 45,
    ExceededSteamLimit = 46,
    OverlappingPackagesInCart = 47,
    NoWallet = 48,
    NoCachedPaymentMethod = 49,
    CannotRedeemCodeFromClient = 50,
    PurchaseAmountNoSupportedByProvider = 51,
    OverlappingPackagesInPendingTransaction = 52,
    RateLimited = 53,
    OwnsExcludedApp = 54,
    CreditCardBinMismatchesType = 55,
    CartValueTooHigh = 56,
    BillingAgreementAlreadyExists = 57,
    POSACodeNotActivated = 58,
    CannotShipToCountry = 59,
    HungTransactionCancelled = 60,
    PaypalInternalError = 61,
    UnknownGlobalCollectError = 62,
    InvalidTaxAddress = 63,
    PhysicalProductLimitExceeded = 64,
    PurchaseCannotBeReplayed = 65,
    DelayedCompletion = 66,
    BundleTypeCannotBeGifted = 67,
    BlockedByUSGov = 68,
    ItemsReservedForCommercialUse = 69,
    GiftAlreadyOwned = 70,
    GiftInvalidForRecipientRegion = 71,
    GiftPricingImbalance = 72,
    GiftRecipientNotSpecified = 73,
    ItemsNotAllowedForCommercialUse = 74,
    BusinessStoreCountryCodeMismatch = 75,
    UserAssociatedWithManyCafes = 76,
    UserNotAssociatedWithCafe = 77,
    AddressInvalid = 78,
    CreditCardNumberInvalid = 79,
    CannotShipToMilitaryPostOffice = 80,
    BillingNameInvalidResemblesCreditCard = 81,
    PaymentMethodTemporarilyUnavailable = 82,
    PaymentMethodNotSupportedForProduct = 83,
}

impl EPurchaseResultDetail {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::NoDetail as i32 => Some(Self::NoDetail),
            x if x == Self::AVSFailure as i32 => Some(Self::AVSFailure),
            x if x == Self::InsufficientFunds as i32 => Some(Self::InsufficientFunds),
            x if x == Self::ContactSupport as i32 => Some(Self::ContactSupport),
            x if x == Self::Timeout as i32 => Some(Self::Timeout),
            x if x == Self::InvalidPackage as i32 => Some(Self::InvalidPackage),
            x if x == Self::InvalidPaymentMethod as i32 => Some(Self::InvalidPaymentMethod),
            x if x == Self::InvalidData as i32 => Some(Self::InvalidData),
            x if x == Self::OthersInProgress as i32 => Some(Self::OthersInProgress),
            x if x == Self::AlreadyPurchased as i32 => Some(Self::AlreadyPurchased),
            x if x == Self::WrongPrice as i32 => Some(Self::WrongPrice),
            x if x == Self::FraudCheckFailed as i32 => Some(Self::FraudCheckFailed),
            x if x == Self::CancelledByUser as i32 => Some(Self::CancelledByUser),
            x if x == Self::RestrictedCountry as i32 => Some(Self::RestrictedCountry),
            x if x == Self::BadActivationCode as i32 => Some(Self::BadActivationCode),
            x if x == Self::DuplicateActivationCode as i32 => Some(Self::DuplicateActivationCode),
            x if x == Self::UseOtherPaymentMethod as i32 => Some(Self::UseOtherPaymentMethod),
            x if x == Self::UseOtherFunctionSource as i32 => Some(Self::UseOtherFunctionSource),
            x if x == Self::InvalidShippingAddress as i32 => Some(Self::InvalidShippingAddress),
            x if x == Self::RegionNotSupported as i32 => Some(Self::RegionNotSupported),
            x if x == Self::AcctIsBlocked as i32 => Some(Self::AcctIsBlocked),
            x if x == Self::AcctNotVerified as i32 => Some(Self::AcctNotVerified),
            x if x == Self::InvalidAccount as i32 => Some(Self::InvalidAccount),
            x if x == Self::StoreBillingCountryMismatch as i32 => Some(Self::StoreBillingCountryMismatch),
            x if x == Self::DoesNotOwnRequiredApp as i32 => Some(Self::DoesNotOwnRequiredApp),
            x if x == Self::CanceledByNewTransaction as i32 => Some(Self::CanceledByNewTransaction),
            x if x == Self::ForceCanceledPending as i32 => Some(Self::ForceCanceledPending),
            x if x == Self::FailCurrencyTransProvider as i32 => Some(Self::FailCurrencyTransProvider),
            x if x == Self::FailedCyberCafe as i32 => Some(Self::FailedCyberCafe),
            x if x == Self::NeedsPreApproval as i32 => Some(Self::NeedsPreApproval),
            x if x == Self::PreApprovalDenied as i32 => Some(Self::PreApprovalDenied),
            x if x == Self::WalletCurrencyMismatch as i32 => Some(Self::WalletCurrencyMismatch),
            x if x == Self::EmailNotValidated as i32 => Some(Self::EmailNotValidated),
            x if x == Self::ExpiredCard as i32 => Some(Self::ExpiredCard),
            x if x == Self::TransactionExpired as i32 => Some(Self::TransactionExpired),
            x if x == Self::WouldExceedMaxWallet as i32 => Some(Self::WouldExceedMaxWallet),
            x if x == Self::MustLoginPS3AppForPurchase as i32 => Some(Self::MustLoginPS3AppForPurchase),
            x if x == Self::CannotShipToPOBox as i32 => Some(Self::CannotShipToPOBox),
            x if x == Self::InsufficientInventory as i32 => Some(Self::InsufficientInventory),
            x if x == Self::CannotGiftShippedGoods as i32 => Some(Self::CannotGiftShippedGoods),
            x if x == Self::CannotShipInternationally as i32 => Some(Self::CannotShipInternationally),
            x if x == Self::BillingAgreementCancelled as i32 => Some(Self::BillingAgreementCancelled),
            x if x == Self::InvalidCoupon as i32 => Some(Self::InvalidCoupon),
            x if x == Self::ExpiredCoupon as i32 => Some(Self::ExpiredCoupon),
            x if x == Self::AccountLocked as i32 => Some(Self::AccountLocked),
            x if x == Self::OtherAbortableInProgress as i32 => Some(Self::OtherAbortableInProgress),
            x if x == Self::ExceededSteamLimit as i32 => Some(Self::ExceededSteamLimit),
            x if x == Self::OverlappingPackagesInCart as i32 => Some(Self::OverlappingPackagesInCart),
            x if x == Self::NoWallet as i32 => Some(Self::NoWallet),
            x if x == Self::NoCachedPaymentMethod as i32 => Some(Self::NoCachedPaymentMethod),
            x if x == Self::CannotRedeemCodeFromClient as i32 => Some(Self::CannotRedeemCodeFromClient),
            x if x == Self::PurchaseAmountNoSupportedByProvider as i32 => Some(Self::PurchaseAmountNoSupportedByProvider),
            x if x == Self::OverlappingPackagesInPendingTransaction as i32 => Some(Self::OverlappingPackagesInPendingTransaction),
            x if x == Self::RateLimited as i32 => Some(Self::RateLimited),
            x if x == Self::OwnsExcludedApp as i32 => Some(Self::OwnsExcludedApp),
            x if x == Self::CreditCardBinMismatchesType as i32 => Some(Self::CreditCardBinMismatchesType),
            x if x == Self::CartValueTooHigh as i32 => Some(Self::CartValueTooHigh),
            x if x == Self::BillingAgreementAlreadyExists as i32 => Some(Self::BillingAgreementAlreadyExists),
            x if x == Self::POSACodeNotActivated as i32 => Some(Self::POSACodeNotActivated),
            x if x == Self::CannotShipToCountry as i32 => Some(Self::CannotShipToCountry),
            x if x == Self::HungTransactionCancelled as i32 => Some(Self::HungTransactionCancelled),
            x if x == Self::PaypalInternalError as i32 => Some(Self::PaypalInternalError),
            x if x == Self::UnknownGlobalCollectError as i32 => Some(Self::UnknownGlobalCollectError),
            x if x == Self::InvalidTaxAddress as i32 => Some(Self::InvalidTaxAddress),
            x if x == Self::PhysicalProductLimitExceeded as i32 => Some(Self::PhysicalProductLimitExceeded),
            x if x == Self::PurchaseCannotBeReplayed as i32 => Some(Self::PurchaseCannotBeReplayed),
            x if x == Self::DelayedCompletion as i32 => Some(Self::DelayedCompletion),
            x if x == Self::BundleTypeCannotBeGifted as i32 => Some(Self::BundleTypeCannotBeGifted),
            x if x == Self::BlockedByUSGov as i32 => Some(Self::BlockedByUSGov),
            x if x == Self::ItemsReservedForCommercialUse as i32 => Some(Self::ItemsReservedForCommercialUse),
            x if x == Self::GiftAlreadyOwned as i32 => Some(Self::GiftAlreadyOwned),
            x if x == Self::GiftInvalidForRecipientRegion as i32 => Some(Self::GiftInvalidForRecipientRegion),
            x if x == Self::GiftPricingImbalance as i32 => Some(Self::GiftPricingImbalance),
            x if x == Self::GiftRecipientNotSpecified as i32 => Some(Self::GiftRecipientNotSpecified),
            x if x == Self::ItemsNotAllowedForCommercialUse as i32 => Some(Self::ItemsNotAllowedForCommercialUse),
            x if x == Self::BusinessStoreCountryCodeMismatch as i32 => Some(Self::BusinessStoreCountryCodeMismatch),
            x if x == Self::UserAssociatedWithManyCafes as i32 => Some(Self::UserAssociatedWithManyCafes),
            x if x == Self::UserNotAssociatedWithCafe as i32 => Some(Self::UserNotAssociatedWithCafe),
            x if x == Self::AddressInvalid as i32 => Some(Self::AddressInvalid),
            x if x == Self::CreditCardNumberInvalid as i32 => Some(Self::CreditCardNumberInvalid),
            x if x == Self::CannotShipToMilitaryPostOffice as i32 => Some(Self::CannotShipToMilitaryPostOffice),
            x if x == Self::BillingNameInvalidResemblesCreditCard as i32 => Some(Self::BillingNameInvalidResemblesCreditCard),
            x if x == Self::PaymentMethodTemporarilyUnavailable as i32 => Some(Self::PaymentMethodTemporarilyUnavailable),
            x if x == Self::PaymentMethodNotSupportedForProduct as i32 => Some(Self::PaymentMethodNotSupportedForProduct),
            _ => None,
        }
    }
}