# 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, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from neurograph.v1.models.organizations_component_config import OrganizationsComponentConfig
from neurograph.v1.models.organizations_generation_metadata import OrganizationsGenerationMetadata
from neurograph.v1.models.organizations_spacing_config import OrganizationsSpacingConfig
from neurograph.v1.models.organizations_typography_config import OrganizationsTypographyConfig
from typing import Optional, Set
from typing_extensions import Self

class OrganizationsBrandDetailResponse(BaseModel):
    """
    OrganizationsBrandDetailResponse
    """ # noqa: E501
    accessibility_level: Optional[StrictStr] = 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
    components: Optional[OrganizationsComponentConfig] = None
    dark_mode_enabled: Optional[StrictBool] = None
    error: Optional[StrictStr] = None
    generation_metadata: Optional[OrganizationsGenerationMetadata] = None
    is_ai_generated: Optional[StrictBool] = None
    logo_img_url: Optional[StrictStr] = None
    org_guid: Optional[StrictStr] = None
    primary_color: Optional[StrictStr] = None
    secondary_color: Optional[StrictStr] = None
    spacing: Optional[OrganizationsSpacingConfig] = None
    tertiary_color: Optional[StrictStr] = None
    typography: Optional[OrganizationsTypographyConfig] = None
    version: Optional[StrictInt] = Field(default=None, description="New fields - Phase 4")
    __properties: ClassVar[List[str]] = ["accessibility_level", "background_img_url", "color1", "color2", "color3", "color4", "color5", "components", "dark_mode_enabled", "error", "generation_metadata", "is_ai_generated", "logo_img_url", "org_guid", "primary_color", "secondary_color", "spacing", "tertiary_color", "typography", "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 OrganizationsBrandDetailResponse 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 components
        if self.components:
            _dict['components'] = self.components.to_dict()
        # override the default output from pydantic by calling `to_dict()` of generation_metadata
        if self.generation_metadata:
            _dict['generation_metadata'] = self.generation_metadata.to_dict()
        # override the default output from pydantic by calling `to_dict()` of spacing
        if self.spacing:
            _dict['spacing'] = self.spacing.to_dict()
        # override the default output from pydantic by calling `to_dict()` of typography
        if self.typography:
            _dict['typography'] = self.typography.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of OrganizationsBrandDetailResponse 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": obj.get("accessibility_level"),
            "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"),
            "components": OrganizationsComponentConfig.from_dict(obj["components"]) if obj.get("components") is not None else None,
            "dark_mode_enabled": obj.get("dark_mode_enabled"),
            "error": obj.get("error"),
            "generation_metadata": OrganizationsGenerationMetadata.from_dict(obj["generation_metadata"]) if obj.get("generation_metadata") is not None else None,
            "is_ai_generated": obj.get("is_ai_generated"),
            "logo_img_url": obj.get("logo_img_url"),
            "org_guid": obj.get("org_guid"),
            "primary_color": obj.get("primary_color"),
            "secondary_color": obj.get("secondary_color"),
            "spacing": OrganizationsSpacingConfig.from_dict(obj["spacing"]) if obj.get("spacing") is not None else None,
            "tertiary_color": obj.get("tertiary_color"),
            "typography": OrganizationsTypographyConfig.from_dict(obj["typography"]) if obj.get("typography") is not None else None,
            "version": obj.get("version")
        })
        return _obj


