# coding: utf-8

"""
    CampaignManagementService

    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 ImportAdditionalField(Flag):
    NONE = auto()

    NOTIFICATIONEMAIL = auto()

    AUTODEVICEBIDOPTIMIZATION = auto()

    ACTIVEADGROUPSONLY = auto()

    SEARCHANDREPLACEFORCUSTOMPARAMETERS = auto()

    ADSCHEDULEUSESEARCHERTIMEZONE = auto()

    NEWIMAGEADEXTENSIONS = auto()

    UPDATEIMAGEADEXTENSIONS = auto()

    SEARCHANDREPLACEFORFINALURLSUFFIX = auto()

    RENAMECAMPAIGNNAMEWITHSUFFIX = auto()

    UPDATEADURLS = auto()

    NEWLOGOADEXTENSIONS = auto()

    UPDATELOGOADEXTENSIONS = auto()

    UPDATESITELINKURLS = auto()

    NEWLEADFORMADEXTENSIONS = auto()

    UPDATELEADFORMADEXTENSIONS = auto()

    NEWACCOUNTNEGATIVEKEYWORDS = auto()

    UPDATEACCOUNTNEGATIVEKEYWORDS = auto()

    UPDATEADCUSTOMIZERATTRIBUTES = auto()

    NEWCONVERSIONGOALS = auto()

    UPDATECONVERSIONGOALS = auto()

    NEWBRANDSUITABILITY = auto()

    UPDATEBRANDSUITABILITY = auto()

    NEWCAROUSELAD = auto()

    UPDATEASSETAUTOMATIONCAMPAIGNSETTING = auto()

    ENABLECOPILOT = auto()

    NEWTOPICTARGETS = auto()

    UPDATETOPICTARGETS = auto()

    NEWPORTFOLIOBIDSTRATEGY = auto()

    NEWAIMAXSETTINGS = auto()

    IMAGEASSETAUTOMATIONOPTOUT = auto()

    UPDATEAIMAXSETTINGS = 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 = {
            ImportAdditionalField.NONE: 'None',
            ImportAdditionalField.NOTIFICATIONEMAIL: 'NotificationEmail',
            ImportAdditionalField.AUTODEVICEBIDOPTIMIZATION: 'AutoDeviceBidOptimization',
            ImportAdditionalField.ACTIVEADGROUPSONLY: 'ActiveAdGroupsOnly',
            ImportAdditionalField.SEARCHANDREPLACEFORCUSTOMPARAMETERS: 'SearchAndReplaceForCustomParameters',
            ImportAdditionalField.ADSCHEDULEUSESEARCHERTIMEZONE: 'AdScheduleUseSearcherTimezone',
            ImportAdditionalField.NEWIMAGEADEXTENSIONS: 'NewImageAdExtensions',
            ImportAdditionalField.UPDATEIMAGEADEXTENSIONS: 'UpdateImageAdExtensions',
            ImportAdditionalField.SEARCHANDREPLACEFORFINALURLSUFFIX: 'SearchAndReplaceForFinalURLSuffix',
            ImportAdditionalField.RENAMECAMPAIGNNAMEWITHSUFFIX: 'RenameCampaignNameWithSuffix',
            ImportAdditionalField.UPDATEADURLS: 'UpdateAdUrls',
            ImportAdditionalField.NEWLOGOADEXTENSIONS: 'NewLogoAdExtensions',
            ImportAdditionalField.UPDATELOGOADEXTENSIONS: 'UpdateLogoAdExtensions',
            ImportAdditionalField.UPDATESITELINKURLS: 'UpdateSitelinkUrls',
            ImportAdditionalField.NEWLEADFORMADEXTENSIONS: 'NewLeadFormAdExtensions',
            ImportAdditionalField.UPDATELEADFORMADEXTENSIONS: 'UpdateLeadFormAdExtensions',
            ImportAdditionalField.NEWACCOUNTNEGATIVEKEYWORDS: 'NewAccountNegativeKeywords',
            ImportAdditionalField.UPDATEACCOUNTNEGATIVEKEYWORDS: 'UpdateAccountNegativeKeywords',
            ImportAdditionalField.UPDATEADCUSTOMIZERATTRIBUTES: 'UpdateAdCustomizerAttributes',
            ImportAdditionalField.NEWCONVERSIONGOALS: 'NewConversionGoals',
            ImportAdditionalField.UPDATECONVERSIONGOALS: 'UpdateConversionGoals',
            ImportAdditionalField.NEWBRANDSUITABILITY: 'NewBrandSuitability',
            ImportAdditionalField.UPDATEBRANDSUITABILITY: 'UpdateBrandSuitability',
            ImportAdditionalField.NEWCAROUSELAD: 'NewCarouselAd',
            ImportAdditionalField.UPDATEASSETAUTOMATIONCAMPAIGNSETTING: 'UpdateAssetAutomationCampaignSetting',
            ImportAdditionalField.ENABLECOPILOT: 'EnableCopilot',
            ImportAdditionalField.NEWTOPICTARGETS: 'NewTopicTargets',
            ImportAdditionalField.UPDATETOPICTARGETS: 'UpdateTopicTargets',
            ImportAdditionalField.NEWPORTFOLIOBIDSTRATEGY: 'NewPortfolioBidStrategy',
            ImportAdditionalField.NEWAIMAXSETTINGS: 'NewAIMaxSettings',
            ImportAdditionalField.IMAGEASSETAUTOMATIONOPTOUT: 'ImageAssetAutomationOptOut',
            ImportAdditionalField.UPDATEAIMAXSETTINGS: 'UpdateAIMaxSettings',
        }
        """Convert the enum flags to a comma-separated string of quoted, capitalized names"""
        names = [_NAME_MAPPING[flag] for flag in ImportAdditionalField 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) -> "ImportAdditionalField":
        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 ImportAdditionalField value: {value}")
        raise ValueError(f"Cannot convert {value} to ImportAdditionalField")


