# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# Path: freezer_api/context.py
# LOG = log.getLogger(__name__)
# class FreezerContext(context.RequestContext):
#     def __init__(self, auth_token=None, user=None, tenant=None, domain=None,
#                  user_domain=None, project_domain=None, is_admin=False,
#                  read_only=False, show_deleted=False, request_id=None,
#                  resource_uuid=None, overwrite=True, roles=None):
#     def from_dict(cls, values):
#     def elevated(self, show_deleted=False):
#     def view_deleted(self):
# def get_admin_context(show_deleted="no"):
# def get_current():


import falcon
import webob.dec
import webob.exc
from oslo_log import log
from oslo_serialization import jsonutils as json
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api import context
            return before_hook
        except AttributeError as ex:
            # No such method, we presume.
            message_template = ("Failed to get before hook from middleware "
                                "{0} - {1}")
            message = message_template.format(self.__name__, ex.message)
            LOG.error(message)
            LOG.exception(ex)
            raise freezer_api_exc.FreezerAPIException(message)

    def as_after_hook(self):
        """Extract process_response method as "after" hook

        :return: after hook function
        """

        # Need to wrap this up in a closure because the parameter counts
        # differ
        def after_hook(req, resp, resource=None):
            return self.process_response(req, resp, resource)

        try:
            return after_hook
        except AttributeError as ex:
            # No such method, we presume.
            message_template = ("Failed to get after hook from middleware "
                                "{0} - {1}")
            message = message_template.format(self.__name__, ex.message)
            LOG.error(message)
            LOG.exception(ex)

# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# Path: freezer_api/context.py
# LOG = log.getLogger(__name__)
# class FreezerContext(context.RequestContext):
#     def __init__(self, auth_token=None, user=None, tenant=None, domain=None,
#                  user_domain=None, project_domain=None, is_admin=False,
#                  read_only=False, show_deleted=False, request_id=None,
#                  resource_uuid=None, overwrite=True, roles=None):
#     def from_dict(cls, values):
#     def elevated(self, show_deleted=False):
#     def view_deleted(self):
# def get_admin_context(show_deleted="no"):
# def get_current():


# Path: freezer_api/api/common/middleware.py
import falcon
import webob.dec
import webob.exc
from oslo_log import log
from oslo_serialization import jsonutils as json
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api import context

            return before_hook
        except AttributeError as ex:
            # No such method, we presume.
            message_template = ("Failed to get before hook from middleware "
                                "{0} - {1}")
            message = message_template.format(self.__name__, ex.message)
            LOG.error(message)
            LOG.exception(ex)
            raise freezer_api_exc.FreezerAPIException(message)

    def as_after_hook(self):
        """Extract process_response method as "after" hook

        :return: after hook function
        """

        # Need to wrap this up in a closure because the parameter counts
        # differ
        def after_hook(req, resp, resource=None):
            return self.process_response(req, resp, resource)

        try:
            return after_hook
        except AttributeError as ex:
            # No such method, we presume.
            message_template = ("Failed to get after hook from middleware "
                                "{0} - {1}")
            message = message_template.format(self.__name__, ex.message)
            LOG.error(message)
            LOG.exception(ex)

            raise freezer_api_exc.FreezerAPIException(message)