# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class NestedError(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 = {
        'input_error': 'InputError',
        'forbidden_error': 'ForbiddenError',
        'unauthorized_error': 'UnauthorizedError',
        'not_found_error': 'NotFoundError',
        'conflict_error': 'ConflictError',
        'error': 'Error',
        '_property': 'str',
        'index': 'int'
    }

    attribute_map = {
        'input_error': 'inputError',
        'forbidden_error': 'forbiddenError',
        'unauthorized_error': 'unauthorizedError',
        'not_found_error': 'notFoundError',
        'conflict_error': 'conflictError',
        'error': 'error',
        '_property': 'property',
        'index': 'index'
    }

    def __init__(self, input_error=None, forbidden_error=None, unauthorized_error=None, not_found_error=None, conflict_error=None, error=None, _property=None, index=None, _configuration=None):  # noqa: E501
        """NestedError - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._input_error = None
        self._forbidden_error = None
        self._unauthorized_error = None
        self._not_found_error = None
        self._conflict_error = None
        self._error = None
        self.__property = None
        self._index = None
        self.discriminator = None

        if input_error is not None:
            self.input_error = input_error
        if forbidden_error is not None:
            self.forbidden_error = forbidden_error
        if unauthorized_error is not None:
            self.unauthorized_error = unauthorized_error
        if not_found_error is not None:
            self.not_found_error = not_found_error
        if conflict_error is not None:
            self.conflict_error = conflict_error
        if error is not None:
            self.error = error
        if _property is not None:
            self._property = _property
        if index is not None:
            self.index = index

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

        The nested error when `InputError`  # noqa: E501

        :return: The input_error of this NestedError.  # noqa: E501
        :rtype: InputError
        """
        return self._input_error

    @input_error.setter
    def input_error(self, input_error):
        """Sets the input_error of this NestedError.

        The nested error when `InputError`  # noqa: E501

        :param input_error: The input_error of this NestedError.  # noqa: E501
        :type: InputError
        """

        self._input_error = input_error

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

        The nested error when `ForbiddenError`  # noqa: E501

        :return: The forbidden_error of this NestedError.  # noqa: E501
        :rtype: ForbiddenError
        """
        return self._forbidden_error

    @forbidden_error.setter
    def forbidden_error(self, forbidden_error):
        """Sets the forbidden_error of this NestedError.

        The nested error when `ForbiddenError`  # noqa: E501

        :param forbidden_error: The forbidden_error of this NestedError.  # noqa: E501
        :type: ForbiddenError
        """

        self._forbidden_error = forbidden_error

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

        The nested error when `UnauthorizedError`  # noqa: E501

        :return: The unauthorized_error of this NestedError.  # noqa: E501
        :rtype: UnauthorizedError
        """
        return self._unauthorized_error

    @unauthorized_error.setter
    def unauthorized_error(self, unauthorized_error):
        """Sets the unauthorized_error of this NestedError.

        The nested error when `UnauthorizedError`  # noqa: E501

        :param unauthorized_error: The unauthorized_error of this NestedError.  # noqa: E501
        :type: UnauthorizedError
        """

        self._unauthorized_error = unauthorized_error

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

        The nested error when `NotFoundError`  # noqa: E501

        :return: The not_found_error of this NestedError.  # noqa: E501
        :rtype: NotFoundError
        """
        return self._not_found_error

    @not_found_error.setter
    def not_found_error(self, not_found_error):
        """Sets the not_found_error of this NestedError.

        The nested error when `NotFoundError`  # noqa: E501

        :param not_found_error: The not_found_error of this NestedError.  # noqa: E501
        :type: NotFoundError
        """

        self._not_found_error = not_found_error

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

        The nested error when `ConflictError`  # noqa: E501

        :return: The conflict_error of this NestedError.  # noqa: E501
        :rtype: ConflictError
        """
        return self._conflict_error

    @conflict_error.setter
    def conflict_error(self, conflict_error):
        """Sets the conflict_error of this NestedError.

        The nested error when `ConflictError`  # noqa: E501

        :param conflict_error: The conflict_error of this NestedError.  # noqa: E501
        :type: ConflictError
        """

        self._conflict_error = conflict_error

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

        The nested error when `Error`  # noqa: E501

        :return: The error of this NestedError.  # noqa: E501
        :rtype: Error
        """
        return self._error

    @error.setter
    def error(self, error):
        """Sets the error of this NestedError.

        The nested error when `Error`  # noqa: E501

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

        self._error = error

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

        The property name that generated the error  # noqa: E501

        :return: The _property of this NestedError.  # noqa: E501
        :rtype: str
        """
        return self.__property

    @_property.setter
    def _property(self, _property):
        """Sets the _property of this NestedError.

        The property name that generated the error  # noqa: E501

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

        self.__property = _property

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

        If the property is indexed, contains the index with error              # noqa: E501

        :return: The index of this NestedError.  # noqa: E501
        :rtype: int
        """
        return self._index

    @index.setter
    def index(self, index):
        """Sets the index of this NestedError.

        If the property is indexed, contains the index with error              # noqa: E501

        :param index: The index of this NestedError.  # noqa: E501
        :type: int
        """

        self._index = index

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

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