export type DeleteApiApiV1StatuspagesStatuspageIdIncidentsPkArgs = {statuspage_id: string, pk: string}; export type DeleteApiApiV1StatuspagesStatuspageIdIncidentsPkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a single status page incident or maintenance window * * DELETE /api/v1/statuspages/{statuspage_id}/incidents/{pk}/ */ export const deleteApiApiV1StatuspagesStatuspageIdIncidentsPk = async (args: DeleteApiApiV1StatuspagesStatuspageIdIncidentsPkArgs, options: DeleteApiApiV1StatuspagesStatuspageIdIncidentsPkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/statuspages/${encodeURIComponent(String(args.statuspage_id))}/incidents/${encodeURIComponent(String(args.pk))}/${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 };