# 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.brand_kit_font import BrandKitFont
from openapi_client.models.campaign.brand_kit_image import BrandKitImage
from openapi_client.models.campaign.brand_kit_palette import BrandKitPalette
from typing_extensions import Self

class BrandKit(BaseModel):
    """
    BrandKit
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, alias="Id")
    name: Optional[StrictStr] = Field(default=None, alias="Name")
    business_name: Optional[StrictStr] = Field(default=None, alias="BusinessName")
    images: Optional[List[Optional[BrandKitImage]]] = Field(default=None, alias="Images")
    square_logos: Optional[List[Optional[BrandKitImage]]] = Field(default=None, alias="SquareLogos")
    landscape_logos: Optional[List[Optional[BrandKitImage]]] = Field(default=None, alias="LandscapeLogos")
    palettes: Optional[List[Optional[BrandKitPalette]]] = Field(default=None, alias="Palettes")
    fonts: Optional[List[Optional[BrandKitFont]]] = Field(default=None, alias="Fonts")
    __properties: ClassVar[List[str]] = ["Id", "Name", "BusinessName", "Images", "SquareLogos", "LandscapeLogos", "Palettes", "Fonts"]

    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 each item in images (list)
        _items = []
        if self.images:
            for _item_images in self.images:
                if _item_images:
                    _items.append(_item_images.to_dict())
            _dict['Images'] = _items
        # override the default output from pydantic by calling `to_dict()` of each item in square_logos (list)
        _items = []
        if self.square_logos:
            for _item_square_logos in self.square_logos:
                if _item_square_logos:
                    _items.append(_item_square_logos.to_dict())
            _dict['SquareLogos'] = _items
        # override the default output from pydantic by calling `to_dict()` of each item in landscape_logos (list)
        _items = []
        if self.landscape_logos:
            for _item_landscape_logos in self.landscape_logos:
                if _item_landscape_logos:
                    _items.append(_item_landscape_logos.to_dict())
            _dict['LandscapeLogos'] = _items
        # override the default output from pydantic by calling `to_dict()` of each item in palettes (list)
        _items = []
        if self.palettes:
            for _item_palettes in self.palettes:
                if _item_palettes:
                    _items.append(_item_palettes.to_dict())
            _dict['Palettes'] = _items
        # override the default output from pydantic by calling `to_dict()` of each item in fonts (list)
        _items = []
        if self.fonts:
            for _item_fonts in self.fonts:
                if _item_fonts:
                    _items.append(_item_fonts.to_dict())
            _dict['Fonts'] = _items
        # set to None if id (nullable) is None
        # and model_fields_set contains the field
        if self.id is None and "id" in self.model_fields_set:
            _dict['Id'] = None

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Id": obj.get("Id") if obj.get("Id") is not None else None,
                        "Name": obj.get("Name") if obj.get("Name") is not None else None,
                        "BusinessName": obj.get("BusinessName") if obj.get("BusinessName") is not None else None,
                        "Images": [BrandKitImage.from_dict(_item) for _item in obj["Images"]] if obj.get("Images") is not None else None,
                        "SquareLogos": [BrandKitImage.from_dict(_item) for _item in obj["SquareLogos"]] if obj.get("SquareLogos") is not None else None,
                        "LandscapeLogos": [BrandKitImage.from_dict(_item) for _item in obj["LandscapeLogos"]] if obj.get("LandscapeLogos") is not None else None,
                        "Palettes": [BrandKitPalette.from_dict(_item) for _item in obj["Palettes"]] if obj.get("Palettes") is not None else None,
                        "Fonts": [BrandKitFont.from_dict(_item) for _item in obj["Fonts"]] if obj.get("Fonts") is not None else None
        })
        return _obj
