# coding: utf-8

"""
    CloudEndure API documentation

    © 2017 CloudEndure All rights reserved  # General Request authentication in CloudEndure's API is done using session cookies. A session cookie is returned upon successful execution of the \"login\" method. This value must then be provided within the request headers of all subsequent API requests.  ## Errors Some errors are not specifically written in every method since they may always return. Those are: 1) 401 (Unauthorized) - for unauthenticated requests. 2) 405 (Method Not Allowed) - for using a method that is not supported (POST instead of GET). 3) 403 (Forbidden) - request is authenticated, but the user is not allowed to access. 4) 422 (Unprocessable Entity) - for invalid input.  ## Formats All strings with date-time format are according to RFC3339.  All strings with \"duration\" format are according to ISO8601. For example, a full day duration can be specified with \"PNNNND\".   # noqa: E501

    OpenAPI spec version: 5
    Contact: https://bit.ly/2T54hSc
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class CloudEndureUser:
    """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",
        "status": "str",
        "account": "str",
        "roles": "list[str]",
        "settings": "object",
        "api_token": "str",
        "has_password": "bool",
        "terms_accepted": "bool",
        "id": "str",
        "self_link": "str",
    }

    attribute_map = {
        "username": "username",
        "status": "status",
        "account": "account",
        "roles": "roles",
        "settings": "settings",
        "api_token": "apiToken",
        "has_password": "hasPassword",
        "terms_accepted": "termsAccepted",
        "id": "id",
        "self_link": "selfLink",
    }

    def __init__(
        self,
        username=None,
        status=None,
        account=None,
        roles=None,
        settings=None,
        api_token=None,
        has_password=None,
        terms_accepted=None,
        id=None,
        self_link=None,
    ):  # noqa: E501
        """CloudEndureUser - a model defined in Swagger"""  # noqa: E501
        self._username = None
        self._status = None
        self._account = None
        self._roles = None
        self._settings = None
        self._api_token = None
        self._has_password = None
        self._terms_accepted = None
        self._id = None
        self._self_link = None
        self.discriminator = None
        if username is not None:
            self.username = username
        if status is not None:
            self.status = status
        if account is not None:
            self.account = account
        if roles is not None:
            self.roles = roles
        if settings is not None:
            self.settings = settings
        if api_token is not None:
            self.api_token = api_token
        if has_password is not None:
            self.has_password = has_password
        if terms_accepted is not None:
            self.terms_accepted = terms_accepted
        if id is not None:
            self.id = id
        if self_link is not None:
            self.self_link = self_link

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


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

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


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

        self._username = username

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


        :return: The status of this CloudEndureUser.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this CloudEndureUser.


        :param status: The status of this CloudEndureUser.  # noqa: E501
        :type: str
        """
        allowed_values = ["PENDING", "CONFIRMED", "DELETED"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}".format(  # noqa: E501
                    status, allowed_values
                )
            )

        self._status = status

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


        :return: The account of this CloudEndureUser.  # noqa: E501
        :rtype: str
        """
        return self._account

    @account.setter
    def account(self, account):
        """Sets the account of this CloudEndureUser.


        :param account: The account of this CloudEndureUser.  # noqa: E501
        :type: str
        """

        self._account = account

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


        :return: The roles of this CloudEndureUser.  # noqa: E501
        :rtype: list[str]
        """
        return self._roles

    @roles.setter
    def roles(self, roles):
        """Sets the roles of this CloudEndureUser.


        :param roles: The roles of this CloudEndureUser.  # noqa: E501
        :type: list[str]
        """
        allowed_values = [
            "USER",
            "ACCOUNT_ADMIN",
            "ACCOUNT_OWNER",
            "GLOBAL_READONLY",
        ]  # noqa: E501
        if not set(roles).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `roles` [{0}], must be a subset of [{1}]".format(  # noqa: E501
                    ", ".join(map(str, set(roles) - set(allowed_values))),  # noqa: E501
                    ", ".join(map(str, allowed_values)),
                )
            )

        self._roles = roles

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


        :return: The settings of this CloudEndureUser.  # noqa: E501
        :rtype: object
        """
        return self._settings

    @settings.setter
    def settings(self, settings):
        """Sets the settings of this CloudEndureUser.


        :param settings: The settings of this CloudEndureUser.  # noqa: E501
        :type: object
        """

        self._settings = settings

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


        :return: The api_token of this CloudEndureUser.  # noqa: E501
        :rtype: str
        """
        return self._api_token

    @api_token.setter
    def api_token(self, api_token):
        """Sets the api_token of this CloudEndureUser.


        :param api_token: The api_token of this CloudEndureUser.  # noqa: E501
        :type: str
        """

        self._api_token = api_token

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


        :return: The has_password of this CloudEndureUser.  # noqa: E501
        :rtype: bool
        """
        return self._has_password

    @has_password.setter
    def has_password(self, has_password):
        """Sets the has_password of this CloudEndureUser.


        :param has_password: The has_password of this CloudEndureUser.  # noqa: E501
        :type: bool
        """

        self._has_password = has_password

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

        todo one-way; cannot be set at time of POST  # noqa: E501

        :return: The terms_accepted of this CloudEndureUser.  # noqa: E501
        :rtype: bool
        """
        return self._terms_accepted

    @terms_accepted.setter
    def terms_accepted(self, terms_accepted):
        """Sets the terms_accepted of this CloudEndureUser.

        todo one-way; cannot be set at time of POST  # noqa: E501

        :param terms_accepted: The terms_accepted of this CloudEndureUser.  # noqa: E501
        :type: bool
        """

        self._terms_accepted = terms_accepted

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


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

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


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

        self._id = id

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


        :return: The self_link of this CloudEndureUser.  # noqa: E501
        :rtype: str
        """
        return self._self_link

    @self_link.setter
    def self_link(self, self_link):
        """Sets the self_link of this CloudEndureUser.


        :param self_link: The self_link of this CloudEndureUser.  # noqa: E501
        :type: str
        """

        self._self_link = self_link

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

        return self.__dict__ == other.__dict__

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