# 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
import pprint
import re  # noqa: F401
import json

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union, Set
from typing_extensions import Self

class VideoTemplateFilter(BaseModel):
    """
    VideoTemplateFilter
    """ # noqa: E501
    themes: Optional[List[StrictStr]] = Field(default=None, alias="Themes")
    aspect_ratios: Optional[List[StrictStr]] = Field(default=None, alias="AspectRatios")
    template_ids: Optional[List[StrictStr]] = Field(default=None, alias="TemplateIds")
    durations: Optional[List[StrictInt]] = Field(default=None, alias="Durations")
    max_media_asset_count: Optional[StrictInt] = Field(default=None, alias="MaxMediaAssetCount")
    max_text_asset_count: Optional[StrictInt] = Field(default=None, alias="MaxTextAssetCount")
    __properties: ClassVar[List[str]] = ["Themes", "AspectRatios", "TemplateIds", "Durations", "MaxMediaAssetCount", "MaxTextAssetCount"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )
	

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # set to None if themes (nullable) is None
        # and model_fields_set contains the field
        if self.themes is None and "themes" in self.model_fields_set:
            _dict['Themes'] = None

        # set to None if aspect_ratios (nullable) is None
        # and model_fields_set contains the field
        if self.aspect_ratios is None and "aspect_ratios" in self.model_fields_set:
            _dict['AspectRatios'] = None

        # set to None if template_ids (nullable) is None
        # and model_fields_set contains the field
        if self.template_ids is None and "template_ids" in self.model_fields_set:
            _dict['TemplateIds'] = None

        # set to None if durations (nullable) is None
        # and model_fields_set contains the field
        if self.durations is None and "durations" in self.model_fields_set:
            _dict['Durations'] = None

        # set to None if max_media_asset_count (nullable) is None
        # and model_fields_set contains the field
        if self.max_media_asset_count is None and "max_media_asset_count" in self.model_fields_set:
            _dict['MaxMediaAssetCount'] = None

        # set to None if max_text_asset_count (nullable) is None
        # and model_fields_set contains the field
        if self.max_text_asset_count is None and "max_text_asset_count" in self.model_fields_set:
            _dict['MaxTextAssetCount'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of VideoTemplateFilter from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "Themes": obj.get("Themes"),
                        "AspectRatios": obj.get("AspectRatios"),
                        "TemplateIds": obj.get("TemplateIds"),
                        "Durations": obj.get("Durations"),
                        "MaxMediaAssetCount": obj.get("MaxMediaAssetCount") if obj.get("MaxMediaAssetCount") is not None else None,
                        "MaxTextAssetCount": obj.get("MaxTextAssetCount") if obj.get("MaxTextAssetCount") is not None else None
        })
        return _obj
