# coding: utf-8

"""
    Neurograph Core

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from neurograph.v1.models.pgtype_bool import PgtypeBool
from neurograph.v1.models.pgtype_int4 import PgtypeInt4
from neurograph.v1.models.pgtype_text import PgtypeText
from neurograph.v1.models.pgtype_timestamptz import PgtypeTimestamptz
from typing import Optional, Set
from typing_extensions import Self

class DbAccountOrganizationBrand(BaseModel):
    """
    DbAccountOrganizationBrand
    """ # noqa: E501
    accessibility_level: Optional[PgtypeText] = None
    background_img_url: Optional[StrictStr] = None
    color1: Optional[StrictStr] = None
    color2: Optional[StrictStr] = None
    color3: Optional[StrictStr] = None
    color4: Optional[StrictStr] = None
    color5: Optional[StrictStr] = None
    component_config: Optional[List[StrictInt]] = None
    dark_mode_enabled: Optional[PgtypeBool] = None
    generation_metadata: Optional[List[StrictInt]] = None
    id: Optional[StrictInt] = None
    is_ai_generated: Optional[PgtypeBool] = None
    logo_img_url: Optional[StrictStr] = None
    org_id: Optional[StrictStr] = None
    preset_applied_at: Optional[PgtypeTimestamptz] = Field(default=None, description="Timestamp when preset was last applied")
    preset_customized: Optional[PgtypeBool] = Field(default=None, description="Whether the preset has been customized after application")
    preset_id: Optional[PgtypeText] = Field(default=None, description="ID of the theme preset applied to this branding")
    preset_name: Optional[PgtypeText] = Field(default=None, description="Name of the theme preset for display purposes")
    primary_color: Optional[StrictStr] = None
    secondary_color: Optional[StrictStr] = None
    spacing_config: Optional[List[StrictInt]] = None
    tertiary_color: Optional[StrictStr] = None
    typography_config: Optional[List[StrictInt]] = None
    version: Optional[PgtypeInt4] = None
    __properties: ClassVar[List[str]] = ["accessibility_level", "background_img_url", "color1", "color2", "color3", "color4", "color5", "component_config", "dark_mode_enabled", "generation_metadata", "id", "is_ai_generated", "logo_img_url", "org_id", "preset_applied_at", "preset_customized", "preset_id", "preset_name", "primary_color", "secondary_color", "spacing_config", "tertiary_color", "typography_config", "version"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

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

    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 accessibility_level
        if self.accessibility_level:
            _dict['accessibility_level'] = self.accessibility_level.to_dict()
        # override the default output from pydantic by calling `to_dict()` of dark_mode_enabled
        if self.dark_mode_enabled:
            _dict['dark_mode_enabled'] = self.dark_mode_enabled.to_dict()
        # override the default output from pydantic by calling `to_dict()` of is_ai_generated
        if self.is_ai_generated:
            _dict['is_ai_generated'] = self.is_ai_generated.to_dict()
        # override the default output from pydantic by calling `to_dict()` of preset_applied_at
        if self.preset_applied_at:
            _dict['preset_applied_at'] = self.preset_applied_at.to_dict()
        # override the default output from pydantic by calling `to_dict()` of preset_customized
        if self.preset_customized:
            _dict['preset_customized'] = self.preset_customized.to_dict()
        # override the default output from pydantic by calling `to_dict()` of preset_id
        if self.preset_id:
            _dict['preset_id'] = self.preset_id.to_dict()
        # override the default output from pydantic by calling `to_dict()` of preset_name
        if self.preset_name:
            _dict['preset_name'] = self.preset_name.to_dict()
        # override the default output from pydantic by calling `to_dict()` of version
        if self.version:
            _dict['version'] = self.version.to_dict()
        return _dict

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

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

        _obj = cls.model_validate({
            "accessibility_level": PgtypeText.from_dict(obj["accessibility_level"]) if obj.get("accessibility_level") is not None else None,
            "background_img_url": obj.get("background_img_url"),
            "color1": obj.get("color1"),
            "color2": obj.get("color2"),
            "color3": obj.get("color3"),
            "color4": obj.get("color4"),
            "color5": obj.get("color5"),
            "component_config": obj.get("component_config"),
            "dark_mode_enabled": PgtypeBool.from_dict(obj["dark_mode_enabled"]) if obj.get("dark_mode_enabled") is not None else None,
            "generation_metadata": obj.get("generation_metadata"),
            "id": obj.get("id"),
            "is_ai_generated": PgtypeBool.from_dict(obj["is_ai_generated"]) if obj.get("is_ai_generated") is not None else None,
            "logo_img_url": obj.get("logo_img_url"),
            "org_id": obj.get("org_id"),
            "preset_applied_at": PgtypeTimestamptz.from_dict(obj["preset_applied_at"]) if obj.get("preset_applied_at") is not None else None,
            "preset_customized": PgtypeBool.from_dict(obj["preset_customized"]) if obj.get("preset_customized") is not None else None,
            "preset_id": PgtypeText.from_dict(obj["preset_id"]) if obj.get("preset_id") is not None else None,
            "preset_name": PgtypeText.from_dict(obj["preset_name"]) if obj.get("preset_name") is not None else None,
            "primary_color": obj.get("primary_color"),
            "secondary_color": obj.get("secondary_color"),
            "spacing_config": obj.get("spacing_config"),
            "tertiary_color": obj.get("tertiary_color"),
            "typography_config": obj.get("typography_config"),
            "version": PgtypeInt4.from_dict(obj["version"]) if obj.get("version") is not None else None
        })
        return _obj


