export type CreateApiV3ModelsUidArchivesExtraArgs = {body: BodyInit}; export type CreateApiV3ModelsUidArchivesExtraOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Adds or replace a model's extra archive, only for orgs and users with a paid plan. * * POST /v3/models/{uid}/archives/extra */ export const createApiV3ModelsUidArchivesExtra = async (args: CreateApiV3ModelsUidArchivesExtraArgs, options?: CreateApiV3ModelsUidArchivesExtraOptions) => { 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))}/archives/extra${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };