"""paypalserversdk.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501

class CardBrand(object):
    """Implementation of the 'Card Brand' enum.

    The card network or brand. Applies to credit, debit, gift, and payment cards.

    Attributes:
        VISA: Visa card.
        MASTERCARD: Mastercard card.
        DISCOVER: Discover card.
        AMEX: American Express card.
        SOLO: Solo debit card.
        JCB: Japan Credit Bureau card.
        STAR: Military Star card.
        DELTA: Delta Airlines card.
        SWITCH: Switch credit card.
        MAESTRO: Maestro credit card.
        CB_NATIONALE: Carte Bancaire (CB) credit card.
        CONFIGOGA: Configoga credit card.
        CONFIDIS: Confidis credit card.
        ELECTRON: Visa Electron credit card.
        CETELEM: Cetelem credit card.
        CHINA_UNION_PAY: China union pay credit card.
        DINERS: The Diners Club International banking and payment services capability
            network owned by Discover Financial Services (DFS), one of the most
            recognized brands in US financial services.
        ELO: The Brazilian Elo card payment network.
        HIPER: The Hiper - Ingenico ePayment network.
        HIPERCARD: The Brazilian Hipercard payment network that's widely accepted in
            the retail market.
        RUPAY: The RuPay payment network.
        GE: The GE Credit Union 3Point card payment network.
        SYNCHRONY: The Synchrony Financial (SYF) payment network.
        EFTPOS: The Electronic Fund Transfer At Point of Sale(EFTPOS) Debit card
            payment network.
        CARTE_BANCAIRE: The Carte Bancaire payment network.
        STAR_ACCESS: The Star Access payment network.
        PULSE: The Pulse payment network.
        NYCE: The NYCE payment network.
        ACCEL: The Accel payment network.
        UNKNOWN: UNKNOWN payment network.

    """

    VISA = "VISA"

    MASTERCARD = "MASTERCARD"

    DISCOVER = "DISCOVER"

    AMEX = "AMEX"

    SOLO = "SOLO"

    JCB = "JCB"

    STAR = "STAR"

    DELTA = "DELTA"

    SWITCH = "SWITCH"

    MAESTRO = "MAESTRO"

    CB_NATIONALE = "CB_NATIONALE"

    CONFIGOGA = "CONFIGOGA"

    CONFIDIS = "CONFIDIS"

    ELECTRON = "ELECTRON"

    CETELEM = "CETELEM"

    CHINA_UNION_PAY = "CHINA_UNION_PAY"

    DINERS = "DINERS"

    ELO = "ELO"

    HIPER = "HIPER"

    HIPERCARD = "HIPERCARD"

    RUPAY = "RUPAY"

    GE = "GE"

    SYNCHRONY = "SYNCHRONY"

    EFTPOS = "EFTPOS"

    CARTE_BANCAIRE = "CARTE_BANCAIRE"

    STAR_ACCESS = "STAR_ACCESS"

    PULSE = "PULSE"

    NYCE = "NYCE"

    ACCEL = "ACCEL"

    UNKNOWN = "UNKNOWN"

    @classmethod
    def from_value(cls, value, default=None):
        """Return the matching enum value for the given input."""
        if value is None:
            return default

        # If numeric and matches directly
        if isinstance(value, int):
            for name, val in cls.__dict__.items():
                if not name.startswith("_") and val == value:
                    return val

        # If string, perform case-insensitive match
        if isinstance(value, str):
            value_lower = value.lower()
            for name, val in cls.__dict__.items():
                if not name.startswith("_") and (
                    name.lower() == value_lower or str(val).lower() == value_lower
                ):
                    return val

        # Fallback to default
        return default
