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

com.dominodatalab.pub.model.CopyProjectSpecV1 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.BillingTagV1;
import com.dominodatalab.pub.model.GitCodeRepoSpecV1;
import com.dominodatalab.pub.model.ProjectVisibilityV1;
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;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * CopyProjectSpecV1
 */
@JsonPropertyOrder({
  CopyProjectSpecV1.JSON_PROPERTY_BILLING_TAG,
  CopyProjectSpecV1.JSON_PROPERTY_COPY_DATASETS,
  CopyProjectSpecV1.JSON_PROPERTY_GIT_CODE_REPO_SPEC,
  CopyProjectSpecV1.JSON_PROPERTY_IMPORTED_GIT_REPOS_CREDENTIAL_ID,
  CopyProjectSpecV1.JSON_PROPERTY_NAME,
  CopyProjectSpecV1.JSON_PROPERTY_OWNER_ID,
  CopyProjectSpecV1.JSON_PROPERTY_VISIBILITY
})
@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 CopyProjectSpecV1 {
  public static final String JSON_PROPERTY_BILLING_TAG = "billingTag";
  private BillingTagV1 billingTag;

  public static final String JSON_PROPERTY_COPY_DATASETS = "copyDatasets";
  private Boolean copyDatasets;

  public static final String JSON_PROPERTY_GIT_CODE_REPO_SPEC = "gitCodeRepoSpec";
  private GitCodeRepoSpecV1 gitCodeRepoSpec;

  public static final String JSON_PROPERTY_IMPORTED_GIT_REPOS_CREDENTIAL_ID = "importedGitReposCredentialId";
  private String importedGitReposCredentialId;

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

  public static final String JSON_PROPERTY_OWNER_ID = "ownerId";
  private String ownerId;

  public static final String JSON_PROPERTY_VISIBILITY = "visibility";
  private ProjectVisibilityV1 visibility;

  public CopyProjectSpecV1() { 
  }

  public CopyProjectSpecV1 billingTag(BillingTagV1 billingTag) {
    this.billingTag = billingTag;
    return this;
  }

  /**
   * Get billingTag
   * @return billingTag
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_BILLING_TAG)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public BillingTagV1 getBillingTag() {
    return billingTag;
  }


  @JsonProperty(JSON_PROPERTY_BILLING_TAG)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setBillingTag(BillingTagV1 billingTag) {
    this.billingTag = billingTag;
  }


  public CopyProjectSpecV1 copyDatasets(Boolean copyDatasets) {
    this.copyDatasets = copyDatasets;
    return this;
  }

  /**
   * Whether to copy the Project's datasets or not
   * @return copyDatasets
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_COPY_DATASETS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Boolean getCopyDatasets() {
    return copyDatasets;
  }


  @JsonProperty(JSON_PROPERTY_COPY_DATASETS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCopyDatasets(Boolean copyDatasets) {
    this.copyDatasets = copyDatasets;
  }


  public CopyProjectSpecV1 gitCodeRepoSpec(GitCodeRepoSpecV1 gitCodeRepoSpec) {
    this.gitCodeRepoSpec = gitCodeRepoSpec;
    return this;
  }

  /**
   * Get gitCodeRepoSpec
   * @return gitCodeRepoSpec
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_GIT_CODE_REPO_SPEC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public GitCodeRepoSpecV1 getGitCodeRepoSpec() {
    return gitCodeRepoSpec;
  }


  @JsonProperty(JSON_PROPERTY_GIT_CODE_REPO_SPEC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setGitCodeRepoSpec(GitCodeRepoSpecV1 gitCodeRepoSpec) {
    this.gitCodeRepoSpec = gitCodeRepoSpec;
  }


  public CopyProjectSpecV1 importedGitReposCredentialId(String importedGitReposCredentialId) {
    this.importedGitReposCredentialId = importedGitReposCredentialId;
    return this;
  }

  /**
   * The Domino ID of the PAT credential, which will be used to access the Imported Git Repos on the new project.
   * @return importedGitReposCredentialId
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_IMPORTED_GIT_REPOS_CREDENTIAL_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getImportedGitReposCredentialId() {
    return importedGitReposCredentialId;
  }


  @JsonProperty(JSON_PROPERTY_IMPORTED_GIT_REPOS_CREDENTIAL_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setImportedGitReposCredentialId(String importedGitReposCredentialId) {
    this.importedGitReposCredentialId = importedGitReposCredentialId;
  }


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

  /**
   * The name of the new Domino Project.
   * @return name
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getName() {
    return name;
  }


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


  public CopyProjectSpecV1 ownerId(String ownerId) {
    this.ownerId = ownerId;
    return this;
  }

  /**
   * The Domino ID of owner of the copied project.
   * @return ownerId
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_OWNER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public String getOwnerId() {
    return ownerId;
  }


  @JsonProperty(JSON_PROPERTY_OWNER_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOwnerId(String ownerId) {
    this.ownerId = ownerId;
  }


  public CopyProjectSpecV1 visibility(ProjectVisibilityV1 visibility) {
    this.visibility = visibility;
    return this;
  }

  /**
   * Get visibility
   * @return visibility
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_VISIBILITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public ProjectVisibilityV1 getVisibility() {
    return visibility;
  }


  @JsonProperty(JSON_PROPERTY_VISIBILITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setVisibility(ProjectVisibilityV1 visibility) {
    this.visibility = visibility;
  }


  /**
   * Return true if this CopyProjectSpecV1 object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CopyProjectSpecV1 copyProjectSpecV1 = (CopyProjectSpecV1) o;
    return Objects.equals(this.billingTag, copyProjectSpecV1.billingTag) &&
        Objects.equals(this.copyDatasets, copyProjectSpecV1.copyDatasets) &&
        Objects.equals(this.gitCodeRepoSpec, copyProjectSpecV1.gitCodeRepoSpec) &&
        Objects.equals(this.importedGitReposCredentialId, copyProjectSpecV1.importedGitReposCredentialId) &&
        Objects.equals(this.name, copyProjectSpecV1.name) &&
        Objects.equals(this.ownerId, copyProjectSpecV1.ownerId) &&
        Objects.equals(this.visibility, copyProjectSpecV1.visibility);
  }

  @Override
  public int hashCode() {
    return Objects.hash(billingTag, copyDatasets, gitCodeRepoSpec, importedGitReposCredentialId, name, ownerId, visibility);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CopyProjectSpecV1 {\n");
    sb.append("    billingTag: ").append(toIndentedString(billingTag)).append("\n");
    sb.append("    copyDatasets: ").append(toIndentedString(copyDatasets)).append("\n");
    sb.append("    gitCodeRepoSpec: ").append(toIndentedString(gitCodeRepoSpec)).append("\n");
    sb.append("    importedGitReposCredentialId: ").append(toIndentedString(importedGitReposCredentialId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    ownerId: ").append(toIndentedString(ownerId)).append("\n");
    sb.append("    visibility: ").append(toIndentedString(visibility)).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 `billingTag` to the URL query string
    if (getBillingTag() != null) {
      joiner.add(getBillingTag().toUrlQueryString(prefix + "billingTag" + suffix));
    }

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

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

    // add `importedGitReposCredentialId` to the URL query string
    if (getImportedGitReposCredentialId() != null) {
      joiner.add(String.format("%simportedGitReposCredentialId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getImportedGitReposCredentialId()), 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 `ownerId` to the URL query string
    if (getOwnerId() != null) {
      joiner.add(String.format("%sownerId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOwnerId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy