export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type CaptiveRecipient = {clientUserId?: string | undefined, email?: string | undefined, errorDetails?: ErrorDetails | undefined, userName?: string | undefined}; export type CaptiveRecipientInformation = {captiveRecipients?: Array | undefined}; export type DeleteApiV21AccountsAccountIdCaptiveRecipientsRecipientPartArgs = {accountId: string, recipientPart: string, body: CaptiveRecipientInformation}; export type DeleteApiV21AccountsAccountIdCaptiveRecipientsRecipientPartOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes the signature for one or more captive recipient records. * * DELETE /v2.1/accounts/{accountId}/captive_recipients/{recipientPart} */ export const deleteApiV21AccountsAccountIdCaptiveRecipientsRecipientPart = async (args: DeleteApiV21AccountsAccountIdCaptiveRecipientsRecipientPartArgs, options?: DeleteApiV21AccountsAccountIdCaptiveRecipientsRecipientPartOptions) => { 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))}/captive_recipients/${encodeURIComponent(String(args.recipientPart))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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() };