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: InterfaceController

Controller 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:

TesCancelTaskResponse

Returns:

A response indicating the task was canceled.

Raises:

poiesis.api.controllers.create_task module

Controller for creating a task.

class poiesis.api.controllers.create_task.CreateTaskController(db, task, user_id)[source]

Bases: InterfaceController

Controller for creating a task.

async execute(*args, **kwargs)[source]

Execute the controller.

Return type:

TesCreateTaskResponse

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: InterfaceController

Controller 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:

TesTask

Returns:

The requested task.

Raises:

NotFoundException – If the task is not found.

poiesis.api.controllers.interface module

Interface controllers for the Poiesis API.

class poiesis.api.controllers.interface.InterfaceController[source]

Bases: ABC

Abstract base class for interface controllers.

abstractmethod async execute(*args, **kwargs)[source]

Execute the interface controller.

Return type:

BaseModel

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: InterfaceController

Controller 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.

async execute(*args, **kwargs)[source]

Execute the controller to list tasks.

Return type:

TesListTasksResponse

Returns:

A response containing the list of tasks and pagination token.

Module contents

Controllers for the Poiesis API.