export type GetApiUserIdIdUserImageThumbnailArgs = {id: string, scaleWidth?: number | undefined, scaleHeight?: number | undefined, imageId?: string | undefined}; export type GetApiUserIdIdUserImageThumbnailOptions = {baseUrl: string, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /user/id/{id}/userImageThumbnail */ export const getApiUserIdIdUserImageThumbnail = async (args: GetApiUserIdIdUserImageThumbnailArgs, options: GetApiUserIdIdUserImageThumbnailOptions) => { 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))}/userImageThumbnail${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 };