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.create_message_request_content import \
    CreateMessageRequestContent  # noqa: E501
from timestep.api.openai.v1.models.message_object_attachments_inner import \
    MessageObjectAttachmentsInner  # noqa: E501


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

    Do not edit the class manually.
    """

    def __init__(self, role=None, content=None, attachments=None, metadata=None):  # noqa: E501
        """CreateMessageRequest - a model defined in OpenAPI

        :param role: The role of this CreateMessageRequest.  # noqa: E501
        :type role: str
        :param content: The content of this CreateMessageRequest.  # noqa: E501
        :type content: CreateMessageRequestContent
        :param attachments: The attachments of this CreateMessageRequest.  # noqa: E501
        :type attachments: List[MessageObjectAttachmentsInner]
        :param metadata: The metadata of this CreateMessageRequest.  # noqa: E501
        :type metadata: object
        """
        self.openapi_types = {
            'role': str,
            'content': CreateMessageRequestContent,
            'attachments': List[MessageObjectAttachmentsInner],
            'metadata': object
        }

        self.attribute_map = {
            'role': 'role',
            'content': 'content',
            'attachments': 'attachments',
            'metadata': 'metadata'
        }

        self._role = role
        self._content = content
        self._attachments = attachments
        self._metadata = metadata

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

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

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

        The role of the entity that is creating the message. Allowed values include: - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.   # noqa: E501

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

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

        The role of the entity that is creating the message. Allowed values include: - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.   # noqa: E501

        :param role: The role of this CreateMessageRequest.
        :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) -> CreateMessageRequestContent:
        """Gets the content of this CreateMessageRequest.


        :return: The content of this CreateMessageRequest.
        :rtype: CreateMessageRequestContent
        """
        return self._content

    @content.setter
    def content(self, content: CreateMessageRequestContent):
        """Sets the content of this CreateMessageRequest.


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

        self._content = content

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

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

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

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

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

        :param attachments: The attachments of this CreateMessageRequest.
        :type attachments: List[MessageObjectAttachmentsInner]
        """

        self._attachments = attachments

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

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

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

        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 CreateMessageRequest.
        :type metadata: object
        """

        self._metadata = metadata
