export type DeleteApiApiV1SlaReportsPkArgs = {pk: string}; export type DeleteApiApiV1SlaReportsPkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete an SLA report * * DELETE /api/v1/sla-reports/{pk}/ */ export const deleteApiApiV1SlaReportsPk = async (args: DeleteApiApiV1SlaReportsPkArgs, options: DeleteApiApiV1SlaReportsPkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/sla-reports/${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 };