export type GetApiV21AccountsAccountIdConsumerDisclosureArgs = {accountId: string, langCode?: string | undefined}; export type GetApiV21AccountsAccountIdConsumerDisclosureOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the default Electronic Record and Signature Disclosure for an account. * * GET /v2.1/accounts/{accountId}/consumer_disclosure */ export const getApiV21AccountsAccountIdConsumerDisclosure = async (args: GetApiV21AccountsAccountIdConsumerDisclosureArgs, options?: GetApiV21AccountsAccountIdConsumerDisclosureOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.langCode != null) query.append("langCode", String(args.langCode)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/consumer_disclosure${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() };