# 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 Error(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 = {
        'code': 'int',
        'key': 'str',
        'messages': 'list[str]',
        'model': 'str',
        'type': 'str'
    }

    attribute_map = {
        'code': 'Code',
        'key': 'Key',
        'messages': 'Messages',
        'model': 'Model',
        'type': 'Type'
    }

    def __init__(self, code=None, key=None, messages=None, model=None, type=None, _configuration=None):  # noqa: E501
        """Error - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._code = None
        self._key = None
        self._messages = None
        self._model = None
        self._type = None
        self.discriminator = None

        if code is not None:
            self.code = code
        if key is not None:
            self.key = key
        if messages is not None:
            self.messages = messages
        if model is not None:
            self.model = model
        if type is not None:
            self.type = type

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

        Code is the HTTP status code that should be used for this Error  # noqa: E501

        :return: The code of this Error.  # noqa: E501
        :rtype: int
        """
        return self._code

    @code.setter
    def code(self, code):
        """Sets the code of this Error.

        Code is the HTTP status code that should be used for this Error  # noqa: E501

        :param code: The code of this Error.  # noqa: E501
        :type: int
        """

        self._code = code

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

        Key is the unique per-model identifier of the object to which the error refers. It is generally whatever thing.Key() would return.  # noqa: E501

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

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

        Key is the unique per-model identifier of the object to which the error refers. It is generally whatever thing.Key() would return.  # noqa: E501

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

        self._key = key

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

        Messages are any additional messages related to this Error  # noqa: E501

        :return: The messages of this Error.  # noqa: E501
        :rtype: list[str]
        """
        return self._messages

    @messages.setter
    def messages(self, messages):
        """Sets the messages of this Error.

        Messages are any additional messages related to this Error  # noqa: E501

        :param messages: The messages of this Error.  # noqa: E501
        :type: list[str]
        """

        self._messages = messages

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

        Model is the type of object to which the error refers.  It is generally whatever thing.Prefix() would return.  # noqa: E501

        :return: The model of this Error.  # noqa: E501
        :rtype: str
        """
        return self._model

    @model.setter
    def model(self, model):
        """Sets the model of this Error.

        Model is the type of object to which the error refers.  It is generally whatever thing.Prefix() would return.  # noqa: E501

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

        self._model = model

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

        Type is the type of error this is.  There is no set definition for what this us.  # noqa: E501

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

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

        Type is the type of error this is.  There is no set definition for what this us.  # noqa: E501

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

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

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