export type DocGenSyntaxError = {errorCode?: string | undefined, message?: string | undefined, tagIdentifier?: string | undefined}; export type ConnectedObjectDetails = {recordId?: string | undefined}; export type DocGenFormat = {expression?: string | undefined, locale?: string | undefined}; export type DocGenFormFieldOption = {description?: string | undefined, label?: string | undefined, selected?: string | undefined, value?: string | undefined}; export type DocGenFormFieldRowValue = {docGenFormFieldList?: Array | undefined}; export type DocGenFormFieldValidation = {errorMessage?: string | undefined, expression?: string | undefined}; export type DocGenFormField = {connectedObjectDetails?: ConnectedObjectDetails | undefined, defaultValue?: string | undefined, description?: string | undefined, filter?: string | undefined, format?: DocGenFormat | undefined, fullyQualifiedPath?: string | undefined, hidden?: string | undefined, label?: string | undefined, name?: string | undefined, options?: Array | undefined, order?: string | undefined, predefinedValidation?: string | undefined, readOnly?: string | undefined, required?: string | undefined, rowValues?: Array | undefined, type?: string | undefined, validation?: DocGenFormFieldValidation | undefined, value?: string | undefined}; export type DocGenFormFields = {docGenDocumentStatus?: string | undefined, docGenErrors?: Array | undefined, docGenFormFieldList?: Array | undefined, documentId?: string | undefined}; export type DocGenFormFieldRequest = {docGenFormFields?: Array | undefined}; export type UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdDocGenFormFieldsArgs = {accountId: string, envelopeId: string, update_docgen_formfields_only?: string | undefined, body: DocGenFormFieldRequest}; export type UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdDocGenFormFieldsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates sender fields for an envelope. * * PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields */ export const updateApiV21AccountsAccountIdEnvelopesEnvelopeIdDocGenFormFields = async (args: UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdDocGenFormFieldsArgs, options?: UpdateApiV21AccountsAccountIdEnvelopesEnvelopeIdDocGenFormFieldsOptions) => { 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', "*/*") if (args.update_docgen_formfields_only != null) query.append("update_docgen_formfields_only", String(args.update_docgen_formfields_only)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/envelopes/${encodeURIComponent(String(args.envelopeId))}/docGenFormFields${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() };