export type PatchApiV3ModelsUidArgs = {body: BodyInit}; export type PatchApiV3ModelsUidOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates model information. * * PATCH /v3/models/{uid} */ export const patchApiV3ModelsUid = async (args: PatchApiV3ModelsUidArgs, options?: PatchApiV3ModelsUidOptions) => { const {baseUrl = "https://api.sketchfab.com", fetch: fetchFn = fetch, Token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Token !== undefined) headers.set("Authorization", Token) const url = `${baseUrl.replace(/\/+$/, '')}/v3/models/${encodeURIComponent(String(args.uid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };