export type Expirations = {expireAfter?: string | undefined, expireEnabled?: string | undefined, expireWarn?: string | undefined}; export type Reminders = {maximumReminderCount?: string | undefined, reminderDelay?: string | undefined, reminderEnabled?: string | undefined, reminderFrequency?: string | undefined, smartReminderEnabled?: string | undefined}; export type EnvelopeNotificationRequest = {expirations?: Expirations | undefined, reminders?: Reminders | undefined, useAccountDefaults?: string | undefined}; export type UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdNotificationArgs = {accountId: string, envelopeId: string, body: EnvelopeNotificationRequest}; export type UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdNotificationOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sets envelope notifications for an existing envelope. * * PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/notification */ export const updateApiV21AccountsAccountIdEnvelopesEnvelopeIdNotification = async (args: UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdNotificationArgs, options?: UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdNotificationOptions) => { 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))}/notification${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() };