# coding: utf-8

"""
    ExaVault API

    See our API reference documentation at https://www.exavault.com/developer/api-docs/  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: support@exavault.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class AddUserRequestBody(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 = {
        'username': 'str',
        'nickname': 'str',
        'home_resource': 'str',
        'email': 'str',
        'password': 'str',
        'role': 'str',
        'permissions': 'UsersPermissions',
        'time_zone': 'str',
        'expiration': 'str',
        'locked': 'bool',
        'welcome_email': 'bool',
        'onboarding': 'bool'
    }

    attribute_map = {
        'username': 'username',
        'nickname': 'nickname',
        'home_resource': 'homeResource',
        'email': 'email',
        'password': 'password',
        'role': 'role',
        'permissions': 'permissions',
        'time_zone': 'timeZone',
        'expiration': 'expiration',
        'locked': 'locked',
        'welcome_email': 'welcomeEmail',
        'onboarding': 'onboarding'
    }

    def __init__(self, username=None, nickname=None, home_resource=None, email=None, password=None, role=None, permissions=None, time_zone=None, expiration=None, locked=None, welcome_email=None, onboarding=None):  # noqa: E501
        """AddUserRequestBody - a model defined in Swagger"""  # noqa: E501
        self._username = None
        self._nickname = None
        self._home_resource = None
        self._email = None
        self._password = None
        self._role = None
        self._permissions = None
        self._time_zone = None
        self._expiration = None
        self._locked = None
        self._welcome_email = None
        self._onboarding = None
        self.discriminator = None
        self.username = username
        if nickname is not None:
            self.nickname = nickname
        self.home_resource = home_resource
        self.email = email
        self.password = password
        self.role = role
        self.permissions = permissions
        self.time_zone = time_zone
        if expiration is not None:
            self.expiration = expiration
        if locked is not None:
            self.locked = locked
        if welcome_email is not None:
            self.welcome_email = welcome_email
        if onboarding is not None:
            self.onboarding = onboarding

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

        Username of the user to create. This should follow standard username conventions - spaces are not allowed, etc. We do allow email addresses as usernames.  **Note** Usernames must be unique across all ExaVault accounts.  # noqa: E501

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

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

        Username of the user to create. This should follow standard username conventions - spaces are not allowed, etc. We do allow email addresses as usernames.  **Note** Usernames must be unique across all ExaVault accounts.  # noqa: E501

        :param username: The username of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if username is None:
            raise ValueError("Invalid value for `username`, must not be `None`")  # noqa: E501

        self._username = username

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

        An optional nickname (e.g. 'David from Sales').  # noqa: E501

        :return: The nickname of this AddUserRequestBody.  # noqa: E501
        :rtype: str
        """
        return self._nickname

    @nickname.setter
    def nickname(self, nickname):
        """Sets the nickname of this AddUserRequestBody.

        An optional nickname (e.g. 'David from Sales').  # noqa: E501

        :param nickname: The nickname of this AddUserRequestBody.  # noqa: E501
        :type: str
        """

        self._nickname = nickname

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

        Resource identifier for the user's home folder. See details on [how to specify resources](#section/Identifying-Resources) above.  The user will be locked to this directory and unable to move 'up' in the account. If the folder does not exist in the account, it will be created when the user is created.   This setting is ignored for users with the `role` **admin**.  # noqa: E501

        :return: The home_resource of this AddUserRequestBody.  # noqa: E501
        :rtype: str
        """
        return self._home_resource

    @home_resource.setter
    def home_resource(self, home_resource):
        """Sets the home_resource of this AddUserRequestBody.

        Resource identifier for the user's home folder. See details on [how to specify resources](#section/Identifying-Resources) above.  The user will be locked to this directory and unable to move 'up' in the account. If the folder does not exist in the account, it will be created when the user is created.   This setting is ignored for users with the `role` **admin**.  # noqa: E501

        :param home_resource: The home_resource of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if home_resource is None:
            raise ValueError("Invalid value for `home_resource`, must not be `None`")  # noqa: E501

        self._home_resource = home_resource

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

        Email address for the user  # noqa: E501

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

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

        Email address for the user  # noqa: E501

        :param email: The email of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if email is None:
            raise ValueError("Invalid value for `email`, must not be `None`")  # noqa: E501

        self._email = email

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

        Password for the user  # noqa: E501

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

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

        Password for the user  # noqa: E501

        :param password: The password of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if password is None:
            raise ValueError("Invalid value for `password`, must not be `None`")  # noqa: E501

        self._password = password

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

        The type of user to create. Note that admin users cannot have a `homeResource` other than '/', and will have full permissions, but you must provide at least \"download,upload,list,delete\" in the `permissions` parameter.  # noqa: E501

        :return: The role of this AddUserRequestBody.  # noqa: E501
        :rtype: str
        """
        return self._role

    @role.setter
    def role(self, role):
        """Sets the role of this AddUserRequestBody.

        The type of user to create. Note that admin users cannot have a `homeResource` other than '/', and will have full permissions, but you must provide at least \"download,upload,list,delete\" in the `permissions` parameter.  # noqa: E501

        :param role: The role of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if role is None:
            raise ValueError("Invalid value for `role`, must not be `None`")  # noqa: E501
        allowed_values = ["user", "admin"]  # noqa: E501
        if role not in allowed_values:
            raise ValueError(
                "Invalid value for `role` ({0}), must be one of {1}"  # noqa: E501
                .format(role, allowed_values)
            )

        self._role = role

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


        :return: The permissions of this AddUserRequestBody.  # noqa: E501
        :rtype: UsersPermissions
        """
        return self._permissions

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


        :param permissions: The permissions of this AddUserRequestBody.  # noqa: E501
        :type: UsersPermissions
        """
        if permissions is None:
            raise ValueError("Invalid value for `permissions`, must not be `None`")  # noqa: E501

        self._permissions = permissions

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

        Time zone, used for accurate time display within the application. See <a href='https://php.net/manual/en/timezones.php' target='blank'>this page</a> for allowed values.   # noqa: E501

        :return: The time_zone of this AddUserRequestBody.  # noqa: E501
        :rtype: str
        """
        return self._time_zone

    @time_zone.setter
    def time_zone(self, time_zone):
        """Sets the time_zone of this AddUserRequestBody.

        Time zone, used for accurate time display within the application. See <a href='https://php.net/manual/en/timezones.php' target='blank'>this page</a> for allowed values.   # noqa: E501

        :param time_zone: The time_zone of this AddUserRequestBody.  # noqa: E501
        :type: str
        """
        if time_zone is None:
            raise ValueError("Invalid value for `time_zone`, must not be `None`")  # noqa: E501

        self._time_zone = time_zone

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

        Optional timestamp when the user should expire, formatted in date-time.  # noqa: E501

        :return: The expiration of this AddUserRequestBody.  # noqa: E501
        :rtype: str
        """
        return self._expiration

    @expiration.setter
    def expiration(self, expiration):
        """Sets the expiration of this AddUserRequestBody.

        Optional timestamp when the user should expire, formatted in date-time.  # noqa: E501

        :param expiration: The expiration of this AddUserRequestBody.  # noqa: E501
        :type: str
        """

        self._expiration = expiration

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

        If true, the user will not be able to log in  # noqa: E501

        :return: The locked of this AddUserRequestBody.  # noqa: E501
        :rtype: bool
        """
        return self._locked

    @locked.setter
    def locked(self, locked):
        """Sets the locked of this AddUserRequestBody.

        If true, the user will not be able to log in  # noqa: E501

        :param locked: The locked of this AddUserRequestBody.  # noqa: E501
        :type: bool
        """

        self._locked = locked

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

        If **true**, send this new user a welcome email upon creation. The content of the welcome email can be configured with the [PATCH /accounts](#operation/updateAccount) method.  # noqa: E501

        :return: The welcome_email of this AddUserRequestBody.  # noqa: E501
        :rtype: bool
        """
        return self._welcome_email

    @welcome_email.setter
    def welcome_email(self, welcome_email):
        """Sets the welcome_email of this AddUserRequestBody.

        If **true**, send this new user a welcome email upon creation. The content of the welcome email can be configured with the [PATCH /accounts](#operation/updateAccount) method.  # noqa: E501

        :param welcome_email: The welcome_email of this AddUserRequestBody.  # noqa: E501
        :type: bool
        """

        self._welcome_email = welcome_email

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

        Set this to **true** to enable extra help popups in the web file manager for this user.  # noqa: E501

        :return: The onboarding of this AddUserRequestBody.  # noqa: E501
        :rtype: bool
        """
        return self._onboarding

    @onboarding.setter
    def onboarding(self, onboarding):
        """Sets the onboarding of this AddUserRequestBody.

        Set this to **true** to enable extra help popups in the web file manager for this user.  # noqa: E501

        :param onboarding: The onboarding of this AddUserRequestBody.  # noqa: E501
        :type: bool
        """

        self._onboarding = onboarding

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

        return self.__dict__ == other.__dict__

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