import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { BasePage, type BasePageParams, PagePromise } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; /** * Incidents occur when an anomaly alert is triggered in Mux Data. The Incidents API provides operations related to the raising and managing of alerting incidents. */ export declare class Incidents extends APIResource { /** * Returns the details of an incident. * * @example * ```ts * const incidentResponse = * await client.data.incidents.retrieve('abcd1234'); * ``` */ retrieve(incidentID: string, options?: RequestOptions): APIPromise; /** * Returns a list of incidents. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const incident of client.data.incidents.list()) { * // ... * } * ``` */ list(query?: IncidentListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Returns all the incidents that seem related to a specific incident. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const incident of client.data.incidents.listRelated( * 'abcd1234', * )) { * // ... * } * ``` */ listRelated(incidentID: string, query?: IncidentListRelatedParams | null | undefined, options?: RequestOptions): PagePromise; } export type IncidentsBasePage = BasePage; export interface Incident { id: string; affected_views: number; affected_views_per_hour: number; affected_views_per_hour_on_open: number; breakdowns: Array; description: string; error_description: string; impact: string; incident_key: string; measured_value: number | null; measured_value_on_close: number | null; measurement: string; notification_rules: Array; notifications: Array; resolved_at: string | null; sample_size: number; sample_size_unit: string; severity: string; started_at: string; status: string; threshold: number; } export declare namespace Incident { interface Breakdown { id: string; name: string; value: string; } interface NotificationRule { id: string; action: string; property_id: string; rules: Array; status: string; } namespace NotificationRule { interface Rule { id: string; name: string; value: string; } } interface Notification { id: number; attempted_at: string; queued_at: string; } } export interface IncidentResponse { data: Incident; timeframe: Array; total_row_count: number | null; } export interface IncidentListParams extends BasePageParams { /** * Value to order the results by */ order_by?: 'negative_impact' | 'value' | 'views' | 'field'; /** * Sort order. */ order_direction?: 'asc' | 'desc'; /** * Severity to filter incidents by */ severity?: 'warning' | 'alert'; /** * Status to filter incidents by */ status?: 'open' | 'closed' | 'expired'; } export interface IncidentListRelatedParams extends BasePageParams { /** * Value to order the results by */ order_by?: 'negative_impact' | 'value' | 'views' | 'field'; /** * Sort order. */ order_direction?: 'asc' | 'desc'; } export declare namespace Incidents { export { type Incident as Incident, type IncidentResponse as IncidentResponse, type IncidentsBasePage as IncidentsBasePage, type IncidentListParams as IncidentListParams, type IncidentListRelatedParams as IncidentListRelatedParams, }; } //# sourceMappingURL=incidents.d.ts.map