"""paypalserversdk.

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

# ruff: noqa: E501

class PaypalExperienceLandingPage(object):
    """Implementation of the 'PayPal Experience Landing Page' enum.

    The type of landing page to show on the PayPal site for customer checkout.

    Attributes:
        LOGIN: When the customer clicks PayPal Checkout, the customer is redirected
            to a page to log in to PayPal and approve the payment.
        GUEST_CHECKOUT: When the customer clicks PayPal Checkout, the customer is
            redirected to a page to enter credit or debit card and other relevant
            billing information required to complete the purchase. This option has
            previously been also called as 'BILLING'
        NO_PREFERENCE: When the customer clicks PayPal Checkout, the customer is
            redirected to either a page to log in to PayPal and approve the payment
            or to a page to enter credit or debit card and other relevant billing
            information required to complete the purchase, depending on their
            previous interaction with PayPal.
        BILLING: DEPRECATED - please use GUEST_CHECKOUT. All implementations of
            'BILLING' will be routed to 'GUEST_CHECKOUT'. When the customer clicks
            PayPal Checkout, the customer is redirected to a page to enter credit or
            debit card and other relevant billing information required to complete
            the purchase.

    """

    LOGIN = "LOGIN"

    GUEST_CHECKOUT = "GUEST_CHECKOUT"

    NO_PREFERENCE = "NO_PREFERENCE"

    BILLING = "BILLING"

    @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
