# Path: zoe_api/auth/requests_oauth2/errors.py
# class ConfigurationError(OAuth2Error):
#     """OAuth configuration error."""


from urllib.parse import parse_qs, quote, urlencode
from .errors import ConfigurationError
import requests
    token_url = '/oauth/token'
    revoke_url = '/oauth2/revoke'
    scope_sep = None

    def __init__(self, client_id=None, client_secret=None, site=None, redirect_uri=None, authorization_url=None, token_url=None, revoke_url=None, scope_sep=None):  # pylint: disable=too-many-arguments
        """
        Initializes the hook with OAuth2 parameters
        """
        if client_id is not None:
            self.client_id = client_id
        if client_secret is not None:
            self.client_secret = client_secret
        if site is not None:
            self.site = site
        if redirect_uri is not None:
            self.redirect_uri = redirect_uri
        if authorization_url is not None:
            self.authorization_url = authorization_url
        if token_url is not None:
            self.token_url = token_url
        if revoke_url is not None:
            self.revoke_url = revoke_url
        if scope_sep is not None:
            self.scope_sep = scope_sep

    def _check_configuration(self, *attrs):
        """Check that each named attr has been configured
        """
        for attr in attrs:
            if getattr(self, attr, None) is None:

# Path: zoe_api/auth/requests_oauth2/errors.py
# class ConfigurationError(OAuth2Error):
#     """OAuth configuration error."""


# Path: zoe_api/auth/requests_oauth2/oauth2.py
from urllib.parse import parse_qs, quote, urlencode
from .errors import ConfigurationError
import requests

    token_url = '/oauth/token'
    revoke_url = '/oauth2/revoke'
    scope_sep = None

    def __init__(self, client_id=None, client_secret=None, site=None, redirect_uri=None, authorization_url=None, token_url=None, revoke_url=None, scope_sep=None):  # pylint: disable=too-many-arguments
        """
        Initializes the hook with OAuth2 parameters
        """
        if client_id is not None:
            self.client_id = client_id
        if client_secret is not None:
            self.client_secret = client_secret
        if site is not None:
            self.site = site
        if redirect_uri is not None:
            self.redirect_uri = redirect_uri
        if authorization_url is not None:
            self.authorization_url = authorization_url
        if token_url is not None:
            self.token_url = token_url
        if revoke_url is not None:
            self.revoke_url = revoke_url
        if scope_sep is not None:
            self.scope_sep = scope_sep

    def _check_configuration(self, *attrs):
        """Check that each named attr has been configured
        """
        for attr in attrs:
            if getattr(self, attr, None) is None:

                raise ConfigurationError("{} not configured".format(attr))