# coding: utf-8

"""
    FlowHunt

    FlowHunt API

    The version of the OpenAPI document: 2.0.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 flowhunt.models.chatbot_status import ChatbotStatus
from typing import Optional, Set
from typing_extensions import Self

class ChatbotResponse(BaseModel):
    """
    ChatbotResponse
    """ # noqa: E501
    workspace_id: StrictStr = Field(description="Workspace id")
    chatbot_id: StrictStr = Field(description="Chatbot id")
    title: StrictStr = Field(description="Tenant name")
    description: Optional[StrictStr] = None
    flow_id: StrictStr = Field(description="Flow ID")
    status: Optional[ChatbotStatus]
    url_suffix: Optional[StrictStr] = None
    theme: Optional[StrictStr] = None
    max_window_size: Optional[StrictStr] = None
    msg_rpm: Optional[StrictInt] = None
    msg_ip_rpm: Optional[StrictInt] = None
    chatbot_description: Optional[StrictStr] = None
    show_chatbot_header: Optional[StrictBool] = None
    chat_bubble_bg_color: Optional[StrictStr] = None
    chat_bubble_icon_color: Optional[StrictStr] = None
    chat_bubble_img_url: Optional[StrictStr] = None
    chatbot_theme: Optional[StrictStr] = None
    chatbot_position: Optional[StrictStr] = None
    message_placeholder: Optional[StrictStr] = None
    chatbot_header_text: Optional[StrictStr] = None
    chatbot_header_logo_url: Optional[StrictStr] = None
    assistant_avatar_image_url: Optional[StrictStr] = None
    remove_branding: Optional[StrictBool] = None
    chatbot_style: Optional[StrictStr] = None
    session_message_history: Optional[StrictBool] = None
    chatbot_bubble_size: Optional[StrictInt] = None
    message_header_logo_url: Optional[StrictStr] = None
    __properties: ClassVar[List[str]] = ["workspace_id", "chatbot_id", "title", "description", "flow_id", "status", "url_suffix", "theme", "max_window_size", "msg_rpm", "msg_ip_rpm", "chatbot_description", "show_chatbot_header", "chat_bubble_bg_color", "chat_bubble_icon_color", "chat_bubble_img_url", "chatbot_theme", "chatbot_position", "message_placeholder", "chatbot_header_text", "chatbot_header_logo_url", "assistant_avatar_image_url", "remove_branding", "chatbot_style", "session_message_history", "chatbot_bubble_size", "message_header_logo_url"]

    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 ChatbotResponse 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,
        )
        # set to None if description (nullable) is None
        # and model_fields_set contains the field
        if self.description is None and "description" in self.model_fields_set:
            _dict['description'] = None

        # set to None if status (nullable) is None
        # and model_fields_set contains the field
        if self.status is None and "status" in self.model_fields_set:
            _dict['status'] = None

        # set to None if url_suffix (nullable) is None
        # and model_fields_set contains the field
        if self.url_suffix is None and "url_suffix" in self.model_fields_set:
            _dict['url_suffix'] = None

        # set to None if theme (nullable) is None
        # and model_fields_set contains the field
        if self.theme is None and "theme" in self.model_fields_set:
            _dict['theme'] = None

        # set to None if max_window_size (nullable) is None
        # and model_fields_set contains the field
        if self.max_window_size is None and "max_window_size" in self.model_fields_set:
            _dict['max_window_size'] = None

        # set to None if msg_rpm (nullable) is None
        # and model_fields_set contains the field
        if self.msg_rpm is None and "msg_rpm" in self.model_fields_set:
            _dict['msg_rpm'] = None

        # set to None if msg_ip_rpm (nullable) is None
        # and model_fields_set contains the field
        if self.msg_ip_rpm is None and "msg_ip_rpm" in self.model_fields_set:
            _dict['msg_ip_rpm'] = None

        # set to None if chatbot_description (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_description is None and "chatbot_description" in self.model_fields_set:
            _dict['chatbot_description'] = None

        # set to None if show_chatbot_header (nullable) is None
        # and model_fields_set contains the field
        if self.show_chatbot_header is None and "show_chatbot_header" in self.model_fields_set:
            _dict['show_chatbot_header'] = None

        # set to None if chat_bubble_bg_color (nullable) is None
        # and model_fields_set contains the field
        if self.chat_bubble_bg_color is None and "chat_bubble_bg_color" in self.model_fields_set:
            _dict['chat_bubble_bg_color'] = None

        # set to None if chat_bubble_icon_color (nullable) is None
        # and model_fields_set contains the field
        if self.chat_bubble_icon_color is None and "chat_bubble_icon_color" in self.model_fields_set:
            _dict['chat_bubble_icon_color'] = None

        # set to None if chat_bubble_img_url (nullable) is None
        # and model_fields_set contains the field
        if self.chat_bubble_img_url is None and "chat_bubble_img_url" in self.model_fields_set:
            _dict['chat_bubble_img_url'] = None

        # set to None if chatbot_theme (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_theme is None and "chatbot_theme" in self.model_fields_set:
            _dict['chatbot_theme'] = None

        # set to None if chatbot_position (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_position is None and "chatbot_position" in self.model_fields_set:
            _dict['chatbot_position'] = None

        # set to None if message_placeholder (nullable) is None
        # and model_fields_set contains the field
        if self.message_placeholder is None and "message_placeholder" in self.model_fields_set:
            _dict['message_placeholder'] = None

        # set to None if chatbot_header_text (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_header_text is None and "chatbot_header_text" in self.model_fields_set:
            _dict['chatbot_header_text'] = None

        # set to None if chatbot_header_logo_url (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_header_logo_url is None and "chatbot_header_logo_url" in self.model_fields_set:
            _dict['chatbot_header_logo_url'] = None

        # set to None if assistant_avatar_image_url (nullable) is None
        # and model_fields_set contains the field
        if self.assistant_avatar_image_url is None and "assistant_avatar_image_url" in self.model_fields_set:
            _dict['assistant_avatar_image_url'] = None

        # set to None if remove_branding (nullable) is None
        # and model_fields_set contains the field
        if self.remove_branding is None and "remove_branding" in self.model_fields_set:
            _dict['remove_branding'] = None

        # set to None if chatbot_style (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_style is None and "chatbot_style" in self.model_fields_set:
            _dict['chatbot_style'] = None

        # set to None if session_message_history (nullable) is None
        # and model_fields_set contains the field
        if self.session_message_history is None and "session_message_history" in self.model_fields_set:
            _dict['session_message_history'] = None

        # set to None if chatbot_bubble_size (nullable) is None
        # and model_fields_set contains the field
        if self.chatbot_bubble_size is None and "chatbot_bubble_size" in self.model_fields_set:
            _dict['chatbot_bubble_size'] = None

        # set to None if message_header_logo_url (nullable) is None
        # and model_fields_set contains the field
        if self.message_header_logo_url is None and "message_header_logo_url" in self.model_fields_set:
            _dict['message_header_logo_url'] = None

        return _dict

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

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

        _obj = cls.model_validate({
            "workspace_id": obj.get("workspace_id"),
            "chatbot_id": obj.get("chatbot_id"),
            "title": obj.get("title"),
            "description": obj.get("description"),
            "flow_id": obj.get("flow_id"),
            "status": obj.get("status"),
            "url_suffix": obj.get("url_suffix"),
            "theme": obj.get("theme"),
            "max_window_size": obj.get("max_window_size"),
            "msg_rpm": obj.get("msg_rpm"),
            "msg_ip_rpm": obj.get("msg_ip_rpm"),
            "chatbot_description": obj.get("chatbot_description"),
            "show_chatbot_header": obj.get("show_chatbot_header"),
            "chat_bubble_bg_color": obj.get("chat_bubble_bg_color"),
            "chat_bubble_icon_color": obj.get("chat_bubble_icon_color"),
            "chat_bubble_img_url": obj.get("chat_bubble_img_url"),
            "chatbot_theme": obj.get("chatbot_theme"),
            "chatbot_position": obj.get("chatbot_position"),
            "message_placeholder": obj.get("message_placeholder"),
            "chatbot_header_text": obj.get("chatbot_header_text"),
            "chatbot_header_logo_url": obj.get("chatbot_header_logo_url"),
            "assistant_avatar_image_url": obj.get("assistant_avatar_image_url"),
            "remove_branding": obj.get("remove_branding"),
            "chatbot_style": obj.get("chatbot_style"),
            "session_message_history": obj.get("session_message_history"),
            "chatbot_bubble_size": obj.get("chatbot_bubble_size"),
            "message_header_logo_url": obj.get("message_header_logo_url")
        })
        return _obj


