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

com.dominodatalab.api.model.RunUtilization Maven / Gradle / Ivy

/*
 * Domino Data Lab API v4
 * This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key. 
 *
 * The version of the OpenAPI document: 4.0.0
 * 
 *
 * 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.dominodatalab.api.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.dominodatalab.api.model.RunType;
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 java.math.BigDecimal;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


/**
 * Statistics on a specific run
 */
@JsonPropertyOrder({
  RunUtilization.JSON_PROPERTY_ID,
  RunUtilization.JSON_PROPERTY_PROJECT_ID,
  RunUtilization.JSON_PROPERTY_PROJECT_IDENTITY,
  RunUtilization.JSON_PROPERTY_STARTING_USER_ID,
  RunUtilization.JSON_PROPERTY_STARTING_USER_FULL_NAME,
  RunUtilization.JSON_PROPERTY_RUN_TYPE,
  RunUtilization.JSON_PROPERTY_HARDWARE_TIER_ID,
  RunUtilization.JSON_PROPERTY_START_DATE_TIME,
  RunUtilization.JSON_PROPERTY_QUEUE_DURATION_IN_SECONDS,
  RunUtilization.JSON_PROPERTY_RUN_DURATION_IN_SECONDS,
  RunUtilization.JSON_PROPERTY_ESTIMATED_COST
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class RunUtilization {
  public static final String JSON_PROPERTY_ID = "id";
  private String id;

  public static final String JSON_PROPERTY_PROJECT_ID = "projectId";
  private String projectId;

  public static final String JSON_PROPERTY_PROJECT_IDENTITY = "projectIdentity";
  private String projectIdentity;

  public static final String JSON_PROPERTY_STARTING_USER_ID = "startingUserId";
  private String startingUserId;

  public static final String JSON_PROPERTY_STARTING_USER_FULL_NAME = "startingUserFullName";
  private String startingUserFullName;

  public static final String JSON_PROPERTY_RUN_TYPE = "runType";
  private RunType runType;

  public static final String JSON_PROPERTY_HARDWARE_TIER_ID = "hardwareTierId";
  private String hardwareTierId;

  public static final String JSON_PROPERTY_START_DATE_TIME = "startDateTime";
  private String startDateTime;

  public static final String JSON_PROPERTY_QUEUE_DURATION_IN_SECONDS = "queueDurationInSeconds";
  private BigDecimal queueDurationInSeconds;

  public static final String JSON_PROPERTY_RUN_DURATION_IN_SECONDS = "runDurationInSeconds";
  private BigDecimal runDurationInSeconds;

  public static final String JSON_PROPERTY_ESTIMATED_COST = "estimatedCost";
  private BigDecimal estimatedCost;

  public RunUtilization() { 
  }

  public RunUtilization id(String id) {
    this.id = id;
    return this;
  }

   /**
   * Id of a run
   * @return id
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getId() {
    return id;
  }


  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setId(String id) {
    this.id = id;
  }


  public RunUtilization projectId(String projectId) {
    this.projectId = projectId;
    return this;
  }

   /**
   * Id of a oproject the run belongs to
   * @return projectId
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PROJECT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getProjectId() {
    return projectId;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setProjectId(String projectId) {
    this.projectId = projectId;
  }


  public RunUtilization projectIdentity(String projectIdentity) {
    this.projectIdentity = projectIdentity;
    return this;
  }

   /**
   * human-readable project identifier
   * @return projectIdentity
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PROJECT_IDENTITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getProjectIdentity() {
    return projectIdentity;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_IDENTITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setProjectIdentity(String projectIdentity) {
    this.projectIdentity = projectIdentity;
  }


  public RunUtilization startingUserId(String startingUserId) {
    this.startingUserId = startingUserId;
    return this;
  }

   /**
   * Id of a user who started the run
   * @return startingUserId
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_STARTING_USER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getStartingUserId() {
    return startingUserId;
  }


  @JsonProperty(JSON_PROPERTY_STARTING_USER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setStartingUserId(String startingUserId) {
    this.startingUserId = startingUserId;
  }


  public RunUtilization startingUserFullName(String startingUserFullName) {
    this.startingUserFullName = startingUserFullName;
    return this;
  }

   /**
   * Full name of a user who started the run
   * @return startingUserFullName
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_STARTING_USER_FULL_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getStartingUserFullName() {
    return startingUserFullName;
  }


  @JsonProperty(JSON_PROPERTY_STARTING_USER_FULL_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setStartingUserFullName(String startingUserFullName) {
    this.startingUserFullName = startingUserFullName;
  }


  public RunUtilization runType(RunType runType) {
    this.runType = runType;
    return this;
  }

   /**
   * Get runType
   * @return runType
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_RUN_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public RunType getRunType() {
    return runType;
  }


  @JsonProperty(JSON_PROPERTY_RUN_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRunType(RunType runType) {
    this.runType = runType;
  }


  public RunUtilization hardwareTierId(String hardwareTierId) {
    this.hardwareTierId = hardwareTierId;
    return this;
  }

   /**
   * Hardware tier which was used for these runs
   * @return hardwareTierId
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_HARDWARE_TIER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getHardwareTierId() {
    return hardwareTierId;
  }


  @JsonProperty(JSON_PROPERTY_HARDWARE_TIER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setHardwareTierId(String hardwareTierId) {
    this.hardwareTierId = hardwareTierId;
  }


  public RunUtilization startDateTime(String startDateTime) {
    this.startDateTime = startDateTime;
    return this;
  }

   /**
   * Date when the run was started in the ISO-8601 format
   * @return startDateTime
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_START_DATE_TIME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getStartDateTime() {
    return startDateTime;
  }


  @JsonProperty(JSON_PROPERTY_START_DATE_TIME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setStartDateTime(String startDateTime) {
    this.startDateTime = startDateTime;
  }


  public RunUtilization queueDurationInSeconds(BigDecimal queueDurationInSeconds) {
    this.queueDurationInSeconds = queueDurationInSeconds;
    return this;
  }

   /**
   * How long the run spent in the queue before running (in seconds)
   * @return queueDurationInSeconds
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_QUEUE_DURATION_IN_SECONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public BigDecimal getQueueDurationInSeconds() {
    return queueDurationInSeconds;
  }


  @JsonProperty(JSON_PROPERTY_QUEUE_DURATION_IN_SECONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setQueueDurationInSeconds(BigDecimal queueDurationInSeconds) {
    this.queueDurationInSeconds = queueDurationInSeconds;
  }


  public RunUtilization runDurationInSeconds(BigDecimal runDurationInSeconds) {
    this.runDurationInSeconds = runDurationInSeconds;
    return this;
  }

   /**
   * How long the run was running (in seconds)
   * @return runDurationInSeconds
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_RUN_DURATION_IN_SECONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public BigDecimal getRunDurationInSeconds() {
    return runDurationInSeconds;
  }


  @JsonProperty(JSON_PROPERTY_RUN_DURATION_IN_SECONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRunDurationInSeconds(BigDecimal runDurationInSeconds) {
    this.runDurationInSeconds = runDurationInSeconds;
  }


  public RunUtilization estimatedCost(BigDecimal estimatedCost) {
    this.estimatedCost = estimatedCost;
    return this;
  }

   /**
   * The estimated cost of the run
   * @return estimatedCost
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ESTIMATED_COST)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public BigDecimal getEstimatedCost() {
    return estimatedCost;
  }


  @JsonProperty(JSON_PROPERTY_ESTIMATED_COST)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setEstimatedCost(BigDecimal estimatedCost) {
    this.estimatedCost = estimatedCost;
  }


  /**
   * Return true if this RunUtilization object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RunUtilization runUtilization = (RunUtilization) o;
    return Objects.equals(this.id, runUtilization.id) &&
        Objects.equals(this.projectId, runUtilization.projectId) &&
        Objects.equals(this.projectIdentity, runUtilization.projectIdentity) &&
        Objects.equals(this.startingUserId, runUtilization.startingUserId) &&
        Objects.equals(this.startingUserFullName, runUtilization.startingUserFullName) &&
        Objects.equals(this.runType, runUtilization.runType) &&
        Objects.equals(this.hardwareTierId, runUtilization.hardwareTierId) &&
        Objects.equals(this.startDateTime, runUtilization.startDateTime) &&
        Objects.equals(this.queueDurationInSeconds, runUtilization.queueDurationInSeconds) &&
        Objects.equals(this.runDurationInSeconds, runUtilization.runDurationInSeconds) &&
        Objects.equals(this.estimatedCost, runUtilization.estimatedCost);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, projectId, projectIdentity, startingUserId, startingUserFullName, runType, hardwareTierId, startDateTime, queueDurationInSeconds, runDurationInSeconds, estimatedCost);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RunUtilization {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    projectId: ").append(toIndentedString(projectId)).append("\n");
    sb.append("    projectIdentity: ").append(toIndentedString(projectIdentity)).append("\n");
    sb.append("    startingUserId: ").append(toIndentedString(startingUserId)).append("\n");
    sb.append("    startingUserFullName: ").append(toIndentedString(startingUserFullName)).append("\n");
    sb.append("    runType: ").append(toIndentedString(runType)).append("\n");
    sb.append("    hardwareTierId: ").append(toIndentedString(hardwareTierId)).append("\n");
    sb.append("    startDateTime: ").append(toIndentedString(startDateTime)).append("\n");
    sb.append("    queueDurationInSeconds: ").append(toIndentedString(queueDurationInSeconds)).append("\n");
    sb.append("    runDurationInSeconds: ").append(toIndentedString(runDurationInSeconds)).append("\n");
    sb.append("    estimatedCost: ").append(toIndentedString(estimatedCost)).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    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `id` to the URL query string
    if (getId() != null) {
      joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `projectId` to the URL query string
    if (getProjectId() != null) {
      joiner.add(String.format("%sprojectId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProjectId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `projectIdentity` to the URL query string
    if (getProjectIdentity() != null) {
      joiner.add(String.format("%sprojectIdentity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProjectIdentity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `startingUserId` to the URL query string
    if (getStartingUserId() != null) {
      joiner.add(String.format("%sstartingUserId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartingUserId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `startingUserFullName` to the URL query string
    if (getStartingUserFullName() != null) {
      joiner.add(String.format("%sstartingUserFullName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartingUserFullName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `runType` to the URL query string
    if (getRunType() != null) {
      joiner.add(String.format("%srunType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRunType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `hardwareTierId` to the URL query string
    if (getHardwareTierId() != null) {
      joiner.add(String.format("%shardwareTierId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHardwareTierId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `startDateTime` to the URL query string
    if (getStartDateTime() != null) {
      joiner.add(String.format("%sstartDateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStartDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `queueDurationInSeconds` to the URL query string
    if (getQueueDurationInSeconds() != null) {
      joiner.add(String.format("%squeueDurationInSeconds%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQueueDurationInSeconds()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `runDurationInSeconds` to the URL query string
    if (getRunDurationInSeconds() != null) {
      joiner.add(String.format("%srunDurationInSeconds%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getRunDurationInSeconds()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `estimatedCost` to the URL query string
    if (getEstimatedCost() != null) {
      joiner.add(String.format("%sestimatedCost%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEstimatedCost()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy