# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


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

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'topic': 'str',
        'key': 'str',
        'message': 'str',
        'message_type': 'str',
        'timestamp': 'datetime'
    }

    attribute_map = {
        'topic': 'topic',
        'key': 'key',
        'message': 'message',
        'message_type': 'message_type',
        'timestamp': 'timestamp'
    }

    def __init__(self, topic=None, key=None, message=None, message_type=None, timestamp=None, local_vars_configuration=None):  # noqa: E501
        """StreamPublishRequest - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._topic = None
        self._key = None
        self._message = None
        self._message_type = None
        self._timestamp = None
        self.discriminator = None

        self.topic = topic
        self.key = key
        self.message = message
        self.message_type = message_type
        self.timestamp = timestamp

    @property
    def topic(self):
        """Gets the topic of this StreamPublishRequest.  # noqa: E501

        A topic to publish this event into.  # noqa: E501

        :return: The topic of this StreamPublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._topic

    @topic.setter
    def topic(self, topic):
        """Sets the topic of this StreamPublishRequest.

        A topic to publish this event into.  # noqa: E501

        :param topic: The topic of this StreamPublishRequest.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and topic is None:  # noqa: E501
            raise ValueError("Invalid value for `topic`, must not be `None`")  # noqa: E501

        self._topic = topic

    @property
    def key(self):
        """Gets the key of this StreamPublishRequest.  # noqa: E501

        A partitioning key for the event; all events emitted with a single key will be read in-order (usually cloud ID, cluster ID, etc.)  # noqa: E501

        :return: The key of this StreamPublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._key

    @key.setter
    def key(self, key):
        """Sets the key of this StreamPublishRequest.

        A partitioning key for the event; all events emitted with a single key will be read in-order (usually cloud ID, cluster ID, etc.)  # noqa: E501

        :param key: The key of this StreamPublishRequest.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and key is None:  # noqa: E501
            raise ValueError("Invalid value for `key`, must not be `None`")  # noqa: E501

        self._key = key

    @property
    def message(self):
        """Gets the message of this StreamPublishRequest.  # noqa: E501

        A JSON-serialized protobuf message body.  # noqa: E501

        :return: The message of this StreamPublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._message

    @message.setter
    def message(self, message):
        """Sets the message of this StreamPublishRequest.

        A JSON-serialized protobuf message body.  # noqa: E501

        :param message: The message of this StreamPublishRequest.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and message is None:  # noqa: E501
            raise ValueError("Invalid value for `message`, must not be `None`")  # noqa: E501

        self._message = message

    @property
    def message_type(self):
        """Gets the message_type of this StreamPublishRequest.  # noqa: E501

        The type of protobuf that we want to publish (e.g. protobuf message type name).  # noqa: E501

        :return: The message_type of this StreamPublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._message_type

    @message_type.setter
    def message_type(self, message_type):
        """Sets the message_type of this StreamPublishRequest.

        The type of protobuf that we want to publish (e.g. protobuf message type name).  # noqa: E501

        :param message_type: The message_type of this StreamPublishRequest.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and message_type is None:  # noqa: E501
            raise ValueError("Invalid value for `message_type`, must not be `None`")  # noqa: E501

        self._message_type = message_type

    @property
    def timestamp(self):
        """Gets the timestamp of this StreamPublishRequest.  # noqa: E501

        The time (in UTC) at which this event occurred.  # noqa: E501

        :return: The timestamp of this StreamPublishRequest.  # noqa: E501
        :rtype: datetime
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this StreamPublishRequest.

        The time (in UTC) at which this event occurred.  # noqa: E501

        :param timestamp: The timestamp of this StreamPublishRequest.  # noqa: E501
        :type: datetime
        """
        if self.local_vars_configuration.client_side_validation and timestamp is None:  # noqa: E501
            raise ValueError("Invalid value for `timestamp`, must not be `None`")  # noqa: E501

        self._timestamp = timestamp

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, StreamPublishRequest):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, StreamPublishRequest):
            return True

        return self.to_dict() != other.to_dict()
