export type CreateApiAuthoringV1ChangesSetLibraryArgs = {body: {ids: Array<{id?: string | undefined, classification?: ('asset' | 'content') | undefined}>, libraryId: string}}; export type CreateApiAuthoringV1ChangesSetLibraryOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Beta - Bulk move items to another library. * * POST /authoring/v1/changes/set-library */ export const createApiAuthoringV1ChangesSetLibrary = async (args: CreateApiAuthoringV1ChangesSetLibraryArgs, options: CreateApiAuthoringV1ChangesSetLibraryOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/authoring/v1/changes/set-library${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };