export type DeleteApiApiV1SchedulesScheduleIdArgs = {schedule_id: string}; export type DeleteApiApiV1SchedulesScheduleIdOptions = {baseUrl?: string | undefined, secretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Schedule * * DELETE /api/v1/schedules/{schedule_id} */ export const deleteApiApiV1SchedulesScheduleId = async (args: DeleteApiApiV1SchedulesScheduleIdArgs, options?: DeleteApiApiV1SchedulesScheduleIdOptions) => { const {baseUrl = "https://api.trigger.dev", fetch: fetchFn = fetch, secretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (secretKey !== undefined) headers.set('authorization', `Bearer ${secretKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/schedules/${encodeURIComponent(String(args.schedule_id))}${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 };