# coding: utf-8

"""
    3blades API

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

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


from pprint import pformat
from six import iteritems
import re


class Collaborator(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',
        'owner': 'bool',
        'user': 'str',
        'project': 'str',
        'joined': 'str',
        'username': 'str',
        'email': 'str',
        'first_name': 'str',
        'last_name': 'str',
        'permissions': 'list[str]'
    }

    attribute_map = {
        'id': 'id',
        'owner': 'owner',
        'user': 'user',
        'project': 'project',
        'joined': 'joined',
        'username': 'username',
        'email': 'email',
        'first_name': 'first_name',
        'last_name': 'last_name',
        'permissions': 'permissions'
    }

    def __init__(self, id=None, owner=None, user=None, project=None, joined=None, username=None, email=None, first_name=None, last_name=None, permissions=None):
        """
        Collaborator - a model defined in Swagger
        """

        self._id = None
        self._owner = None
        self._user = None
        self._project = None
        self._joined = None
        self._username = None
        self._email = None
        self._first_name = None
        self._last_name = None
        self._permissions = None

        if id is not None:
          self.id = id
        if owner is not None:
          self.owner = owner
        if user is not None:
          self.user = user
        if project is not None:
          self.project = project
        if joined is not None:
          self.joined = joined
        if username is not None:
          self.username = username
        if email is not None:
          self.email = email
        if first_name is not None:
          self.first_name = first_name
        if last_name is not None:
          self.last_name = last_name
        if permissions is not None:
          self.permissions = permissions

    @property
    def id(self):
        """
        Gets the id of this Collaborator.
        Collaborator unique identifier in UUID format.

        :return: The id of this Collaborator.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this Collaborator.
        Collaborator unique identifier in UUID format.

        :param id: The id of this Collaborator.
        :type: str
        """

        self._id = id

    @property
    def owner(self):
        """
        Gets the owner of this Collaborator.
        Boolean that states whether collaborator is project owner, or not. 

        :return: The owner of this Collaborator.
        :rtype: bool
        """
        return self._owner

    @owner.setter
    def owner(self, owner):
        """
        Sets the owner of this Collaborator.
        Boolean that states whether collaborator is project owner, or not. 

        :param owner: The owner of this Collaborator.
        :type: bool
        """

        self._owner = owner

    @property
    def user(self):
        """
        Gets the user of this Collaborator.
        Collaborator user name.

        :return: The user of this Collaborator.
        :rtype: str
        """
        return self._user

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

        :param user: The user of this Collaborator.
        :type: str
        """

        self._user = user

    @property
    def project(self):
        """
        Gets the project of this Collaborator.
        Collaborator project name.

        :return: The project of this Collaborator.
        :rtype: str
        """
        return self._project

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

        :param project: The project of this Collaborator.
        :type: str
        """

        self._project = project

    @property
    def joined(self):
        """
        Gets the joined of this Collaborator.
        Date time of when collaborator joined.

        :return: The joined of this Collaborator.
        :rtype: str
        """
        return self._joined

    @joined.setter
    def joined(self, joined):
        """
        Sets the joined of this Collaborator.
        Date time of when collaborator joined.

        :param joined: The joined of this Collaborator.
        :type: str
        """

        self._joined = joined

    @property
    def username(self):
        """
        Gets the username of this Collaborator.
        Collaborator's user name. This must be a valid user name within the system. 

        :return: The username of this Collaborator.
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """
        Sets the username of this Collaborator.
        Collaborator's user name. This must be a valid user name within the system. 

        :param username: The username of this Collaborator.
        :type: str
        """

        self._username = username

    @property
    def email(self):
        """
        Gets the email of this Collaborator.
        Collaborator's valid email address.

        :return: The email of this Collaborator.
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """
        Sets the email of this Collaborator.
        Collaborator's valid email address.

        :param email: The email of this Collaborator.
        :type: str
        """

        self._email = email

    @property
    def first_name(self):
        """
        Gets the first_name of this Collaborator.
        Collaborator's first name.

        :return: The first_name of this Collaborator.
        :rtype: str
        """
        return self._first_name

    @first_name.setter
    def first_name(self, first_name):
        """
        Sets the first_name of this Collaborator.
        Collaborator's first name.

        :param first_name: The first_name of this Collaborator.
        :type: str
        """

        self._first_name = first_name

    @property
    def last_name(self):
        """
        Gets the last_name of this Collaborator.
        Collaborator's last name.

        :return: The last_name of this Collaborator.
        :rtype: str
        """
        return self._last_name

    @last_name.setter
    def last_name(self, last_name):
        """
        Sets the last_name of this Collaborator.
        Collaborator's last name.

        :param last_name: The last_name of this Collaborator.
        :type: str
        """

        self._last_name = last_name

    @property
    def permissions(self):
        """
        Gets the permissions of this Collaborator.
        Collaborator permissions. Project creators are assigned owner priviledges by default. Permissions are write and read. 

        :return: The permissions of this Collaborator.
        :rtype: list[str]
        """
        return self._permissions

    @permissions.setter
    def permissions(self, permissions):
        """
        Sets the permissions of this Collaborator.
        Collaborator permissions. Project creators are assigned owner priviledges by default. Permissions are write and read. 

        :param permissions: The permissions of this Collaborator.
        :type: list[str]
        """
        allowed_values = ["write_project", "read_project"]
        if not set(permissions).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `permissions` [{0}], must be a subset of [{1}]"
                .format(", ".join(map(str, set(permissions)-set(allowed_values))),
                        ", ".join(map(str, allowed_values)))
            )

        self._permissions = permissions

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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, Collaborator):
            return False

        return self.__dict__ == other.__dict__

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