Class UpdateOrderRequest

java.lang.Object
markets.alpaca.client.openapi.broker.model.UpdateOrderRequest
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class UpdateOrderRequest extends Object implements Serializable
Represents the fields that are editable in an order replace/update call. Note: client_order_id is currently not editable on its own, one of the other fields must be changed at the same time to effectively replace the order. Note: `qty` and `notional` are mutually exclusive on a single replace request. `notional` is only valid for IPO indications of interest (`asset_class: \"ipo\"`); non-IPO notional orders cannot be replaced at all.
See Also:
  • Field Details

  • Constructor Details

    • UpdateOrderRequest

      public UpdateOrderRequest()
  • Method Details

    • advancedInstructions

      public UpdateOrderRequest advancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • getAdvancedInstructions

      @Nullable public AdvancedInstructions getAdvancedInstructions()
      Get advancedInstructions
      Returns:
      advancedInstructions
    • setAdvancedInstructions

      public void setAdvancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • clientOrderId

      public UpdateOrderRequest clientOrderId(@Nullable String clientOrderId)
    • getClientOrderId

      @Nullable public String getClientOrderId()
      A unique identifier for the new order. Automatically generated if not sent. (<= 128 characters)
      Returns:
      clientOrderId
    • setClientOrderId

      public void setClientOrderId(@Nullable String clientOrderId)
    • limitPrice

      public UpdateOrderRequest limitPrice(@Nullable BigDecimal limitPrice)
    • getLimitPrice

      @Nullable public BigDecimal getLimitPrice()
      Required if original order's `type` field was `limit` or `stop_limit`. In case of `mleg`, the limit_price parameter is expressed with the following notation: - A positive value indicates a debit, representing a cost or payment to be made. - A negative value signifies a credit, reflecting an amount to be received.
      Returns:
      limitPrice
    • setLimitPrice

      public void setLimitPrice(@Nullable BigDecimal limitPrice)
    • notional

      public UpdateOrderRequest notional(@Nullable BigDecimal notional)
    • getNotional

      @Nullable public BigDecimal getNotional()
      New notional (dollar amount) for the order. Only valid for IPO indications of interest (`asset_class: \"ipo\"`); will be rejected for any other asset class. Mutually exclusive with `qty` on the same replace request.
      Returns:
      notional
    • setNotional

      public void setNotional(@Nullable BigDecimal notional)
    • qty

      public UpdateOrderRequest qty(@Nullable BigDecimal qty)
    • getQty

      @Nullable public BigDecimal getQty()
      You can only patch full shares for now. Qty of equity fractional orders are not allowed to change. Non-IPO notional orders cannot be replaced at all - no fields (qty, limit_price, stop_price, etc.) can be modified; cancel and resubmit instead. In case of multi-leg orders represents the number of units to trade of this strategy.
      Returns:
      qty
    • setQty

      public void setQty(@Nullable BigDecimal qty)
    • stopPrice

      public UpdateOrderRequest stopPrice(@Nullable BigDecimal stopPrice)
    • getStopPrice

      @Nullable public BigDecimal getStopPrice()
      Required if original order's `type` field was stop or stop_limit
      Returns:
      stopPrice
    • setStopPrice

      public void setStopPrice(@Nullable BigDecimal stopPrice)
    • timeInForce

      public UpdateOrderRequest timeInForce(@Nullable TimeInForce timeInForce)
    • getTimeInForce

      @Nullable public TimeInForce getTimeInForce()
      Get timeInForce
      Returns:
      timeInForce
    • setTimeInForce

      public void setTimeInForce(@Nullable TimeInForce timeInForce)
    • trail

      public UpdateOrderRequest trail(@Nullable BigDecimal trail)
    • getTrail

      @Nullable public BigDecimal getTrail()
      The new value of the trail_price or trail_percent
      Returns:
      trail
    • setTrail

      public void setTrail(@Nullable BigDecimal trail)
    • putAdditionalProperty

      public UpdateOrderRequest putAdditionalProperty(String key, Object value)
      Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
      Parameters:
      key - name of the property
      value - value of the property
      Returns:
      the UpdateOrderRequest instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to UpdateOrderRequest
    • fromJson

      public static UpdateOrderRequest fromJson(String jsonString) throws IOException
      Create an instance of UpdateOrderRequest given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of UpdateOrderRequest
      Throws:
      IOException - if the JSON string is invalid with respect to UpdateOrderRequest
    • toJson

      public String toJson()
      Convert an instance of UpdateOrderRequest to an JSON string
      Returns:
      JSON string