"""paypalserversdk.

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

# ruff: noqa: E501

class SellerProtectionStatus(object):
    """Implementation of the 'Seller Protection Status' enum.

    Indicates whether the transaction is eligible for seller protection. For
    information, see [PayPal Seller Protection for
    Merchants](https://www.paypal.com/us/webapps/mpp/security/seller-protection).

    Attributes:
        ELIGIBLE: Your PayPal balance remains intact if the customer claims that they
            did not receive an item or the account holder claims that they did not
            authorize the payment.
        PARTIALLY_ELIGIBLE: Your PayPal balance remains intact if the customer claims
            that they did not receive an item.
        NOT_ELIGIBLE: This transaction is not eligible for seller protection.

    """

    ELIGIBLE = "ELIGIBLE"

    PARTIALLY_ELIGIBLE = "PARTIALLY_ELIGIBLE"

    NOT_ELIGIBLE = "NOT_ELIGIBLE"

    @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
