"""paypalserversdk.

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

# ruff: noqa: E501

class EciFlag(object):
    """Implementation of the 'ECI Flag' enum.

    Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data elements
    that indicate the transaction was processed electronically. This should be passed
    on the authorization transaction to the Gateway/Processor.

    Attributes:
        MASTERCARD_NON_3D_SECURE_TRANSACTION: Mastercard non-3-D Secure transaction.
        MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION: Mastercard attempted
            authentication transaction.
        MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION: Mastercard fully authenticated
            transaction.
        FULLY_AUTHENTICATED_TRANSACTION: VISA, AMEX, JCB, DINERS CLUB fully
            authenticated transaction.
        ATTEMPTED_AUTHENTICATION_TRANSACTION: VISA, AMEX, JCB, DINERS CLUB attempted
            authentication transaction.
        NON_3D_SECURE_TRANSACTION: VISA, AMEX, JCB, DINERS CLUB non-3-D Secure
            transaction.

    """

    MASTERCARD_NON_3D_SECURE_TRANSACTION = "MASTERCARD_NON_3D_SECURE_TRANSACTION"

    MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION = "MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION" # noqa: E501

    MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION = "MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION" # noqa: E501

    FULLY_AUTHENTICATED_TRANSACTION = "FULLY_AUTHENTICATED_TRANSACTION"

    ATTEMPTED_AUTHENTICATION_TRANSACTION = "ATTEMPTED_AUTHENTICATION_TRANSACTION"

    NON_3D_SECURE_TRANSACTION = "NON_3D_SECURE_TRANSACTION"

    @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
