# coding: utf-8

"""
    Mentortools Design API

    Mentortools service for getting and editing design data

    The version of the OpenAPI document: 0.1.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 typing import Optional
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr
from design_server_connector.models.font_get import FontGet
from design_server_connector.models.web_colors import WebColors

class WebThemeGet(BaseModel):
    """
    WebThemeGet
    """
    id: StrictInt = Field(...)
    colors_light: WebColors = Field(...)
    colors_dark: WebColors = Field(...)
    enable_dark_mode: Optional[StrictBool] = True
    automatically_manage_dark_mode: Optional[StrictBool] = False
    primary_font_id: StrictInt = Field(...)
    primary_font: FontGet = Field(...)
    primary_bold: StrictBool = Field(...)
    primary_italic: StrictBool = Field(...)
    primary_underline: StrictBool = Field(...)
    secondary_font_id: StrictInt = Field(...)
    secondary_font: FontGet = Field(...)
    secondary_bold: StrictBool = Field(...)
    secondary_italic: StrictBool = Field(...)
    secondary_underline: StrictBool = Field(...)
    is_active: Optional[StrictBool] = False
    name: Optional[StrictStr] = ''
    is_preset: Optional[StrictBool] = False
    is_default: Optional[StrictBool] = False
    __properties = ["id", "colors_light", "colors_dark", "enable_dark_mode", "automatically_manage_dark_mode", "primary_font_id", "primary_font", "primary_bold", "primary_italic", "primary_underline", "secondary_font_id", "secondary_font", "secondary_bold", "secondary_italic", "secondary_underline", "is_active", "name", "is_preset", "is_default"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> WebThemeGet:
        """Create an instance of WebThemeGet from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # override the default output from pydantic by calling `to_dict()` of colors_light
        if self.colors_light:
            _dict['colors_light'] = self.colors_light.to_dict()
        # override the default output from pydantic by calling `to_dict()` of colors_dark
        if self.colors_dark:
            _dict['colors_dark'] = self.colors_dark.to_dict()
        # override the default output from pydantic by calling `to_dict()` of primary_font
        if self.primary_font:
            _dict['primary_font'] = self.primary_font.to_dict()
        # override the default output from pydantic by calling `to_dict()` of secondary_font
        if self.secondary_font:
            _dict['secondary_font'] = self.secondary_font.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> WebThemeGet:
        """Create an instance of WebThemeGet from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return WebThemeGet.parse_obj(obj)

        _obj = WebThemeGet.parse_obj({
            "id": obj.get("id"),
            "colors_light": WebColors.from_dict(obj.get("colors_light")) if obj.get("colors_light") is not None else None,
            "colors_dark": WebColors.from_dict(obj.get("colors_dark")) if obj.get("colors_dark") is not None else None,
            "enable_dark_mode": obj.get("enable_dark_mode") if obj.get("enable_dark_mode") is not None else True,
            "automatically_manage_dark_mode": obj.get("automatically_manage_dark_mode") if obj.get("automatically_manage_dark_mode") is not None else False,
            "primary_font_id": obj.get("primary_font_id"),
            "primary_font": FontGet.from_dict(obj.get("primary_font")) if obj.get("primary_font") is not None else None,
            "primary_bold": obj.get("primary_bold"),
            "primary_italic": obj.get("primary_italic"),
            "primary_underline": obj.get("primary_underline"),
            "secondary_font_id": obj.get("secondary_font_id"),
            "secondary_font": FontGet.from_dict(obj.get("secondary_font")) if obj.get("secondary_font") is not None else None,
            "secondary_bold": obj.get("secondary_bold"),
            "secondary_italic": obj.get("secondary_italic"),
            "secondary_underline": obj.get("secondary_underline"),
            "is_active": obj.get("is_active") if obj.get("is_active") is not None else False,
            "name": obj.get("name") if obj.get("name") is not None else '',
            "is_preset": obj.get("is_preset") if obj.get("is_preset") is not None else False,
            "is_default": obj.get("is_default") if obj.get("is_default") is not None else False
        })
        return _obj


