"""mindbodypublicapi.

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

# ruff: noqa: E501

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

    Attributes:
        SUNDAY: The enum member of type str.
        MONDAY: The enum member of type str.
        TUESDAY: The enum member of type str.
        WEDNESDAY: The enum member of type str.
        THURSDAY: The enum member of type str.
        FRIDAY: The enum member of type str.
        SATURDAY: The enum member of type str.

    """

    SUNDAY = "Sunday"

    MONDAY = "Monday"

    TUESDAY = "Tuesday"

    WEDNESDAY = "Wednesday"

    THURSDAY = "Thursday"

    FRIDAY = "Friday"

    SATURDAY = "Saturday"

    @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
