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

com.dominodatalab.pub.model.ModelApiCreationRequest 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.ModelApiEnvironmentVariable;
import com.dominodatalab.pub.model.ModelApiVersionCreationRequest;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * ModelApiCreationRequest
 */
@JsonPropertyOrder({
  ModelApiCreationRequest.JSON_PROPERTY_DESCRIPTION,
  ModelApiCreationRequest.JSON_PROPERTY_ENVIRONMENT_ID,
  ModelApiCreationRequest.JSON_PROPERTY_ENVIRONMENT_VARIABLES,
  ModelApiCreationRequest.JSON_PROPERTY_HARDWARE_TIER_ID,
  ModelApiCreationRequest.JSON_PROPERTY_IS_ASYNC,
  ModelApiCreationRequest.JSON_PROPERTY_NAME,
  ModelApiCreationRequest.JSON_PROPERTY_REPLICAS,
  ModelApiCreationRequest.JSON_PROPERTY_RESOURCE_QUOTA_ID,
  ModelApiCreationRequest.JSON_PROPERTY_STRICT_NODE_ANTI_AFFINITY,
  ModelApiCreationRequest.JSON_PROPERTY_VERSION
})
@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 ModelApiCreationRequest {
  public static final String JSON_PROPERTY_DESCRIPTION = "description";
  private String description;

  public static final String JSON_PROPERTY_ENVIRONMENT_ID = "environmentId";
  private String environmentId;

  public static final String JSON_PROPERTY_ENVIRONMENT_VARIABLES = "environmentVariables";
  private List environmentVariables = new ArrayList<>();

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

  public static final String JSON_PROPERTY_IS_ASYNC = "isAsync";
  private Boolean isAsync;

  public static final String JSON_PROPERTY_NAME = "name";
  private String name;

  public static final String JSON_PROPERTY_REPLICAS = "replicas";
  private Integer replicas;

  public static final String JSON_PROPERTY_RESOURCE_QUOTA_ID = "resourceQuotaId";
  private String resourceQuotaId;

  public static final String JSON_PROPERTY_STRICT_NODE_ANTI_AFFINITY = "strictNodeAntiAffinity";
  private Boolean strictNodeAntiAffinity;

  public static final String JSON_PROPERTY_VERSION = "version";
  private ModelApiVersionCreationRequest version;

  public ModelApiCreationRequest() { 
  }

  public ModelApiCreationRequest description(String description) {
    this.description = description;
    return this;
  }

  /**
   * The description of the Model API to create.
   * @return description
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getDescription() {
    return description;
  }


  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDescription(String description) {
    this.description = description;
  }


  public ModelApiCreationRequest environmentId(String environmentId) {
    this.environmentId = environmentId;
    return this;
  }

  /**
   * The id of the environment the Model API to create should be deployed to.
   * @return environmentId
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getEnvironmentId() {
    return environmentId;
  }


  @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setEnvironmentId(String environmentId) {
    this.environmentId = environmentId;
  }


  public ModelApiCreationRequest environmentVariables(List environmentVariables) {
    this.environmentVariables = environmentVariables;
    return this;
  }

  public ModelApiCreationRequest addEnvironmentVariablesItem(ModelApiEnvironmentVariable environmentVariablesItem) {
    if (this.environmentVariables == null) {
      this.environmentVariables = new ArrayList<>();
    }
    this.environmentVariables.add(environmentVariablesItem);
    return this;
  }

  /**
   * The environment variables of the Model API to create.
   * @return environmentVariables
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ENVIRONMENT_VARIABLES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public List getEnvironmentVariables() {
    return environmentVariables;
  }


  @JsonProperty(JSON_PROPERTY_ENVIRONMENT_VARIABLES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setEnvironmentVariables(List environmentVariables) {
    this.environmentVariables = environmentVariables;
  }


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

  /**
   * The id of the hardware tier the Model API to create should be deployed with.
   * @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 ModelApiCreationRequest isAsync(Boolean isAsync) {
    this.isAsync = isAsync;
    return this;
  }

  /**
   * Whether the Model API to create should be async.
   * @return isAsync
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_IS_ASYNC)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Boolean getIsAsync() {
    return isAsync;
  }


  @JsonProperty(JSON_PROPERTY_IS_ASYNC)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setIsAsync(Boolean isAsync) {
    this.isAsync = isAsync;
  }


  public ModelApiCreationRequest name(String name) {
    this.name = name;
    return this;
  }

  /**
   * The name of the Model API to create.
   * @return name
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getName() {
    return name;
  }


  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setName(String name) {
    this.name = name;
  }


  public ModelApiCreationRequest replicas(Integer replicas) {
    this.replicas = replicas;
    return this;
  }

  /**
   * The number of replicas of the Model API should be created with.
   * @return replicas
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_REPLICAS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public Integer getReplicas() {
    return replicas;
  }


  @JsonProperty(JSON_PROPERTY_REPLICAS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setReplicas(Integer replicas) {
    this.replicas = replicas;
  }


  public ModelApiCreationRequest resourceQuotaId(String resourceQuotaId) {
    this.resourceQuotaId = resourceQuotaId;
    return this;
  }

  /**
   * The id of the resource quota the Model API to create should be deployed with.
   * @return resourceQuotaId
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_RESOURCE_QUOTA_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getResourceQuotaId() {
    return resourceQuotaId;
  }


  @JsonProperty(JSON_PROPERTY_RESOURCE_QUOTA_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setResourceQuotaId(String resourceQuotaId) {
    this.resourceQuotaId = resourceQuotaId;
  }


  public ModelApiCreationRequest strictNodeAntiAffinity(Boolean strictNodeAntiAffinity) {
    this.strictNodeAntiAffinity = strictNodeAntiAffinity;
    return this;
  }

  /**
   * Whether the Model API to create should have strict node anti affinity.
   * @return strictNodeAntiAffinity
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_STRICT_NODE_ANTI_AFFINITY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Boolean getStrictNodeAntiAffinity() {
    return strictNodeAntiAffinity;
  }


  @JsonProperty(JSON_PROPERTY_STRICT_NODE_ANTI_AFFINITY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setStrictNodeAntiAffinity(Boolean strictNodeAntiAffinity) {
    this.strictNodeAntiAffinity = strictNodeAntiAffinity;
  }


  public ModelApiCreationRequest version(ModelApiVersionCreationRequest version) {
    this.version = version;
    return this;
  }

  /**
   * Get version
   * @return version
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_VERSION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public ModelApiVersionCreationRequest getVersion() {
    return version;
  }


  @JsonProperty(JSON_PROPERTY_VERSION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setVersion(ModelApiVersionCreationRequest version) {
    this.version = version;
  }


  /**
   * Return true if this ModelApiCreationRequest object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ModelApiCreationRequest modelApiCreationRequest = (ModelApiCreationRequest) o;
    return Objects.equals(this.description, modelApiCreationRequest.description) &&
        Objects.equals(this.environmentId, modelApiCreationRequest.environmentId) &&
        Objects.equals(this.environmentVariables, modelApiCreationRequest.environmentVariables) &&
        Objects.equals(this.hardwareTierId, modelApiCreationRequest.hardwareTierId) &&
        Objects.equals(this.isAsync, modelApiCreationRequest.isAsync) &&
        Objects.equals(this.name, modelApiCreationRequest.name) &&
        Objects.equals(this.replicas, modelApiCreationRequest.replicas) &&
        Objects.equals(this.resourceQuotaId, modelApiCreationRequest.resourceQuotaId) &&
        Objects.equals(this.strictNodeAntiAffinity, modelApiCreationRequest.strictNodeAntiAffinity) &&
        Objects.equals(this.version, modelApiCreationRequest.version);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, environmentId, environmentVariables, hardwareTierId, isAsync, name, replicas, resourceQuotaId, strictNodeAntiAffinity, version);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ModelApiCreationRequest {\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    environmentId: ").append(toIndentedString(environmentId)).append("\n");
    sb.append("    environmentVariables: ").append(toIndentedString(environmentVariables)).append("\n");
    sb.append("    hardwareTierId: ").append(toIndentedString(hardwareTierId)).append("\n");
    sb.append("    isAsync: ").append(toIndentedString(isAsync)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    replicas: ").append(toIndentedString(replicas)).append("\n");
    sb.append("    resourceQuotaId: ").append(toIndentedString(resourceQuotaId)).append("\n");
    sb.append("    strictNodeAntiAffinity: ").append(toIndentedString(strictNodeAntiAffinity)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).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 `description` to the URL query string
    if (getDescription() != null) {
      joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

    // add `environmentVariables` to the URL query string
    if (getEnvironmentVariables() != null) {
      for (int i = 0; i < getEnvironmentVariables().size(); i++) {
        if (getEnvironmentVariables().get(i) != null) {
          joiner.add(getEnvironmentVariables().get(i).toUrlQueryString(String.format("%senvironmentVariables%s%s", prefix, suffix,
          "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

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

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

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

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

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

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

    // add `version` to the URL query string
    if (getVersion() != null) {
      joiner.add(getVersion().toUrlQueryString(prefix + "version" + suffix));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy