export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type SigningGroupUser = {email?: string | undefined, errorDetails?: ErrorDetails | undefined, userName?: string | undefined}; export type SigningGroup = {created?: string | undefined, createdBy?: string | undefined, errorDetails?: ErrorDetails | undefined, groupEmail?: string | undefined, groupName?: string | undefined, groupType?: string | undefined, modified?: string | undefined, modifiedBy?: string | undefined, signingGroupId?: string | undefined, users?: Array | undefined}; export type SigningGroupInformation = {groups?: Array | undefined}; export type UpdateApiV21AccountsAccountIdSigningGroupsArgs = {accountId: string, body: SigningGroupInformation}; export type UpdateApiV21AccountsAccountIdSigningGroupsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates signing group names. * * PUT /v2.1/accounts/{accountId}/signing_groups */ export const updateApiV21AccountsAccountIdSigningGroups = async (args: UpdateApiV21AccountsAccountIdSigningGroupsArgs, options?: UpdateApiV21AccountsAccountIdSigningGroupsOptions) => { 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))}/signing_groups${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() };