trading_agent.gateway.routes.route_group
¶
The shared base of the gateway's API route groups.
Every route of a group needs the access token, so the group builds its router with the guard's check attached, and each subclass only adds its own routes.
Typical usage example:
class AccountRoutes(RouteGroup): def _add_routes(self, router): router.add_api_route('/api/account', self.account, methods=['GET'])
RouteGroup
¶
A set of related API routes behind the access token.
Creates the group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
guard
|
AccessGuard
|
Checks the access token. |
required |
Source code in src/trading_agent/gateway/routes/route_group.py
router
¶
Builds the router, every route requiring the token.
Returns:
| Type | Description |
|---|---|
APIRouter
|
The router. |