"""paypalserversdk.

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

# ruff: noqa: E501

class OrderTrackerStatus(object):
    """Implementation of the 'Order Tracker Status' enum.

    The status of the item shipment.

    Attributes:
        CANCELLED: The shipment was cancelled and the tracking number no longer
            applies.
        SHIPPED: The merchant has assigned a tracking number to the items being
            shipped from the Order. This does not correspond to the carrier's actual
            status for the shipment. The latest status of the parcel must be
            retrieved from the carrier.

    """

    CANCELLED = "CANCELLED"

    SHIPPED = "SHIPPED"

    @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
