export type GetApiApiV2AccountsAccountIdActivitiesBrokerageArgs = {page_size?: (number | null) | undefined, page_token?: (string | null) | undefined}; export type GetApiApiV2AccountsAccountIdActivitiesBrokerageOptions = {baseUrl?: string | undefined, ApiKeyId?: string | undefined, ApiSecretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Brokerage Account Activities * * GET /api/v2/accounts/{account_id}/activities/brokerage */ export const getApiApiV2AccountsAccountIdActivitiesBrokerage = async (args: GetApiApiV2AccountsAccountIdActivitiesBrokerageArgs, options?: GetApiApiV2AccountsAccountIdActivitiesBrokerageOptions) => { const {baseUrl = "https://api-enterprise.sbt.dinari.com", fetch: fetchFn = fetch, ApiKeyId, ApiSecretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.page_size != null) query.append("page_size", String(args.page_size)) if (args.page_token != null) query.append("page_token", String(args.page_token)) if (ApiKeyId !== undefined) headers.set("X-API-Key-Id", ApiKeyId) if (ApiSecretKey !== undefined) headers.set("X-API-Secret-Key", ApiSecretKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/accounts/${encodeURIComponent(String(args.account_id))}/activities/brokerage${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 undefined };