export type CreateApiPublicV1DocumentsIdMoveToFolderFolderIdArgs = {id: string, folder_id: string}; export type CreateApiPublicV1DocumentsIdMoveToFolderFolderIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Document move to folder * * POST /public/v1/documents/{id}/move-to-folder/{folder_id} * * Also accepts auth: oauth2 */ export const createApiPublicV1DocumentsIdMoveToFolderFolderId = async (args: CreateApiPublicV1DocumentsIdMoveToFolderFolderIdArgs, options?: CreateApiPublicV1DocumentsIdMoveToFolderFolderIdOptions) => { const {baseUrl = "https://api.pandadoc.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/documents/${encodeURIComponent(String(args.id))}/move-to-folder/${encodeURIComponent(String(args.folder_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };