All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.factset.sdk.DirectStreamingofTransactionMessages.models.DsotmParameters Maven / Gradle / Ivy

The newest version!
/*
 * dsotm API
 * Allow clients to send transactions data to FactSet.
 *
 * The version of the OpenAPI document: 1.6.0
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.factset.sdk.DirectStreamingofTransactionMessages.models;

import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.Execution;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.Order;
import com.factset.sdk.DirectStreamingofTransactionMessages.models.Placement;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.DirectStreamingofTransactionMessages.JSON;


/**
 * Container object for transaction records
 */
@ApiModel(description = "Container object for transaction records")
@JsonPropertyOrder({
  DsotmParameters.JSON_PROPERTY_ORDERS,
  DsotmParameters.JSON_PROPERTY_PLACEMENTS,
  DsotmParameters.JSON_PROPERTY_EXECUTIONS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")

public class DsotmParameters implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String JSON_PROPERTY_ORDERS = "orders";
  private JsonNullable> orders = JsonNullable.>undefined();

  public static final String JSON_PROPERTY_PLACEMENTS = "placements";
  private JsonNullable> placements = JsonNullable.>undefined();

  public static final String JSON_PROPERTY_EXECUTIONS = "executions";
  private JsonNullable> executions = JsonNullable.>undefined();

  public DsotmParameters() { 
  }

  public DsotmParameters orders(java.util.List orders) {
    this.orders = JsonNullable.>of(orders);
    return this;
  }

  public DsotmParameters addOrdersItem(Order ordersItem) {
    if (this.orders == null || !this.orders.isPresent()) {
      this.orders = JsonNullable.>of(new java.util.ArrayList<>());
    }
    try {
      this.orders.get().add(ordersItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

   /**
   * List of orders
   * @return orders
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "List of orders")
  @JsonIgnore

  public java.util.List getOrders() {
        return orders.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_ORDERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getOrders_JsonNullable() {
    return orders;
  }
  
  @JsonProperty(JSON_PROPERTY_ORDERS)
  public void setOrders_JsonNullable(JsonNullable> orders) {
    this.orders = orders;
  }

  public void setOrders(java.util.List orders) {
    this.orders = JsonNullable.>of(orders);
  }


  public DsotmParameters placements(java.util.List placements) {
    this.placements = JsonNullable.>of(placements);
    return this;
  }

  public DsotmParameters addPlacementsItem(Placement placementsItem) {
    if (this.placements == null || !this.placements.isPresent()) {
      this.placements = JsonNullable.>of(new java.util.ArrayList<>());
    }
    try {
      this.placements.get().add(placementsItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

   /**
   * List of placements
   * @return placements
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "List of placements")
  @JsonIgnore

  public java.util.List getPlacements() {
        return placements.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_PLACEMENTS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getPlacements_JsonNullable() {
    return placements;
  }
  
  @JsonProperty(JSON_PROPERTY_PLACEMENTS)
  public void setPlacements_JsonNullable(JsonNullable> placements) {
    this.placements = placements;
  }

  public void setPlacements(java.util.List placements) {
    this.placements = JsonNullable.>of(placements);
  }


  public DsotmParameters executions(java.util.List executions) {
    this.executions = JsonNullable.>of(executions);
    return this;
  }

  public DsotmParameters addExecutionsItem(Execution executionsItem) {
    if (this.executions == null || !this.executions.isPresent()) {
      this.executions = JsonNullable.>of(new java.util.ArrayList<>());
    }
    try {
      this.executions.get().add(executionsItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

   /**
   * List of executions
   * @return executions
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "List of executions")
  @JsonIgnore

  public java.util.List getExecutions() {
        return executions.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_EXECUTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getExecutions_JsonNullable() {
    return executions;
  }
  
  @JsonProperty(JSON_PROPERTY_EXECUTIONS)
  public void setExecutions_JsonNullable(JsonNullable> executions) {
    this.executions = executions;
  }

  public void setExecutions(java.util.List executions) {
    this.executions = JsonNullable.>of(executions);
  }


  /**
   * Return true if this DsotmParameters object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DsotmParameters dsotmParameters = (DsotmParameters) o;
    return equalsNullable(this.orders, dsotmParameters.orders) &&
        equalsNullable(this.placements, dsotmParameters.placements) &&
        equalsNullable(this.executions, dsotmParameters.executions);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(hashCodeNullable(orders), hashCodeNullable(placements), hashCodeNullable(executions));
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DsotmParameters {\n");
    sb.append("    orders: ").append(toIndentedString(orders)).append("\n");
    sb.append("    placements: ").append(toIndentedString(placements)).append("\n");
    sb.append("    executions: ").append(toIndentedString(executions)).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    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy