# coding: utf-8

"""

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

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


from pprint import pformat
from six import iteritems
import re


class QueryCondition(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 = {
        '_not': 'str',
        'field': 'Path',
        'operator': 'str',
        'value': 'object',
        '_and': 'list[QueryCondition]',
        '_or': 'list[QueryCondition]',
        'constant_score': 'bool',
        'boost': 'float',
        'negated': 'bool'
    }

    attribute_map = {
        '_not': 'not',
        'field': 'field',
        'operator': 'operator',
        'value': 'value',
        '_and': 'and',
        '_or': 'or',
        'constant_score': 'constantScore',
        'boost': 'boost',
        'negated': 'negated'
    }

    def __init__(self, _not=None, field=None, operator=None, value=None, _and=None, _or=None, constant_score=None, boost=None, negated=None):
        """
        QueryCondition - a model defined in Swagger
        """

        self.__not = None
        self._field = None
        self._operator = None
        self._value = None
        self.__and = None
        self.__or = None
        self._constant_score = None
        self._boost = None
        self._negated = None
        self.discriminator = None

        if _not is not None:
          self._not = _not
        if field is not None:
          self.field = field
        if operator is not None:
          self.operator = operator
        if value is not None:
          self.value = value
        if _and is not None:
          self._and = _and
        if _or is not None:
          self._or = _or
        if constant_score is not None:
          self.constant_score = constant_score
        if boost is not None:
          self.boost = boost
        if negated is not None:
          self.negated = negated

    @property
    def _not(self):
        """
        Gets the _not of this QueryCondition.

        :return: The _not of this QueryCondition.
        :rtype: str
        """
        return self.__not

    @_not.setter
    def _not(self, _not):
        """
        Sets the _not of this QueryCondition.

        :param _not: The _not of this QueryCondition.
        :type: str
        """
        allowed_values = ["NOT"]
        if _not not in allowed_values:
            raise ValueError(
                "Invalid value for `_not` ({0}), must be one of {1}"
                .format(_not, allowed_values)
            )

        self.__not = _not

    @property
    def field(self):
        """
        Gets the field of this QueryCondition.

        :return: The field of this QueryCondition.
        :rtype: Path
        """
        return self._field

    @field.setter
    def field(self, field):
        """
        Sets the field of this QueryCondition.

        :param field: The field of this QueryCondition.
        :type: Path
        """

        self._field = field

    @property
    def operator(self):
        """
        Gets the operator of this QueryCondition.

        :return: The operator of this QueryCondition.
        :rtype: str
        """
        return self._operator

    @operator.setter
    def operator(self, operator):
        """
        Sets the operator of this QueryCondition.

        :param operator: The operator of this QueryCondition.
        :type: str
        """
        allowed_values = ["EQUALS", "NOT_EQUALS", "EQUALS_IC", "NOT_EQUALS_IC", "LIKE", "NOT_LIKE", "LT", "LTE", "GT", "GTE", "BETWEEN", "NOT_BETWEEN", "IN", "NOT_IN", "MATCHES", "NOT_MATCHES", "STARTS_WITH", "NOT_STARTS_WITH", "STARTS_WITH_IC", "NOT_STARTS_WITH_IC"]
        if operator not in allowed_values:
            raise ValueError(
                "Invalid value for `operator` ({0}), must be one of {1}"
                .format(operator, allowed_values)
            )

        self._operator = operator

    @property
    def value(self):
        """
        Gets the value of this QueryCondition.

        :return: The value of this QueryCondition.
        :rtype: object
        """
        return self._value

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

        :param value: The value of this QueryCondition.
        :type: object
        """

        self._value = value

    @property
    def _and(self):
        """
        Gets the _and of this QueryCondition.

        :return: The _and of this QueryCondition.
        :rtype: list[QueryCondition]
        """
        return self.__and

    @_and.setter
    def _and(self, _and):
        """
        Sets the _and of this QueryCondition.

        :param _and: The _and of this QueryCondition.
        :type: list[QueryCondition]
        """

        self.__and = _and

    @property
    def _or(self):
        """
        Gets the _or of this QueryCondition.

        :return: The _or of this QueryCondition.
        :rtype: list[QueryCondition]
        """
        return self.__or

    @_or.setter
    def _or(self, _or):
        """
        Sets the _or of this QueryCondition.

        :param _or: The _or of this QueryCondition.
        :type: list[QueryCondition]
        """

        self.__or = _or

    @property
    def constant_score(self):
        """
        Gets the constant_score of this QueryCondition.

        :return: The constant_score of this QueryCondition.
        :rtype: bool
        """
        return self._constant_score

    @constant_score.setter
    def constant_score(self, constant_score):
        """
        Sets the constant_score of this QueryCondition.

        :param constant_score: The constant_score of this QueryCondition.
        :type: bool
        """

        self._constant_score = constant_score

    @property
    def boost(self):
        """
        Gets the boost of this QueryCondition.

        :return: The boost of this QueryCondition.
        :rtype: float
        """
        return self._boost

    @boost.setter
    def boost(self, boost):
        """
        Sets the boost of this QueryCondition.

        :param boost: The boost of this QueryCondition.
        :type: float
        """

        self._boost = boost

    @property
    def negated(self):
        """
        Gets the negated of this QueryCondition.

        :return: The negated of this QueryCondition.
        :rtype: bool
        """
        return self._negated

    @negated.setter
    def negated(self, negated):
        """
        Sets the negated of this QueryCondition.

        :param negated: The negated of this QueryCondition.
        :type: bool
        """

        self._negated = negated

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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, QueryCondition):
            return False

        return self.__dict__ == other.__dict__

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