poiesis.api.controllers package¶
Submodules¶
poiesis.api.controllers.cancel_task module¶
Controller for canceling tasks.
- class poiesis.api.controllers.cancel_task.CancelTaskController(db, task_id, user_id)[source]¶
Bases:
InterfaceControllerController for canceling a task.
This controller handles the cancellation of a task in the database.
- Parameters:
db (
MongoDBClient) – The database client.task_id (
str) – The ID of the task to cancel.user_id (
str) – The ID of the user making the request.
- async execute(*args, **kwargs)[source]¶
Cancel a task.
- Return type:
- Returns:
A response indicating the task was canceled.
- Raises:
NotFoundException – If the task is not found for the user.
BadRequestException – If the task is already completed, canceled, or being canceled.
poiesis.api.controllers.create_task module¶
Controller for creating a task.
- class poiesis.api.controllers.create_task.CreateTaskController(db, task, user_id)[source]¶
Bases:
InterfaceControllerController for creating a task.
poiesis.api.controllers.get_task module¶
Controller for getting a task.
- class poiesis.api.controllers.get_task.GetTaskController(db, id, user_id, view='MINIMAL')[source]¶
Bases:
InterfaceControllerController for getting a task.
This controller handles retrieving a specific task from the database.
- Parameters:
db (
MongoDBClient) – The database client.id (
str) – The ID of the task to retrieve.user_id (
str) – The ID of the user to retrieve the task for.view (
str|None) – The view to retrieve the task in.
- async execute(*args, **kwargs)[source]¶
Execute the controller to get a task.
- Return type:
- Returns:
The requested task.
- Raises:
NotFoundException – If the task is not found.
poiesis.api.controllers.interface module¶
Interface controllers for the Poiesis API.
poiesis.api.controllers.list_tasks module¶
Controller for listing tasks.
- class poiesis.api.controllers.list_tasks.ListTasksController(db, user_id, query_filter, page_size=None, page_token=None)[source]¶
Bases:
InterfaceControllerController for listing tasks.
This controller handles the listing of tasks from the database.
- Parameters:
db (
MongoDBClient) – The database client.page_size (
int|None) – The number of tasks to return per page.page_token (
str|None) – Token for pagination.user_id (
str) – The ID of the user making the request.query_filter (
TesListTasksFilter) – The filter for the list tasks.
Module contents¶
Controllers for the Poiesis API.