# coding: utf-8

"""
    Tator REST API

    Interface to the Tator backend.  # noqa: E501

    The version of the OpenAPI document: v1
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class Credentials(object):
    """
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'password': 'str',
        'refresh': 'bool',
        'username': 'str'
    }

    attribute_map = {
        'password': 'password',
        'refresh': 'refresh',
        'username': 'username'
    }

    def __init__(self, password=None, refresh=None, username=None, local_vars_configuration=None):  # noqa: E501
        """Credentials - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._password = None
        self._refresh = None
        self._username = None
        self.discriminator = None

        self.password = password
        if refresh is not None:
            self.refresh = refresh
        self.username = username

    @property
    def password(self):
        """
        Account password.

        :return: The password of this Credentials. 
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """
        Account password.

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

        self._password = password

    @property
    def refresh(self):
        """
        If true, forces generation of new token.

        :return: The refresh of this Credentials. 
        :rtype: bool
        """
        return self._refresh

    @refresh.setter
    def refresh(self, refresh):
        """
        If true, forces generation of new token.

        :param refresh: The refresh of this Credentials.
        :type: bool
        """

        self._refresh = refresh

    @property
    def username(self):
        """
        Account username.

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

    @username.setter
    def username(self, username):
        """
        Account username.

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

        self._username = username

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

        for attr, _ in six.iteritems(self.openapi_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 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, Credentials):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
