Class ClosePositionError

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.28.0") public class ClosePositionError extends Object implements Serializable
The per-position error reported inside a close-all-positions 207 response when a position's `status` is not 200. Other rejection-specific string fields may appear.
See Also:
  • Field Details

  • Constructor Details

    • ClosePositionError

      public ClosePositionError()
  • Method Details

    • available

      public ClosePositionError available(@Nullable String available)
    • getAvailable

      @Nullable public String getAvailable()
      Quantity available. On insufficient-quantity rejections, the position quantity available to close.
      Returns:
      available
    • setAvailable

      public void setAvailable(@Nullable String available)
    • code

      public ClosePositionError code(@Nonnull String code)
    • getCode

      @Nonnull public String getCode()
      Alpaca error code, such as `\"40310000\"`. Usually the HTTP status code followed by a five-digit suffix. Several rejections can share the same code, so check `message` and the other fields for the specific reason.
      Returns:
      code
    • setCode

      public void setCode(@Nonnull String code)
    • existingQty

      public ClosePositionError existingQty(@Nullable String existingQty)
    • getExistingQty

      @Nullable public String getExistingQty()
      Absolute quantity of the existing position. Present only on insufficient-quantity rejections.
      Returns:
      existingQty
    • setExistingQty

      public void setExistingQty(@Nullable String existingQty)
    • heldForOptions

      public ClosePositionError heldForOptions(@Nullable String heldForOptions)
    • getHeldForOptions

      @Nullable public String getHeldForOptions()
      Position quantity held for options. Present only on insufficient-quantity rejections, and only when that hold is positive.
      Returns:
      heldForOptions
    • setHeldForOptions

      public void setHeldForOptions(@Nullable String heldForOptions)
    • heldForOrders

      public ClosePositionError heldForOrders(@Nullable String heldForOrders)
    • getHeldForOrders

      @Nullable public String getHeldForOrders()
      Position quantity held by open orders. Present only on insufficient-quantity rejections.
      Returns:
      heldForOrders
    • setHeldForOrders

      public void setHeldForOrders(@Nullable String heldForOrders)
    • message

      public ClosePositionError message(@Nonnull String message)
    • getMessage

      @Nonnull public String getMessage()
      Human-readable reason for the rejection.
      Returns:
      message
    • setMessage

      public void setMessage(@Nonnull String message)
    • symbol

      public ClosePositionError symbol(@Nullable String symbol)
    • getSymbol

      @Nullable public String getSymbol()
      Symbol the rejection applies to. Set on insufficient-quantity rejections and on some other order rejections, such as admin trading restrictions.
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nullable String symbol)
    • putAdditionalProperty

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

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

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