# coding: utf-8

"""
    teralytic

    The Teralytic API allows clients to manage their organization, view their fields and and probes, and query sensor readings and analytics.  For sandbox testing you may use the api key: `swagger.teralytic.io`   # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from teralytic.models.role_permission import RolePermission  # noqa: F401,E501
from teralytic.models.uuid_array import UUIDArray  # noqa: F401,E501


class OrgRole(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',
        'user_id': 'str',
        'organization_id': 'str',
        'permission_ids': 'UUIDArray',
        'permissions': 'list[RolePermission]',
        'owner': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'user_id': 'user_id',
        'organization_id': 'organization_id',
        'permission_ids': 'permission_ids',
        'permissions': 'permissions',
        'owner': 'owner'
    }

    def __init__(self, id=None, user_id=None, organization_id=None, permission_ids=None, permissions=None, owner=None):  # noqa: E501
        """OrgRole - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._user_id = None
        self._organization_id = None
        self._permission_ids = None
        self._permissions = None
        self._owner = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if user_id is not None:
            self.user_id = user_id
        if organization_id is not None:
            self.organization_id = organization_id
        if permission_ids is not None:
            self.permission_ids = permission_ids
        if permissions is not None:
            self.permissions = permissions
        if owner is not None:
            self.owner = owner

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

        Role id  # noqa: E501

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

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

        Role id  # noqa: E501

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

        self._id = id

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

        The user id  # noqa: E501

        :return: The user_id of this OrgRole.  # noqa: E501
        :rtype: str
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this OrgRole.

        The user id  # noqa: E501

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

        self._user_id = user_id

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

        The organization id  # noqa: E501

        :return: The organization_id of this OrgRole.  # noqa: E501
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """Sets the organization_id of this OrgRole.

        The organization id  # noqa: E501

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

        self._organization_id = organization_id

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


        :return: The permission_ids of this OrgRole.  # noqa: E501
        :rtype: UUIDArray
        """
        return self._permission_ids

    @permission_ids.setter
    def permission_ids(self, permission_ids):
        """Sets the permission_ids of this OrgRole.


        :param permission_ids: The permission_ids of this OrgRole.  # noqa: E501
        :type: UUIDArray
        """

        self._permission_ids = permission_ids

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


        :return: The permissions of this OrgRole.  # noqa: E501
        :rtype: list[RolePermission]
        """
        return self._permissions

    @permissions.setter
    def permissions(self, permissions):
        """Sets the permissions of this OrgRole.


        :param permissions: The permissions of this OrgRole.  # noqa: E501
        :type: list[RolePermission]
        """

        self._permissions = permissions

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

        Flag is the user role is an owner  # noqa: E501

        :return: The owner of this OrgRole.  # noqa: E501
        :rtype: bool
        """
        return self._owner

    @owner.setter
    def owner(self, owner):
        """Sets the owner of this OrgRole.

        Flag is the user role is an owner  # noqa: E501

        :param owner: The owner of this OrgRole.  # noqa: E501
        :type: bool
        """

        self._owner = owner

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

        return self.__dict__ == other.__dict__

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