export type GetApiV21AccountsAccountIdBrandsArgs = {accountId: string, exclude_distributor_brand?: string | undefined, include_logos?: string | undefined}; export type GetApiV21AccountsAccountIdBrandsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets a list of brands. * * GET /v2.1/accounts/{accountId}/brands */ export const getApiV21AccountsAccountIdBrands = async (args: GetApiV21AccountsAccountIdBrandsArgs, options?: GetApiV21AccountsAccountIdBrandsOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.exclude_distributor_brand != null) query.append("exclude_distributor_brand", String(args.exclude_distributor_brand)) if (args.include_logos != null) query.append("include_logos", String(args.include_logos)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/brands${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() };