export type Attachment = {accessControl?: string | undefined, attachmentId?: string | undefined, attachmentType?: string | undefined, data?: string | undefined, label?: string | undefined, name?: string | undefined, remoteUrl?: string | undefined}; export type EnvelopeAttachmentsRequest = {attachments?: Array | undefined}; export type DeleteApiV21AccountsAccountIdEnvelopesEnvelopeIdAttachmentsArgs = {accountId: string, envelopeId: string, body: EnvelopeAttachmentsRequest}; export type DeleteApiV21AccountsAccountIdEnvelopesEnvelopeIdAttachmentsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes one or more envelope attachments from a draft envelope. * * DELETE /v2.1/accounts/{accountId}/envelopes/{envelopeId}/attachments */ export const deleteApiV21AccountsAccountIdEnvelopesEnvelopeIdAttachments = async (args: DeleteApiV21AccountsAccountIdEnvelopesEnvelopeIdAttachmentsArgs, options?: DeleteApiV21AccountsAccountIdEnvelopesEnvelopeIdAttachmentsOptions) => { 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))}/envelopes/${encodeURIComponent(String(args.envelopeId))}/attachments${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() };