bayesline.apiclient.IncidentsServiceClientImpl#
- class bayesline.apiclient.IncidentsServiceClientImpl(client: ApiClient)#
Synchronous client for the incidents API.
Methods
__init__(client)get_incident(incident_id)Obtain the incident with the given ID.
get_incident_summary([start_date, end_date, ...])Obtain incident summaries for the given date and index range.
submit_incident(incident_id, source, body)Submit an incident with the given ID and source.
- submit_incident(incident_id: str, source: str, body: dict[str, Any]) IncidentSummaryItem#
Submit an incident with the given ID and source.
Parameters#
Returns#
- IncidentSummaryItem
The submitted incident item.
- get_incident_summary(start_date: str | date | datetime | None = None, end_date: str | date | datetime | None = None, start_idx: int = 0, end_idx: int = 999999999) IncidentSummary#
Obtain incident summaries for the given date and index range.
Parameters#
- start_dateDateLike | None, default=None
The start date of the range. If None, the last 24 hours are used.
- end_dateDateLike | None, default=None
The end date of the range. If None, now is used.
- start_idxint, default=0
The start index of the range, 0 being first.
- end_idxint, default=999999999
The end index of the range, -1 being last.
Returns#
- IncidentSummary
The incident summary.