Record Class ListOrdersRequest

java.lang.Object
java.lang.Record
markets.alpaca.client.trading.ListOrdersRequest

public record ListOrdersRequest(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClasses, String beforeOrderId, String afterOrderId) extends Record
Named parameters for the Trading API GET /v2/orders endpoint.

Unset fields are sent as null, allowing Alpaca's API defaults to apply. The SDK validates local constraints that are easy to violate accidentally: limit must be between 1 and 500, beforeOrderId and afterOrderId are mutually exclusive, and order-id pagination cannot be combined with after/until time filters.

See Also:
  • Constructor Details

    • ListOrdersRequest

      public ListOrdersRequest(String status, Integer limit, String after, String until, String direction, Boolean nested, String symbols, String side, List<String> assetClasses, String beforeOrderId, String afterOrderId)
      Creates an instance of a ListOrdersRequest record class.
      Parameters:
      status - the value for the status record component
      limit - the value for the limit record component
      after - the value for the after record component
      until - the value for the until record component
      direction - the value for the direction record component
      nested - the value for the nested record component
      symbols - the value for the symbols record component
      side - the value for the side record component
      assetClasses - the value for the assetClasses record component
      beforeOrderId - the value for the beforeOrderId record component
      afterOrderId - the value for the afterOrderId record component
  • Method Details

    • empty

      public static ListOrdersRequest empty()
      Returns an empty request that uses the API defaults.
    • builder

      public static ListOrdersRequest.Builder builder()
      Returns a builder for named list-orders parameters.
    • assetClasses

      public List<String> assetClasses()
      Returns the asset-class filter 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.
    • status

      public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • limit

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

      public String after()
      Returns the value of the after record component.
      Returns:
      the value of the after record component
    • until

      public String until()
      Returns the value of the until record component.
      Returns:
      the value of the until record component
    • direction

      public String direction()
      Returns the value of the direction record component.
      Returns:
      the value of the direction record component
    • nested

      public Boolean nested()
      Returns the value of the nested record component.
      Returns:
      the value of the nested record component
    • symbols

      public String symbols()
      Returns the value of the symbols record component.
      Returns:
      the value of the symbols record component
    • side

      public String side()
      Returns the value of the side record component.
      Returns:
      the value of the side record component
    • beforeOrderId

      public String beforeOrderId()
      Returns the value of the beforeOrderId record component.
      Returns:
      the value of the beforeOrderId record component
    • afterOrderId

      public String afterOrderId()
      Returns the value of the afterOrderId record component.
      Returns:
      the value of the afterOrderId record component