"""paypalserversdk.

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

# ruff: noqa: E501

class ExperienceStatus(object):
    """Implementation of the 'Experience Status' enum.

    This field indicates the status of PayPal's Checkout experience throughout the
    order lifecycle. The values reflect the current stage of the checkout process.

    Attributes:
        NOT_STARTED: PayPal checkout process has not yet begun.
        IN_PROGRESS: PayPal checkout initiated. User is on the checkout page for
            order review before approval.
        CANCELED: PayPal checkout is canceled (by closing the checkout window or
            clicking cancel) before the order approval.
        APPROVED: Order is approved. User has completed the checkout process.

    """

    NOT_STARTED = "NOT_STARTED"

    IN_PROGRESS = "IN_PROGRESS"

    CANCELED = "CANCELED"

    APPROVED = "APPROVED"

    @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
