export type DeleteApiV1ProjectsProjectIdSchedulesScheduleIdArgs = {projectId: string, scheduleId: string}; export type DeleteApiV1ProjectsProjectIdSchedulesScheduleIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes the schedule by the given schedule id * * DELETE /v1/projects/{projectId}/schedules/{scheduleId} */ export const deleteApiV1ProjectsProjectIdSchedulesScheduleId = async (args: DeleteApiV1ProjectsProjectIdSchedulesScheduleIdArgs, options?: DeleteApiV1ProjectsProjectIdSchedulesScheduleIdOptions) => { const {baseUrl = "https://eu1.api.matillion.com/dpc", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.projectId))}/schedules/${encodeURIComponent(String(args.scheduleId))}${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 };