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