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

com.dominodatalab.api.model.DominoProvenanceApiProvenanceEnvironmentVariablesMap 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.DominoProjectsApiProjectEnvVarVersion;
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;


/**
 * DominoProvenanceApiProvenanceEnvironmentVariablesMap
 */
@JsonPropertyOrder({
  DominoProvenanceApiProvenanceEnvironmentVariablesMap.JSON_PROPERTY_PROJECT_ENV_VAR_BLOB_KEYS,
  DominoProvenanceApiProvenanceEnvironmentVariablesMap.JSON_PROPERTY_USER_ENV_VAR_BLOB_KEY,
  DominoProvenanceApiProvenanceEnvironmentVariablesMap.JSON_PROPERTY_PROJECT_VAR_VERSIONS,
  DominoProvenanceApiProvenanceEnvironmentVariablesMap.JSON_PROPERTY_USER_VAR_VERSION
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoProvenanceApiProvenanceEnvironmentVariablesMap {
  public static final String JSON_PROPERTY_PROJECT_ENV_VAR_BLOB_KEYS = "projectEnvVarBlobKeys";
  private List projectEnvVarBlobKeys = new ArrayList<>();

  public static final String JSON_PROPERTY_USER_ENV_VAR_BLOB_KEY = "userEnvVarBlobKey";
  private String userEnvVarBlobKey;

  public static final String JSON_PROPERTY_PROJECT_VAR_VERSIONS = "projectVarVersions";
  private List projectVarVersions = new ArrayList<>();

  public static final String JSON_PROPERTY_USER_VAR_VERSION = "userVarVersion";
  private Integer userVarVersion;

  public DominoProvenanceApiProvenanceEnvironmentVariablesMap() { 
  }

  public DominoProvenanceApiProvenanceEnvironmentVariablesMap projectEnvVarBlobKeys(List projectEnvVarBlobKeys) {
    this.projectEnvVarBlobKeys = projectEnvVarBlobKeys;
    return this;
  }

  public DominoProvenanceApiProvenanceEnvironmentVariablesMap addProjectEnvVarBlobKeysItem(String projectEnvVarBlobKeysItem) {
    if (this.projectEnvVarBlobKeys == null) {
      this.projectEnvVarBlobKeys = new ArrayList<>();
    }
    this.projectEnvVarBlobKeys.add(projectEnvVarBlobKeysItem);
    return this;
  }

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

  public List getProjectEnvVarBlobKeys() {
    return projectEnvVarBlobKeys;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_ENV_VAR_BLOB_KEYS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setProjectEnvVarBlobKeys(List projectEnvVarBlobKeys) {
    this.projectEnvVarBlobKeys = projectEnvVarBlobKeys;
  }


  public DominoProvenanceApiProvenanceEnvironmentVariablesMap userEnvVarBlobKey(String userEnvVarBlobKey) {
    this.userEnvVarBlobKey = userEnvVarBlobKey;
    return this;
  }

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

  public String getUserEnvVarBlobKey() {
    return userEnvVarBlobKey;
  }


  @JsonProperty(JSON_PROPERTY_USER_ENV_VAR_BLOB_KEY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUserEnvVarBlobKey(String userEnvVarBlobKey) {
    this.userEnvVarBlobKey = userEnvVarBlobKey;
  }


  public DominoProvenanceApiProvenanceEnvironmentVariablesMap projectVarVersions(List projectVarVersions) {
    this.projectVarVersions = projectVarVersions;
    return this;
  }

  public DominoProvenanceApiProvenanceEnvironmentVariablesMap addProjectVarVersionsItem(DominoProjectsApiProjectEnvVarVersion projectVarVersionsItem) {
    if (this.projectVarVersions == null) {
      this.projectVarVersions = new ArrayList<>();
    }
    this.projectVarVersions.add(projectVarVersionsItem);
    return this;
  }

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

  public List getProjectVarVersions() {
    return projectVarVersions;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_VAR_VERSIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setProjectVarVersions(List projectVarVersions) {
    this.projectVarVersions = projectVarVersions;
  }


  public DominoProvenanceApiProvenanceEnvironmentVariablesMap userVarVersion(Integer userVarVersion) {
    this.userVarVersion = userVarVersion;
    return this;
  }

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

  public Integer getUserVarVersion() {
    return userVarVersion;
  }


  @JsonProperty(JSON_PROPERTY_USER_VAR_VERSION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setUserVarVersion(Integer userVarVersion) {
    this.userVarVersion = userVarVersion;
  }


  /**
   * Return true if this domino.provenance.api.ProvenanceEnvironmentVariablesMap object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoProvenanceApiProvenanceEnvironmentVariablesMap dominoProvenanceApiProvenanceEnvironmentVariablesMap = (DominoProvenanceApiProvenanceEnvironmentVariablesMap) o;
    return Objects.equals(this.projectEnvVarBlobKeys, dominoProvenanceApiProvenanceEnvironmentVariablesMap.projectEnvVarBlobKeys) &&
        Objects.equals(this.userEnvVarBlobKey, dominoProvenanceApiProvenanceEnvironmentVariablesMap.userEnvVarBlobKey) &&
        Objects.equals(this.projectVarVersions, dominoProvenanceApiProvenanceEnvironmentVariablesMap.projectVarVersions) &&
        Objects.equals(this.userVarVersion, dominoProvenanceApiProvenanceEnvironmentVariablesMap.userVarVersion);
  }

  @Override
  public int hashCode() {
    return Objects.hash(projectEnvVarBlobKeys, userEnvVarBlobKey, projectVarVersions, userVarVersion);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoProvenanceApiProvenanceEnvironmentVariablesMap {\n");
    sb.append("    projectEnvVarBlobKeys: ").append(toIndentedString(projectEnvVarBlobKeys)).append("\n");
    sb.append("    userEnvVarBlobKey: ").append(toIndentedString(userEnvVarBlobKey)).append("\n");
    sb.append("    projectVarVersions: ").append(toIndentedString(projectVarVersions)).append("\n");
    sb.append("    userVarVersion: ").append(toIndentedString(userVarVersion)).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 `projectEnvVarBlobKeys` to the URL query string
    if (getProjectEnvVarBlobKeys() != null) {
      for (int i = 0; i < getProjectEnvVarBlobKeys().size(); i++) {
        joiner.add(String.format("%sprojectEnvVarBlobKeys%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(String.valueOf(getProjectEnvVarBlobKeys().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

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

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

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

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy