export type GetApiV21AccountsAccountIdFoldersFolderIdArgs = {accountId: string, folderId: string, from_date?: string | undefined, include_items?: string | undefined, owner_email?: string | undefined, owner_name?: string | undefined, search_text?: string | undefined, start_position?: string | undefined, status?: string | undefined, to_date?: string | undefined}; export type GetApiV21AccountsAccountIdFoldersFolderIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets information about items in a specified folder. * * GET /v2.1/accounts/{accountId}/folders/{folderId} */ export const getApiV21AccountsAccountIdFoldersFolderId = async (args: GetApiV21AccountsAccountIdFoldersFolderIdArgs, options?: GetApiV21AccountsAccountIdFoldersFolderIdOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.from_date != null) query.append("from_date", String(args.from_date)) if (args.include_items != null) query.append("include_items", String(args.include_items)) if (args.owner_email != null) query.append("owner_email", String(args.owner_email)) if (args.owner_name != null) query.append("owner_name", String(args.owner_name)) if (args.search_text != null) query.append("search_text", String(args.search_text)) if (args.start_position != null) query.append("start_position", String(args.start_position)) if (args.status != null) query.append("status", String(args.status)) if (args.to_date != null) query.append("to_date", String(args.to_date)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/folders/${encodeURIComponent(String(args.folderId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };