bayesline.apiclient.IncidentsServiceClientImpl#

class bayesline.apiclient.IncidentsServiceClientImpl(client: ApiClient)#

Synchronous client for the incidents API.

__init__(client: ApiClient)#

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.

__init__(client: ApiClient)#
submit_incident(incident_id: str, source: str, body: dict[str, Any]) IncidentSummaryItem#

Submit an incident with the given ID and source.

Parameters#

incident_idstr

The ID of the incident. Cannot contain any of the following characters: /\:*?”<>|-

sourcestr

The source of the incident. Cannot contain any of the following characters: /\:*?”<>|-

bodydict[str, Any]

The body of the incident.

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.

get_incident(incident_id: str) dict[str, dict[str, Any]]#

Obtain the incident with the given ID.

Parameters#

incident_idstr

The ID of the incident. Cannot contain any of the following characters: /\:*?”<>|-

Returns#

dict[str, dict[str, Any]]

The incident details.