# Path: rollbar/contrib/asgi/integration.py
# class integrate:
#     """
#     Integrates functions and classes (derived from IntegrationBase) in the SDK.
#     """
# 
#     def __init__(self, *, framework_name='unknown'):
#         self._framework_name = framework_name
# 
#     def __call__(self, obj):
#         if inspect.isclass(obj):
#             obj._integrate = self._register_hook
#             return obj
#         else:
#             return self._insert_hook(obj)
# 
#     def _register_hook(self):
#         def _hook(request, data):
#             data['framework'] = self._framework_name
# 
#         rollbar.BASE_DATA_HOOK = _hook
# 
#     def _insert_hook(self, func):
#         @functools.wraps(func)
#         def wrapper(*args, **kwargs):
#             self._register_hook()
#             return func(*args, **kwargs)
# 
#         return wrapper
# 
# Path: rollbar/contrib/starlette/logger.py
# class LoggerMiddleware(ASGIReporterMiddleware):
#     def __init__(self, app: ASGIApp) -> None:
#         if sys.version_info < (3, 6):
#             log.error(
#                 'LoggerMiddleware requires Python 3.7+ (or 3.6 with `aiocontextvars` package)'
#             )
#             raise RuntimeError(
#                 'LoggerMiddleware requires Python 3.7+ (or 3.6 with `aiocontextvars` package)'
#             )
# 
#         super().__init__(app)
# 
#     async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
#         store_current_request(scope, receive)
# 
#         await self.app(scope, receive, send)


from fastapi import __version__
from rollbar.contrib.asgi.integration import integrate
from rollbar.contrib.starlette import LoggerMiddleware as StarletteLoggerMiddleware
__all__ = ['LoggerMiddleware']




@integrate(framework_name=f'fastapi {__version__}')
class LoggerMiddleware(StarletteLoggerMiddleware):

# Path: rollbar/contrib/asgi/integration.py
# class integrate:
#     """
#     Integrates functions and classes (derived from IntegrationBase) in the SDK.
#     """
# 
#     def __init__(self, *, framework_name='unknown'):
#         self._framework_name = framework_name
# 
#     def __call__(self, obj):
#         if inspect.isclass(obj):
#             obj._integrate = self._register_hook
#             return obj
#         else:
#             return self._insert_hook(obj)
# 
#     def _register_hook(self):
#         def _hook(request, data):
#             data['framework'] = self._framework_name
# 
#         rollbar.BASE_DATA_HOOK = _hook
# 
#     def _insert_hook(self, func):
#         @functools.wraps(func)
#         def wrapper(*args, **kwargs):
#             self._register_hook()
#             return func(*args, **kwargs)
# 
#         return wrapper
# 
# Path: rollbar/contrib/starlette/logger.py
# class LoggerMiddleware(ASGIReporterMiddleware):
#     def __init__(self, app: ASGIApp) -> None:
#         if sys.version_info < (3, 6):
#             log.error(
#                 'LoggerMiddleware requires Python 3.7+ (or 3.6 with `aiocontextvars` package)'
#             )
#             raise RuntimeError(
#                 'LoggerMiddleware requires Python 3.7+ (or 3.6 with `aiocontextvars` package)'
#             )
# 
#         super().__init__(app)
# 
#     async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
#         store_current_request(scope, receive)
# 
#         await self.app(scope, receive, send)


# Path: rollbar/contrib/fastapi/logger.py
from fastapi import __version__
from rollbar.contrib.asgi.integration import integrate
from rollbar.contrib.starlette import LoggerMiddleware as StarletteLoggerMiddleware

__all__ = ['LoggerMiddleware']




@integrate(framework_name=f'fastapi {__version__}')
class LoggerMiddleware(StarletteLoggerMiddleware):

    ...