Record Class StockTradesRequest

java.lang.Object
java.lang.Record
markets.alpaca.client.data.StockTradesRequest

public record StockTradesRequest(List<String> symbols, OffsetDateTime start, OffsetDateTime end, Integer limit, String asof, StockHistoricalFeed feed, String currency, String pageToken, Sort sort) extends Record
Named parameters for Market Data historical stock-trades endpoints.

At least one symbol is required. Unset optional fields are sent as null, allowing the generated client and API defaults to apply. AlpacaStocks.trades(StockTradesRequest) supports multiple symbols; AlpacaStocks.tradesForSymbol(StockTradesRequest) requires exactly one symbol because it calls the generated single-symbol endpoint.

See Also:
  • Constructor Details

    • StockTradesRequest

      public StockTradesRequest(List<String> symbols, OffsetDateTime start, OffsetDateTime end, Integer limit, String asof, StockHistoricalFeed feed, String currency, String pageToken, Sort sort)
      Creates an instance of a StockTradesRequest record class.
      Parameters:
      symbols - the value for the symbols record component
      start - the value for the start record component
      end - the value for the end record component
      limit - the value for the limit record component
      asof - the value for the asof record component
      feed - the value for the feed record component
      currency - the value for the currency record component
      pageToken - the value for the pageToken record component
      sort - the value for the sort record component
  • Method Details

    • builder

      public static StockTradesRequest.Builder builder()
      Returns a builder for historical stock-trades parameters.
    • symbols

      public List<String> symbols()
      Returns the requested symbols as an immutable snapshot.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • start

      public OffsetDateTime start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public OffsetDateTime end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • limit

      public Integer limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component
    • asof

      public String asof()
      Returns the value of the asof record component.
      Returns:
      the value of the asof record component
    • feed

      public StockHistoricalFeed feed()
      Returns the value of the feed record component.
      Returns:
      the value of the feed record component
    • currency

      public String currency()
      Returns the value of the currency record component.
      Returns:
      the value of the currency record component
    • pageToken

      public String pageToken()
      Returns the value of the pageToken record component.
      Returns:
      the value of the pageToken record component
    • sort

      public Sort sort()
      Returns the value of the sort record component.
      Returns:
      the value of the sort record component