export type DeleteApiV3SchedulesIdCustomShiftsCustomShiftIdArgs = {id: string, custom_shift_id: string}; export type DeleteApiV3SchedulesIdCustomShiftsCustomShiftIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a custom shift * * DELETE /v3/schedules/{id}/custom_shifts/{custom_shift_id} */ export const deleteApiV3SchedulesIdCustomShiftsCustomShiftId = async (args: DeleteApiV3SchedulesIdCustomShiftsCustomShiftIdArgs, options?: DeleteApiV3SchedulesIdCustomShiftsCustomShiftIdOptions) => { const {baseUrl = "https://api.pagerduty.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/schedules/${encodeURIComponent(String(args.id))}/custom_shifts/${encodeURIComponent(String(args.custom_shift_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 };