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.assistants_named_tool_choice import \
    AssistantsNamedToolChoice  # noqa: E501
from timestep.api.openai.v1.models.base_model import Model
from timestep.api.openai.v1.models.chat_completion_named_tool_choice_function import \
    ChatCompletionNamedToolChoiceFunction  # noqa: E501


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

    Do not edit the class manually.
    """

    def __init__(self, type=None, function=None):  # noqa: E501
        """AssistantsApiToolChoiceOption - a model defined in OpenAPI

        :param type: The type of this AssistantsApiToolChoiceOption.  # noqa: E501
        :type type: str
        :param function: The function of this AssistantsApiToolChoiceOption.  # noqa: E501
        :type function: ChatCompletionNamedToolChoiceFunction
        """
        self.openapi_types = {
            'type': str,
            'function': ChatCompletionNamedToolChoiceFunction
        }

        self.attribute_map = {
            'type': 'type',
            'function': 'function'
        }

        self._type = type
        self._function = function

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

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

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

        The type of the tool. If type is `function`, the function name must be set  # noqa: E501

        :return: The type of this AssistantsApiToolChoiceOption.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type: str):
        """Sets the type of this AssistantsApiToolChoiceOption.

        The type of the tool. If type is `function`, the function name must be set  # noqa: E501

        :param type: The type of this AssistantsApiToolChoiceOption.
        :type type: str
        """
        allowed_values = ["function", "code_interpreter", "file_search"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"
                .format(type, allowed_values)
            )

        self._type = type

    @property
    def function(self) -> ChatCompletionNamedToolChoiceFunction:
        """Gets the function of this AssistantsApiToolChoiceOption.


        :return: The function of this AssistantsApiToolChoiceOption.
        :rtype: ChatCompletionNamedToolChoiceFunction
        """
        return self._function

    @function.setter
    def function(self, function: ChatCompletionNamedToolChoiceFunction):
        """Sets the function of this AssistantsApiToolChoiceOption.


        :param function: The function of this AssistantsApiToolChoiceOption.
        :type function: ChatCompletionNamedToolChoiceFunction
        """

        self._function = function
