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.thread_object_tool_resources import \
    ThreadObjectToolResources  # noqa: E501


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

    Do not edit the class manually.
    """

    def __init__(self, id=None, object=None, created_at=None, tool_resources=None, metadata=None):  # noqa: E501
        """ThreadObject - a model defined in OpenAPI

        :param id: The id of this ThreadObject.  # noqa: E501
        :type id: str
        :param object: The object of this ThreadObject.  # noqa: E501
        :type object: str
        :param created_at: The created_at of this ThreadObject.  # noqa: E501
        :type created_at: int
        :param tool_resources: The tool_resources of this ThreadObject.  # noqa: E501
        :type tool_resources: ThreadObjectToolResources
        :param metadata: The metadata of this ThreadObject.  # noqa: E501
        :type metadata: object
        """
        self.openapi_types = {
            'id': str,
            'object': str,
            'created_at': int,
            'tool_resources': ThreadObjectToolResources,
            'metadata': object
        }

        self.attribute_map = {
            'id': 'id',
            'object': 'object',
            'created_at': 'created_at',
            'tool_resources': 'tool_resources',
            'metadata': 'metadata'
        }

        self._id = id
        self._object = object
        self._created_at = created_at
        self._tool_resources = tool_resources
        self._metadata = metadata

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

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

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

        The identifier, which can be referenced in API endpoints.  # noqa: E501

        :return: The id of this ThreadObject.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id: str):
        """Sets the id of this ThreadObject.

        The identifier, which can be referenced in API endpoints.  # noqa: E501

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

        self._id = id

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

        The object type, which is always `thread`.  # noqa: E501

        :return: The object of this ThreadObject.
        :rtype: str
        """
        return self._object

    @object.setter
    def object(self, object: str):
        """Sets the object of this ThreadObject.

        The object type, which is always `thread`.  # noqa: E501

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

        self._object = object

    @property
    def created_at(self) -> int:
        """Gets the created_at of this ThreadObject.

        The Unix timestamp (in seconds) for when the thread was created.  # noqa: E501

        :return: The created_at of this ThreadObject.
        :rtype: int
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at: int):
        """Sets the created_at of this ThreadObject.

        The Unix timestamp (in seconds) for when the thread was created.  # noqa: E501

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

        self._created_at = created_at

    @property
    def tool_resources(self) -> ThreadObjectToolResources:
        """Gets the tool_resources of this ThreadObject.


        :return: The tool_resources of this ThreadObject.
        :rtype: ThreadObjectToolResources
        """
        return self._tool_resources

    @tool_resources.setter
    def tool_resources(self, tool_resources: ThreadObjectToolResources):
        """Sets the tool_resources of this ThreadObject.


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

        self._tool_resources = tool_resources

    @property
    def metadata(self) -> object:
        """Gets the metadata of this ThreadObject.

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

        :return: The metadata of this ThreadObject.
        :rtype: object
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata: object):
        """Sets the metadata of this ThreadObject.

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

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

        self._metadata = metadata
