# coding: utf-8

"""
    ThingsBoard REST API

    For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>.  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class OAuth2MapperConfig(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 = {
        'activate_user': 'bool',
        'allow_user_creation': 'bool',
        'basic': 'OAuth2BasicMapperConfig',
        'custom': 'OAuth2CustomMapperConfig',
        'type': 'str'
    }

    attribute_map = {
        'activate_user': 'activateUser',
        'allow_user_creation': 'allowUserCreation',
        'basic': 'basic',
        'custom': 'custom',
        'type': 'type'
    }

    def __init__(self, activate_user=None, allow_user_creation=None, basic=None, custom=None, type=None):  # noqa: E501
        """OAuth2MapperConfig - a model defined in Swagger"""  # noqa: E501
        self._activate_user = None
        self._allow_user_creation = None
        self._basic = None
        self._custom = None
        self._type = None
        self.discriminator = None
        if activate_user is not None:
            self.activate_user = activate_user
        if allow_user_creation is not None:
            self.allow_user_creation = allow_user_creation
        if basic is not None:
            self.basic = basic
        if custom is not None:
            self.custom = custom
        if type is not None:
            self.type = type

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


        :return: The activate_user of this OAuth2MapperConfig.  # noqa: E501
        :rtype: bool
        """
        return self._activate_user

    @activate_user.setter
    def activate_user(self, activate_user):
        """Sets the activate_user of this OAuth2MapperConfig.


        :param activate_user: The activate_user of this OAuth2MapperConfig.  # noqa: E501
        :type: bool
        """

        self._activate_user = activate_user

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


        :return: The allow_user_creation of this OAuth2MapperConfig.  # noqa: E501
        :rtype: bool
        """
        return self._allow_user_creation

    @allow_user_creation.setter
    def allow_user_creation(self, allow_user_creation):
        """Sets the allow_user_creation of this OAuth2MapperConfig.


        :param allow_user_creation: The allow_user_creation of this OAuth2MapperConfig.  # noqa: E501
        :type: bool
        """

        self._allow_user_creation = allow_user_creation

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


        :return: The basic of this OAuth2MapperConfig.  # noqa: E501
        :rtype: OAuth2BasicMapperConfig
        """
        return self._basic

    @basic.setter
    def basic(self, basic):
        """Sets the basic of this OAuth2MapperConfig.


        :param basic: The basic of this OAuth2MapperConfig.  # noqa: E501
        :type: OAuth2BasicMapperConfig
        """

        self._basic = basic

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


        :return: The custom of this OAuth2MapperConfig.  # noqa: E501
        :rtype: OAuth2CustomMapperConfig
        """
        return self._custom

    @custom.setter
    def custom(self, custom):
        """Sets the custom of this OAuth2MapperConfig.


        :param custom: The custom of this OAuth2MapperConfig.  # noqa: E501
        :type: OAuth2CustomMapperConfig
        """

        self._custom = custom

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


        :return: The type of this OAuth2MapperConfig.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this OAuth2MapperConfig.


        :param type: The type of this OAuth2MapperConfig.  # noqa: E501
        :type: str
        """
        allowed_values = ["BASIC", "CUSTOM", "GITHUB", "APPLE"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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

        return self.__dict__ == other.__dict__

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