plexus.dashboard.api.models.scorecard module
Scorecard Model - Python representation of the GraphQL Scorecard type.
Provides lookup methods to find scorecards by: - ID (direct lookup) - Key (using secondary index) - Name (using filter)
Each scorecard belongs to an account and contains sections with scores.
- class plexus.dashboard.api.models.scorecard.Scorecard(id: str, name: str, key: str, externalId: str, accountId: str, description: str | None = None, client: ForwardRef('_BaseAPIClient') | None = None)
Bases:
BaseModel- __init__(id: str, name: str, key: str, externalId: str, accountId: str, description: str | None = None, client: _BaseAPIClient | None = None)
- accountId: str
- classmethod create(client: _BaseAPIClient, name: str, key: str, externalId: str, accountId: str, description: str | None = None) Scorecard
Create a new scorecard.
- Args:
client: The API client name: Name of the scorecard key: Unique key identifier externalId: External ID (usually from YAML) accountId: ID of the account this scorecard belongs to description: Optional description
- Returns:
The created Scorecard instance
- description: str | None = None
- externalId: str
- classmethod fields() str
Return the GraphQL fields to query for this model
- classmethod from_dict(data: Dict[str, Any], client: _BaseAPIClient) Scorecard
Create an instance from a dictionary of data
- classmethod get_by_account_and_external_id(account_id: str, external_id: str, client: _BaseAPIClient) Scorecard | None
Get a scorecard by account ID and external ID using the GSI.
This uses the byAccountIdAndExternalId GSI for efficient lookup.
- Args:
account_id: The account ID to filter by external_id: The scorecard external ID to look up client: The API client instance
- Returns:
Scorecard: The found scorecard or None
- key: str
- classmethod list_by_external_id(external_id: str, client: _BaseAPIClient) Scorecard | None
Get a scorecard by its external ID.
- Args:
external_id: The scorecard external ID to look up client: The API client instance
- Returns:
Scorecard: The found scorecard or None
- classmethod list_by_key(key: str, client: _BaseAPIClient) Scorecard | None
Get a scorecard by its key.
- Args:
key: The scorecard key to look up client: The API client instance
- Returns:
Scorecard: The found scorecard or None
- classmethod list_by_name(name: str, client: _BaseAPIClient) Scorecard | None
Get a scorecard by its name.
- Args:
name: The scorecard name to look up client: The API client instance
- Returns:
Scorecard: The found scorecard or None
- name: str