export type CircuitBreakerNotificationUpdate = {type?: ('webhook' | 'slack' | 'pagerduty') | undefined, url?: string | undefined, secret?: string | undefined, tenant_id?: string | undefined, active?: boolean | undefined}; export type UpdateApiApiV1CircuitBreakerNotificationsIdArgs = {Authorization: string, id: string, body: CircuitBreakerNotificationUpdate}; export type UpdateApiApiV1CircuitBreakerNotificationsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update notification config * * PUT /api/v1/circuit-breaker/notifications/{id} */ export const updateApiApiV1CircuitBreakerNotificationsId = async (args: UpdateApiApiV1CircuitBreakerNotificationsIdArgs, options?: UpdateApiApiV1CircuitBreakerNotificationsIdOptions) => { const {baseUrl = "https://agent.getaxonflow.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/circuit-breaker/notifications/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };