export type CollectionSchema = {category?: (string | null) | undefined, created_by_user?: string | undefined, custom_keyframe?: (string | null) | undefined, custom_order_status?: ('DISABLED' | 'ENABLING' | 'ENABLED') | undefined, custom_poster?: (string | null) | undefined, date_created?: string | undefined, date_deleted?: string | undefined, date_modified?: string | undefined, date_viewed?: string | undefined, deleted_by_user?: string | undefined, external_id?: (string | null) | undefined, favoured?: boolean | undefined, id?: string | undefined, in_collections?: Array | undefined, is_root?: boolean | undefined, keyframe_asset_ids?: Array | undefined, keyframes?: Array> | undefined, metadata?: Record | undefined, object_type?: string | undefined, parent_id?: (string | null) | undefined, parents?: Array | undefined, permissions?: Array | undefined, position?: number | undefined, project_id?: string | undefined, status?: ('ACTIVE' | 'HIDDEN' | 'DELETED') | undefined, storage_id?: (string | null) | undefined, title: string}; export type UpdateApiV1CollectionsCollectionIdSearchDocumentArgs = {'App-ID': string, 'Auth-Token': string, collection_id: string, body: CollectionSchema}; export type UpdateApiV1CollectionsCollectionIdSearchDocumentOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update metadata for collection * * PUT /v1/collections/{collection_id}/search_document/ */ export const updateApiV1CollectionsCollectionIdSearchDocument = async (args: UpdateApiV1CollectionsCollectionIdSearchDocumentArgs, options: UpdateApiV1CollectionsCollectionIdSearchDocumentOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/collections/${encodeURIComponent(String(args.collection_id))}/search_document/${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 };