"""cellpointapi.

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

# ruff: noqa: E501

class IdentifyingDocumentType(object):
    """Implementation of the 'IdentifyingDocumentType' enum.

    Identification document types.

    Attributes:
        PASSPORT: The enum member of type str.
        ID_CARD: The enum member of type str.
        DRIVING_LICENSE: The enum member of type str.
        SOCIAL_SECURITY_NUMBER: The enum member of type str.
        TAX_IDENTIFICATION_NUMBER: The enum member of type str.
        NATIONAL_INSURANCE_NUMBER: The enum member of type str.
        NATIONAL_IDENTITY_CARD: The enum member of type str.
        OTHER: The enum member of type str.

    """

    PASSPORT = "PASSPORT"

    ID_CARD = "ID_CARD"

    DRIVING_LICENSE = "DRIVING_LICENSE"

    SOCIAL_SECURITY_NUMBER = "SOCIAL_SECURITY_NUMBER"

    TAX_IDENTIFICATION_NUMBER = "TAX_IDENTIFICATION_NUMBER"

    NATIONAL_INSURANCE_NUMBER = "NATIONAL_INSURANCE_NUMBER"

    NATIONAL_IDENTITY_CARD = "NATIONAL_IDENTITY_CARD"

    OTHER = "OTHER"

    @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
