bayesline.apiclient.IncidentsServiceClientImpl#

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

Bases: IncidentsServiceApi

Synchronous client for the incidents API.

Methods

__init__(client)

get_incident(incident_id)

Obtains the incident with the given ID.

get_incident_summary([start_date, end_date, ...])

Obtains incident summaries for the given date and index range.

submit_incident(incident_id, source, body)

Submits an incident with the given ID and source.

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

Submits 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#

Obtains incident summaries for the given date and index range.

Parameters#

start_dateDateLike | None, optional

The start date of the range. If None, the last 24 hours are used.

end_dateDateLike | None, optional

The end date of the range. If None, now is used.

start_idxint, optional

The start index of the range, 0 being first. Default is 0.

end_idxint, optional

The end index of the range, -1 being last. Default is 999999999.

Returns#

IncidentSummary

The incident summary.

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

Obtains the incident with the given ID.

Parameters#

incident_idstr

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

Returns#

dict

The incident details.