export type GetApiUserIdIdUserImageArgs = {id: string, scaleWidth?: number | undefined, scaleHeight?: number | undefined, imageId?: string | undefined}; export type GetApiUserIdIdUserImageOptions = {baseUrl: string, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /user/id/{id}/userImage */ export const getApiUserIdIdUserImage = async (args: GetApiUserIdIdUserImageArgs, options: GetApiUserIdIdUserImageOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.scaleWidth != null) query.append("scaleWidth", String(args.scaleWidth)) if (args.scaleHeight != null) query.append("scaleHeight", String(args.scaleHeight)) if (args.imageId != null) query.append("imageId", String(args.imageId)) if (APIToken !== undefined) headers.set("AuthenticationToken", APIToken) const url = `${baseUrl.replace(/\/+$/, '')}/user/id/${encodeURIComponent(String(args.id))}/userImage${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 };