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

com.dominodatalab.pub.model.DataSourceEnvelopeV1 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.DataSourceCredentialTypeV1;
import com.dominodatalab.pub.model.DataSourcePermissionsV1;
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.time.OffsetDateTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * DataSourceEnvelopeV1
 */
@JsonPropertyOrder({
  DataSourceEnvelopeV1.JSON_PROPERTY_AUTH_TYPE,
  DataSourceEnvelopeV1.JSON_PROPERTY_CONFIG,
  DataSourceEnvelopeV1.JSON_PROPERTY_CREDENTIAL_TYPE,
  DataSourceEnvelopeV1.JSON_PROPERTY_DATA_SOURCE_TYPE,
  DataSourceEnvelopeV1.JSON_PROPERTY_DESCRIPTION,
  DataSourceEnvelopeV1.JSON_PROPERTY_DISPLAY_NAME,
  DataSourceEnvelopeV1.JSON_PROPERTY_ID,
  DataSourceEnvelopeV1.JSON_PROPERTY_LAST_UPDATED,
  DataSourceEnvelopeV1.JSON_PROPERTY_NAME,
  DataSourceEnvelopeV1.JSON_PROPERTY_OWNER_ID,
  DataSourceEnvelopeV1.JSON_PROPERTY_OWNER_USERNAME,
  DataSourceEnvelopeV1.JSON_PROPERTY_PERMISSIONS
})
@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 DataSourceEnvelopeV1 {
  public static final String JSON_PROPERTY_AUTH_TYPE = "authType";
  private String authType;

  public static final String JSON_PROPERTY_CONFIG = "config";
  private Map config = new HashMap<>();

  public static final String JSON_PROPERTY_CREDENTIAL_TYPE = "credentialType";
  private DataSourceCredentialTypeV1 credentialType;

  public static final String JSON_PROPERTY_DATA_SOURCE_TYPE = "dataSourceType";
  private String dataSourceType;

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

  public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName";
  private String displayName;

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

  public static final String JSON_PROPERTY_LAST_UPDATED = "lastUpdated";
  private OffsetDateTime lastUpdated;

  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_OWNER_USERNAME = "ownerUsername";
  private String ownerUsername;

  public static final String JSON_PROPERTY_PERMISSIONS = "permissions";
  private DataSourcePermissionsV1 permissions;

  public DataSourceEnvelopeV1() { 
  }

  public DataSourceEnvelopeV1 authType(String authType) {
    this.authType = authType;
    return this;
  }

  /**
   * The type of Data Source authentication
   * @return authType
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_AUTH_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getAuthType() {
    return authType;
  }


  @JsonProperty(JSON_PROPERTY_AUTH_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setAuthType(String authType) {
    this.authType = authType;
  }


  public DataSourceEnvelopeV1 config(Map config) {
    this.config = config;
    return this;
  }

  public DataSourceEnvelopeV1 putConfigItem(String key, String configItem) {
    if (this.config == null) {
      this.config = new HashMap<>();
    }
    this.config.put(key, configItem);
    return this;
  }

  /**
   * A map of configuration name -> value
   * @return config
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CONFIG)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Map getConfig() {
    return config;
  }


  @JsonProperty(JSON_PROPERTY_CONFIG)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setConfig(Map config) {
    this.config = config;
  }


  public DataSourceEnvelopeV1 credentialType(DataSourceCredentialTypeV1 credentialType) {
    this.credentialType = credentialType;
    return this;
  }

  /**
   * Get credentialType
   * @return credentialType
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CREDENTIAL_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public DataSourceCredentialTypeV1 getCredentialType() {
    return credentialType;
  }


  @JsonProperty(JSON_PROPERTY_CREDENTIAL_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCredentialType(DataSourceCredentialTypeV1 credentialType) {
    this.credentialType = credentialType;
  }


  public DataSourceEnvelopeV1 dataSourceType(String dataSourceType) {
    this.dataSourceType = dataSourceType;
    return this;
  }

  /**
   * The configuration type of the Data Source
   * @return dataSourceType
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DATA_SOURCE_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getDataSourceType() {
    return dataSourceType;
  }


  @JsonProperty(JSON_PROPERTY_DATA_SOURCE_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDataSourceType(String dataSourceType) {
    this.dataSourceType = dataSourceType;
  }


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

  /**
   * Description of the Data Source
   * @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 DataSourceEnvelopeV1 displayName(String displayName) {
    this.displayName = displayName;
    return this;
  }

  /**
   * Data Source display name
   * @return displayName
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DISPLAY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getDisplayName() {
    return displayName;
  }


  @JsonProperty(JSON_PROPERTY_DISPLAY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }


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

  /**
   * ID of the Data Source
   * @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 DataSourceEnvelopeV1 lastUpdated(OffsetDateTime lastUpdated) {
    this.lastUpdated = lastUpdated;
    return this;
  }

  /**
   * ISO 8601 formatted time of when the Data Source was last updated
   * @return lastUpdated
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_LAST_UPDATED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OffsetDateTime getLastUpdated() {
    return lastUpdated;
  }


  @JsonProperty(JSON_PROPERTY_LAST_UPDATED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setLastUpdated(OffsetDateTime lastUpdated) {
    this.lastUpdated = lastUpdated;
  }


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

  /**
   * User given name of the Data Source
   * @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 DataSourceEnvelopeV1 ownerId(String ownerId) {
    this.ownerId = ownerId;
    return this;
  }

  /**
   * ID of the Data Source owner
   * @return ownerId
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_OWNER_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getOwnerId() {
    return ownerId;
  }


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


  public DataSourceEnvelopeV1 ownerUsername(String ownerUsername) {
    this.ownerUsername = ownerUsername;
    return this;
  }

  /**
   * Username of the owner of the Data Source
   * @return ownerUsername
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_OWNER_USERNAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getOwnerUsername() {
    return ownerUsername;
  }


  @JsonProperty(JSON_PROPERTY_OWNER_USERNAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOwnerUsername(String ownerUsername) {
    this.ownerUsername = ownerUsername;
  }


  public DataSourceEnvelopeV1 permissions(DataSourcePermissionsV1 permissions) {
    this.permissions = permissions;
    return this;
  }

  /**
   * Get permissions
   * @return permissions
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_PERMISSIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public DataSourcePermissionsV1 getPermissions() {
    return permissions;
  }


  @JsonProperty(JSON_PROPERTY_PERMISSIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setPermissions(DataSourcePermissionsV1 permissions) {
    this.permissions = permissions;
  }


  /**
   * Return true if this DataSourceEnvelopeV1 object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DataSourceEnvelopeV1 dataSourceEnvelopeV1 = (DataSourceEnvelopeV1) o;
    return Objects.equals(this.authType, dataSourceEnvelopeV1.authType) &&
        Objects.equals(this.config, dataSourceEnvelopeV1.config) &&
        Objects.equals(this.credentialType, dataSourceEnvelopeV1.credentialType) &&
        Objects.equals(this.dataSourceType, dataSourceEnvelopeV1.dataSourceType) &&
        Objects.equals(this.description, dataSourceEnvelopeV1.description) &&
        Objects.equals(this.displayName, dataSourceEnvelopeV1.displayName) &&
        Objects.equals(this.id, dataSourceEnvelopeV1.id) &&
        Objects.equals(this.lastUpdated, dataSourceEnvelopeV1.lastUpdated) &&
        Objects.equals(this.name, dataSourceEnvelopeV1.name) &&
        Objects.equals(this.ownerId, dataSourceEnvelopeV1.ownerId) &&
        Objects.equals(this.ownerUsername, dataSourceEnvelopeV1.ownerUsername) &&
        Objects.equals(this.permissions, dataSourceEnvelopeV1.permissions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(authType, config, credentialType, dataSourceType, description, displayName, id, lastUpdated, name, ownerId, ownerUsername, permissions);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DataSourceEnvelopeV1 {\n");
    sb.append("    authType: ").append(toIndentedString(authType)).append("\n");
    sb.append("    config: ").append(toIndentedString(config)).append("\n");
    sb.append("    credentialType: ").append(toIndentedString(credentialType)).append("\n");
    sb.append("    dataSourceType: ").append(toIndentedString(dataSourceType)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    displayName: ").append(toIndentedString(displayName)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    ownerId: ").append(toIndentedString(ownerId)).append("\n");
    sb.append("    ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n");
    sb.append("    permissions: ").append(toIndentedString(permissions)).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 `authType` to the URL query string
    if (getAuthType() != null) {
      joiner.add(String.format("%sauthType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAuthType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `config` to the URL query string
    if (getConfig() != null) {
      for (String _key : getConfig().keySet()) {
        joiner.add(String.format("%sconfig%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
            getConfig().get(_key), URLEncoder.encode(ApiClient.valueToString(getConfig().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

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

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

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

    // add `lastUpdated` to the URL query string
    if (getLastUpdated() != null) {
      joiner.add(String.format("%slastUpdated%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLastUpdated()), 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 `ownerUsername` to the URL query string
    if (getOwnerUsername() != null) {
      joiner.add(String.format("%sownerUsername%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOwnerUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy