export type ContactPhoneNumber = {phoneNumber?: string | undefined, phoneType?: string | undefined}; export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type JurisdictionSummary = {authorizedForIPen?: string | undefined, authorizedForRon?: string | undefined, jurisdictionId?: string | undefined, jurisdictionName?: string | undefined}; export type NotaryContactDetails = {hasDocusignCertificate?: string | undefined, jurisdictions?: Array | undefined}; export type Contact = {canManage?: string | undefined, cloudProvider?: string | undefined, cloudProviderContainerId?: string | undefined, contactId?: string | undefined, contactPhoneNumbers?: Array | undefined, contactUri?: string | undefined, emails?: Array | undefined, errorDetails?: ErrorDetails | undefined, isOwner?: boolean | undefined, name?: string | undefined, notaryContactDetails?: NotaryContactDetails | undefined, organization?: string | undefined, roomContactType?: string | undefined, shared?: string | undefined, signingGroup?: string | undefined, signingGroupName?: string | undefined}; export type ContactModRequest = {contactList?: Array | undefined}; export type UpdateApiV21AccountsAccountIdContactsArgs = {accountId: string, body: ContactModRequest}; export type UpdateApiV21AccountsAccountIdContactsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates one or more contacts. * * PUT /v2.1/accounts/{accountId}/contacts */ export const updateApiV21AccountsAccountIdContacts = async (args: UpdateApiV21AccountsAccountIdContactsArgs, options?: UpdateApiV21AccountsAccountIdContactsOptions) => { 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))}/contacts${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() };