export type DeleteApiV1ChatAlertsAlertIdArgs = {alert_id: string}; export type DeleteApiV1ChatAlertsAlertIdOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an alert * * DELETE /v1/chat/alerts/{alert_id} */ export const deleteApiV1ChatAlertsAlertId = async (args: DeleteApiV1ChatAlertsAlertIdArgs, options?: DeleteApiV1ChatAlertsAlertIdOptions) => { const {baseUrl = "https://api.asknews.app", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKey !== undefined) headers.set("Authorization", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/chat/alerts/${encodeURIComponent(String(args.alert_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };