# coding: utf-8

"""
    Syntropy network API

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

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

import pprint
import re  # noqa: F401

import six


class Permission(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 = {
        "permission_id": "float",
        "permission_name": "str",
        "permission_description": "str",
        "users": "list[User]",
        "roles": "list[Role]",
    }

    attribute_map = {
        "permission_id": "permission_id",
        "permission_name": "permission_name",
        "permission_description": "permission_description",
        "users": "users",
        "roles": "roles",
    }

    def __init__(
        self,
        permission_id=None,
        permission_name=None,
        permission_description=None,
        users=None,
        roles=None,
    ):  # noqa: E501
        """Permission - a model defined in Swagger"""  # noqa: E501
        self._permission_id = None
        self._permission_name = None
        self._permission_description = None
        self._users = None
        self._roles = None
        self.discriminator = None
        self.permission_id = permission_id
        self.permission_name = permission_name
        self.permission_description = permission_description
        if users is not None:
            self.users = users
        if roles is not None:
            self.roles = roles

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


        :return: The permission_id of this Permission.  # noqa: E501
        :rtype: float
        """
        return self._permission_id

    @permission_id.setter
    def permission_id(self, permission_id):
        """Sets the permission_id of this Permission.


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

        self._permission_id = permission_id

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


        :return: The permission_name of this Permission.  # noqa: E501
        :rtype: str
        """
        return self._permission_name

    @permission_name.setter
    def permission_name(self, permission_name):
        """Sets the permission_name of this Permission.


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

        self._permission_name = permission_name

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


        :return: The permission_description of this Permission.  # noqa: E501
        :rtype: str
        """
        return self._permission_description

    @permission_description.setter
    def permission_description(self, permission_description):
        """Sets the permission_description of this Permission.


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

        self._permission_description = permission_description

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


        :return: The users of this Permission.  # noqa: E501
        :rtype: list[User]
        """
        return self._users

    @users.setter
    def users(self, users):
        """Sets the users of this Permission.


        :param users: The users of this Permission.  # noqa: E501
        :type: list[User]
        """

        self._users = users

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


        :return: The roles of this Permission.  # noqa: E501
        :rtype: list[Role]
        """
        return self._roles

    @roles.setter
    def roles(self, roles):
        """Sets the roles of this Permission.


        :param roles: The roles of this Permission.  # noqa: E501
        :type: list[Role]
        """

        self._roles = roles

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

        return self.__dict__ == other.__dict__

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