"""paypalserversdk.

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

# ruff: noqa: E501

class VenmoWalletExperienceContextUserAction(object):
    """Implementation of the 'Venmo Wallet Experience Context User Action' enum.

    Configures a Continue or Pay Now checkout flow.

    Attributes:
        CONTINUE: After you redirect the customer to the Venmo payment page, a
            Continue button appears. Use this option when the final amount is not
            known when the checkout flow is initiated and you want to redirect the
            customer to the merchant page without processing the payment.
        PAY_NOW: After you redirect the customer to the Venmo payment page, a Pay Now
            button appears. Use this option when the final amount is known when the
            checkout is initiated and you want to process the payment immediately
            when the customer clicks Pay Now.

    """

    CONTINUE = "CONTINUE"

    PAY_NOW = "PAY_NOW"

    @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
