export type UpdateApiV3ModelsUidArgs = {body: BodyInit}; export type UpdateApiV3ModelsUidOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reuploads a model. Accepts multipart/form-data only. * * PUT /v3/models/{uid} */ export const updateApiV3ModelsUid = async (args: UpdateApiV3ModelsUidArgs, options?: UpdateApiV3ModelsUidOptions) => { 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: "PUT", 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 };