sdks/java/src/main/java/com/konfigthis/client/model/StrategyOrderPlaceOrdersInner.java
/*
 * SnapTrade
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: nnheo@example.com
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.konfigthis.client.model.StrategyOrderPlaceOrdersInnerLegsInner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.konfigthis.client.JSON;

/**
 * StrategyOrderPlaceOrdersInner
 */
@javax.annotation.Generated(value = "Generated by https://konfigthis.com")
public class StrategyOrderPlaceOrdersInner {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Integer id;

  public static final String SERIALIZED_NAME_SYMBOL = "symbol";
  @SerializedName(SERIALIZED_NAME_SYMBOL)
  private String symbol;

  public static final String SERIALIZED_NAME_SYMBOL_ID = "symbolId";
  @SerializedName(SERIALIZED_NAME_SYMBOL_ID)
  private Integer symbolId;

  public static final String SERIALIZED_NAME_TOTAL_QUANTITY = "totalQuantity";
  @SerializedName(SERIALIZED_NAME_TOTAL_QUANTITY)
  private Integer totalQuantity;

  public static final String SERIALIZED_NAME_OPEN_QUANTITY = "openQuantity";
  @SerializedName(SERIALIZED_NAME_OPEN_QUANTITY)
  private Integer openQuantity;

  public static final String SERIALIZED_NAME_FILLED_QUANTITY = "filledQuantity";
  @SerializedName(SERIALIZED_NAME_FILLED_QUANTITY)
  private Integer filledQuantity;

  public static final String SERIALIZED_NAME_CANCELED_QUANTITY = "canceledQuantity";
  @SerializedName(SERIALIZED_NAME_CANCELED_QUANTITY)
  private Integer canceledQuantity;

  public static final String SERIALIZED_NAME_SIDE = "side";
  @SerializedName(SERIALIZED_NAME_SIDE)
  private String side;

  public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType";
  @SerializedName(SERIALIZED_NAME_ORDER_TYPE)
  private String orderType;

  public static final String SERIALIZED_NAME_LIMIT_PRICE = "limitPrice";
  @SerializedName(SERIALIZED_NAME_LIMIT_PRICE)
  private String limitPrice;

  public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice";
  @SerializedName(SERIALIZED_NAME_STOP_PRICE)
  private String stopPrice;

  public static final String SERIALIZED_NAME_IS_ALL_OR_NONE = "isAllOrNone";
  @SerializedName(SERIALIZED_NAME_IS_ALL_OR_NONE)
  private Boolean isAllOrNone;

  public static final String SERIALIZED_NAME_IS_ANONYMOUS = "isAnonymous";
  @SerializedName(SERIALIZED_NAME_IS_ANONYMOUS)
  private Boolean isAnonymous;

  public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity";
  @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY)
  private String icebergQuantity;

  public static final String SERIALIZED_NAME_MIN_QUANTITY = "minQuantity";
  @SerializedName(SERIALIZED_NAME_MIN_QUANTITY)
  private String minQuantity;

  public static final String SERIALIZED_NAME_AVG_EXEC_PRICE = "avgExecPrice";
  @SerializedName(SERIALIZED_NAME_AVG_EXEC_PRICE)
  private Integer avgExecPrice;

  public static final String SERIALIZED_NAME_LAST_EXEC_PRICE = "lastExecPrice";
  @SerializedName(SERIALIZED_NAME_LAST_EXEC_PRICE)
  private String lastExecPrice;

  public static final String SERIALIZED_NAME_SOURCE = "source";
  @SerializedName(SERIALIZED_NAME_SOURCE)
  private String source;

  public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce";
  @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE)
  private String timeInForce;

  public static final String SERIALIZED_NAME_GTD_DATE = "gtdDate";
  @SerializedName(SERIALIZED_NAME_GTD_DATE)
  private String gtdDate;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private String state;

  public static final String SERIALIZED_NAME_REJECTION_REASON = "rejectionReason";
  @SerializedName(SERIALIZED_NAME_REJECTION_REASON)
  private String rejectionReason;

  public static final String SERIALIZED_NAME_CHAIN_ID = "chainId";
  @SerializedName(SERIALIZED_NAME_CHAIN_ID)
  private Integer chainId;

  public static final String SERIALIZED_NAME_CREATION_TIME = "creationTime";
  @SerializedName(SERIALIZED_NAME_CREATION_TIME)
  private String creationTime;

  public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime";
  @SerializedName(SERIALIZED_NAME_UPDATE_TIME)
  private String updateTime;

  public static final String SERIALIZED_NAME_NOTES = "notes";
  @SerializedName(SERIALIZED_NAME_NOTES)
  private String notes;

  public static final String SERIALIZED_NAME_PRIMARY_ROUTE = "primaryRoute";
  @SerializedName(SERIALIZED_NAME_PRIMARY_ROUTE)
  private String primaryRoute;

  public static final String SERIALIZED_NAME_SECONDARY_ROUTE = "secondaryRoute";
  @SerializedName(SERIALIZED_NAME_SECONDARY_ROUTE)
  private String secondaryRoute;

  public static final String SERIALIZED_NAME_ORDER_ROUTE = "orderRoute";
  @SerializedName(SERIALIZED_NAME_ORDER_ROUTE)
  private String orderRoute;

  public static final String SERIALIZED_NAME_VENUE_HOLDING_ORDER = "venueHoldingOrder";
  @SerializedName(SERIALIZED_NAME_VENUE_HOLDING_ORDER)
  private String venueHoldingOrder;

  public static final String SERIALIZED_NAME_COMISSION_CHARGED = "comissionCharged";
  @SerializedName(SERIALIZED_NAME_COMISSION_CHARGED)
  private Integer comissionCharged;

  public static final String SERIALIZED_NAME_EXCHANGE_ORDER_ID = "exchangeOrderId";
  @SerializedName(SERIALIZED_NAME_EXCHANGE_ORDER_ID)
  private String exchangeOrderId;

  public static final String SERIALIZED_NAME_IS_SIGNIFICANT_SHARE_HOLDER = "isSignificantShareHolder";
  @SerializedName(SERIALIZED_NAME_IS_SIGNIFICANT_SHARE_HOLDER)
  private Boolean isSignificantShareHolder;

  public static final String SERIALIZED_NAME_IS_INSIDER = "isInsider";
  @SerializedName(SERIALIZED_NAME_IS_INSIDER)
  private Boolean isInsider;

  public static final String SERIALIZED_NAME_IS_LIMIT_OFFSET_IN_DOLLAR = "isLimitOffsetInDollar";
  @SerializedName(SERIALIZED_NAME_IS_LIMIT_OFFSET_IN_DOLLAR)
  private Boolean isLimitOffsetInDollar;

  public static final String SERIALIZED_NAME_USER_ID = "userId";
  @SerializedName(SERIALIZED_NAME_USER_ID)
  private Integer userId;

  public static final String SERIALIZED_NAME_PLACEMENT_COMMISSION = "placementCommission";
  @SerializedName(SERIALIZED_NAME_PLACEMENT_COMMISSION)
  private String placementCommission;

  public static final String SERIALIZED_NAME_LEGS = "legs";
  @SerializedName(SERIALIZED_NAME_LEGS)
  private List<StrategyOrderPlaceOrdersInnerLegsInner> legs = null;

  public static final String SERIALIZED_NAME_STRATEGY_TYPE = "strategyType";
  @SerializedName(SERIALIZED_NAME_STRATEGY_TYPE)
  private String strategyType;

  public static final String SERIALIZED_NAME_TRIGGER_STOP_PRICE = "triggerStopPrice";
  @SerializedName(SERIALIZED_NAME_TRIGGER_STOP_PRICE)
  private String triggerStopPrice;

  public static final String SERIALIZED_NAME_ORDER_GROUP_ID = "orderGroupId";
  @SerializedName(SERIALIZED_NAME_ORDER_GROUP_ID)
  private Integer orderGroupId;

  public static final String SERIALIZED_NAME_ORDER_CLASS = "orderClass";
  @SerializedName(SERIALIZED_NAME_ORDER_CLASS)
  private String orderClass;

  public static final String SERIALIZED_NAME_IS_CROSS_ZERO = "isCrossZero";
  @SerializedName(SERIALIZED_NAME_IS_CROSS_ZERO)
  private Boolean isCrossZero;

  public StrategyOrderPlaceOrdersInner() {
  }

  public StrategyOrderPlaceOrdersInner id(Integer id) {

    
    
    
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1069605761", value = "")

  public Integer getId() {
    return id;
  }


  public void setId(Integer id) {

    
    
    
    this.id = id;
  }


  public StrategyOrderPlaceOrdersInner symbol(String symbol) {

    
    
    
    
    this.symbol = symbol;
    return this;
  }

   /**
   * Get symbol
   * @return symbol
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "AC.TO", value = "")

  public String getSymbol() {
    return symbol;
  }


  public void setSymbol(String symbol) {

    
    
    
    this.symbol = symbol;
  }


  public StrategyOrderPlaceOrdersInner symbolId(Integer symbolId) {

    
    
    
    
    this.symbolId = symbolId;
    return this;
  }

   /**
   * Get symbolId
   * @return symbolId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "7960447", value = "")

  public Integer getSymbolId() {
    return symbolId;
  }


  public void setSymbolId(Integer symbolId) {

    
    
    
    this.symbolId = symbolId;
  }


  public StrategyOrderPlaceOrdersInner totalQuantity(Integer totalQuantity) {

    
    
    
    
    this.totalQuantity = totalQuantity;
    return this;
  }

   /**
   * Get totalQuantity
   * @return totalQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "")

  public Integer getTotalQuantity() {
    return totalQuantity;
  }


  public void setTotalQuantity(Integer totalQuantity) {

    
    
    
    this.totalQuantity = totalQuantity;
  }


  public StrategyOrderPlaceOrdersInner openQuantity(Integer openQuantity) {

    
    
    
    
    this.openQuantity = openQuantity;
    return this;
  }

   /**
   * Get openQuantity
   * @return openQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1", value = "")

  public Integer getOpenQuantity() {
    return openQuantity;
  }


  public void setOpenQuantity(Integer openQuantity) {

    
    
    
    this.openQuantity = openQuantity;
  }


  public StrategyOrderPlaceOrdersInner filledQuantity(Integer filledQuantity) {

    
    
    
    
    this.filledQuantity = filledQuantity;
    return this;
  }

   /**
   * Get filledQuantity
   * @return filledQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Integer getFilledQuantity() {
    return filledQuantity;
  }


  public void setFilledQuantity(Integer filledQuantity) {

    
    
    
    this.filledQuantity = filledQuantity;
  }


  public StrategyOrderPlaceOrdersInner canceledQuantity(Integer canceledQuantity) {

    
    
    
    
    this.canceledQuantity = canceledQuantity;
    return this;
  }

   /**
   * Get canceledQuantity
   * @return canceledQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Integer getCanceledQuantity() {
    return canceledQuantity;
  }


  public void setCanceledQuantity(Integer canceledQuantity) {

    
    
    
    this.canceledQuantity = canceledQuantity;
  }


  public StrategyOrderPlaceOrdersInner side(String side) {

    
    
    
    
    this.side = side;
    return this;
  }

   /**
   * Get side
   * @return side
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Buy", value = "")

  public String getSide() {
    return side;
  }


  public void setSide(String side) {

    
    
    
    this.side = side;
  }


  public StrategyOrderPlaceOrdersInner orderType(String orderType) {

    
    
    
    
    this.orderType = orderType;
    return this;
  }

   /**
   * Get orderType
   * @return orderType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Market", value = "")

  public String getOrderType() {
    return orderType;
  }


  public void setOrderType(String orderType) {

    
    
    
    this.orderType = orderType;
  }


  public StrategyOrderPlaceOrdersInner limitPrice(String limitPrice) {

    
    
    
    
    this.limitPrice = limitPrice;
    return this;
  }

   /**
   * Get limitPrice
   * @return limitPrice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getLimitPrice() {
    return limitPrice;
  }


  public void setLimitPrice(String limitPrice) {

    
    
    
    this.limitPrice = limitPrice;
  }


  public StrategyOrderPlaceOrdersInner stopPrice(String stopPrice) {

    
    
    
    
    this.stopPrice = stopPrice;
    return this;
  }

   /**
   * Get stopPrice
   * @return stopPrice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getStopPrice() {
    return stopPrice;
  }


  public void setStopPrice(String stopPrice) {

    
    
    
    this.stopPrice = stopPrice;
  }


  public StrategyOrderPlaceOrdersInner isAllOrNone(Boolean isAllOrNone) {

    
    
    
    
    this.isAllOrNone = isAllOrNone;
    return this;
  }

   /**
   * Get isAllOrNone
   * @return isAllOrNone
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsAllOrNone() {
    return isAllOrNone;
  }


  public void setIsAllOrNone(Boolean isAllOrNone) {

    
    
    
    this.isAllOrNone = isAllOrNone;
  }


  public StrategyOrderPlaceOrdersInner isAnonymous(Boolean isAnonymous) {

    
    
    
    
    this.isAnonymous = isAnonymous;
    return this;
  }

   /**
   * Get isAnonymous
   * @return isAnonymous
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsAnonymous() {
    return isAnonymous;
  }


  public void setIsAnonymous(Boolean isAnonymous) {

    
    
    
    this.isAnonymous = isAnonymous;
  }


  public StrategyOrderPlaceOrdersInner icebergQuantity(String icebergQuantity) {

    
    
    
    
    this.icebergQuantity = icebergQuantity;
    return this;
  }

   /**
   * Get icebergQuantity
   * @return icebergQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getIcebergQuantity() {
    return icebergQuantity;
  }


  public void setIcebergQuantity(String icebergQuantity) {

    
    
    
    this.icebergQuantity = icebergQuantity;
  }


  public StrategyOrderPlaceOrdersInner minQuantity(String minQuantity) {

    
    
    
    
    this.minQuantity = minQuantity;
    return this;
  }

   /**
   * Get minQuantity
   * @return minQuantity
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getMinQuantity() {
    return minQuantity;
  }


  public void setMinQuantity(String minQuantity) {

    
    
    
    this.minQuantity = minQuantity;
  }


  public StrategyOrderPlaceOrdersInner avgExecPrice(Integer avgExecPrice) {

    
    
    
    
    this.avgExecPrice = avgExecPrice;
    return this;
  }

   /**
   * Get avgExecPrice
   * @return avgExecPrice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Integer getAvgExecPrice() {
    return avgExecPrice;
  }


  public void setAvgExecPrice(Integer avgExecPrice) {

    
    
    
    this.avgExecPrice = avgExecPrice;
  }


  public StrategyOrderPlaceOrdersInner lastExecPrice(String lastExecPrice) {

    
    
    
    
    this.lastExecPrice = lastExecPrice;
    return this;
  }

   /**
   * Get lastExecPrice
   * @return lastExecPrice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getLastExecPrice() {
    return lastExecPrice;
  }


  public void setLastExecPrice(String lastExecPrice) {

    
    
    
    this.lastExecPrice = lastExecPrice;
  }


  public StrategyOrderPlaceOrdersInner source(String source) {

    
    
    
    
    this.source = source;
    return this;
  }

   /**
   * Get source
   * @return source
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "TradingAPI", value = "")

  public String getSource() {
    return source;
  }


  public void setSource(String source) {

    
    
    
    this.source = source;
  }


  public StrategyOrderPlaceOrdersInner timeInForce(String timeInForce) {

    
    
    
    
    this.timeInForce = timeInForce;
    return this;
  }

   /**
   * Get timeInForce
   * @return timeInForce
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Day", value = "")

  public String getTimeInForce() {
    return timeInForce;
  }


  public void setTimeInForce(String timeInForce) {

    
    
    
    this.timeInForce = timeInForce;
  }


  public StrategyOrderPlaceOrdersInner gtdDate(String gtdDate) {

    
    
    
    
    this.gtdDate = gtdDate;
    return this;
  }

   /**
   * Get gtdDate
   * @return gtdDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getGtdDate() {
    return gtdDate;
  }


  public void setGtdDate(String gtdDate) {

    
    
    
    this.gtdDate = gtdDate;
  }


  public StrategyOrderPlaceOrdersInner state(String state) {

    
    
    
    
    this.state = state;
    return this;
  }

   /**
   * Get state
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Pending", value = "")

  public String getState() {
    return state;
  }


  public void setState(String state) {

    
    
    
    this.state = state;
  }


  public StrategyOrderPlaceOrdersInner rejectionReason(String rejectionReason) {

    
    
    
    
    this.rejectionReason = rejectionReason;
    return this;
  }

   /**
   * Get rejectionReason
   * @return rejectionReason
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "None", value = "")

  public String getRejectionReason() {
    return rejectionReason;
  }


  public void setRejectionReason(String rejectionReason) {

    
    
    
    this.rejectionReason = rejectionReason;
  }


  public StrategyOrderPlaceOrdersInner chainId(Integer chainId) {

    
    
    
    
    this.chainId = chainId;
    return this;
  }

   /**
   * Get chainId
   * @return chainId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "1069605761", value = "")

  public Integer getChainId() {
    return chainId;
  }


  public void setChainId(Integer chainId) {

    
    
    
    this.chainId = chainId;
  }


  public StrategyOrderPlaceOrdersInner creationTime(String creationTime) {

    
    
    
    
    this.creationTime = creationTime;
    return this;
  }

   /**
   * Get creationTime
   * @return creationTime
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2022-07-19T19:53:47.915Z", value = "")

  public String getCreationTime() {
    return creationTime;
  }


  public void setCreationTime(String creationTime) {

    
    
    
    this.creationTime = creationTime;
  }


  public StrategyOrderPlaceOrdersInner updateTime(String updateTime) {

    
    
    
    
    this.updateTime = updateTime;
    return this;
  }

   /**
   * Get updateTime
   * @return updateTime
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "2022-07-19T19:53:47.939Z", value = "")

  public String getUpdateTime() {
    return updateTime;
  }


  public void setUpdateTime(String updateTime) {

    
    
    
    this.updateTime = updateTime;
  }


  public StrategyOrderPlaceOrdersInner notes(String notes) {

    
    
    
    
    this.notes = notes;
    return this;
  }

   /**
   * Get notes
   * @return notes
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "None", value = "")

  public String getNotes() {
    return notes;
  }


  public void setNotes(String notes) {

    
    
    
    this.notes = notes;
  }


  public StrategyOrderPlaceOrdersInner primaryRoute(String primaryRoute) {

    
    
    
    
    this.primaryRoute = primaryRoute;
    return this;
  }

   /**
   * Get primaryRoute
   * @return primaryRoute
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "AUTO", value = "")

  public String getPrimaryRoute() {
    return primaryRoute;
  }


  public void setPrimaryRoute(String primaryRoute) {

    
    
    
    this.primaryRoute = primaryRoute;
  }


  public StrategyOrderPlaceOrdersInner secondaryRoute(String secondaryRoute) {

    
    
    
    
    this.secondaryRoute = secondaryRoute;
    return this;
  }

   /**
   * Get secondaryRoute
   * @return secondaryRoute
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "AUTO", value = "")

  public String getSecondaryRoute() {
    return secondaryRoute;
  }


  public void setSecondaryRoute(String secondaryRoute) {

    
    
    
    this.secondaryRoute = secondaryRoute;
  }


  public StrategyOrderPlaceOrdersInner orderRoute(String orderRoute) {

    
    
    
    
    this.orderRoute = orderRoute;
    return this;
  }

   /**
   * Get orderRoute
   * @return orderRoute
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "MX", value = "")

  public String getOrderRoute() {
    return orderRoute;
  }


  public void setOrderRoute(String orderRoute) {

    
    
    
    this.orderRoute = orderRoute;
  }


  public StrategyOrderPlaceOrdersInner venueHoldingOrder(String venueHoldingOrder) {

    
    
    
    
    this.venueHoldingOrder = venueHoldingOrder;
    return this;
  }

   /**
   * Get venueHoldingOrder
   * @return venueHoldingOrder
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "None", value = "")

  public String getVenueHoldingOrder() {
    return venueHoldingOrder;
  }


  public void setVenueHoldingOrder(String venueHoldingOrder) {

    
    
    
    this.venueHoldingOrder = venueHoldingOrder;
  }


  public StrategyOrderPlaceOrdersInner comissionCharged(Integer comissionCharged) {

    
    
    
    
    this.comissionCharged = comissionCharged;
    return this;
  }

   /**
   * Get comissionCharged
   * @return comissionCharged
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Integer getComissionCharged() {
    return comissionCharged;
  }


  public void setComissionCharged(Integer comissionCharged) {

    
    
    
    this.comissionCharged = comissionCharged;
  }


  public StrategyOrderPlaceOrdersInner exchangeOrderId(String exchangeOrderId) {

    
    
    
    
    this.exchangeOrderId = exchangeOrderId;
    return this;
  }

   /**
   * Get exchangeOrderId
   * @return exchangeOrderId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "None", value = "")

  public String getExchangeOrderId() {
    return exchangeOrderId;
  }


  public void setExchangeOrderId(String exchangeOrderId) {

    
    
    
    this.exchangeOrderId = exchangeOrderId;
  }


  public StrategyOrderPlaceOrdersInner isSignificantShareHolder(Boolean isSignificantShareHolder) {

    
    
    
    
    this.isSignificantShareHolder = isSignificantShareHolder;
    return this;
  }

   /**
   * Get isSignificantShareHolder
   * @return isSignificantShareHolder
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsSignificantShareHolder() {
    return isSignificantShareHolder;
  }


  public void setIsSignificantShareHolder(Boolean isSignificantShareHolder) {

    
    
    
    this.isSignificantShareHolder = isSignificantShareHolder;
  }


  public StrategyOrderPlaceOrdersInner isInsider(Boolean isInsider) {

    
    
    
    
    this.isInsider = isInsider;
    return this;
  }

   /**
   * Get isInsider
   * @return isInsider
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsInsider() {
    return isInsider;
  }


  public void setIsInsider(Boolean isInsider) {

    
    
    
    this.isInsider = isInsider;
  }


  public StrategyOrderPlaceOrdersInner isLimitOffsetInDollar(Boolean isLimitOffsetInDollar) {

    
    
    
    
    this.isLimitOffsetInDollar = isLimitOffsetInDollar;
    return this;
  }

   /**
   * Get isLimitOffsetInDollar
   * @return isLimitOffsetInDollar
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsLimitOffsetInDollar() {
    return isLimitOffsetInDollar;
  }


  public void setIsLimitOffsetInDollar(Boolean isLimitOffsetInDollar) {

    
    
    
    this.isLimitOffsetInDollar = isLimitOffsetInDollar;
  }


  public StrategyOrderPlaceOrdersInner userId(Integer userId) {

    
    
    
    
    this.userId = userId;
    return this;
  }

   /**
   * Get userId
   * @return userId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "514603", value = "")

  public Integer getUserId() {
    return userId;
  }


  public void setUserId(Integer userId) {

    
    
    
    this.userId = userId;
  }


  public StrategyOrderPlaceOrdersInner placementCommission(String placementCommission) {

    
    
    
    
    this.placementCommission = placementCommission;
    return this;
  }

   /**
   * Get placementCommission
   * @return placementCommission
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getPlacementCommission() {
    return placementCommission;
  }


  public void setPlacementCommission(String placementCommission) {

    
    
    
    this.placementCommission = placementCommission;
  }


  public StrategyOrderPlaceOrdersInner legs(List<StrategyOrderPlaceOrdersInnerLegsInner> legs) {

    
    
    
    
    this.legs = legs;
    return this;
  }

  public StrategyOrderPlaceOrdersInner addLegsItem(StrategyOrderPlaceOrdersInnerLegsInner legsItem) {
    if (this.legs == null) {
      this.legs = new ArrayList<>();
    }
    this.legs.add(legsItem);
    return this;
  }

   /**
   * Get legs
   * @return legs
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<StrategyOrderPlaceOrdersInnerLegsInner> getLegs() {
    return legs;
  }


  public void setLegs(List<StrategyOrderPlaceOrdersInnerLegsInner> legs) {

    
    
    
    this.legs = legs;
  }


  public StrategyOrderPlaceOrdersInner strategyType(String strategyType) {

    
    
    
    
    this.strategyType = strategyType;
    return this;
  }

   /**
   * Get strategyType
   * @return strategyType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "Strangle", value = "")

  public String getStrategyType() {
    return strategyType;
  }


  public void setStrategyType(String strategyType) {

    
    
    
    this.strategyType = strategyType;
  }


  public StrategyOrderPlaceOrdersInner triggerStopPrice(String triggerStopPrice) {

    
    
    
    
    this.triggerStopPrice = triggerStopPrice;
    return this;
  }

   /**
   * Get triggerStopPrice
   * @return triggerStopPrice
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getTriggerStopPrice() {
    return triggerStopPrice;
  }


  public void setTriggerStopPrice(String triggerStopPrice) {

    
    
    
    this.triggerStopPrice = triggerStopPrice;
  }


  public StrategyOrderPlaceOrdersInner orderGroupId(Integer orderGroupId) {

    
    
    
    
    this.orderGroupId = orderGroupId;
    return this;
  }

   /**
   * Get orderGroupId
   * @return orderGroupId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "0", value = "")

  public Integer getOrderGroupId() {
    return orderGroupId;
  }


  public void setOrderGroupId(Integer orderGroupId) {

    
    
    
    this.orderGroupId = orderGroupId;
  }


  public StrategyOrderPlaceOrdersInner orderClass(String orderClass) {

    
    
    
    
    this.orderClass = orderClass;
    return this;
  }

   /**
   * Get orderClass
   * @return orderClass
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public String getOrderClass() {
    return orderClass;
  }


  public void setOrderClass(String orderClass) {

    
    
    
    this.orderClass = orderClass;
  }


  public StrategyOrderPlaceOrdersInner isCrossZero(Boolean isCrossZero) {

    
    
    
    
    this.isCrossZero = isCrossZero;
    return this;
  }

   /**
   * Get isCrossZero
   * @return isCrossZero
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getIsCrossZero() {
    return isCrossZero;
  }


  public void setIsCrossZero(Boolean isCrossZero) {

    
    
    
    this.isCrossZero = isCrossZero;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map<String, Object> additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   *
   * @param key name of the property
   * @param value value of the property
   * @return the StrategyOrderPlaceOrdersInner instance itself
   */
  public StrategyOrderPlaceOrdersInner putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap<String, Object>();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map<String, Object> getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   *
   * @param key name of the property
   * @return an object
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    StrategyOrderPlaceOrdersInner strategyOrderPlaceOrdersInner = (StrategyOrderPlaceOrdersInner) o;
    return Objects.equals(this.id, strategyOrderPlaceOrdersInner.id) &&
        Objects.equals(this.symbol, strategyOrderPlaceOrdersInner.symbol) &&
        Objects.equals(this.symbolId, strategyOrderPlaceOrdersInner.symbolId) &&
        Objects.equals(this.totalQuantity, strategyOrderPlaceOrdersInner.totalQuantity) &&
        Objects.equals(this.openQuantity, strategyOrderPlaceOrdersInner.openQuantity) &&
        Objects.equals(this.filledQuantity, strategyOrderPlaceOrdersInner.filledQuantity) &&
        Objects.equals(this.canceledQuantity, strategyOrderPlaceOrdersInner.canceledQuantity) &&
        Objects.equals(this.side, strategyOrderPlaceOrdersInner.side) &&
        Objects.equals(this.orderType, strategyOrderPlaceOrdersInner.orderType) &&
        Objects.equals(this.limitPrice, strategyOrderPlaceOrdersInner.limitPrice) &&
        Objects.equals(this.stopPrice, strategyOrderPlaceOrdersInner.stopPrice) &&
        Objects.equals(this.isAllOrNone, strategyOrderPlaceOrdersInner.isAllOrNone) &&
        Objects.equals(this.isAnonymous, strategyOrderPlaceOrdersInner.isAnonymous) &&
        Objects.equals(this.icebergQuantity, strategyOrderPlaceOrdersInner.icebergQuantity) &&
        Objects.equals(this.minQuantity, strategyOrderPlaceOrdersInner.minQuantity) &&
        Objects.equals(this.avgExecPrice, strategyOrderPlaceOrdersInner.avgExecPrice) &&
        Objects.equals(this.lastExecPrice, strategyOrderPlaceOrdersInner.lastExecPrice) &&
        Objects.equals(this.source, strategyOrderPlaceOrdersInner.source) &&
        Objects.equals(this.timeInForce, strategyOrderPlaceOrdersInner.timeInForce) &&
        Objects.equals(this.gtdDate, strategyOrderPlaceOrdersInner.gtdDate) &&
        Objects.equals(this.state, strategyOrderPlaceOrdersInner.state) &&
        Objects.equals(this.rejectionReason, strategyOrderPlaceOrdersInner.rejectionReason) &&
        Objects.equals(this.chainId, strategyOrderPlaceOrdersInner.chainId) &&
        Objects.equals(this.creationTime, strategyOrderPlaceOrdersInner.creationTime) &&
        Objects.equals(this.updateTime, strategyOrderPlaceOrdersInner.updateTime) &&
        Objects.equals(this.notes, strategyOrderPlaceOrdersInner.notes) &&
        Objects.equals(this.primaryRoute, strategyOrderPlaceOrdersInner.primaryRoute) &&
        Objects.equals(this.secondaryRoute, strategyOrderPlaceOrdersInner.secondaryRoute) &&
        Objects.equals(this.orderRoute, strategyOrderPlaceOrdersInner.orderRoute) &&
        Objects.equals(this.venueHoldingOrder, strategyOrderPlaceOrdersInner.venueHoldingOrder) &&
        Objects.equals(this.comissionCharged, strategyOrderPlaceOrdersInner.comissionCharged) &&
        Objects.equals(this.exchangeOrderId, strategyOrderPlaceOrdersInner.exchangeOrderId) &&
        Objects.equals(this.isSignificantShareHolder, strategyOrderPlaceOrdersInner.isSignificantShareHolder) &&
        Objects.equals(this.isInsider, strategyOrderPlaceOrdersInner.isInsider) &&
        Objects.equals(this.isLimitOffsetInDollar, strategyOrderPlaceOrdersInner.isLimitOffsetInDollar) &&
        Objects.equals(this.userId, strategyOrderPlaceOrdersInner.userId) &&
        Objects.equals(this.placementCommission, strategyOrderPlaceOrdersInner.placementCommission) &&
        Objects.equals(this.legs, strategyOrderPlaceOrdersInner.legs) &&
        Objects.equals(this.strategyType, strategyOrderPlaceOrdersInner.strategyType) &&
        Objects.equals(this.triggerStopPrice, strategyOrderPlaceOrdersInner.triggerStopPrice) &&
        Objects.equals(this.orderGroupId, strategyOrderPlaceOrdersInner.orderGroupId) &&
        Objects.equals(this.orderClass, strategyOrderPlaceOrdersInner.orderClass) &&
        Objects.equals(this.isCrossZero, strategyOrderPlaceOrdersInner.isCrossZero)&&
        Objects.equals(this.additionalProperties, strategyOrderPlaceOrdersInner.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, symbol, symbolId, totalQuantity, openQuantity, filledQuantity, canceledQuantity, side, orderType, limitPrice, stopPrice, isAllOrNone, isAnonymous, icebergQuantity, minQuantity, avgExecPrice, lastExecPrice, source, timeInForce, gtdDate, state, rejectionReason, chainId, creationTime, updateTime, notes, primaryRoute, secondaryRoute, orderRoute, venueHoldingOrder, comissionCharged, exchangeOrderId, isSignificantShareHolder, isInsider, isLimitOffsetInDollar, userId, placementCommission, legs, strategyType, triggerStopPrice, orderGroupId, orderClass, isCrossZero, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class StrategyOrderPlaceOrdersInner {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    symbol: ").append(toIndentedString(symbol)).append("\n");
    sb.append("    symbolId: ").append(toIndentedString(symbolId)).append("\n");
    sb.append("    totalQuantity: ").append(toIndentedString(totalQuantity)).append("\n");
    sb.append("    openQuantity: ").append(toIndentedString(openQuantity)).append("\n");
    sb.append("    filledQuantity: ").append(toIndentedString(filledQuantity)).append("\n");
    sb.append("    canceledQuantity: ").append(toIndentedString(canceledQuantity)).append("\n");
    sb.append("    side: ").append(toIndentedString(side)).append("\n");
    sb.append("    orderType: ").append(toIndentedString(orderType)).append("\n");
    sb.append("    limitPrice: ").append(toIndentedString(limitPrice)).append("\n");
    sb.append("    stopPrice: ").append(toIndentedString(stopPrice)).append("\n");
    sb.append("    isAllOrNone: ").append(toIndentedString(isAllOrNone)).append("\n");
    sb.append("    isAnonymous: ").append(toIndentedString(isAnonymous)).append("\n");
    sb.append("    icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n");
    sb.append("    minQuantity: ").append(toIndentedString(minQuantity)).append("\n");
    sb.append("    avgExecPrice: ").append(toIndentedString(avgExecPrice)).append("\n");
    sb.append("    lastExecPrice: ").append(toIndentedString(lastExecPrice)).append("\n");
    sb.append("    source: ").append(toIndentedString(source)).append("\n");
    sb.append("    timeInForce: ").append(toIndentedString(timeInForce)).append("\n");
    sb.append("    gtdDate: ").append(toIndentedString(gtdDate)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    rejectionReason: ").append(toIndentedString(rejectionReason)).append("\n");
    sb.append("    chainId: ").append(toIndentedString(chainId)).append("\n");
    sb.append("    creationTime: ").append(toIndentedString(creationTime)).append("\n");
    sb.append("    updateTime: ").append(toIndentedString(updateTime)).append("\n");
    sb.append("    notes: ").append(toIndentedString(notes)).append("\n");
    sb.append("    primaryRoute: ").append(toIndentedString(primaryRoute)).append("\n");
    sb.append("    secondaryRoute: ").append(toIndentedString(secondaryRoute)).append("\n");
    sb.append("    orderRoute: ").append(toIndentedString(orderRoute)).append("\n");
    sb.append("    venueHoldingOrder: ").append(toIndentedString(venueHoldingOrder)).append("\n");
    sb.append("    comissionCharged: ").append(toIndentedString(comissionCharged)).append("\n");
    sb.append("    exchangeOrderId: ").append(toIndentedString(exchangeOrderId)).append("\n");
    sb.append("    isSignificantShareHolder: ").append(toIndentedString(isSignificantShareHolder)).append("\n");
    sb.append("    isInsider: ").append(toIndentedString(isInsider)).append("\n");
    sb.append("    isLimitOffsetInDollar: ").append(toIndentedString(isLimitOffsetInDollar)).append("\n");
    sb.append("    userId: ").append(toIndentedString(userId)).append("\n");
    sb.append("    placementCommission: ").append(toIndentedString(placementCommission)).append("\n");
    sb.append("    legs: ").append(toIndentedString(legs)).append("\n");
    sb.append("    strategyType: ").append(toIndentedString(strategyType)).append("\n");
    sb.append("    triggerStopPrice: ").append(toIndentedString(triggerStopPrice)).append("\n");
    sb.append("    orderGroupId: ").append(toIndentedString(orderGroupId)).append("\n");
    sb.append("    orderClass: ").append(toIndentedString(orderClass)).append("\n");
    sb.append("    isCrossZero: ").append(toIndentedString(isCrossZero)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }


  public static HashSet<String> openapiFields;
  public static HashSet<String> openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet<String>();
    openapiFields.add("id");
    openapiFields.add("symbol");
    openapiFields.add("symbolId");
    openapiFields.add("totalQuantity");
    openapiFields.add("openQuantity");
    openapiFields.add("filledQuantity");
    openapiFields.add("canceledQuantity");
    openapiFields.add("side");
    openapiFields.add("orderType");
    openapiFields.add("limitPrice");
    openapiFields.add("stopPrice");
    openapiFields.add("isAllOrNone");
    openapiFields.add("isAnonymous");
    openapiFields.add("icebergQuantity");
    openapiFields.add("minQuantity");
    openapiFields.add("avgExecPrice");
    openapiFields.add("lastExecPrice");
    openapiFields.add("source");
    openapiFields.add("timeInForce");
    openapiFields.add("gtdDate");
    openapiFields.add("state");
    openapiFields.add("rejectionReason");
    openapiFields.add("chainId");
    openapiFields.add("creationTime");
    openapiFields.add("updateTime");
    openapiFields.add("notes");
    openapiFields.add("primaryRoute");
    openapiFields.add("secondaryRoute");
    openapiFields.add("orderRoute");
    openapiFields.add("venueHoldingOrder");
    openapiFields.add("comissionCharged");
    openapiFields.add("exchangeOrderId");
    openapiFields.add("isSignificantShareHolder");
    openapiFields.add("isInsider");
    openapiFields.add("isLimitOffsetInDollar");
    openapiFields.add("userId");
    openapiFields.add("placementCommission");
    openapiFields.add("legs");
    openapiFields.add("strategyType");
    openapiFields.add("triggerStopPrice");
    openapiFields.add("orderGroupId");
    openapiFields.add("orderClass");
    openapiFields.add("isCrossZero");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>();
  }

 /**
  * Validates the JSON Object and throws an exception if issues found
  *
  * @param jsonObj JSON Object
  * @throws IOException if the JSON Object is invalid with respect to StrategyOrderPlaceOrdersInner
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (!StrategyOrderPlaceOrdersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
          throw new IllegalArgumentException(String.format("The required field(s) %s in StrategyOrderPlaceOrdersInner is not found in the empty JSON string", StrategyOrderPlaceOrdersInner.openapiRequiredFields.toString()));
        }
      }
      if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("symbol").toString()));
      }
      if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `side` to be a primitive type in the JSON string but got `%s`", jsonObj.get("side").toString()));
      }
      if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) && !jsonObj.get("orderType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `orderType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderType").toString()));
      }
      if ((jsonObj.get("limitPrice") != null && !jsonObj.get("limitPrice").isJsonNull()) && !jsonObj.get("limitPrice").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `limitPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("limitPrice").toString()));
      }
      if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) && !jsonObj.get("stopPrice").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `stopPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stopPrice").toString()));
      }
      if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) && !jsonObj.get("icebergQuantity").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `icebergQuantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icebergQuantity").toString()));
      }
      if ((jsonObj.get("minQuantity") != null && !jsonObj.get("minQuantity").isJsonNull()) && !jsonObj.get("minQuantity").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `minQuantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("minQuantity").toString()));
      }
      if ((jsonObj.get("lastExecPrice") != null && !jsonObj.get("lastExecPrice").isJsonNull()) && !jsonObj.get("lastExecPrice").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `lastExecPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastExecPrice").toString()));
      }
      if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) && !jsonObj.get("source").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString()));
      }
      if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) && !jsonObj.get("timeInForce").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `timeInForce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeInForce").toString()));
      }
      if ((jsonObj.get("gtdDate") != null && !jsonObj.get("gtdDate").isJsonNull()) && !jsonObj.get("gtdDate").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `gtdDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gtdDate").toString()));
      }
      if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString()));
      }
      if ((jsonObj.get("rejectionReason") != null && !jsonObj.get("rejectionReason").isJsonNull()) && !jsonObj.get("rejectionReason").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `rejectionReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rejectionReason").toString()));
      }
      if ((jsonObj.get("creationTime") != null && !jsonObj.get("creationTime").isJsonNull()) && !jsonObj.get("creationTime").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `creationTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creationTime").toString()));
      }
      if ((jsonObj.get("updateTime") != null && !jsonObj.get("updateTime").isJsonNull()) && !jsonObj.get("updateTime").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `updateTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updateTime").toString()));
      }
      if ((jsonObj.get("notes") != null && !jsonObj.get("notes").isJsonNull()) && !jsonObj.get("notes").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notes").toString()));
      }
      if ((jsonObj.get("primaryRoute") != null && !jsonObj.get("primaryRoute").isJsonNull()) && !jsonObj.get("primaryRoute").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `primaryRoute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryRoute").toString()));
      }
      if ((jsonObj.get("secondaryRoute") != null && !jsonObj.get("secondaryRoute").isJsonNull()) && !jsonObj.get("secondaryRoute").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `secondaryRoute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secondaryRoute").toString()));
      }
      if ((jsonObj.get("orderRoute") != null && !jsonObj.get("orderRoute").isJsonNull()) && !jsonObj.get("orderRoute").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `orderRoute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderRoute").toString()));
      }
      if ((jsonObj.get("venueHoldingOrder") != null && !jsonObj.get("venueHoldingOrder").isJsonNull()) && !jsonObj.get("venueHoldingOrder").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `venueHoldingOrder` to be a primitive type in the JSON string but got `%s`", jsonObj.get("venueHoldingOrder").toString()));
      }
      if ((jsonObj.get("exchangeOrderId") != null && !jsonObj.get("exchangeOrderId").isJsonNull()) && !jsonObj.get("exchangeOrderId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `exchangeOrderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exchangeOrderId").toString()));
      }
      if ((jsonObj.get("placementCommission") != null && !jsonObj.get("placementCommission").isJsonNull()) && !jsonObj.get("placementCommission").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `placementCommission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("placementCommission").toString()));
      }
      // ensure the optional json data is an array if present
      if (jsonObj.get("legs") != null && !jsonObj.get("legs").isJsonArray()) {
        throw new IllegalArgumentException(String.format("Expected the field `legs` to be an array in the JSON string but got `%s`", jsonObj.get("legs").toString()));
      }
      if ((jsonObj.get("strategyType") != null && !jsonObj.get("strategyType").isJsonNull()) && !jsonObj.get("strategyType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `strategyType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("strategyType").toString()));
      }
      if ((jsonObj.get("triggerStopPrice") != null && !jsonObj.get("triggerStopPrice").isJsonNull()) && !jsonObj.get("triggerStopPrice").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `triggerStopPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("triggerStopPrice").toString()));
      }
      if ((jsonObj.get("orderClass") != null && !jsonObj.get("orderClass").isJsonNull()) && !jsonObj.get("orderClass").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format("Expected the field `orderClass` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderClass").toString()));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
       if (!StrategyOrderPlaceOrdersInner.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'StrategyOrderPlaceOrdersInner' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<StrategyOrderPlaceOrdersInner> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(StrategyOrderPlaceOrdersInner.class));

       return (TypeAdapter<T>) new TypeAdapter<StrategyOrderPlaceOrdersInner>() {
           @Override
           public void write(JsonWriter out, StrategyOrderPlaceOrdersInner value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additonal properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else {
                   obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
                 }
               }
             }
             elementAdapter.write(out, obj);
           }

           @Override
           public StrategyOrderPlaceOrdersInner read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             // store additional fields in the deserialized instance
             StrategyOrderPlaceOrdersInner instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else if (entry.getValue().isJsonArray()) {
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
                 } else { // JSON object
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of StrategyOrderPlaceOrdersInner given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of StrategyOrderPlaceOrdersInner
  * @throws IOException if the JSON string is invalid with respect to StrategyOrderPlaceOrdersInner
  */
  public static StrategyOrderPlaceOrdersInner fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, StrategyOrderPlaceOrdersInner.class);
  }

 /**
  * Convert an instance of StrategyOrderPlaceOrdersInner to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}

