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

com.dominodatalab.api.model.DominoProjectsApiOnDemandSparkClusterStatus 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.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.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


/**
 * DominoProjectsApiOnDemandSparkClusterStatus
 */
@JsonPropertyOrder({
  DominoProjectsApiOnDemandSparkClusterStatus.JSON_PROPERTY_CLUSTER_NAME,
  DominoProjectsApiOnDemandSparkClusterStatus.JSON_PROPERTY_CLUSTER_STATE,
  DominoProjectsApiOnDemandSparkClusterStatus.JSON_PROPERTY_EXISTS,
  DominoProjectsApiOnDemandSparkClusterStatus.JSON_PROPERTY_IS_READY,
  DominoProjectsApiOnDemandSparkClusterStatus.JSON_PROPERTY_WORKER_COUNT
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoProjectsApiOnDemandSparkClusterStatus {
  public static final String JSON_PROPERTY_CLUSTER_NAME = "clusterName";
  private String clusterName;

  /**
   * Gets or Sets clusterState
   */
  public enum ClusterStateEnum {
    PENDING("Pending"),
    
    STOPPING("Stopping"),
    
    STARTING("Starting"),
    
    READY("Ready"),
    
    NOTFOUND("NotFound");

    private String value;

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

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

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

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

  public static final String JSON_PROPERTY_CLUSTER_STATE = "clusterState";
  private ClusterStateEnum clusterState;

  public static final String JSON_PROPERTY_EXISTS = "exists";
  private Boolean exists;

  public static final String JSON_PROPERTY_IS_READY = "isReady";
  private Boolean isReady;

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

  public DominoProjectsApiOnDemandSparkClusterStatus() { 
  }

  public DominoProjectsApiOnDemandSparkClusterStatus clusterName(String clusterName) {
    this.clusterName = clusterName;
    return this;
  }

   /**
   * Get clusterName
   * @return clusterName
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CLUSTER_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getClusterName() {
    return clusterName;
  }


  @JsonProperty(JSON_PROPERTY_CLUSTER_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setClusterName(String clusterName) {
    this.clusterName = clusterName;
  }


  public DominoProjectsApiOnDemandSparkClusterStatus clusterState(ClusterStateEnum clusterState) {
    this.clusterState = clusterState;
    return this;
  }

   /**
   * Get clusterState
   * @return clusterState
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CLUSTER_STATE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public ClusterStateEnum getClusterState() {
    return clusterState;
  }


  @JsonProperty(JSON_PROPERTY_CLUSTER_STATE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setClusterState(ClusterStateEnum clusterState) {
    this.clusterState = clusterState;
  }


  public DominoProjectsApiOnDemandSparkClusterStatus exists(Boolean exists) {
    this.exists = exists;
    return this;
  }

   /**
   * Get exists
   * @return exists
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_EXISTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getExists() {
    return exists;
  }


  @JsonProperty(JSON_PROPERTY_EXISTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setExists(Boolean exists) {
    this.exists = exists;
  }


  public DominoProjectsApiOnDemandSparkClusterStatus isReady(Boolean isReady) {
    this.isReady = isReady;
    return this;
  }

   /**
   * Get isReady
   * @return isReady
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_IS_READY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getIsReady() {
    return isReady;
  }


  @JsonProperty(JSON_PROPERTY_IS_READY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setIsReady(Boolean isReady) {
    this.isReady = isReady;
  }


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

   /**
   * Get workerCount
   * @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;
  }


  /**
   * Return true if this domino.projects.api.OnDemandSparkClusterStatus object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoProjectsApiOnDemandSparkClusterStatus dominoProjectsApiOnDemandSparkClusterStatus = (DominoProjectsApiOnDemandSparkClusterStatus) o;
    return Objects.equals(this.clusterName, dominoProjectsApiOnDemandSparkClusterStatus.clusterName) &&
        Objects.equals(this.clusterState, dominoProjectsApiOnDemandSparkClusterStatus.clusterState) &&
        Objects.equals(this.exists, dominoProjectsApiOnDemandSparkClusterStatus.exists) &&
        Objects.equals(this.isReady, dominoProjectsApiOnDemandSparkClusterStatus.isReady) &&
        Objects.equals(this.workerCount, dominoProjectsApiOnDemandSparkClusterStatus.workerCount);
  }

  @Override
  public int hashCode() {
    return Objects.hash(clusterName, clusterState, exists, isReady, workerCount);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoProjectsApiOnDemandSparkClusterStatus {\n");
    sb.append("    clusterName: ").append(toIndentedString(clusterName)).append("\n");
    sb.append("    clusterState: ").append(toIndentedString(clusterState)).append("\n");
    sb.append("    exists: ").append(toIndentedString(exists)).append("\n");
    sb.append("    isReady: ").append(toIndentedString(isReady)).append("\n");
    sb.append("    workerCount: ").append(toIndentedString(workerCount)).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 `clusterName` to the URL query string
    if (getClusterName() != null) {
      joiner.add(String.format("%sclusterName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClusterName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

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

    // add `isReady` to the URL query string
    if (getIsReady() != null) {
      joiner.add(String.format("%sisReady%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsReady()), 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(String.valueOf(getWorkerCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy