# 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 PropertyRole(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',
        'property_id': 'str',
        'permission_ids': 'UUIDArray',
        'permissions': 'list[RolePermission]'
    }

    attribute_map = {
        'id': 'id',
        'user_id': 'user_id',
        'property_id': 'property_id',
        'permission_ids': 'permission_ids',
        'permissions': 'permissions'
    }

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

        self._id = None
        self._user_id = None
        self._property_id = None
        self._permission_ids = None
        self._permissions = None
        self.discriminator = None

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

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

        Role id  # noqa: E501

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

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

        Role id  # noqa: E501

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

        self._id = id

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

        The user id  # noqa: E501

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

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

        The user id  # noqa: E501

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

        self._user_id = user_id

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

        The property id  # noqa: E501

        :return: The property_id of this PropertyRole.  # noqa: E501
        :rtype: str
        """
        return self._property_id

    @property_id.setter
    def property_id(self, property_id):
        """Sets the property_id of this PropertyRole.

        The property id  # noqa: E501

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

        self._property_id = property_id

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


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

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


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

        self._permission_ids = permission_ids

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


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

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


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

        self._permissions = permissions

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

        return self.__dict__ == other.__dict__

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