export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type ListCustomField = {configurationType?: string | undefined, errorDetails?: ErrorDetails | undefined, fieldId?: string | undefined, listItems?: Array | undefined, name?: string | undefined, required?: string | undefined, show?: string | undefined, value?: string | undefined}; export type TextCustomField = {configurationType?: string | undefined, errorDetails?: ErrorDetails | undefined, fieldId?: string | undefined, name?: string | undefined, required?: string | undefined, show?: string | undefined, value?: string | undefined}; export type TemplateCustomFields = {listCustomFields?: Array | undefined, textCustomFields?: Array | undefined}; export type DeleteApiV21AccountsAccountIdTemplatesTemplateIdCustomFieldsArgs = {accountId: string, templateId: string, body: TemplateCustomFields}; export type DeleteApiV21AccountsAccountIdTemplatesTemplateIdCustomFieldsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes envelope custom fields in a template. * * DELETE /v2.1/accounts/{accountId}/templates/{templateId}/custom_fields */ export const deleteApiV21AccountsAccountIdTemplatesTemplateIdCustomFields = async (args: DeleteApiV21AccountsAccountIdTemplatesTemplateIdCustomFieldsArgs, options?: DeleteApiV21AccountsAccountIdTemplatesTemplateIdCustomFieldsOptions) => { 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))}/templates/${encodeURIComponent(String(args.templateId))}/custom_fields${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() };