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

com.dominodatalab.pub.model.ComputeClusterConfigV1 Maven / Gradle / Ivy

Go to download

Domino Data Lab API Client to connect to Domino web services using Java HTTP Client.

There is a newer version: 6.0.1.0
Show newest version
/*
 * Domino Public API
 * Domino Public API Endpoints
 *
 * The version of the OpenAPI document: 0.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.pub.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.pub.model.ClusterTypeV1;
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;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * ComputeClusterConfigV1
 */
@JsonPropertyOrder({
  ComputeClusterConfigV1.JSON_PROPERTY_CLUSTER_TYPE,
  ComputeClusterConfigV1.JSON_PROPERTY_COMPUTE_ENVIRONMENT_ID,
  ComputeClusterConfigV1.JSON_PROPERTY_COMPUTE_ENVIRONMENT_REVISION_SPEC,
  ComputeClusterConfigV1.JSON_PROPERTY_MASTER_HARDWARE_TIER_ID,
  ComputeClusterConfigV1.JSON_PROPERTY_MAX_WORKER_COUNT,
  ComputeClusterConfigV1.JSON_PROPERTY_WORKER_COUNT,
  ComputeClusterConfigV1.JSON_PROPERTY_WORKER_HARDWARE_TIER,
  ComputeClusterConfigV1.JSON_PROPERTY_WORKER_STORAGE_M_B
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T16:37:28.765500600-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class ComputeClusterConfigV1 {
  public static final String JSON_PROPERTY_CLUSTER_TYPE = "clusterType";
  private ClusterTypeV1 clusterType;

  public static final String JSON_PROPERTY_COMPUTE_ENVIRONMENT_ID = "computeEnvironmentId";
  private String computeEnvironmentId;

  public static final String JSON_PROPERTY_COMPUTE_ENVIRONMENT_REVISION_SPEC = "computeEnvironmentRevisionSpec";
  private String computeEnvironmentRevisionSpec;

  public static final String JSON_PROPERTY_MASTER_HARDWARE_TIER_ID = "masterHardwareTierId";
  private String masterHardwareTierId;

  public static final String JSON_PROPERTY_MAX_WORKER_COUNT = "maxWorkerCount";
  private Integer maxWorkerCount;

  public static final String JSON_PROPERTY_WORKER_COUNT = "workerCount";
  private Integer workerCount;

  public static final String JSON_PROPERTY_WORKER_HARDWARE_TIER = "workerHardwareTier";
  private String workerHardwareTier;

  public static final String JSON_PROPERTY_WORKER_STORAGE_M_B = "workerStorageMB";
  private BigDecimal workerStorageMB;

  public ComputeClusterConfigV1() { 
  }

  public ComputeClusterConfigV1 clusterType(ClusterTypeV1 clusterType) {
    this.clusterType = clusterType;
    return this;
  }

  /**
   * Get clusterType
   * @return clusterType
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CLUSTER_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public ClusterTypeV1 getClusterType() {
    return clusterType;
  }


  @JsonProperty(JSON_PROPERTY_CLUSTER_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setClusterType(ClusterTypeV1 clusterType) {
    this.clusterType = clusterType;
  }


  public ComputeClusterConfigV1 computeEnvironmentId(String computeEnvironmentId) {
    this.computeEnvironmentId = computeEnvironmentId;
    return this;
  }

  /**
   * Id of compute environment to use.
   * @return computeEnvironmentId
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_COMPUTE_ENVIRONMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getComputeEnvironmentId() {
    return computeEnvironmentId;
  }


  @JsonProperty(JSON_PROPERTY_COMPUTE_ENVIRONMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setComputeEnvironmentId(String computeEnvironmentId) {
    this.computeEnvironmentId = computeEnvironmentId;
  }


  public ComputeClusterConfigV1 computeEnvironmentRevisionSpec(String computeEnvironmentRevisionSpec) {
    this.computeEnvironmentRevisionSpec = computeEnvironmentRevisionSpec;
    return this;
  }

  /**
   * Specification describing which environment revision to use. Defaults to \"ActiveRevision\"
   * @return computeEnvironmentRevisionSpec
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_COMPUTE_ENVIRONMENT_REVISION_SPEC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getComputeEnvironmentRevisionSpec() {
    return computeEnvironmentRevisionSpec;
  }


  @JsonProperty(JSON_PROPERTY_COMPUTE_ENVIRONMENT_REVISION_SPEC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setComputeEnvironmentRevisionSpec(String computeEnvironmentRevisionSpec) {
    this.computeEnvironmentRevisionSpec = computeEnvironmentRevisionSpec;
  }


  public ComputeClusterConfigV1 masterHardwareTierId(String masterHardwareTierId) {
    this.masterHardwareTierId = masterHardwareTierId;
    return this;
  }

  /**
   * Hardware tier to use for master node in compute cluster.
   * @return masterHardwareTierId
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MASTER_HARDWARE_TIER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getMasterHardwareTierId() {
    return masterHardwareTierId;
  }


  @JsonProperty(JSON_PROPERTY_MASTER_HARDWARE_TIER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMasterHardwareTierId(String masterHardwareTierId) {
    this.masterHardwareTierId = masterHardwareTierId;
  }


  public ComputeClusterConfigV1 maxWorkerCount(Integer maxWorkerCount) {
    this.maxWorkerCount = maxWorkerCount;
    return this;
  }

  /**
   * Max number of workers to use in compute cluster. Enables auto-scaling for cluster when present.
   * @return maxWorkerCount
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MAX_WORKER_COUNT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Integer getMaxWorkerCount() {
    return maxWorkerCount;
  }


  @JsonProperty(JSON_PROPERTY_MAX_WORKER_COUNT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMaxWorkerCount(Integer maxWorkerCount) {
    this.maxWorkerCount = maxWorkerCount;
  }


  public ComputeClusterConfigV1 workerCount(Integer workerCount) {
    this.workerCount = workerCount;
    return this;
  }

  /**
   * Number of workers to use in compute cluster. Used as min number of workers in maxWorkerCount is set.
   * @return workerCount
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_WORKER_COUNT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Integer getWorkerCount() {
    return workerCount;
  }


  @JsonProperty(JSON_PROPERTY_WORKER_COUNT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setWorkerCount(Integer workerCount) {
    this.workerCount = workerCount;
  }


  public ComputeClusterConfigV1 workerHardwareTier(String workerHardwareTier) {
    this.workerHardwareTier = workerHardwareTier;
    return this;
  }

  /**
   * Hardware tier to use for workers in compute cluster.
   * @return workerHardwareTier
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_WORKER_HARDWARE_TIER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getWorkerHardwareTier() {
    return workerHardwareTier;
  }


  @JsonProperty(JSON_PROPERTY_WORKER_HARDWARE_TIER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setWorkerHardwareTier(String workerHardwareTier) {
    this.workerHardwareTier = workerHardwareTier;
  }


  public ComputeClusterConfigV1 workerStorageMB(BigDecimal workerStorageMB) {
    this.workerStorageMB = workerStorageMB;
    return this;
  }

  /**
   * Disk size in MB for each worker.
   * @return workerStorageMB
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_WORKER_STORAGE_M_B)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public BigDecimal getWorkerStorageMB() {
    return workerStorageMB;
  }


  @JsonProperty(JSON_PROPERTY_WORKER_STORAGE_M_B)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setWorkerStorageMB(BigDecimal workerStorageMB) {
    this.workerStorageMB = workerStorageMB;
  }


  /**
   * Return true if this ComputeClusterConfigV1 object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ComputeClusterConfigV1 computeClusterConfigV1 = (ComputeClusterConfigV1) o;
    return Objects.equals(this.clusterType, computeClusterConfigV1.clusterType) &&
        Objects.equals(this.computeEnvironmentId, computeClusterConfigV1.computeEnvironmentId) &&
        Objects.equals(this.computeEnvironmentRevisionSpec, computeClusterConfigV1.computeEnvironmentRevisionSpec) &&
        Objects.equals(this.masterHardwareTierId, computeClusterConfigV1.masterHardwareTierId) &&
        Objects.equals(this.maxWorkerCount, computeClusterConfigV1.maxWorkerCount) &&
        Objects.equals(this.workerCount, computeClusterConfigV1.workerCount) &&
        Objects.equals(this.workerHardwareTier, computeClusterConfigV1.workerHardwareTier) &&
        Objects.equals(this.workerStorageMB, computeClusterConfigV1.workerStorageMB);
  }

  @Override
  public int hashCode() {
    return Objects.hash(clusterType, computeEnvironmentId, computeEnvironmentRevisionSpec, masterHardwareTierId, maxWorkerCount, workerCount, workerHardwareTier, workerStorageMB);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ComputeClusterConfigV1 {\n");
    sb.append("    clusterType: ").append(toIndentedString(clusterType)).append("\n");
    sb.append("    computeEnvironmentId: ").append(toIndentedString(computeEnvironmentId)).append("\n");
    sb.append("    computeEnvironmentRevisionSpec: ").append(toIndentedString(computeEnvironmentRevisionSpec)).append("\n");
    sb.append("    masterHardwareTierId: ").append(toIndentedString(masterHardwareTierId)).append("\n");
    sb.append("    maxWorkerCount: ").append(toIndentedString(maxWorkerCount)).append("\n");
    sb.append("    workerCount: ").append(toIndentedString(workerCount)).append("\n");
    sb.append("    workerHardwareTier: ").append(toIndentedString(workerHardwareTier)).append("\n");
    sb.append("    workerStorageMB: ").append(toIndentedString(workerStorageMB)).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 `clusterType` to the URL query string
    if (getClusterType() != null) {
      joiner.add(String.format("%sclusterType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClusterType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `computeEnvironmentId` to the URL query string
    if (getComputeEnvironmentId() != null) {
      joiner.add(String.format("%scomputeEnvironmentId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getComputeEnvironmentId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `computeEnvironmentRevisionSpec` to the URL query string
    if (getComputeEnvironmentRevisionSpec() != null) {
      joiner.add(String.format("%scomputeEnvironmentRevisionSpec%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getComputeEnvironmentRevisionSpec()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `masterHardwareTierId` to the URL query string
    if (getMasterHardwareTierId() != null) {
      joiner.add(String.format("%smasterHardwareTierId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMasterHardwareTierId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `maxWorkerCount` to the URL query string
    if (getMaxWorkerCount() != null) {
      joiner.add(String.format("%smaxWorkerCount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMaxWorkerCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `workerCount` to the URL query string
    if (getWorkerCount() != null) {
      joiner.add(String.format("%sworkerCount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWorkerCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `workerHardwareTier` to the URL query string
    if (getWorkerHardwareTier() != null) {
      joiner.add(String.format("%sworkerHardwareTier%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWorkerHardwareTier()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `workerStorageMB` to the URL query string
    if (getWorkerStorageMB() != null) {
      joiner.add(String.format("%sworkerStorageMB%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWorkerStorageMB()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy