export type BulkSendBatchRequest = {batchName?: string | undefined}; export type UpdateApiV21AccountsAccountIdBulkSendBatchBulkSendBatchIdArgs = {accountId: string, bulkSendBatchId: string, body: BulkSendBatchRequest}; export type UpdateApiV21AccountsAccountIdBulkSendBatchBulkSendBatchIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the name of a bulk send batch. * * PUT /v2.1/accounts/{accountId}/bulk_send_batch/{bulkSendBatchId} */ export const updateApiV21AccountsAccountIdBulkSendBatchBulkSendBatchId = async (args: UpdateApiV21AccountsAccountIdBulkSendBatchBulkSendBatchIdArgs, options?: UpdateApiV21AccountsAccountIdBulkSendBatchBulkSendBatchIdOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/bulk_send_batch/${encodeURIComponent(String(args.bulkSendBatchId))}${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.blob() };