"""paypalserversdk.

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

# ruff: noqa: E501

class VaultStatus(object):
    """Implementation of the 'Vault Status' enum.

    The vault status.

    Attributes:
        VAULTED: The payment source has been saved in your customer's vault. This
            vault status reflects `/v3/vault` status.
        CREATED: DEPRECATED. The payment source has been saved in your customer's
            vault. This status applies to deprecated integration patterns and will
            not be returned for v3/vault integrations.
        APPROVED: Customer has approved the action of saving the specified
            payment_source into their vault. Use v3/vault/payment-tokens with given
            setup_token to save the payment source in the vault

    """

    VAULTED = "VAULTED"

    CREATED = "CREATED"

    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
