export type UpdateApiApiOrgIdFoldersFolderIdArgs = {org_id: string, folder_id: string, body: {description?: string | undefined, folder_id?: string | undefined, icon?: (string | null) | undefined, name?: string | undefined}}; export type UpdateApiApiOrgIdFoldersFolderIdOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an existing folder (deprecated) * * PUT /api/{org_id}/folders/{folder_id} */ export const updateApiApiOrgIdFoldersFolderId = async (args: UpdateApiApiOrgIdFoldersFolderIdArgs, options: UpdateApiApiOrgIdFoldersFolderIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/folders/${encodeURIComponent(String(args.folder_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 res.text() };