Class ClosePositionError
java.lang.Object
markets.alpaca.client.openapi.trading.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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexistingQty(String existingQty) static ClosePositionErrorCreate an instance of ClosePositionError given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Quantity available.getCode()Alpaca error code, such as `40310000`.Absolute quantity of the existing position.Position quantity held for options.Position quantity held by open orders.Human-readable reason for the rejection.Symbol the rejection applies to.inthashCode()heldForOptions(String heldForOptions) heldForOrders(String heldForOrders) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.voidsetAvailable(String available) voidvoidsetExistingQty(String existingQty) voidsetHeldForOptions(String heldForOptions) voidsetHeldForOrders(String heldForOrders) voidsetMessage(String message) voidtoJson()Convert an instance of ClosePositionError to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_AVAILABLE
- See Also:
-
SERIALIZED_NAME_CODE
- See Also:
-
SERIALIZED_NAME_EXISTING_QTY
- See Also:
-
SERIALIZED_NAME_HELD_FOR_OPTIONS
- See Also:
-
SERIALIZED_NAME_HELD_FOR_ORDERS
- See Also:
-
SERIALIZED_NAME_MESSAGE
- See Also:
-
SERIALIZED_NAME_SYMBOL
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
ClosePositionError
public ClosePositionError()
-
-
Method Details
-
available
-
getAvailable
Quantity available. On insufficient-quantity rejections, the position quantity available to close.- Returns:
- available
-
setAvailable
-
code
-
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
-
existingQty
-
getExistingQty
Absolute quantity of the existing position. Present only on insufficient-quantity rejections.- Returns:
- existingQty
-
setExistingQty
-
heldForOptions
-
getHeldForOptions
Position quantity held for options. Present only on insufficient-quantity rejections, and only when that hold is positive.- Returns:
- heldForOptions
-
setHeldForOptions
-
heldForOrders
-
getHeldForOrders
Position quantity held by open orders. Present only on insufficient-quantity rejections.- Returns:
- heldForOrders
-
setHeldForOrders
-
message
-
getMessage
Human-readable reason for the rejection.- Returns:
- message
-
setMessage
-
symbol
-
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
-
putAdditionalProperty
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 propertyvalue- value of the property- Returns:
- the ClosePositionError instance itself
-
getAdditionalProperties
Return the additional (undeclared) property.- Returns:
- a map of objects
-
getAdditionalProperty
Return the additional (undeclared) property with the specified name.- Parameters:
key- name of the property- Returns:
- an object
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
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
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
Convert an instance of ClosePositionError to an JSON string- Returns:
- JSON string
-