# 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.org_role import OrgRole  # noqa: F401,E501
from teralytic.models.property_role import PropertyRole  # noqa: F401,E501
from teralytic.models.uuid_array import UUIDArray  # noqa: F401,E501


class User(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',
        'organizations': 'UUIDArray',
        'first_name': 'str',
        'last_name': 'str',
        'email': 'str',
        'email_verified': 'bool',
        'username': 'str',
        'org_roles': 'list[OrgRole]',
        'property_roles': 'list[PropertyRole]'
    }

    attribute_map = {
        'id': 'id',
        'organizations': 'organizations',
        'first_name': 'first_name',
        'last_name': 'last_name',
        'email': 'email',
        'email_verified': 'email_verified',
        'username': 'username',
        'org_roles': 'org_roles',
        'property_roles': 'property_roles'
    }

    def __init__(self, id=None, organizations=None, first_name=None, last_name=None, email=None, email_verified=None, username=None, org_roles=None, property_roles=None):  # noqa: E501
        """User - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._organizations = None
        self._first_name = None
        self._last_name = None
        self._email = None
        self._email_verified = None
        self._username = None
        self._org_roles = None
        self._property_roles = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if organizations is not None:
            self.organizations = organizations
        if first_name is not None:
            self.first_name = first_name
        if last_name is not None:
            self.last_name = last_name
        if email is not None:
            self.email = email
        if email_verified is not None:
            self.email_verified = email_verified
        if username is not None:
            self.username = username
        if org_roles is not None:
            self.org_roles = org_roles
        if property_roles is not None:
            self.property_roles = property_roles

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

        The users uuid  # noqa: E501

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

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

        The users uuid  # noqa: E501

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

        self._id = id

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


        :return: The organizations of this User.  # noqa: E501
        :rtype: UUIDArray
        """
        return self._organizations

    @organizations.setter
    def organizations(self, organizations):
        """Sets the organizations of this User.


        :param organizations: The organizations of this User.  # noqa: E501
        :type: UUIDArray
        """

        self._organizations = organizations

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

        The user's first name  # noqa: E501

        :return: The first_name of this User.  # noqa: E501
        :rtype: str
        """
        return self._first_name

    @first_name.setter
    def first_name(self, first_name):
        """Sets the first_name of this User.

        The user's first name  # noqa: E501

        :param first_name: The first_name of this User.  # noqa: E501
        :type: str
        """

        self._first_name = first_name

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

        The user's last name  # noqa: E501

        :return: The last_name of this User.  # noqa: E501
        :rtype: str
        """
        return self._last_name

    @last_name.setter
    def last_name(self, last_name):
        """Sets the last_name of this User.

        The user's last name  # noqa: E501

        :param last_name: The last_name of this User.  # noqa: E501
        :type: str
        """

        self._last_name = last_name

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

        The user's email address  # noqa: E501

        :return: The email of this User.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this User.

        The user's email address  # noqa: E501

        :param email: The email of this User.  # noqa: E501
        :type: str
        """

        self._email = email

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

        Set if the user's email address is verified  # noqa: E501

        :return: The email_verified of this User.  # noqa: E501
        :rtype: bool
        """
        return self._email_verified

    @email_verified.setter
    def email_verified(self, email_verified):
        """Sets the email_verified of this User.

        Set if the user's email address is verified  # noqa: E501

        :param email_verified: The email_verified of this User.  # noqa: E501
        :type: bool
        """

        self._email_verified = email_verified

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

        The users login name  # noqa: E501

        :return: The username of this User.  # noqa: E501
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """Sets the username of this User.

        The users login name  # noqa: E501

        :param username: The username of this User.  # noqa: E501
        :type: str
        """

        self._username = username

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


        :return: The org_roles of this User.  # noqa: E501
        :rtype: list[OrgRole]
        """
        return self._org_roles

    @org_roles.setter
    def org_roles(self, org_roles):
        """Sets the org_roles of this User.


        :param org_roles: The org_roles of this User.  # noqa: E501
        :type: list[OrgRole]
        """

        self._org_roles = org_roles

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


        :return: The property_roles of this User.  # noqa: E501
        :rtype: list[PropertyRole]
        """
        return self._property_roles

    @property_roles.setter
    def property_roles(self, property_roles):
        """Sets the property_roles of this User.


        :param property_roles: The property_roles of this User.  # noqa: E501
        :type: list[PropertyRole]
        """

        self._property_roles = property_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(User, 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, User):
            return False

        return self.__dict__ == other.__dict__

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