# 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 EtcdserverpbCompare(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 = {
        'create_revision': 'str',
        'key': 'str',
        'lease': 'str',
        'mod_revision': 'str',
        'range_end': 'str',
        'result': 'CompareCompareResult',
        'target': 'CompareCompareTarget',
        'value': 'str',
        'version': 'str'
    }

    attribute_map = {
        'create_revision': 'create_revision',
        'key': 'key',
        'lease': 'lease',
        'mod_revision': 'mod_revision',
        'range_end': 'range_end',
        'result': 'result',
        'target': 'target',
        'value': 'value',
        'version': 'version'
    }

    def __init__(self, create_revision=None, key=None, lease=None, mod_revision=None, range_end=None, result=None, target=None, value=None, version=None, _configuration=None):  # noqa: E501
        """EtcdserverpbCompare - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._create_revision = None
        self._key = None
        self._lease = None
        self._mod_revision = None
        self._range_end = None
        self._result = None
        self._target = None
        self._value = None
        self._version = None
        self.discriminator = None

        if create_revision is not None:
            self.create_revision = create_revision
        if key is not None:
            self.key = key
        if lease is not None:
            self.lease = lease
        if mod_revision is not None:
            self.mod_revision = mod_revision
        if range_end is not None:
            self.range_end = range_end
        if result is not None:
            self.result = result
        if target is not None:
            self.target = target
        if value is not None:
            self.value = value
        if version is not None:
            self.version = version

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


        :return: The create_revision of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._create_revision

    @create_revision.setter
    def create_revision(self, create_revision):
        """Sets the create_revision of this EtcdserverpbCompare.


        :param create_revision: The create_revision of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """

        self._create_revision = create_revision

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

        key is the subject key for the comparison operation.  # noqa: E501

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

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

        key is the subject key for the comparison operation.  # noqa: E501

        :param key: The key of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                key is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', key)):  # noqa: E501
            raise ValueError(r"Invalid value for `key`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._key = key

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

        lease is the lease id of the given key.  # noqa: E501

        :return: The lease of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._lease

    @lease.setter
    def lease(self, lease):
        """Sets the lease of this EtcdserverpbCompare.

        lease is the lease id of the given key.  # noqa: E501

        :param lease: The lease of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """

        self._lease = lease

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

        mod_revision is the last modified revision of the given key.  # noqa: E501

        :return: The mod_revision of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._mod_revision

    @mod_revision.setter
    def mod_revision(self, mod_revision):
        """Sets the mod_revision of this EtcdserverpbCompare.

        mod_revision is the last modified revision of the given key.  # noqa: E501

        :param mod_revision: The mod_revision of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """

        self._mod_revision = mod_revision

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

        range_end compares the given target to all keys in the range [key, range_end). See RangeRequest for more details on key ranges.  # noqa: E501

        :return: The range_end of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._range_end

    @range_end.setter
    def range_end(self, range_end):
        """Sets the range_end of this EtcdserverpbCompare.

        range_end compares the given target to all keys in the range [key, range_end). See RangeRequest for more details on key ranges.  # noqa: E501

        :param range_end: The range_end of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                range_end is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', range_end)):  # noqa: E501
            raise ValueError(r"Invalid value for `range_end`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._range_end = range_end

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

        result is logical comparison operation for this comparison.  # noqa: E501

        :return: The result of this EtcdserverpbCompare.  # noqa: E501
        :rtype: CompareCompareResult
        """
        return self._result

    @result.setter
    def result(self, result):
        """Sets the result of this EtcdserverpbCompare.

        result is logical comparison operation for this comparison.  # noqa: E501

        :param result: The result of this EtcdserverpbCompare.  # noqa: E501
        :type: CompareCompareResult
        """

        self._result = result

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

        target is the key-value field to inspect for the comparison.  # noqa: E501

        :return: The target of this EtcdserverpbCompare.  # noqa: E501
        :rtype: CompareCompareTarget
        """
        return self._target

    @target.setter
    def target(self, target):
        """Sets the target of this EtcdserverpbCompare.

        target is the key-value field to inspect for the comparison.  # noqa: E501

        :param target: The target of this EtcdserverpbCompare.  # noqa: E501
        :type: CompareCompareTarget
        """

        self._target = target

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

        value is the value of the given key, in bytes.  # noqa: E501

        :return: The value of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this EtcdserverpbCompare.

        value is the value of the given key, in bytes.  # noqa: E501

        :param value: The value of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                value is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', value)):  # noqa: E501
            raise ValueError(r"Invalid value for `value`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._value = value

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


        :return: The version of this EtcdserverpbCompare.  # noqa: E501
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this EtcdserverpbCompare.


        :param version: The version of this EtcdserverpbCompare.  # noqa: E501
        :type: str
        """

        self._version = version

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

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