# Path: mapmyfitness/exceptions.py
# class BadRequestException(Exception):
#     """The API returned a status of 400 (Bad Request)."""
# 
# class UnauthorizedException(Exception):
#     """The request authentication failed. The OAuth credentials that the client supplied were missing or invalid."""
# 
# class NotFoundException(Exception):
#     """The resource could not be found."""
# 
# class InternalServerErrorException(Exception):
#     """There was an error while processing your request."""
# 
# class ForbiddenException(Exception):
#     """The request credentials authenticated, but the requesting user or client app is not authorized to access the given resource."""
# 
# Path: mapmyfitness/utils.py
# def datetime_to_iso_format(dt):
#     utc_datetime = dt.replace(tzinfo=utc)
#     return utc_datetime.isoformat()


import datetime
import json
import requests
from ..exceptions import BadRequestException, UnauthorizedException, NotFoundException, InternalServerErrorException, ForbiddenException
from ..utils import datetime_to_iso_format




class BaseAPI(object):
    http_exception_map = {
        400: BadRequestException,
        401: UnauthorizedException,

# Path: mapmyfitness/exceptions.py
# class BadRequestException(Exception):
#     """The API returned a status of 400 (Bad Request)."""
# 
# class UnauthorizedException(Exception):
#     """The request authentication failed. The OAuth credentials that the client supplied were missing or invalid."""
# 
# class NotFoundException(Exception):
#     """The resource could not be found."""
# 
# class InternalServerErrorException(Exception):
#     """There was an error while processing your request."""
# 
# class ForbiddenException(Exception):
#     """The request credentials authenticated, but the requesting user or client app is not authorized to access the given resource."""
# 
# Path: mapmyfitness/utils.py
# def datetime_to_iso_format(dt):
#     utc_datetime = dt.replace(tzinfo=utc)
#     return utc_datetime.isoformat()


# Path: mapmyfitness/api/base.py
import datetime
import json
import requests
from ..exceptions import BadRequestException, UnauthorizedException, NotFoundException, InternalServerErrorException, ForbiddenException
from ..utils import datetime_to_iso_format





class BaseAPI(object):
    http_exception_map = {
        400: BadRequestException,
        401: UnauthorizedException,

        403: ForbiddenException,