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.message_object_attachments_inner import \
    MessageObjectAttachmentsInner  # noqa: E501
from timestep.api.openai.v1.models.message_object_content_inner import \
    MessageObjectContentInner  # noqa: E501
from timestep.api.openai.v1.models.message_object_incomplete_details import \
    MessageObjectIncompleteDetails  # noqa: E501


class MessageObject(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, thread_id=None, status=None, incomplete_details=None, completed_at=None, incomplete_at=None, role=None, content=None, assistant_id=None, run_id=None, attachments=None, metadata=None):  # noqa: E501
        """MessageObject - a model defined in OpenAPI

        :param id: The id of this MessageObject.  # noqa: E501
        :type id: str
        :param object: The object of this MessageObject.  # noqa: E501
        :type object: str
        :param created_at: The created_at of this MessageObject.  # noqa: E501
        :type created_at: int
        :param thread_id: The thread_id of this MessageObject.  # noqa: E501
        :type thread_id: str
        :param status: The status of this MessageObject.  # noqa: E501
        :type status: str
        :param incomplete_details: The incomplete_details of this MessageObject.  # noqa: E501
        :type incomplete_details: MessageObjectIncompleteDetails
        :param completed_at: The completed_at of this MessageObject.  # noqa: E501
        :type completed_at: int
        :param incomplete_at: The incomplete_at of this MessageObject.  # noqa: E501
        :type incomplete_at: int
        :param role: The role of this MessageObject.  # noqa: E501
        :type role: str
        :param content: The content of this MessageObject.  # noqa: E501
        :type content: List[MessageObjectContentInner]
        :param assistant_id: The assistant_id of this MessageObject.  # noqa: E501
        :type assistant_id: str
        :param run_id: The run_id of this MessageObject.  # noqa: E501
        :type run_id: str
        :param attachments: The attachments of this MessageObject.  # noqa: E501
        :type attachments: List[MessageObjectAttachmentsInner]
        :param metadata: The metadata of this MessageObject.  # noqa: E501
        :type metadata: object
        """
        self.openapi_types = {
            'id': str,
            'object': str,
            'created_at': int,
            'thread_id': str,
            'status': str,
            'incomplete_details': MessageObjectIncompleteDetails,
            'completed_at': int,
            'incomplete_at': int,
            'role': str,
            'content': List[MessageObjectContentInner],
            'assistant_id': str,
            'run_id': str,
            'attachments': List[MessageObjectAttachmentsInner],
            'metadata': object
        }

        self.attribute_map = {
            'id': 'id',
            'object': 'object',
            'created_at': 'created_at',
            'thread_id': 'thread_id',
            'status': 'status',
            'incomplete_details': 'incomplete_details',
            'completed_at': 'completed_at',
            'incomplete_at': 'incomplete_at',
            'role': 'role',
            'content': 'content',
            'assistant_id': 'assistant_id',
            'run_id': 'run_id',
            'attachments': 'attachments',
            'metadata': 'metadata'
        }

        self._id = id
        self._object = object
        self._created_at = created_at
        self._thread_id = thread_id
        self._status = status
        self._incomplete_details = incomplete_details
        self._completed_at = completed_at
        self._incomplete_at = incomplete_at
        self._role = role
        self._content = content
        self._assistant_id = assistant_id
        self._run_id = run_id
        self._attachments = attachments
        self._metadata = metadata

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

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

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

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

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

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

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

        :param id: The id of this MessageObject.
        :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 MessageObject.

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

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

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

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

        :param object: The object of this MessageObject.
        :type object: str
        """
        allowed_values = ["thread.message"]  # 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 MessageObject.

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

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

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

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

        :param created_at: The created_at of this MessageObject.
        :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 thread_id(self) -> str:
        """Gets the thread_id of this MessageObject.

        The [thread](/docs/api-reference/threads) ID that this message belongs to.  # noqa: E501

        :return: The thread_id of this MessageObject.
        :rtype: str
        """
        return self._thread_id

    @thread_id.setter
    def thread_id(self, thread_id: str):
        """Sets the thread_id of this MessageObject.

        The [thread](/docs/api-reference/threads) ID that this message belongs to.  # noqa: E501

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

        self._thread_id = thread_id

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

        The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.  # noqa: E501

        :return: The status of this MessageObject.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status: str):
        """Sets the status of this MessageObject.

        The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.  # noqa: E501

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

        self._status = status

    @property
    def incomplete_details(self) -> MessageObjectIncompleteDetails:
        """Gets the incomplete_details of this MessageObject.


        :return: The incomplete_details of this MessageObject.
        :rtype: MessageObjectIncompleteDetails
        """
        return self._incomplete_details

    @incomplete_details.setter
    def incomplete_details(self, incomplete_details: MessageObjectIncompleteDetails):
        """Sets the incomplete_details of this MessageObject.


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

        self._incomplete_details = incomplete_details

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

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

        :return: The completed_at of this MessageObject.
        :rtype: int
        """
        return self._completed_at

    @completed_at.setter
    def completed_at(self, completed_at: int):
        """Sets the completed_at of this MessageObject.

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

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

        self._completed_at = completed_at

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

        The Unix timestamp (in seconds) for when the message was marked as incomplete.  # noqa: E501

        :return: The incomplete_at of this MessageObject.
        :rtype: int
        """
        return self._incomplete_at

    @incomplete_at.setter
    def incomplete_at(self, incomplete_at: int):
        """Sets the incomplete_at of this MessageObject.

        The Unix timestamp (in seconds) for when the message was marked as incomplete.  # noqa: E501

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

        self._incomplete_at = incomplete_at

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

        The entity that produced the message. One of `user` or `assistant`.  # noqa: E501

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

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

        The entity that produced the message. One of `user` or `assistant`.  # noqa: E501

        :param role: The role of this MessageObject.
        :type role: str
        """
        allowed_values = ["user", "assistant"]  # 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

    @property
    def content(self) -> List[MessageObjectContentInner]:
        """Gets the content of this MessageObject.

        The content of the message in array of text and/or images.  # noqa: E501

        :return: The content of this MessageObject.
        :rtype: List[MessageObjectContentInner]
        """
        return self._content

    @content.setter
    def content(self, content: List[MessageObjectContentInner]):
        """Sets the content of this MessageObject.

        The content of the message in array of text and/or images.  # noqa: E501

        :param content: The content of this MessageObject.
        :type content: List[MessageObjectContentInner]
        """
        if content is None:
            raise ValueError("Invalid value for `content`, must not be `None`")  # noqa: E501

        self._content = content

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

        If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.  # noqa: E501

        :return: The assistant_id of this MessageObject.
        :rtype: str
        """
        return self._assistant_id

    @assistant_id.setter
    def assistant_id(self, assistant_id: str):
        """Sets the assistant_id of this MessageObject.

        If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.  # noqa: E501

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

        self._assistant_id = assistant_id

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

        The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.  # noqa: E501

        :return: The run_id of this MessageObject.
        :rtype: str
        """
        return self._run_id

    @run_id.setter
    def run_id(self, run_id: str):
        """Sets the run_id of this MessageObject.

        The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.  # noqa: E501

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

        self._run_id = run_id

    @property
    def attachments(self) -> List[MessageObjectAttachmentsInner]:
        """Gets the attachments of this MessageObject.

        A list of files attached to the message, and the tools they were added to.  # noqa: E501

        :return: The attachments of this MessageObject.
        :rtype: List[MessageObjectAttachmentsInner]
        """
        return self._attachments

    @attachments.setter
    def attachments(self, attachments: List[MessageObjectAttachmentsInner]):
        """Sets the attachments of this MessageObject.

        A list of files attached to the message, and the tools they were added to.  # noqa: E501

        :param attachments: The attachments of this MessageObject.
        :type attachments: List[MessageObjectAttachmentsInner]
        """
        if attachments is None:
            raise ValueError("Invalid value for `attachments`, must not be `None`")  # noqa: E501

        self._attachments = attachments

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

        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 MessageObject.
        :rtype: object
        """
        return self._metadata

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

        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 MessageObject.
        :type metadata: object
        """
        if metadata is None:
            raise ValueError("Invalid value for `metadata`, must not be `None`")  # noqa: E501

        self._metadata = metadata
