# 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.app_colors import AppColors

class AppThemeListGet(BaseModel):
    """
    AppThemeListGet
    """
    id: StrictInt = Field(...)
    colors_light: AppColors = Field(...)
    colors_dark: AppColors = Field(...)
    enable_dark_mode: Optional[StrictBool] = True
    automatically_manage_dark_mode: Optional[StrictBool] = False
    is_active: Optional[StrictBool] = False
    name: Optional[StrictStr] = ''
    is_preset: Optional[StrictBool] = False
    is_default: Optional[StrictBool] = False
    order: StrictInt = Field(...)
    __properties = ["id", "colors_light", "colors_dark", "enable_dark_mode", "automatically_manage_dark_mode", "is_active", "name", "is_preset", "is_default", "order"]

    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) -> AppThemeListGet:
        """Create an instance of AppThemeListGet 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) -> AppThemeListGet:
        """Create an instance of AppThemeListGet from a dict"""
        if obj is None:
            return None

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

        _obj = AppThemeListGet.parse_obj({
            "id": obj.get("id"),
            "colors_light": AppColors.from_dict(obj.get("colors_light")) if obj.get("colors_light") is not None else None,
            "colors_dark": AppColors.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,
            "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,
            "order": obj.get("order")
        })
        return _obj


