# 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 openapi_client.models.campaign.video_template_filter import VideoTemplateFilter
from typing_extensions import Self

class GetClipchampTemplatesRequest(BaseModel):
    """
    GetClipchampTemplatesRequest
    """ # noqa: E501
    mock: Optional[StrictBool] = Field(default=None, alias="Mock")
    max_ads_count: Optional[StrictInt] = Field(default=None, alias="MaxAdsCount")
    template_filter: Optional[VideoTemplateFilter] = Field(default=None, alias="TemplateFilter")
    locale: Optional[StrictStr] = Field(default=None, alias="Locale")
    __properties: ClassVar[List[str]] = ["Mock", "MaxAdsCount", "TemplateFilter", "Locale"]

    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,
        )
        # override the default output from pydantic by calling `to_dict()` of template_filter
        if self.template_filter:
            _dict['TemplateFilter'] = self.template_filter.to_dict()
        # set to None if mock (nullable) is None
        # and model_fields_set contains the field
        if self.mock is None and "mock" in self.model_fields_set:
            _dict['Mock'] = None

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Mock": obj.get("Mock") if obj.get("Mock") is not None else None,
                        "MaxAdsCount": obj.get("MaxAdsCount") if obj.get("MaxAdsCount") is not None else None,
                        "TemplateFilter": VideoTemplateFilter.from_dict(obj["TemplateFilter"]) if obj.get("TemplateFilter") is not None else None,
                        "Locale": obj.get("Locale") if obj.get("Locale") is not None else None
        })
        return _obj
