# 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 EtcdserverpbWatchResponse(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 = {
        'cancel_reason': 'str',
        'canceled': 'bool',
        'compact_revision': 'str',
        'created': 'bool',
        'events': 'list[MvccpbEvent]',
        'fragment': 'bool',
        'header': 'EtcdserverpbResponseHeader',
        'watch_id': 'str'
    }

    attribute_map = {
        'cancel_reason': 'cancel_reason',
        'canceled': 'canceled',
        'compact_revision': 'compact_revision',
        'created': 'created',
        'events': 'events',
        'fragment': 'fragment',
        'header': 'header',
        'watch_id': 'watch_id'
    }

    def __init__(self, cancel_reason=None, canceled=None, compact_revision=None, created=None, events=None, fragment=None, header=None, watch_id=None, _configuration=None):  # noqa: E501
        """EtcdserverpbWatchResponse - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._cancel_reason = None
        self._canceled = None
        self._compact_revision = None
        self._created = None
        self._events = None
        self._fragment = None
        self._header = None
        self._watch_id = None
        self.discriminator = None

        if cancel_reason is not None:
            self.cancel_reason = cancel_reason
        if canceled is not None:
            self.canceled = canceled
        if compact_revision is not None:
            self.compact_revision = compact_revision
        if created is not None:
            self.created = created
        if events is not None:
            self.events = events
        if fragment is not None:
            self.fragment = fragment
        if header is not None:
            self.header = header
        if watch_id is not None:
            self.watch_id = watch_id

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

        cancel_reason indicates the reason for canceling the watcher.  # noqa: E501

        :return: The cancel_reason of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: str
        """
        return self._cancel_reason

    @cancel_reason.setter
    def cancel_reason(self, cancel_reason):
        """Sets the cancel_reason of this EtcdserverpbWatchResponse.

        cancel_reason indicates the reason for canceling the watcher.  # noqa: E501

        :param cancel_reason: The cancel_reason of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: str
        """

        self._cancel_reason = cancel_reason

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

        canceled is set to true if the response is for a cancel watch request. No further events will be sent to the canceled watcher.  # noqa: E501

        :return: The canceled of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: bool
        """
        return self._canceled

    @canceled.setter
    def canceled(self, canceled):
        """Sets the canceled of this EtcdserverpbWatchResponse.

        canceled is set to true if the response is for a cancel watch request. No further events will be sent to the canceled watcher.  # noqa: E501

        :param canceled: The canceled of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: bool
        """

        self._canceled = canceled

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

        compact_revision is set to the minimum index if a watcher tries to watch at a compacted index.  This happens when creating a watcher at a compacted revision or the watcher cannot catch up with the progress of the key-value store.  The client should treat the watcher as canceled and should not try to create any watcher with the same start_revision again.  # noqa: E501

        :return: The compact_revision of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: str
        """
        return self._compact_revision

    @compact_revision.setter
    def compact_revision(self, compact_revision):
        """Sets the compact_revision of this EtcdserverpbWatchResponse.

        compact_revision is set to the minimum index if a watcher tries to watch at a compacted index.  This happens when creating a watcher at a compacted revision or the watcher cannot catch up with the progress of the key-value store.  The client should treat the watcher as canceled and should not try to create any watcher with the same start_revision again.  # noqa: E501

        :param compact_revision: The compact_revision of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: str
        """

        self._compact_revision = compact_revision

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

        created is set to true if the response is for a create watch request. The client should record the watch_id and expect to receive events for the created watcher from the same stream. All events sent to the created watcher will attach with the same watch_id.  # noqa: E501

        :return: The created of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: bool
        """
        return self._created

    @created.setter
    def created(self, created):
        """Sets the created of this EtcdserverpbWatchResponse.

        created is set to true if the response is for a create watch request. The client should record the watch_id and expect to receive events for the created watcher from the same stream. All events sent to the created watcher will attach with the same watch_id.  # noqa: E501

        :param created: The created of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: bool
        """

        self._created = created

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


        :return: The events of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: list[MvccpbEvent]
        """
        return self._events

    @events.setter
    def events(self, events):
        """Sets the events of this EtcdserverpbWatchResponse.


        :param events: The events of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: list[MvccpbEvent]
        """

        self._events = events

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

        framgment is true if large watch response was split over multiple responses.  # noqa: E501

        :return: The fragment of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: bool
        """
        return self._fragment

    @fragment.setter
    def fragment(self, fragment):
        """Sets the fragment of this EtcdserverpbWatchResponse.

        framgment is true if large watch response was split over multiple responses.  # noqa: E501

        :param fragment: The fragment of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: bool
        """

        self._fragment = fragment

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


        :return: The header of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: EtcdserverpbResponseHeader
        """
        return self._header

    @header.setter
    def header(self, header):
        """Sets the header of this EtcdserverpbWatchResponse.


        :param header: The header of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: EtcdserverpbResponseHeader
        """

        self._header = header

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

        watch_id is the ID of the watcher that corresponds to the response.  # noqa: E501

        :return: The watch_id of this EtcdserverpbWatchResponse.  # noqa: E501
        :rtype: str
        """
        return self._watch_id

    @watch_id.setter
    def watch_id(self, watch_id):
        """Sets the watch_id of this EtcdserverpbWatchResponse.

        watch_id is the ID of the watcher that corresponds to the response.  # noqa: E501

        :param watch_id: The watch_id of this EtcdserverpbWatchResponse.  # noqa: E501
        :type: str
        """

        self._watch_id = watch_id

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

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