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

com.dominodatalab.api.model.DominoDatasetApiDatasetDto 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.DominoCommonProjectId;
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;


/**
 * DominoDatasetApiDatasetDto
 */
@JsonPropertyOrder({
  DominoDatasetApiDatasetDto.JSON_PROPERTY_ARCHIVED,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_CREATED,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_SNAPSHOT_IDS,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_NAME,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_DESCRIPTION,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_ID,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_PROJECT_ID,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_STUPID_PROJECT_ID,
  DominoDatasetApiDatasetDto.JSON_PROPERTY_TAGS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoDatasetApiDatasetDto {
  public static final String JSON_PROPERTY_ARCHIVED = "archived";
  private Boolean archived;

  public static final String JSON_PROPERTY_CREATED = "created";
  private Long created;

  public static final String JSON_PROPERTY_SNAPSHOT_IDS = "snapshotIds";
  private List snapshotIds = new ArrayList<>();

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

  public static final String JSON_PROPERTY_DESCRIPTION = "description";
  private String description;

  public static final String JSON_PROPERTY_ID = "id";
  private String id;

  public static final String JSON_PROPERTY_PROJECT_ID = "projectId";
  private String projectId;

  public static final String JSON_PROPERTY_STUPID_PROJECT_ID = "stupidProjectId";
  private DominoCommonProjectId stupidProjectId;

  public static final String JSON_PROPERTY_TAGS = "tags";
  private Object tags;

  public DominoDatasetApiDatasetDto() { 
  }

  public DominoDatasetApiDatasetDto archived(Boolean archived) {
    this.archived = archived;
    return this;
  }

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

  public Boolean getArchived() {
    return archived;
  }


  @JsonProperty(JSON_PROPERTY_ARCHIVED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setArchived(Boolean archived) {
    this.archived = archived;
  }


  public DominoDatasetApiDatasetDto created(Long created) {
    this.created = created;
    return this;
  }

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

  public Long getCreated() {
    return created;
  }


  @JsonProperty(JSON_PROPERTY_CREATED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCreated(Long created) {
    this.created = created;
  }


  public DominoDatasetApiDatasetDto snapshotIds(List snapshotIds) {
    this.snapshotIds = snapshotIds;
    return this;
  }

  public DominoDatasetApiDatasetDto addSnapshotIdsItem(String snapshotIdsItem) {
    if (this.snapshotIds == null) {
      this.snapshotIds = new ArrayList<>();
    }
    this.snapshotIds.add(snapshotIdsItem);
    return this;
  }

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

  public List getSnapshotIds() {
    return snapshotIds;
  }


  @JsonProperty(JSON_PROPERTY_SNAPSHOT_IDS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSnapshotIds(List snapshotIds) {
    this.snapshotIds = snapshotIds;
  }


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

   /**
   * Get name
   * @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 DominoDatasetApiDatasetDto description(String description) {
    this.description = description;
    return this;
  }

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

  public String getDescription() {
    return description;
  }


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


  public DominoDatasetApiDatasetDto id(String id) {
    this.id = id;
    return this;
  }

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

  public String getId() {
    return id;
  }


  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setId(String id) {
    this.id = id;
  }


  public DominoDatasetApiDatasetDto projectId(String projectId) {
    this.projectId = projectId;
    return this;
  }

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

  public String getProjectId() {
    return projectId;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setProjectId(String projectId) {
    this.projectId = projectId;
  }


  public DominoDatasetApiDatasetDto stupidProjectId(DominoCommonProjectId stupidProjectId) {
    this.stupidProjectId = stupidProjectId;
    return this;
  }

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

  public DominoCommonProjectId getStupidProjectId() {
    return stupidProjectId;
  }


  @JsonProperty(JSON_PROPERTY_STUPID_PROJECT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setStupidProjectId(DominoCommonProjectId stupidProjectId) {
    this.stupidProjectId = stupidProjectId;
  }


  public DominoDatasetApiDatasetDto tags(Object tags) {
    this.tags = tags;
    return this;
  }

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

  public Object getTags() {
    return tags;
  }


  @JsonProperty(JSON_PROPERTY_TAGS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTags(Object tags) {
    this.tags = tags;
  }


  /**
   * Return true if this domino.dataset.api.DatasetDto object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoDatasetApiDatasetDto dominoDatasetApiDatasetDto = (DominoDatasetApiDatasetDto) o;
    return Objects.equals(this.archived, dominoDatasetApiDatasetDto.archived) &&
        Objects.equals(this.created, dominoDatasetApiDatasetDto.created) &&
        Objects.equals(this.snapshotIds, dominoDatasetApiDatasetDto.snapshotIds) &&
        Objects.equals(this.name, dominoDatasetApiDatasetDto.name) &&
        Objects.equals(this.description, dominoDatasetApiDatasetDto.description) &&
        Objects.equals(this.id, dominoDatasetApiDatasetDto.id) &&
        Objects.equals(this.projectId, dominoDatasetApiDatasetDto.projectId) &&
        Objects.equals(this.stupidProjectId, dominoDatasetApiDatasetDto.stupidProjectId) &&
        Objects.equals(this.tags, dominoDatasetApiDatasetDto.tags);
  }

  @Override
  public int hashCode() {
    return Objects.hash(archived, created, snapshotIds, name, description, id, projectId, stupidProjectId, tags);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoDatasetApiDatasetDto {\n");
    sb.append("    archived: ").append(toIndentedString(archived)).append("\n");
    sb.append("    created: ").append(toIndentedString(created)).append("\n");
    sb.append("    snapshotIds: ").append(toIndentedString(snapshotIds)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    projectId: ").append(toIndentedString(projectId)).append("\n");
    sb.append("    stupidProjectId: ").append(toIndentedString(stupidProjectId)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).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 `archived` to the URL query string
    if (getArchived() != null) {
      joiner.add(String.format("%sarchived%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getArchived()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

    // add `snapshotIds` to the URL query string
    if (getSnapshotIds() != null) {
      for (int i = 0; i < getSnapshotIds().size(); i++) {
        joiner.add(String.format("%ssnapshotIds%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(String.valueOf(getSnapshotIds().get(i)), 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(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

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

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

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

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

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy