export type GetApiApiInstructorsOperatorsArgs = {seasonNo?: number | undefined, includeInactiveAndDeleted?: boolean | undefined, modifiedSince?: string | undefined}; export type GetApiApiInstructorsOperatorsOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/Instructors/operators */ export const getApiApiInstructorsOperators = async (args: GetApiApiInstructorsOperatorsArgs, options: GetApiApiInstructorsOperatorsOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.seasonNo != null) query.append("seasonNo", String(args.seasonNo)) if (args.includeInactiveAndDeleted != null) query.append("includeInactiveAndDeleted", String(args.includeInactiveAndDeleted)) if (args.modifiedSince != null) query.append("modifiedSince", String(args.modifiedSince)) if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/Instructors/operators${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };