export type GetApiV21AccountsAccountIdSigningGroupsArgs = {accountId: string, group_type?: string | undefined, include_users?: string | undefined}; export type GetApiV21AccountsAccountIdSigningGroupsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets a list of the Signing Groups in an account. * * GET /v2.1/accounts/{accountId}/signing_groups */ export const getApiV21AccountsAccountIdSigningGroups = async (args: GetApiV21AccountsAccountIdSigningGroupsArgs, options?: GetApiV21AccountsAccountIdSigningGroupsOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.group_type != null) query.append("group_type", String(args.group_type)) if (args.include_users != null) query.append("include_users", String(args.include_users)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/signing_groups${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };