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

com.dominodatalab.api.model.DominoFeaturestoreApiFeatureStoreDto 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.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.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


/**
 * DominoFeaturestoreApiFeatureStoreDto
 */
@JsonPropertyOrder({
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_ID,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_OWNER_ID,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_CREATION_TIME,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_OFFLINE_STORE_TYPE,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_OFFLINE_STORE_CONFIG,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_ONLINE_STORE_TYPE,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_ONLINE_STORE_CONFIG,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_GIT_REPO,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_GIT_SERVICE_PROVIDER,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_GIT_COMMIT_HASH,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_PROJECT_IDS,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_LAST_UPDATED_TIME,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_STATUS,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_SYNC_STATUS,
  DominoFeaturestoreApiFeatureStoreDto.JSON_PROPERTY_RUN_ID
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoFeaturestoreApiFeatureStoreDto {
  public static final String JSON_PROPERTY_ID = "id";
  private String id;

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

  public static final String JSON_PROPERTY_CREATION_TIME = "creationTime";
  private OffsetDateTime creationTime;

  /**
   * Gets or Sets offlineStoreType
   */
  public enum OfflineStoreTypeEnum {
    FILE("File"),
    
    BIGQUERY("BigQuery"),
    
    REDSHIFT("Redshift"),
    
    SNOWFLAKE("Snowflake");

    private String value;

    OfflineStoreTypeEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static OfflineStoreTypeEnum fromValue(String value) {
      for (OfflineStoreTypeEnum b : OfflineStoreTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_OFFLINE_STORE_TYPE = "offlineStoreType";
  private OfflineStoreTypeEnum offlineStoreType;

  public static final String JSON_PROPERTY_OFFLINE_STORE_CONFIG = "offlineStoreConfig";
  private Map offlineStoreConfig = new HashMap<>();

  /**
   * Gets or Sets onlineStoreType
   */
  public enum OnlineStoreTypeEnum {
    SNOWFLAKE("Snowflake"),
    
    DYNAMODB("DynamoDB"),
    
    REDIS("Redis"),
    
    DATASTORE("Datastore"),
    
    BIGTABLE("Bigtable"),
    
    SQLITE("SQLite");

    private String value;

    OnlineStoreTypeEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static OnlineStoreTypeEnum fromValue(String value) {
      for (OnlineStoreTypeEnum b : OnlineStoreTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_ONLINE_STORE_TYPE = "onlineStoreType";
  private OnlineStoreTypeEnum onlineStoreType;

  public static final String JSON_PROPERTY_ONLINE_STORE_CONFIG = "onlineStoreConfig";
  private Map onlineStoreConfig = new HashMap<>();

  public static final String JSON_PROPERTY_GIT_REPO = "gitRepo";
  private String gitRepo;

  /**
   * Gets or Sets gitServiceProvider
   */
  public enum GitServiceProviderEnum {
    GITHUB("github"),
    
    GITLAB("gitlab"),
    
    GITHUBENTERPRISE("githubEnterprise"),
    
    UNKNOWN("unknown"),
    
    GITLABENTERPRISE("gitlabEnterprise"),
    
    BITBUCKET("bitbucket"),
    
    BITBUCKETSERVER("bitbucketServer");

    private String value;

    GitServiceProviderEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static GitServiceProviderEnum fromValue(String value) {
      for (GitServiceProviderEnum b : GitServiceProviderEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_GIT_SERVICE_PROVIDER = "gitServiceProvider";
  private GitServiceProviderEnum gitServiceProvider;

  public static final String JSON_PROPERTY_GIT_COMMIT_HASH = "gitCommitHash";
  private String gitCommitHash;

  public static final String JSON_PROPERTY_PROJECT_IDS = "projectIds";
  private List projectIds = new ArrayList<>();

  public static final String JSON_PROPERTY_LAST_UPDATED_TIME = "lastUpdatedTime";
  private OffsetDateTime lastUpdatedTime;

  /**
   * Gets or Sets status
   */
  public enum StatusEnum {
    ACTIVE("Active"),
    
    DELETED("Deleted");

    private String value;

    StatusEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static StatusEnum fromValue(String value) {
      for (StatusEnum b : StatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_STATUS = "status";
  private StatusEnum status;

  /**
   * Gets or Sets syncStatus
   */
  public enum SyncStatusEnum {
    SUCCESSFUL("Successful"),
    
    FAILED("Failed"),
    
    INPROGRESS("InProgress");

    private String value;

    SyncStatusEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static SyncStatusEnum fromValue(String value) {
      for (SyncStatusEnum b : SyncStatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_SYNC_STATUS = "syncStatus";
  private SyncStatusEnum syncStatus;

  public static final String JSON_PROPERTY_RUN_ID = "runId";
  private String runId;

  public DominoFeaturestoreApiFeatureStoreDto() { 
  }

  public DominoFeaturestoreApiFeatureStoreDto 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 DominoFeaturestoreApiFeatureStoreDto ownerId(String ownerId) {
    this.ownerId = ownerId;
    return this;
  }

   /**
   * Get ownerId
   * @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 DominoFeaturestoreApiFeatureStoreDto creationTime(OffsetDateTime creationTime) {
    this.creationTime = creationTime;
    return this;
  }

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

  public OffsetDateTime getCreationTime() {
    return creationTime;
  }


  @JsonProperty(JSON_PROPERTY_CREATION_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCreationTime(OffsetDateTime creationTime) {
    this.creationTime = creationTime;
  }


  public DominoFeaturestoreApiFeatureStoreDto offlineStoreType(OfflineStoreTypeEnum offlineStoreType) {
    this.offlineStoreType = offlineStoreType;
    return this;
  }

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

  public OfflineStoreTypeEnum getOfflineStoreType() {
    return offlineStoreType;
  }


  @JsonProperty(JSON_PROPERTY_OFFLINE_STORE_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOfflineStoreType(OfflineStoreTypeEnum offlineStoreType) {
    this.offlineStoreType = offlineStoreType;
  }


  public DominoFeaturestoreApiFeatureStoreDto offlineStoreConfig(Map offlineStoreConfig) {
    this.offlineStoreConfig = offlineStoreConfig;
    return this;
  }

  public DominoFeaturestoreApiFeatureStoreDto putOfflineStoreConfigItem(String key, String offlineStoreConfigItem) {
    if (this.offlineStoreConfig == null) {
      this.offlineStoreConfig = new HashMap<>();
    }
    this.offlineStoreConfig.put(key, offlineStoreConfigItem);
    return this;
  }

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

  public Map getOfflineStoreConfig() {
    return offlineStoreConfig;
  }


  @JsonProperty(JSON_PROPERTY_OFFLINE_STORE_CONFIG)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOfflineStoreConfig(Map offlineStoreConfig) {
    this.offlineStoreConfig = offlineStoreConfig;
  }


  public DominoFeaturestoreApiFeatureStoreDto onlineStoreType(OnlineStoreTypeEnum onlineStoreType) {
    this.onlineStoreType = onlineStoreType;
    return this;
  }

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

  public OnlineStoreTypeEnum getOnlineStoreType() {
    return onlineStoreType;
  }


  @JsonProperty(JSON_PROPERTY_ONLINE_STORE_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOnlineStoreType(OnlineStoreTypeEnum onlineStoreType) {
    this.onlineStoreType = onlineStoreType;
  }


  public DominoFeaturestoreApiFeatureStoreDto onlineStoreConfig(Map onlineStoreConfig) {
    this.onlineStoreConfig = onlineStoreConfig;
    return this;
  }

  public DominoFeaturestoreApiFeatureStoreDto putOnlineStoreConfigItem(String key, String onlineStoreConfigItem) {
    if (this.onlineStoreConfig == null) {
      this.onlineStoreConfig = new HashMap<>();
    }
    this.onlineStoreConfig.put(key, onlineStoreConfigItem);
    return this;
  }

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

  public Map getOnlineStoreConfig() {
    return onlineStoreConfig;
  }


  @JsonProperty(JSON_PROPERTY_ONLINE_STORE_CONFIG)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOnlineStoreConfig(Map onlineStoreConfig) {
    this.onlineStoreConfig = onlineStoreConfig;
  }


  public DominoFeaturestoreApiFeatureStoreDto gitRepo(String gitRepo) {
    this.gitRepo = gitRepo;
    return this;
  }

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

  public String getGitRepo() {
    return gitRepo;
  }


  @JsonProperty(JSON_PROPERTY_GIT_REPO)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setGitRepo(String gitRepo) {
    this.gitRepo = gitRepo;
  }


  public DominoFeaturestoreApiFeatureStoreDto gitServiceProvider(GitServiceProviderEnum gitServiceProvider) {
    this.gitServiceProvider = gitServiceProvider;
    return this;
  }

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

  public GitServiceProviderEnum getGitServiceProvider() {
    return gitServiceProvider;
  }


  @JsonProperty(JSON_PROPERTY_GIT_SERVICE_PROVIDER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setGitServiceProvider(GitServiceProviderEnum gitServiceProvider) {
    this.gitServiceProvider = gitServiceProvider;
  }


  public DominoFeaturestoreApiFeatureStoreDto gitCommitHash(String gitCommitHash) {
    this.gitCommitHash = gitCommitHash;
    return this;
  }

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

  public String getGitCommitHash() {
    return gitCommitHash;
  }


  @JsonProperty(JSON_PROPERTY_GIT_COMMIT_HASH)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setGitCommitHash(String gitCommitHash) {
    this.gitCommitHash = gitCommitHash;
  }


  public DominoFeaturestoreApiFeatureStoreDto projectIds(List projectIds) {
    this.projectIds = projectIds;
    return this;
  }

  public DominoFeaturestoreApiFeatureStoreDto addProjectIdsItem(String projectIdsItem) {
    if (this.projectIds == null) {
      this.projectIds = new ArrayList<>();
    }
    this.projectIds.add(projectIdsItem);
    return this;
  }

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

  public List getProjectIds() {
    return projectIds;
  }


  @JsonProperty(JSON_PROPERTY_PROJECT_IDS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setProjectIds(List projectIds) {
    this.projectIds = projectIds;
  }


  public DominoFeaturestoreApiFeatureStoreDto lastUpdatedTime(OffsetDateTime lastUpdatedTime) {
    this.lastUpdatedTime = lastUpdatedTime;
    return this;
  }

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

  public OffsetDateTime getLastUpdatedTime() {
    return lastUpdatedTime;
  }


  @JsonProperty(JSON_PROPERTY_LAST_UPDATED_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setLastUpdatedTime(OffsetDateTime lastUpdatedTime) {
    this.lastUpdatedTime = lastUpdatedTime;
  }


  public DominoFeaturestoreApiFeatureStoreDto status(StatusEnum status) {
    this.status = status;
    return this;
  }

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

  public StatusEnum getStatus() {
    return status;
  }


  @JsonProperty(JSON_PROPERTY_STATUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setStatus(StatusEnum status) {
    this.status = status;
  }


  public DominoFeaturestoreApiFeatureStoreDto syncStatus(SyncStatusEnum syncStatus) {
    this.syncStatus = syncStatus;
    return this;
  }

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

  public SyncStatusEnum getSyncStatus() {
    return syncStatus;
  }


  @JsonProperty(JSON_PROPERTY_SYNC_STATUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSyncStatus(SyncStatusEnum syncStatus) {
    this.syncStatus = syncStatus;
  }


  public DominoFeaturestoreApiFeatureStoreDto runId(String runId) {
    this.runId = runId;
    return this;
  }

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

  public String getRunId() {
    return runId;
  }


  @JsonProperty(JSON_PROPERTY_RUN_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRunId(String runId) {
    this.runId = runId;
  }


  /**
   * Return true if this domino.featurestore.api.FeatureStoreDto object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoFeaturestoreApiFeatureStoreDto dominoFeaturestoreApiFeatureStoreDto = (DominoFeaturestoreApiFeatureStoreDto) o;
    return Objects.equals(this.id, dominoFeaturestoreApiFeatureStoreDto.id) &&
        Objects.equals(this.ownerId, dominoFeaturestoreApiFeatureStoreDto.ownerId) &&
        Objects.equals(this.creationTime, dominoFeaturestoreApiFeatureStoreDto.creationTime) &&
        Objects.equals(this.offlineStoreType, dominoFeaturestoreApiFeatureStoreDto.offlineStoreType) &&
        Objects.equals(this.offlineStoreConfig, dominoFeaturestoreApiFeatureStoreDto.offlineStoreConfig) &&
        Objects.equals(this.onlineStoreType, dominoFeaturestoreApiFeatureStoreDto.onlineStoreType) &&
        Objects.equals(this.onlineStoreConfig, dominoFeaturestoreApiFeatureStoreDto.onlineStoreConfig) &&
        Objects.equals(this.gitRepo, dominoFeaturestoreApiFeatureStoreDto.gitRepo) &&
        Objects.equals(this.gitServiceProvider, dominoFeaturestoreApiFeatureStoreDto.gitServiceProvider) &&
        Objects.equals(this.gitCommitHash, dominoFeaturestoreApiFeatureStoreDto.gitCommitHash) &&
        Objects.equals(this.projectIds, dominoFeaturestoreApiFeatureStoreDto.projectIds) &&
        Objects.equals(this.lastUpdatedTime, dominoFeaturestoreApiFeatureStoreDto.lastUpdatedTime) &&
        Objects.equals(this.status, dominoFeaturestoreApiFeatureStoreDto.status) &&
        Objects.equals(this.syncStatus, dominoFeaturestoreApiFeatureStoreDto.syncStatus) &&
        Objects.equals(this.runId, dominoFeaturestoreApiFeatureStoreDto.runId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, ownerId, creationTime, offlineStoreType, offlineStoreConfig, onlineStoreType, onlineStoreConfig, gitRepo, gitServiceProvider, gitCommitHash, projectIds, lastUpdatedTime, status, syncStatus, runId);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoFeaturestoreApiFeatureStoreDto {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    ownerId: ").append(toIndentedString(ownerId)).append("\n");
    sb.append("    creationTime: ").append(toIndentedString(creationTime)).append("\n");
    sb.append("    offlineStoreType: ").append(toIndentedString(offlineStoreType)).append("\n");
    sb.append("    offlineStoreConfig: ").append(toIndentedString(offlineStoreConfig)).append("\n");
    sb.append("    onlineStoreType: ").append(toIndentedString(onlineStoreType)).append("\n");
    sb.append("    onlineStoreConfig: ").append(toIndentedString(onlineStoreConfig)).append("\n");
    sb.append("    gitRepo: ").append(toIndentedString(gitRepo)).append("\n");
    sb.append("    gitServiceProvider: ").append(toIndentedString(gitServiceProvider)).append("\n");
    sb.append("    gitCommitHash: ").append(toIndentedString(gitCommitHash)).append("\n");
    sb.append("    projectIds: ").append(toIndentedString(projectIds)).append("\n");
    sb.append("    lastUpdatedTime: ").append(toIndentedString(lastUpdatedTime)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    syncStatus: ").append(toIndentedString(syncStatus)).append("\n");
    sb.append("    runId: ").append(toIndentedString(runId)).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 `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 `ownerId` to the URL query string
    if (getOwnerId() != null) {
      joiner.add(String.format("%sownerId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOwnerId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

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

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

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

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

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

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

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

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

    // add `projectIds` to the URL query string
    if (getProjectIds() != null) {
      for (int i = 0; i < getProjectIds().size(); i++) {
        joiner.add(String.format("%sprojectIds%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(String.valueOf(getProjectIds().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

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

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

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

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

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy