"""paypalserversdk.

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

# ruff: noqa: E501

class OrderApplicationContextLandingPage(object):
    """Implementation of the 'Order Application Context Landing Page' enum.

    DEPRECATED. DEPRECATED. The type of landing page to show on the PayPal site for
    customer checkout.  The fields in `application_context` are now available in the
    `experience_context` object under the `payment_source` which supports them (eg.
    `payment_source.paypal.experience_context.landing_page`). Please specify this
    field in the `experience_context` object instead of the `application_context`
    object.

    Attributes:
        LOGIN: When the customer clicks PayPal Checkout, the customer is redirected
            to a page to log in to PayPal and approve the payment.
        BILLING: 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.
        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.

    """

    LOGIN = "LOGIN"

    BILLING = "BILLING"

    NO_PREFERENCE = "NO_PREFERENCE"

    @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
