export type DeleteApiApiPublicV1TeamsTeamRotationsGroupIdShiftIdArgs = {'X-VO-Api-Id': string, 'X-VO-Api-Key': string, team: string, groupId: number, shiftId: number}; export type DeleteApiApiPublicV1TeamsTeamRotationsGroupIdShiftIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a shift * * DELETE /api-public/v1/teams/{team}/rotations/{groupId}/{shiftId} */ export const deleteApiApiPublicV1TeamsTeamRotationsGroupIdShiftId = async (args: DeleteApiApiPublicV1TeamsTeamRotationsGroupIdShiftIdArgs, options?: DeleteApiApiPublicV1TeamsTeamRotationsGroupIdShiftIdOptions) => { const {baseUrl = "https://api.victorops.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-VO-Api-Id'] != null) headers.set("X-VO-Api-Id", String(args['X-VO-Api-Id'])) if (args['X-VO-Api-Key'] != null) headers.set("X-VO-Api-Key", String(args['X-VO-Api-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api-public/v1/teams/${encodeURIComponent(String(args.team))}/rotations/${encodeURIComponent(String(args.groupId))}/${encodeURIComponent(String(args.shiftId))}${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 };