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_functions import \
    ChatCompletionFunctions  # noqa: E501
from timestep.api.openai.v1.models.chat_completion_tool import \
    ChatCompletionTool  # noqa: E501
from timestep.api.openai.v1.models.finetune_chat_request_input_messages_inner import \
    FinetuneChatRequestInputMessagesInner  # noqa: E501


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

    Do not edit the class manually.
    """

    def __init__(self, messages=None, tools=None, parallel_tool_calls=True, functions=None):  # noqa: E501
        """FinetuneChatRequestInput - a model defined in OpenAPI

        :param messages: The messages of this FinetuneChatRequestInput.  # noqa: E501
        :type messages: List[FinetuneChatRequestInputMessagesInner]
        :param tools: The tools of this FinetuneChatRequestInput.  # noqa: E501
        :type tools: List[ChatCompletionTool]
        :param parallel_tool_calls: The parallel_tool_calls of this FinetuneChatRequestInput.  # noqa: E501
        :type parallel_tool_calls: bool
        :param functions: The functions of this FinetuneChatRequestInput.  # noqa: E501
        :type functions: List[ChatCompletionFunctions]
        """
        self.openapi_types = {
            'messages': List[FinetuneChatRequestInputMessagesInner],
            'tools': List[ChatCompletionTool],
            'parallel_tool_calls': bool,
            'functions': List[ChatCompletionFunctions]
        }

        self.attribute_map = {
            'messages': 'messages',
            'tools': 'tools',
            'parallel_tool_calls': 'parallel_tool_calls',
            'functions': 'functions'
        }

        self._messages = messages
        self._tools = tools
        self._parallel_tool_calls = parallel_tool_calls
        self._functions = functions

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

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

    @property
    def messages(self) -> List[FinetuneChatRequestInputMessagesInner]:
        """Gets the messages of this FinetuneChatRequestInput.


        :return: The messages of this FinetuneChatRequestInput.
        :rtype: List[FinetuneChatRequestInputMessagesInner]
        """
        return self._messages

    @messages.setter
    def messages(self, messages: List[FinetuneChatRequestInputMessagesInner]):
        """Sets the messages of this FinetuneChatRequestInput.


        :param messages: The messages of this FinetuneChatRequestInput.
        :type messages: List[FinetuneChatRequestInputMessagesInner]
        """
        if messages is not None and len(messages) < 1:
            raise ValueError("Invalid value for `messages`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._messages = messages

    @property
    def tools(self) -> List[ChatCompletionTool]:
        """Gets the tools of this FinetuneChatRequestInput.

        A list of tools the model may generate JSON inputs for.  # noqa: E501

        :return: The tools of this FinetuneChatRequestInput.
        :rtype: List[ChatCompletionTool]
        """
        return self._tools

    @tools.setter
    def tools(self, tools: List[ChatCompletionTool]):
        """Sets the tools of this FinetuneChatRequestInput.

        A list of tools the model may generate JSON inputs for.  # noqa: E501

        :param tools: The tools of this FinetuneChatRequestInput.
        :type tools: List[ChatCompletionTool]
        """

        self._tools = tools

    @property
    def parallel_tool_calls(self) -> bool:
        """Gets the parallel_tool_calls of this FinetuneChatRequestInput.

        Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.  # noqa: E501

        :return: The parallel_tool_calls of this FinetuneChatRequestInput.
        :rtype: bool
        """
        return self._parallel_tool_calls

    @parallel_tool_calls.setter
    def parallel_tool_calls(self, parallel_tool_calls: bool):
        """Sets the parallel_tool_calls of this FinetuneChatRequestInput.

        Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.  # noqa: E501

        :param parallel_tool_calls: The parallel_tool_calls of this FinetuneChatRequestInput.
        :type parallel_tool_calls: bool
        """

        self._parallel_tool_calls = parallel_tool_calls

    @property
    def functions(self) -> List[ChatCompletionFunctions]:
        """Gets the functions of this FinetuneChatRequestInput.

        A list of functions the model may generate JSON inputs for.  # noqa: E501

        :return: The functions of this FinetuneChatRequestInput.
        :rtype: List[ChatCompletionFunctions]
        """
        return self._functions

    @functions.setter
    def functions(self, functions: List[ChatCompletionFunctions]):
        """Sets the functions of this FinetuneChatRequestInput.

        A list of functions the model may generate JSON inputs for.  # noqa: E501

        :param functions: The functions of this FinetuneChatRequestInput.
        :type functions: List[ChatCompletionFunctions]
        """
        if functions is not None and len(functions) > 128:
            raise ValueError("Invalid value for `functions`, number of items must be less than or equal to `128`")  # noqa: E501
        if functions is not None and len(functions) < 1:
            raise ValueError("Invalid value for `functions`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._functions = functions
