Class PatchOrderRequest

java.lang.Object
markets.alpaca.client.openapi.trading.model.PatchOrderRequest
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class PatchOrderRequest extends Object implements Serializable
Represents a request to patch an 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

    • PatchOrderRequest

      public PatchOrderRequest()
  • Method Details

    • advancedInstructions

      public PatchOrderRequest advancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • getAdvancedInstructions

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

      public void setAdvancedInstructions(@Nullable AdvancedInstructions advancedInstructions)
    • clientOrderId

      public PatchOrderRequest 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 PatchOrderRequest limitPrice(@Nullable String limitPrice)
    • getLimitPrice

      @Nullable public String 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 String limitPrice)
    • notional

      public PatchOrderRequest notional(@Nullable String notional)
    • getNotional

      @Nullable public String 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 String notional)
    • qty

      public PatchOrderRequest qty(@Nullable String qty)
    • getQty

      @Nullable public String getQty()
      number of shares to trade. 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.
      Returns:
      qty
    • setQty

      public void setQty(@Nullable String qty)
    • stopPrice

      public PatchOrderRequest stopPrice(@Nullable String stopPrice)
    • getStopPrice

      @Nullable public String getStopPrice()
      required if original order type is limit or stop_limit
      Returns:
      stopPrice
    • setStopPrice

      public void setStopPrice(@Nullable String stopPrice)
    • timeInForce

      public PatchOrderRequest timeInForce(@Nullable TimeInForce timeInForce)
    • getTimeInForce

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

      public void setTimeInForce(@Nullable TimeInForce timeInForce)
    • trail

      public PatchOrderRequest trail(@Nullable String trail)
    • getTrail

      @Nullable public String getTrail()
      the new value of the trail_price or trail_percent value (works only for type=\"trailing_stop\")
      Returns:
      trail
    • setTrail

      public void setTrail(@Nullable String trail)
    • putAdditionalProperty

      public PatchOrderRequest 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 PatchOrderRequest 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 PatchOrderRequest
    • fromJson

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

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