from datetime import date, datetime  # noqa: F401
from typing import Dict, List  # noqa: F401

from timestep.api.openai.v1 import util
from timestep.api.openai.v1.models.base_model import Model
from timestep.api.openai.v1.models.chat_completion_message_tool_call_chunk import \
    ChatCompletionMessageToolCallChunk  # noqa: E501
from timestep.api.openai.v1.models.chat_completion_stream_response_delta_function_call import \
    ChatCompletionStreamResponseDeltaFunctionCall  # noqa: E501


class ChatCompletionStreamResponseDelta(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, content=None, function_call=None, tool_calls=None, role=None):  # noqa: E501
        """ChatCompletionStreamResponseDelta - a model defined in OpenAPI

        :param content: The content of this ChatCompletionStreamResponseDelta.  # noqa: E501
        :type content: str
        :param function_call: The function_call of this ChatCompletionStreamResponseDelta.  # noqa: E501
        :type function_call: ChatCompletionStreamResponseDeltaFunctionCall
        :param tool_calls: The tool_calls of this ChatCompletionStreamResponseDelta.  # noqa: E501
        :type tool_calls: List[ChatCompletionMessageToolCallChunk]
        :param role: The role of this ChatCompletionStreamResponseDelta.  # noqa: E501
        :type role: str
        """
        self.openapi_types = {
            'content': str,
            'function_call': ChatCompletionStreamResponseDeltaFunctionCall,
            'tool_calls': List[ChatCompletionMessageToolCallChunk],
            'role': str
        }

        self.attribute_map = {
            'content': 'content',
            'function_call': 'function_call',
            'tool_calls': 'tool_calls',
            'role': 'role'
        }

        self._content = content
        self._function_call = function_call
        self._tool_calls = tool_calls
        self._role = role

    @classmethod
    def from_dict(cls, dikt) -> 'ChatCompletionStreamResponseDelta':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The ChatCompletionStreamResponseDelta of this ChatCompletionStreamResponseDelta.  # noqa: E501
        :rtype: ChatCompletionStreamResponseDelta
        """
        return util.deserialize_model(dikt, cls)

    @property
    def content(self) -> str:
        """Gets the content of this ChatCompletionStreamResponseDelta.

        The contents of the chunk message.  # noqa: E501

        :return: The content of this ChatCompletionStreamResponseDelta.
        :rtype: str
        """
        return self._content

    @content.setter
    def content(self, content: str):
        """Sets the content of this ChatCompletionStreamResponseDelta.

        The contents of the chunk message.  # noqa: E501

        :param content: The content of this ChatCompletionStreamResponseDelta.
        :type content: str
        """

        self._content = content

    @property
    def function_call(self) -> ChatCompletionStreamResponseDeltaFunctionCall:
        """Gets the function_call of this ChatCompletionStreamResponseDelta.


        :return: The function_call of this ChatCompletionStreamResponseDelta.
        :rtype: ChatCompletionStreamResponseDeltaFunctionCall
        """
        return self._function_call

    @function_call.setter
    def function_call(self, function_call: ChatCompletionStreamResponseDeltaFunctionCall):
        """Sets the function_call of this ChatCompletionStreamResponseDelta.


        :param function_call: The function_call of this ChatCompletionStreamResponseDelta.
        :type function_call: ChatCompletionStreamResponseDeltaFunctionCall
        """

        self._function_call = function_call

    @property
    def tool_calls(self) -> List[ChatCompletionMessageToolCallChunk]:
        """Gets the tool_calls of this ChatCompletionStreamResponseDelta.


        :return: The tool_calls of this ChatCompletionStreamResponseDelta.
        :rtype: List[ChatCompletionMessageToolCallChunk]
        """
        return self._tool_calls

    @tool_calls.setter
    def tool_calls(self, tool_calls: List[ChatCompletionMessageToolCallChunk]):
        """Sets the tool_calls of this ChatCompletionStreamResponseDelta.


        :param tool_calls: The tool_calls of this ChatCompletionStreamResponseDelta.
        :type tool_calls: List[ChatCompletionMessageToolCallChunk]
        """

        self._tool_calls = tool_calls

    @property
    def role(self) -> str:
        """Gets the role of this ChatCompletionStreamResponseDelta.

        The role of the author of this message.  # noqa: E501

        :return: The role of this ChatCompletionStreamResponseDelta.
        :rtype: str
        """
        return self._role

    @role.setter
    def role(self, role: str):
        """Sets the role of this ChatCompletionStreamResponseDelta.

        The role of the author of this message.  # noqa: E501

        :param role: The role of this ChatCompletionStreamResponseDelta.
        :type role: str
        """
        allowed_values = ["system", "user", "assistant", "tool"]  # noqa: E501
        if role not in allowed_values:
            raise ValueError(
                "Invalid value for `role` ({0}), must be one of {1}"
                .format(role, allowed_values)
            )

        self._role = role
