# 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 ClipchampTemplateInfo(BaseModel):
    """
    ClipchampTemplateInfo
    """ # noqa: E501
    template_id: Optional[StrictStr] = Field(default=None, alias="TemplateId")
    template_name: Optional[StrictStr] = Field(default=None, alias="TemplateName")
    template_description: Optional[StrictStr] = Field(default=None, alias="TemplateDescription")
    duration: Optional[StrictInt] = Field(default=None, alias="Duration")
    aspect_ratio: Optional[StrictStr] = Field(default=None, alias="AspectRatio")
    themes: Optional[List[StrictStr]] = Field(default=None, alias="Themes")
    number_of_images: Optional[StrictInt] = Field(default=None, alias="NumberOfImages")
    number_of_text: Optional[StrictInt] = Field(default=None, alias="NumberOfText")
    number_of_logos: Optional[StrictInt] = Field(default=None, alias="NumberOfLogos")
    template_thumbnail_url: Optional[StrictStr] = Field(default=None, alias="TemplateThumbnailUrl")
    template_preview_url: Optional[StrictStr] = Field(default=None, alias="TemplatePreviewUrl")
    __properties: ClassVar[List[str]] = ["TemplateId", "TemplateName", "TemplateDescription", "Duration", "AspectRatio", "Themes", "NumberOfImages", "NumberOfText", "NumberOfLogos", "TemplateThumbnailUrl", "TemplatePreviewUrl"]

    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 template_id (nullable) is None
        # and model_fields_set contains the field
        if self.template_id is None and "template_id" in self.model_fields_set:
            _dict['TemplateId'] = None

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

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

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

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

        # 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 number_of_images (nullable) is None
        # and model_fields_set contains the field
        if self.number_of_images is None and "number_of_images" in self.model_fields_set:
            _dict['NumberOfImages'] = None

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "TemplateId": obj.get("TemplateId") if obj.get("TemplateId") is not None else None,
                        "TemplateName": obj.get("TemplateName") if obj.get("TemplateName") is not None else None,
                        "TemplateDescription": obj.get("TemplateDescription") if obj.get("TemplateDescription") is not None else None,
                        "Duration": obj.get("Duration") if obj.get("Duration") is not None else None,
                        "AspectRatio": obj.get("AspectRatio") if obj.get("AspectRatio") is not None else None,
                        "Themes": obj.get("Themes"),
                        "NumberOfImages": obj.get("NumberOfImages") if obj.get("NumberOfImages") is not None else None,
                        "NumberOfText": obj.get("NumberOfText") if obj.get("NumberOfText") is not None else None,
                        "NumberOfLogos": obj.get("NumberOfLogos") if obj.get("NumberOfLogos") is not None else None,
                        "TemplateThumbnailUrl": obj.get("TemplateThumbnailUrl") if obj.get("TemplateThumbnailUrl") is not None else None,
                        "TemplatePreviewUrl": obj.get("TemplatePreviewUrl") if obj.get("TemplatePreviewUrl") is not None else None
        })
        return _obj
