Package markets.alpaca.client
Class AlpacaClient.Builder
java.lang.Object
markets.alpaca.client.AlpacaClient.Builder
- Enclosing class:
- AlpacaClient
Builder for immutable
AlpacaClient instances.-
Method Summary
Modifier and TypeMethodDescriptionbrokerBaseUrl(String brokerBaseUrl) Overrides the Broker REST API base URL.brokerCredentials(AlpacaCredentials brokerCredentials) Overrides the credentials used by Broker REST and SSE workflows.brokerEnvironment(BrokerApiEnvironment brokerEnvironment) Sets the Broker API environment.brokerHttpClient(okhttp3.OkHttpClient brokerHttpClient) Sets the HTTP client used by Broker REST and SSE calls.build()Builds an immutable client facade using the configured credentials, environments, base URLs, and HTTP clients.dataBaseUrl(String dataBaseUrl) Overrides the Market Data REST API base URL.dataCredentials(AlpacaCredentials dataCredentials) Overrides the credentials used by Market Data REST workflows.dataHttpClient(okhttp3.OkHttpClient dataHttpClient) Sets the HTTP client used by Market Data REST calls.httpClient(okhttp3.OkHttpClient httpClient) Uses the same HTTP client for Trading, Market Data, and Broker workloads.tradingBaseUrl(String tradingBaseUrl) Overrides the Trading REST API base URL.tradingCredentials(AlpacaCredentials tradingCredentials) Overrides the credentials used by Trading REST workflows.tradingEnvironment(TradingApiEnvironment tradingEnvironment) Sets the Trading API environment.tradingHttpClient(okhttp3.OkHttpClient tradingHttpClient) Sets the HTTP client used by Trading REST calls.
-
Method Details
-
tradingCredentials
Overrides the credentials used by Trading REST workflows. -
dataCredentials
Overrides the credentials used by Market Data REST workflows. -
brokerCredentials
Overrides the credentials used by Broker REST and SSE workflows. -
tradingEnvironment
Sets the Trading API environment. Defaults to paper trading. -
brokerEnvironment
Sets the Broker API environment. Defaults to sandbox. -
tradingBaseUrl
Overrides the Trading REST API base URL. Defaults to the selected Trading environment. -
dataBaseUrl
Overrides the Market Data REST API base URL. Defaults to the generated client default. -
brokerBaseUrl
Overrides the Broker REST API base URL. Defaults to the selected Broker environment. -
httpClient
Uses the same HTTP client for Trading, Market Data, and Broker workloads. -
tradingHttpClient
Sets the HTTP client used by Trading REST calls. -
dataHttpClient
Sets the HTTP client used by Market Data REST calls. -
brokerHttpClient
Sets the HTTP client used by Broker REST and SSE calls. -
build
Builds an immutable client facade using the configured credentials, environments, base URLs, and HTTP clients.The builder copies supplied
OkHttpClientinstances withnewBuilder()so later mutations by the caller cannot change this client.
-