# 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 EventsServicePublishRequest(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',
        'partition': 'str',
        'payload': 'str',
        'event_time': 'int',
        'maxlen': 'str',
        'minid': 'str'
    }

    attribute_map = {
        'topic': 'topic',
        'partition': 'partition',
        'payload': 'payload',
        'event_time': 'event_time',
        'maxlen': 'maxlen',
        'minid': 'minid'
    }

    def __init__(self, topic=None, partition=None, payload=None, event_time=None, maxlen=None, minid=None, local_vars_configuration=None):  # noqa: E501
        """EventsServicePublishRequest - 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._partition = None
        self._payload = None
        self._event_time = None
        self._maxlen = None
        self._minid = None
        self.discriminator = None

        self.topic = topic
        self.partition = partition
        self.payload = payload
        self.event_time = event_time
        if maxlen is not None:
            self.maxlen = maxlen
        if minid is not None:
            self.minid = minid

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

        The topic to publish this event to.  # noqa: E501

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

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

        The topic to publish this event to.  # noqa: E501

        :param topic: The topic of this EventsServicePublishRequest.  # 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 partition(self):
        """Gets the partition of this EventsServicePublishRequest.  # noqa: E501

        The partition key to publish this event to.  # noqa: E501

        :return: The partition of this EventsServicePublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._partition

    @partition.setter
    def partition(self, partition):
        """Sets the partition of this EventsServicePublishRequest.

        The partition key to publish this event to.  # noqa: E501

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

        self._partition = partition

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

        A payload in bytes containing the event message. This should be a serialized version of the google.protobuf.any_pb2.Any message type.  # noqa: E501

        :return: The payload of this EventsServicePublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._payload

    @payload.setter
    def payload(self, payload):
        """Sets the payload of this EventsServicePublishRequest.

        A payload in bytes containing the event message. This should be a serialized version of the google.protobuf.any_pb2.Any message type.  # noqa: E501

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

        self._payload = payload

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

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

        :return: The event_time of this EventsServicePublishRequest.  # noqa: E501
        :rtype: int
        """
        return self._event_time

    @event_time.setter
    def event_time(self, event_time):
        """Sets the event_time of this EventsServicePublishRequest.

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

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

        self._event_time = event_time

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

        If maxlen is specified, old entries are automatically evicted when the specified length is reached, so that the stream is always a constant size.  # noqa: E501

        :return: The maxlen of this EventsServicePublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._maxlen

    @maxlen.setter
    def maxlen(self, maxlen):
        """Sets the maxlen of this EventsServicePublishRequest.

        If maxlen is specified, old entries are automatically evicted when the specified length is reached, so that the stream is always a constant size.  # noqa: E501

        :param maxlen: The maxlen of this EventsServicePublishRequest.  # noqa: E501
        :type: str
        """

        self._maxlen = maxlen

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

        If minid is specified, entries older than minid are evicted.  # noqa: E501

        :return: The minid of this EventsServicePublishRequest.  # noqa: E501
        :rtype: str
        """
        return self._minid

    @minid.setter
    def minid(self, minid):
        """Sets the minid of this EventsServicePublishRequest.

        If minid is specified, entries older than minid are evicted.  # noqa: E501

        :param minid: The minid of this EventsServicePublishRequest.  # noqa: E501
        :type: str
        """

        self._minid = minid

    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, EventsServicePublishRequest):
            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, EventsServicePublishRequest):
            return True

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