# coding: utf-8

"""
    ReportingService

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
from enum import Flag, auto

class LanguageReportFilter(Flag):
    DANISH = auto()

    DUTCH = auto()

    ENGLISH = auto()

    FINNISH = auto()

    FRENCH = auto()

    GERMAN = auto()

    ITALIAN = auto()

    JAPANESE = auto()

    NORWEGIAN = auto()

    PORTUGUESE = auto()

    SWEDISH = auto()

    SPANISH = auto()

    ARABIC = auto()

    HEBREW = auto()

    KOREAN = auto()

    RUSSIAN = auto()

    TRADITIONALCHINESE = auto()

    GREEK = auto()

    POLISH = auto()

    CZECH = auto()

    ROMANIAN = auto()

    HUNGARIAN = auto()

    SLOVAK = auto()

    BULGARIAN = auto()

    CROATIAN = auto()

    LITHUANIAN = auto()

    SLOVENIAN = auto()

    ESTONIAN = auto()

    LATVIAN = auto()

    MALTESE = auto()

	
    def to_json(self) -> str:
        """Convert to JSON string representation"""
        return self._to_str()
	
    def __str__(self) -> str:
        """
        Return a human-readable string representation of the campaign types.
        """
        return self._to_str()

    def _to_str(self) -> str:
        _NAME_MAPPING = {
            LanguageReportFilter.DANISH: 'Danish',
            LanguageReportFilter.DUTCH: 'Dutch',
            LanguageReportFilter.ENGLISH: 'English',
            LanguageReportFilter.FINNISH: 'Finnish',
            LanguageReportFilter.FRENCH: 'French',
            LanguageReportFilter.GERMAN: 'German',
            LanguageReportFilter.ITALIAN: 'Italian',
            LanguageReportFilter.JAPANESE: 'Japanese',
            LanguageReportFilter.NORWEGIAN: 'Norwegian',
            LanguageReportFilter.PORTUGUESE: 'Portuguese',
            LanguageReportFilter.SWEDISH: 'Swedish',
            LanguageReportFilter.SPANISH: 'Spanish',
            LanguageReportFilter.ARABIC: 'Arabic',
            LanguageReportFilter.HEBREW: 'Hebrew',
            LanguageReportFilter.KOREAN: 'Korean',
            LanguageReportFilter.RUSSIAN: 'Russian',
            LanguageReportFilter.TRADITIONALCHINESE: 'TraditionalChinese',
            LanguageReportFilter.GREEK: 'Greek',
            LanguageReportFilter.POLISH: 'Polish',
            LanguageReportFilter.CZECH: 'Czech',
            LanguageReportFilter.ROMANIAN: 'Romanian',
            LanguageReportFilter.HUNGARIAN: 'Hungarian',
            LanguageReportFilter.SLOVAK: 'Slovak',
            LanguageReportFilter.BULGARIAN: 'Bulgarian',
            LanguageReportFilter.CROATIAN: 'Croatian',
            LanguageReportFilter.LITHUANIAN: 'Lithuanian',
            LanguageReportFilter.SLOVENIAN: 'Slovenian',
            LanguageReportFilter.ESTONIAN: 'Estonian',
            LanguageReportFilter.LATVIAN: 'Latvian',
            LanguageReportFilter.MALTESE: 'Maltese',
        }
        """Convert the enum flags to a comma-separated string of quoted, capitalized names"""
        names = [_NAME_MAPPING[flag] for flag in LanguageReportFilter if flag & self]
        if not names:
            return "None"
        if len(names) == 1:
            # For single values, use single quotes
            return f"{names[0]}"
        # For multiple values, use double quotes with comma separation
        return ", ".join(f"{name}" for name in names)
		
    @classmethod
    def __get_validators__(cls):
        yield cls._validate
		
    @classmethod
    def _validate(cls, value, handler) -> "LanguageReportFilter":
        if isinstance(value, cls):
            return value
        if isinstance(value, int):
            return cls(value)
        if isinstance(value, str):
            # Handle comma-separated campaign types
            types = [type_str.strip() for type_str in value.split(',')]
            if len(types) > 1:
                result = cls.NONE
                for type_str in types:
                    try:
                        result |= getattr(cls, type_str.upper())
                    except AttributeError:
                        raise ValueError(f"Invalid CampaignType value: {type_str}")
                return result
            else:
                # Single campaign type
                try:
                    return getattr(cls, value.strip().upper())
                except AttributeError:
                    raise ValueError(f"Invalid LanguageReportFilter value: {value}")
        raise ValueError(f"Cannot convert {value} to LanguageReportFilter")


