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

com.factset.sdk.PAEngine.models.CalculationStatus Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show newest version
/*
 * PA Engine API
 * Allow clients to fetch Analytics through APIs.
 *
 * The version of the OpenAPI document: 3.16.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.PAEngine.models;

import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.PAEngine.models.CalculationUnitStatus;
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.PAEngine.JSON;


/**
 * CalculationStatus
 */
@JsonPropertyOrder({
  CalculationStatus.JSON_PROPERTY_CALCULATIONID,
  CalculationStatus.JSON_PROPERTY_STATUS,
  CalculationStatus.JSON_PROPERTY_UNITS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")

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

  public static final String JSON_PROPERTY_CALCULATIONID = "calculationid";
  private JsonNullable calculationid = JsonNullable.undefined();

  /**
   * Calculation's status
   */
  public enum StatusEnum {
    QUEUED("Queued"),
    
    EXECUTING("Executing"),
    
    COMPLETED("Completed"),
    
    CANCELLED("Cancelled");

    private String value;

    StatusEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static StatusEnum fromValue(String value) {
      for (StatusEnum b : StatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_STATUS = "status";
  private StatusEnum status;

  public static final String JSON_PROPERTY_UNITS = "units";
  private JsonNullable> units = JsonNullable.>undefined();

  public CalculationStatus() { 
  }

  public CalculationStatus calculationid(String calculationid) {
    this.calculationid = JsonNullable.of(calculationid);
    return this;
  }

   /**
   * Calculation's identifier
   * @return calculationid
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "Calculation's identifier")
  @JsonIgnore

  public String getCalculationid() {
        return calculationid.orElse(null);
  }

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

  public JsonNullable getCalculationid_JsonNullable() {
    return calculationid;
  }
  
  @JsonProperty(JSON_PROPERTY_CALCULATIONID)
  public void setCalculationid_JsonNullable(JsonNullable calculationid) {
    this.calculationid = calculationid;
  }

  public void setCalculationid(String calculationid) {
    this.calculationid = JsonNullable.of(calculationid);
  }


  public CalculationStatus status(StatusEnum status) {
    this.status = status;
    return this;
  }

   /**
   * Calculation's status
   * @return status
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "Calculation's status")
  @JsonProperty(JSON_PROPERTY_STATUS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public StatusEnum getStatus() {
    return status;
  }


  @JsonProperty(JSON_PROPERTY_STATUS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setStatus(StatusEnum status) {
    this.status = status;
  }


  public CalculationStatus units(java.util.Map units) {
    this.units = JsonNullable.>of(units);
    return this;
  }

  public CalculationStatus putUnitsItem(String key, CalculationUnitStatus unitsItem) {
    if (this.units == null || !this.units.isPresent()) {
      this.units = JsonNullable.>of(new java.util.HashMap<>());
    }
    try {
      this.units.get().put(key, unitsItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

   /**
   * Number of calculation units in batch.
   * @return units
  **/
  @jakarta.annotation.Nullable
  @ApiModelProperty(value = "Number of calculation units in batch.")
  @JsonIgnore

  public java.util.Map getUnits() {
        return units.orElse(null);
  }

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

  public JsonNullable> getUnits_JsonNullable() {
    return units;
  }
  
  @JsonProperty(JSON_PROPERTY_UNITS)
  public void setUnits_JsonNullable(JsonNullable> units) {
    this.units = units;
  }

  public void setUnits(java.util.Map units) {
    this.units = JsonNullable.>of(units);
  }


  /**
   * Return true if this CalculationStatus object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CalculationStatus calculationStatus = (CalculationStatus) o;
    return equalsNullable(this.calculationid, calculationStatus.calculationid) &&
        Objects.equals(this.status, calculationStatus.status) &&
        equalsNullable(this.units, calculationStatus.units);
  }

  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(calculationid), status, hashCodeNullable(units));
  }

  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 CalculationStatus {\n");
    sb.append("    calculationid: ").append(toIndentedString(calculationid)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    units: ").append(toIndentedString(units)).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