export type UpdateApiV3BackofficeDesignIdArgs = {id: number, body: {name?: string | undefined, description?: (string | null) | undefined, semantic?: (string | null) | undefined, draft_id?: number | undefined, collection_ids?: Array | undefined, notes?: (string | null) | undefined, badge?: (string | null) | undefined, display_name?: (string | null) | undefined, reference?: (string | null) | undefined, tags?: Array | undefined, design_type?: (string | null) | undefined, design_subtype?: (string | null) | undefined, pricing?: ({cost?: number | undefined, markup_percentage?: number | undefined, currency?: string | undefined} | null) | undefined}}; export type UpdateApiV3BackofficeDesignIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a design * * PUT /v3/backoffice/design/{id} */ export const updateApiV3BackofficeDesignId = async (args: UpdateApiV3BackofficeDesignIdArgs, options?: UpdateApiV3BackofficeDesignIdOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/backoffice/design/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };