# coding: utf-8

"""
    DigitalRebar Provision Server

    # An RestFUL API-driven Provisioner and DHCP server  # noqa: E501

    OpenAPI spec version: 4.14.0
    Contact: support@rackn.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from drppy_client.configuration import Configuration


class Index(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 = {
        'regex': 'bool',
        'type': 'str',
        'unique': 'bool',
        'unordered': 'bool'
    }

    attribute_map = {
        'regex': 'Regex',
        'type': 'Type',
        'unique': 'Unique',
        'unordered': 'Unordered'
    }

    def __init__(self, regex=None, type=None, unique=None, unordered=None, _configuration=None):  # noqa: E501
        """Index - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._regex = None
        self._type = None
        self._unique = None
        self._unordered = None
        self.discriminator = None

        if regex is not None:
            self.regex = regex
        if type is not None:
            self.type = type
        if unique is not None:
            self.unique = unique
        if unordered is not None:
            self.unordered = unordered

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

        Regex indicates whether you can use the Re filter with this index  # noqa: E501

        :return: The regex of this Index.  # noqa: E501
        :rtype: bool
        """
        return self._regex

    @regex.setter
    def regex(self, regex):
        """Sets the regex of this Index.

        Regex indicates whether you can use the Re filter with this index  # noqa: E501

        :param regex: The regex of this Index.  # noqa: E501
        :type: bool
        """

        self._regex = regex

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

        Type gives you a rough idea of how the string used to query this index should be formatted.  # noqa: E501

        :return: The type of this Index.  # noqa: E501
        :rtype: str
        """
        return self._type

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

        Type gives you a rough idea of how the string used to query this index should be formatted.  # noqa: E501

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

        self._type = type

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

        Unique tells you whether there can be multiple entries in the index for the same key that refer to different items.  # noqa: E501

        :return: The unique of this Index.  # noqa: E501
        :rtype: bool
        """
        return self._unique

    @unique.setter
    def unique(self, unique):
        """Sets the unique of this Index.

        Unique tells you whether there can be multiple entries in the index for the same key that refer to different items.  # noqa: E501

        :param unique: The unique of this Index.  # noqa: E501
        :type: bool
        """

        self._unique = unique

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

        Unordered tells you whether this index cannot be sorted.  # noqa: E501

        :return: The unordered of this Index.  # noqa: E501
        :rtype: bool
        """
        return self._unordered

    @unordered.setter
    def unordered(self, unordered):
        """Sets the unordered of this Index.

        Unordered tells you whether this index cannot be sorted.  # noqa: E501

        :param unordered: The unordered of this Index.  # noqa: E501
        :type: bool
        """

        self._unordered = unordered

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

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