# coding: utf-8

"""
    Octopus Server API

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

    OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from octopus_deploy_swagger_client.models.identity_resource import IdentityResource  # noqa: F401,E501


class UserResource(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',
        'username': 'str',
        'display_name': 'str',
        'is_active': 'bool',
        'is_service': 'bool',
        'email_address': 'str',
        'can_password_be_edited': 'bool',
        'is_requestor': 'bool',
        'password': 'str',
        'identities': 'list[IdentityResource]',
        'last_modified_on': 'datetime',
        'last_modified_by': 'str',
        'links': 'dict(str, str)'
    }

    attribute_map = {
        'id': 'Id',
        'username': 'Username',
        'display_name': 'DisplayName',
        'is_active': 'IsActive',
        'is_service': 'IsService',
        'email_address': 'EmailAddress',
        'can_password_be_edited': 'CanPasswordBeEdited',
        'is_requestor': 'IsRequestor',
        'password': 'Password',
        'identities': 'Identities',
        'last_modified_on': 'LastModifiedOn',
        'last_modified_by': 'LastModifiedBy',
        'links': 'Links'
    }

    def __init__(self, id=None, username=None, display_name=None, is_active=None, is_service=None, email_address=None, can_password_be_edited=None, is_requestor=None, password=None, identities=None, last_modified_on=None, last_modified_by=None, links=None):  # noqa: E501
        """UserResource - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._username = None
        self._display_name = None
        self._is_active = None
        self._is_service = None
        self._email_address = None
        self._can_password_be_edited = None
        self._is_requestor = None
        self._password = None
        self._identities = None
        self._last_modified_on = None
        self._last_modified_by = None
        self._links = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if username is not None:
            self.username = username
        self.display_name = display_name
        if is_active is not None:
            self.is_active = is_active
        if is_service is not None:
            self.is_service = is_service
        if email_address is not None:
            self.email_address = email_address
        if can_password_be_edited is not None:
            self.can_password_be_edited = can_password_be_edited
        if is_requestor is not None:
            self.is_requestor = is_requestor
        if password is not None:
            self.password = password
        if identities is not None:
            self.identities = identities
        if last_modified_on is not None:
            self.last_modified_on = last_modified_on
        if last_modified_by is not None:
            self.last_modified_by = last_modified_by
        if links is not None:
            self.links = links

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


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

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


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

        self._id = id

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


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

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


        :param username: The username of this UserResource.  # noqa: E501
        :type: str
        """
        if username is not None and len(username) > 64:
            raise ValueError("Invalid value for `username`, length must be less than or equal to `64`")  # noqa: E501
        if username is not None and len(username) < 0:
            raise ValueError("Invalid value for `username`, length must be greater than or equal to `0`")  # noqa: E501

        self._username = username

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


        :return: The display_name of this UserResource.  # noqa: E501
        :rtype: str
        """
        return self._display_name

    @display_name.setter
    def display_name(self, display_name):
        """Sets the display_name of this UserResource.


        :param display_name: The display_name of this UserResource.  # noqa: E501
        :type: str
        """
        if display_name is None:
            raise ValueError("Invalid value for `display_name`, must not be `None`")  # noqa: E501
        if display_name is not None and len(display_name) > 64:
            raise ValueError("Invalid value for `display_name`, length must be less than or equal to `64`")  # noqa: E501
        if display_name is not None and len(display_name) < 0:
            raise ValueError("Invalid value for `display_name`, length must be greater than or equal to `0`")  # noqa: E501

        self._display_name = display_name

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


        :return: The is_active of this UserResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_active

    @is_active.setter
    def is_active(self, is_active):
        """Sets the is_active of this UserResource.


        :param is_active: The is_active of this UserResource.  # noqa: E501
        :type: bool
        """

        self._is_active = is_active

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


        :return: The is_service of this UserResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_service

    @is_service.setter
    def is_service(self, is_service):
        """Sets the is_service of this UserResource.


        :param is_service: The is_service of this UserResource.  # noqa: E501
        :type: bool
        """

        self._is_service = is_service

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


        :return: The email_address of this UserResource.  # noqa: E501
        :rtype: str
        """
        return self._email_address

    @email_address.setter
    def email_address(self, email_address):
        """Sets the email_address of this UserResource.


        :param email_address: The email_address of this UserResource.  # noqa: E501
        :type: str
        """
        if email_address is not None and len(email_address) > 256:
            raise ValueError("Invalid value for `email_address`, length must be less than or equal to `256`")  # noqa: E501
        if email_address is not None and len(email_address) < 0:
            raise ValueError("Invalid value for `email_address`, length must be greater than or equal to `0`")  # noqa: E501

        self._email_address = email_address

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


        :return: The can_password_be_edited of this UserResource.  # noqa: E501
        :rtype: bool
        """
        return self._can_password_be_edited

    @can_password_be_edited.setter
    def can_password_be_edited(self, can_password_be_edited):
        """Sets the can_password_be_edited of this UserResource.


        :param can_password_be_edited: The can_password_be_edited of this UserResource.  # noqa: E501
        :type: bool
        """

        self._can_password_be_edited = can_password_be_edited

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


        :return: The is_requestor of this UserResource.  # noqa: E501
        :rtype: bool
        """
        return self._is_requestor

    @is_requestor.setter
    def is_requestor(self, is_requestor):
        """Sets the is_requestor of this UserResource.


        :param is_requestor: The is_requestor of this UserResource.  # noqa: E501
        :type: bool
        """

        self._is_requestor = is_requestor

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


        :return: The password of this UserResource.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this UserResource.


        :param password: The password of this UserResource.  # noqa: E501
        :type: str
        """

        self._password = password

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


        :return: The identities of this UserResource.  # noqa: E501
        :rtype: list[IdentityResource]
        """
        return self._identities

    @identities.setter
    def identities(self, identities):
        """Sets the identities of this UserResource.


        :param identities: The identities of this UserResource.  # noqa: E501
        :type: list[IdentityResource]
        """

        self._identities = identities

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


        :return: The last_modified_on of this UserResource.  # noqa: E501
        :rtype: datetime
        """
        return self._last_modified_on

    @last_modified_on.setter
    def last_modified_on(self, last_modified_on):
        """Sets the last_modified_on of this UserResource.


        :param last_modified_on: The last_modified_on of this UserResource.  # noqa: E501
        :type: datetime
        """

        self._last_modified_on = last_modified_on

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


        :return: The last_modified_by of this UserResource.  # noqa: E501
        :rtype: str
        """
        return self._last_modified_by

    @last_modified_by.setter
    def last_modified_by(self, last_modified_by):
        """Sets the last_modified_by of this UserResource.


        :param last_modified_by: The last_modified_by of this UserResource.  # noqa: E501
        :type: str
        """

        self._last_modified_by = last_modified_by

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


        :return: The links of this UserResource.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._links

    @links.setter
    def links(self, links):
        """Sets the links of this UserResource.


        :param links: The links of this UserResource.  # noqa: E501
        :type: dict(str, str)
        """

        self._links = links

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

        return self.__dict__ == other.__dict__

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