# coding: utf-8

"""
    AristaFlowREST/WorklistManager

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

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

import pprint
import re  # noqa: F401

import six

class Resource(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 = {
        'id': 'str',
        'name': 'str',
        'desc': 'str',
        'sub_res': 'list[Resource]',
        'attributes': 'list[Attribute]'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'desc': 'desc',
        'sub_res': 'subRes',
        'attributes': 'attributes'
    }

    def __init__(self, id=None, name=None, desc=None, sub_res=None, attributes=None):  # noqa: E501
        """Resource - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._name = None
        self._desc = None
        self._sub_res = None
        self._attributes = None
        if not(hasattr(self, "discriminator")) or not(self.discriminator):
            self.discriminator = None
        self.id = id
        self.name = name
        if desc is not None:
            self.desc = desc
        if sub_res is not None:
            self.sub_res = sub_res
        if attributes is not None:
            self.attributes = attributes

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


        :return: The id of this Resource.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Resource.


        :param id: The id of this Resource.  # noqa: E501
        :type: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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


        :return: The name of this Resource.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Resource.


        :param name: The name of this Resource.  # noqa: E501
        :type: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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


        :return: The desc of this Resource.  # noqa: E501
        :rtype: str
        """
        return self._desc

    @desc.setter
    def desc(self, desc):
        """Sets the desc of this Resource.


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

        self._desc = desc

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


        :return: The sub_res of this Resource.  # noqa: E501
        :rtype: list[Resource]
        """
        return self._sub_res

    @sub_res.setter
    def sub_res(self, sub_res):
        """Sets the sub_res of this Resource.


        :param sub_res: The sub_res of this Resource.  # noqa: E501
        :type: list[Resource]
        """

        self._sub_res = sub_res

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


        :return: The attributes of this Resource.  # noqa: E501
        :rtype: list[Attribute]
        """
        return self._attributes

    @attributes.setter
    def attributes(self, attributes):
        """Sets the attributes of this Resource.


        :param attributes: The attributes of this Resource.  # noqa: E501
        :type: list[Attribute]
        """

        self._attributes = attributes

    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(Resource, 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, Resource):
            return False

        return self.__dict__ == other.__dict__

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