export type GetApiCoachingUserUserIdUserCertificationProgressArgs = {userId: number}; export type GetApiCoachingUserUserIdUserCertificationProgressOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /coaching/user/{userId}/user-certification-progress */ export const getApiCoachingUserUserIdUserCertificationProgress = async (args: GetApiCoachingUserUserIdUserCertificationProgressArgs, options: GetApiCoachingUserUserIdUserCertificationProgressOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/coaching/user/${encodeURIComponent(String(args.userId))}/user-certification-progress${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 };