Every request type in the SDK exposes a paired construction surface:
Foo.of(required...) — convenience factory, required args only, all optionals defaulted
Foo.builder(required...) — full builder for setting optionals
Two multi-symbol request types are missing the of(...) half of that pair — they only have builder(...):
The varargs sibling StockPricesRequest already has both (StockPricesRequest.java:20), so this is an accidental omission, not a deliberate design choice. A consumer wanting a no-options multi-symbol quote is forced into .builder(...).build() for no reason.
Proposed change
Add a matching convenience factory to both types, mirroring StockPricesRequest.of:
public static StockQuotesRequest of(String first, String... rest) {
return builder(first, rest).build();
}
public static OptionsQuotesRequest of(String first, String... rest) {
return builder(first, rest).build();
}
Why now
The API-section docs (MarketDataApp/documentation#154) are standardizing on convenience factories so the Java/Kotlin examples read in 1–3 lines. These two endpoints currently cannot use that pattern and are stuck showing StockQuotesRequest.builder("AAPL", "META", "MSFT").build(). Adding of(...) lets the docs go minimal:
client.stocks().quotes(StockQuotesRequest.of("AAPL", "META", "MSFT")).values().forEach(System.out::println);
Acceptance
Every request type in the SDK exposes a paired construction surface:
Foo.of(required...)— convenience factory, required args only, all optionals defaultedFoo.builder(required...)— full builder for setting optionalsTwo multi-symbol request types are missing the
of(...)half of that pair — they only havebuilder(...):StockQuotesRequest—StockQuotesRequest.java:31hasbuilder(String first, String... rest), noof(...)OptionsQuotesRequest—OptionsQuotesRequest.java:39hasbuilder(String first, String... rest), noof(...)The varargs sibling
StockPricesRequestalready has both (StockPricesRequest.java:20), so this is an accidental omission, not a deliberate design choice. A consumer wanting a no-options multi-symbol quote is forced into.builder(...).build()for no reason.Proposed change
Add a matching convenience factory to both types, mirroring
StockPricesRequest.of:Why now
The API-section docs (MarketDataApp/documentation#154) are standardizing on convenience factories so the Java/Kotlin examples read in 1–3 lines. These two endpoints currently cannot use that pattern and are stuck showing
StockQuotesRequest.builder("AAPL", "META", "MSFT").build(). Addingof(...)lets the docs go minimal:Acceptance
StockQuotesRequest.of(String first, String... rest)addedOptionsQuotesRequest.of(String first, String... rest)addedStockPricesRequesttest coverage)of(...)pair (sweep to confirm this is the last gap)