export type DeleteApiWorkspaceReportsReportSchedulesScheduleArgs = {workspace: string, report: string, schedule: string}; export type DeleteApiWorkspaceReportsReportSchedulesScheduleOptions = {baseUrl?: string | undefined, accessTokenAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a report schedule * * DELETE /{workspace}/reports/{report}/schedules/{schedule} */ export const deleteApiWorkspaceReportsReportSchedulesSchedule = async (args: DeleteApiWorkspaceReportsReportSchedulesScheduleArgs, options?: DeleteApiWorkspaceReportsReportSchedulesScheduleOptions) => { const {baseUrl = "https://modeanalytics.com/api", fetch: fetchFn = fetch, accessTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accessTokenAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${accessTokenAuth.username}:${accessTokenAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.workspace))}/reports/${encodeURIComponent(String(args.report))}/schedules/${encodeURIComponent(String(args.schedule))}${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 };