# 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
from design_server_connector.models.web_colors import WebColors

class WebThemeUpdate(BaseModel):
    """
    WebThemeUpdate
    """
    colors_light: WebColors = Field(...)
    colors_dark: Optional[WebColors] = None
    enable_dark_mode: Optional[StrictBool] = True
    automatically_manage_dark_mode: StrictBool = Field(...)
    primary_font_id: StrictInt = Field(...)
    primary_bold: StrictBool = Field(...)
    primary_italic: StrictBool = Field(...)
    primary_underline: StrictBool = Field(...)
    secondary_font_id: StrictInt = Field(...)
    secondary_bold: StrictBool = Field(...)
    secondary_italic: StrictBool = Field(...)
    secondary_underline: StrictBool = Field(...)
    __properties = ["colors_light", "colors_dark", "enable_dark_mode", "automatically_manage_dark_mode", "primary_font_id", "primary_bold", "primary_italic", "primary_underline", "secondary_font_id", "secondary_bold", "secondary_italic", "secondary_underline"]

    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) -> WebThemeUpdate:
        """Create an instance of WebThemeUpdate 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()
        return _dict

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

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

        _obj = WebThemeUpdate.parse_obj({
            "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"),
            "primary_font_id": obj.get("primary_font_id"),
            "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_bold": obj.get("secondary_bold"),
            "secondary_italic": obj.get("secondary_italic"),
            "secondary_underline": obj.get("secondary_underline")
        })
        return _obj


