# coding: utf-8

"""
    api/etcdserverpb/rpc.proto

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: version not set
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from etcd_client.configuration import Configuration


class MvccpbEvent(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'kv': 'MvccpbKeyValue',
        'prev_kv': 'MvccpbKeyValue',
        'type': 'EventEventType'
    }

    attribute_map = {
        'kv': 'kv',
        'prev_kv': 'prev_kv',
        'type': 'type'
    }

    def __init__(self, kv=None, prev_kv=None, type=None, _configuration=None):  # noqa: E501
        """MvccpbEvent - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._kv = None
        self._prev_kv = None
        self._type = None
        self.discriminator = None

        if kv is not None:
            self.kv = kv
        if prev_kv is not None:
            self.prev_kv = prev_kv
        if type is not None:
            self.type = type

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

        kv holds the KeyValue for the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE/EXPIRE event contains the deleted key with its modification revision set to the revision of deletion.  # noqa: E501

        :return: The kv of this MvccpbEvent.  # noqa: E501
        :rtype: MvccpbKeyValue
        """
        return self._kv

    @kv.setter
    def kv(self, kv):
        """Sets the kv of this MvccpbEvent.

        kv holds the KeyValue for the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE/EXPIRE event contains the deleted key with its modification revision set to the revision of deletion.  # noqa: E501

        :param kv: The kv of this MvccpbEvent.  # noqa: E501
        :type: MvccpbKeyValue
        """

        self._kv = kv

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

        prev_kv holds the key-value pair before the event happens.  # noqa: E501

        :return: The prev_kv of this MvccpbEvent.  # noqa: E501
        :rtype: MvccpbKeyValue
        """
        return self._prev_kv

    @prev_kv.setter
    def prev_kv(self, prev_kv):
        """Sets the prev_kv of this MvccpbEvent.

        prev_kv holds the key-value pair before the event happens.  # noqa: E501

        :param prev_kv: The prev_kv of this MvccpbEvent.  # noqa: E501
        :type: MvccpbKeyValue
        """

        self._prev_kv = prev_kv

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

        type is the kind of event. If type is a PUT, it indicates new data has been stored to the key. If type is a DELETE, it indicates the key was deleted.  # noqa: E501

        :return: The type of this MvccpbEvent.  # noqa: E501
        :rtype: EventEventType
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this MvccpbEvent.

        type is the kind of event. If type is a PUT, it indicates new data has been stored to the key. If type is a DELETE, it indicates the key was deleted.  # noqa: E501

        :param type: The type of this MvccpbEvent.  # noqa: E501
        :type: EventEventType
        """

        self._type = type

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(MvccpbEvent, dict):
            for key, value in self.items():
                result[key] = 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, MvccpbEvent):
            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, MvccpbEvent):
            return True

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