"""paypalserversdk.

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

# ruff: noqa: E501

class GooglePayAuthenticationMethod(object):
    """Implementation of the 'Google Pay Authentication Method' enum.

    Authentication Method which is used for the card transaction.

    Attributes:
        PAN_ONLY: This authentication method is associated with payment cards stored
            on file with the user's Google Account. Returned payment data includes
            primary account number (PAN) with the expiration month and the expiration
            year.
        CRYPTOGRAM_3DS: Returned payment data includes a 3-D Secure (3DS) cryptogram
            generated on the device. -> If authentication_method=CRYPTOGRAM, it is
            required that 'cryptogram' parameter in the request has a valid 3-D
            Secure (3DS) cryptogram generated on the device.

    """

    PAN_ONLY = "PAN_ONLY"

    CRYPTOGRAM_3DS = "CRYPTOGRAM_3DS"

    @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
