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.function_object import \
    FunctionObject  # noqa: E501


class ChatCompletionTool(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
        """ChatCompletionTool - a model defined in OpenAPI

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

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

        self._type = type
        self._function = function

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

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

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

        The type of the tool. Currently, only `function` is supported.  # noqa: E501

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

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

        The type of the tool. Currently, only `function` is supported.  # noqa: E501

        :param type: The type of this ChatCompletionTool.
        :type type: str
        """
        allowed_values = ["function"]  # 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) -> FunctionObject:
        """Gets the function of this ChatCompletionTool.


        :return: The function of this ChatCompletionTool.
        :rtype: FunctionObject
        """
        return self._function

    @function.setter
    def function(self, function: FunctionObject):
        """Sets the function of this ChatCompletionTool.


        :param function: The function of this ChatCompletionTool.
        :type function: FunctionObject
        """
        if function is None:
            raise ValueError("Invalid value for `function`, must not be `None`")  # noqa: E501

        self._function = function
