"""paypalserversdk.

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

# ruff: noqa: E501

class ApplePayPaymentDataType(object):
    """Implementation of the 'Apple Pay Payment Data Type' enum.

    Indicates the type of payment data passed, in case of Non China the payment data
    is 3DSECURE and for China it is EMV.

    Attributes:
        ENUM_3DSECURE: The card was authenticated using 3D Secure (3DS)
            authentication scheme. While using this value make sure to populate
            cryptogram and eci_indicator as part of payment data..
        EMV: The card was authenticated using EMV method, which is applicable for
            China. While using this value make sure to pass emv_data and pin as part
            of payment data.

    """

    ENUM_3DSECURE = "3DSECURE"

    EMV = "EMV"

    @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
