maeser.controllers.remaining_requests_api module#
This module provides a controller for fetching the remaining requests for a user.
- maeser.controllers.remaining_requests_api.controller(user_manager: UserManager, current_user: User) dict[str, int | None] [source]#
Fetch the remaining requests for the current user.
The response is formatted as
{'requests_remaining': <remaining_requests>}
, where “remaining_requests” is the number of remaining requests for the user. This will have a value of None if current_user does not exist.- Parameters:
user_manager (UserManager) – The user manager to use for fetching request data.
current_user (User) – The current user whose request data is being fetched.
- Returns:
A dictionary containing the number of requests remaining for the user.
- Return type:
dict