# Path: chartmogul/api/config.py
# class Config:
#     uri = API_BASE + "/" + VERSION
# 
#     def __init__(self, api_key, request_timeout=None, max_retries=20, backoff_factor=2):
#         self.auth = (api_key, '')
#         self.request_timeout = request_timeout
#         self.max_retries = max_retries
#         self.backoff_factor = backoff_factor
# 
# Path: chartmogul/errors.py
# class ArgumentMissingError(Exception):
#     pass
# 
# class ConfigurationError(Exception):
#     pass
# 
# def annotateHTTPError(err):
#     if isinstance(err, HTTPError):
#         raise_from(APIError(err.response.content), err)
#     else:
#         raise err
# 
# Path: chartmogul/retry_request.py
# def requests_retry_session(retries=20, backoff_factor=2, session=None,):
#     session = session or requests.Session()
#     adapter = _retry_adapter(retries, backoff_factor)
#     session.mount('https://', adapter)
#     return session


from datetime import date, datetime
from json import dumps
from promise import Promise
from uritemplate import URITemplate
from .api.config import Config
from .errors import ArgumentMissingError, ConfigurationError, annotateHTTPError
from .retry_request import requests_retry_session
from .version import __version__
            if key in params:
                params[replacement] = params[key]
                del params[key]
        return params

    @classmethod
    def _request(cls, config, method, http_verb, path, data=None, **kwargs):
        if http_verb == 'get':
            params = cls._preProcessParams(kwargs)
            data = None
        else:
            params = None
            if data is not None:
                data = dumps(data, default=json_serial)

        return Promise(
            lambda resolve,
            _: resolve(
                getattr(
                    requests_retry_session(
                        config.max_retries,
                        config.backoff_factor),
                    http_verb)(
                    config.uri + path,
                    data=data,
                    headers={
                        'content-type': 'application/json', 'User-Agent': 'chartmogul-python/' + __version__},
                    params=params,
                    auth=config.auth,
                    timeout=config.request_timeout))).then(

# Path: chartmogul/api/config.py
# class Config:
#     uri = API_BASE + "/" + VERSION
# 
#     def __init__(self, api_key, request_timeout=None, max_retries=20, backoff_factor=2):
#         self.auth = (api_key, '')
#         self.request_timeout = request_timeout
#         self.max_retries = max_retries
#         self.backoff_factor = backoff_factor
# 
# Path: chartmogul/errors.py
# class ArgumentMissingError(Exception):
#     pass
# 
# class ConfigurationError(Exception):
#     pass
# 
# def annotateHTTPError(err):
#     if isinstance(err, HTTPError):
#         raise_from(APIError(err.response.content), err)
#     else:
#         raise err
# 
# Path: chartmogul/retry_request.py
# def requests_retry_session(retries=20, backoff_factor=2, session=None,):
#     session = session or requests.Session()
#     adapter = _retry_adapter(retries, backoff_factor)
#     session.mount('https://', adapter)
#     return session


# Path: chartmogul/resource.py
from datetime import date, datetime
from json import dumps
from promise import Promise
from uritemplate import URITemplate
from .api.config import Config
from .errors import ArgumentMissingError, ConfigurationError, annotateHTTPError
from .retry_request import requests_retry_session
from .version import __version__

            if key in params:
                params[replacement] = params[key]
                del params[key]
        return params

    @classmethod
    def _request(cls, config, method, http_verb, path, data=None, **kwargs):
        if http_verb == 'get':
            params = cls._preProcessParams(kwargs)
            data = None
        else:
            params = None
            if data is not None:
                data = dumps(data, default=json_serial)

        return Promise(
            lambda resolve,
            _: resolve(
                getattr(
                    requests_retry_session(
                        config.max_retries,
                        config.backoff_factor),
                    http_verb)(
                    config.uri + path,
                    data=data,
                    headers={
                        'content-type': 'application/json', 'User-Agent': 'chartmogul-python/' + __version__},
                    params=params,
                    auth=config.auth,
                    timeout=config.request_timeout))).then(

            cls._load).catch(annotateHTTPError)