plexus.dashboard.api.models.report module
Report Model - Python representation of the GraphQL Report type.
- class plexus.dashboard.api.models.report.Report(id: str, reportConfigurationId: str, accountId: str, name: str, taskId: str, createdAt: datetime.datetime, updatedAt: datetime.datetime, parameters: Dict[str, Any] | None = None, output: str | None = None, client: ForwardRef('_BaseAPIClient') | None = None)
Bases:
BaseModel- __init__(id: str, reportConfigurationId: str, accountId: str, name: str, taskId: str, createdAt: datetime, updatedAt: datetime, parameters: Dict[str, Any] | None = None, output: str | None = None, client: _BaseAPIClient | None = None)
- accountId: str
- classmethod create(client: _BaseAPIClient, reportConfigurationId: str, accountId: str, taskId: str, name: str, parameters: Dict[str, Any] | None = None, output: str | None = None) Report
Create a new Report record via GraphQL mutation, linked to a Task.
- createdAt: datetime
- delete() bool
Delete this Report record and its associated ReportBlock records.
Performs a GraphQL mutation to delete the report. The API is expected to cascade delete all associated ReportBlock records.
- Returns:
bool: True if deletion was successful, False otherwise.
- Raises:
ValueError: If no client is associated with this instance. Exception: If the GraphQL mutation returns an error.
- classmethod delete_by_id(report_id: str, client: _BaseAPIClient) bool
Delete a Report by ID without first retrieving it.
- Args:
report_id: The ID of the report to delete. client: The API client to use for the deletion.
- Returns:
bool: True if deletion was successful, False otherwise.
- Raises:
Exception: If the GraphQL mutation returns an error.
- classmethod delete_multiple(report_ids: List[str], client: _BaseAPIClient) Dict[str, bool]
Delete multiple Reports by IDs.
- Args:
report_ids: A list of report IDs to delete. client: The API client to use for the deletion.
- Returns:
Dict[str, bool]: A dictionary mapping report IDs to deletion success status.
- classmethod fields() str
Return the GraphQL fields to query for this model.
- classmethod from_dict(data: Dict[str, Any], client: _BaseAPIClient) Report
Create an instance from a dictionary of data.
- classmethod get_by_name(name: str, account_id: str, client: _BaseAPIClient) Report | None
Get a Report by its name within a specific account.
Uses the ‘listReportByAccountIdAndUpdatedAt’ index and filters results client-side to find the matching name. Returns the first match found. NOTE: This can be inefficient if there are many reports for the account.
- classmethod list_by_account_id(account_id: str, client: _BaseAPIClient, limit: int = 100, max_items: int | None = None) list[Report]
List Reports for a specific account using pagination.
Uses the ‘listReportByAccountIdAndUpdatedAt’ index.
- Args:
account_id: The ID of the account to list reports for. client: The API client instance. limit: The number of items to fetch per page. max_items: Optional limit on the total number of items to return.
- Returns:
A list of Report instances.
- name: str
- output: str | None = None
- parameters: Dict[str, Any] | None
- reportConfigurationId: str
- taskId: str
- updatedAt: datetime