/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package com.cloudera.api.swagger.model;

import java.util.Objects;
import com.cloudera.api.swagger.model.ApiHdfsReplicationArguments;
import com.cloudera.api.swagger.model.ApiHiveReplicationArguments;
import com.cloudera.api.swagger.model.ApiHiveTable;
import com.cloudera.api.swagger.model.ApiServiceRef;
import com.cloudera.api.swagger.model.ReplicationOption;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Replication arguments for Hive services.
 */
@ApiModel(description = "Replication arguments for Hive services.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiHiveCloudReplicationArguments {
  @SerializedName("sourceService")
  private ApiServiceRef sourceService = null;

  @SerializedName("tableFilters")
  private List<ApiHiveTable> tableFilters = null;

  @SerializedName("exportDir")
  private String exportDir = null;

  @SerializedName("force")
  private Boolean force = null;

  @SerializedName("replicateData")
  private Boolean replicateData = null;

  @SerializedName("hdfsArguments")
  private ApiHdfsReplicationArguments hdfsArguments = null;

  @SerializedName("replicateImpalaMetadata")
  private Boolean replicateImpalaMetadata = null;

  @SerializedName("runInvalidateMetadata")
  private Boolean runInvalidateMetadata = null;

  @SerializedName("dryRun")
  private Boolean dryRun = null;

  @SerializedName("numThreads")
  private java.math.BigDecimal numThreads = null;

  @SerializedName("sentryMigration")
  private Boolean sentryMigration = null;

  @SerializedName("skipUrlPermissions")
  private Boolean skipUrlPermissions = null;

  @SerializedName("sourceAccount")
  private String sourceAccount = null;

  @SerializedName("destinationAccount")
  private String destinationAccount = null;

  @SerializedName("cloudRootPath")
  private String cloudRootPath = null;

  @SerializedName("replicationOption")
  private ReplicationOption replicationOption = null;

  public ApiHiveCloudReplicationArguments sourceService(ApiServiceRef sourceService) {
    this.sourceService = sourceService;
    return this;
  }

   /**
   * The service to replicate from.
   * @return sourceService
  **/
  @ApiModelProperty(value = "The service to replicate from.")
  public ApiServiceRef getSourceService() {
    return sourceService;
  }

  public void setSourceService(ApiServiceRef sourceService) {
    this.sourceService = sourceService;
  }

  public ApiHiveCloudReplicationArguments tableFilters(List<ApiHiveTable> tableFilters) {
    this.tableFilters = tableFilters;
    return this;
  }

  public ApiHiveCloudReplicationArguments addTableFiltersItem(ApiHiveTable tableFiltersItem) {
    if (this.tableFilters == null) {
      this.tableFilters = new ArrayList<ApiHiveTable>();
    }
    this.tableFilters.add(tableFiltersItem);
    return this;
  }

   /**
   * Filters for tables to include in the replication. Optional. If not provided, include all tables in all databases.
   * @return tableFilters
  **/
  @ApiModelProperty(value = "Filters for tables to include in the replication. Optional. If not provided, include all tables in all databases.")
  public List<ApiHiveTable> getTableFilters() {
    return tableFilters;
  }

  public void setTableFilters(List<ApiHiveTable> tableFilters) {
    this.tableFilters = tableFilters;
  }

  public ApiHiveCloudReplicationArguments exportDir(String exportDir) {
    this.exportDir = exportDir;
    return this;
  }

   /**
   * Directory, in the HDFS service where the target Hive service&#39;s data is stored, where the export file will be saved. Optional. If not provided, Cloudera Manager will pick a directory for storing the data.
   * @return exportDir
  **/
  @ApiModelProperty(value = "Directory, in the HDFS service where the target Hive service's data is stored, where the export file will be saved. Optional. If not provided, Cloudera Manager will pick a directory for storing the data.")
  public String getExportDir() {
    return exportDir;
  }

  public void setExportDir(String exportDir) {
    this.exportDir = exportDir;
  }

  public ApiHiveCloudReplicationArguments force(Boolean force) {
    this.force = force;
    return this;
  }

   /**
   * Whether to force overwriting of mismatched tables. Defaults to false.
   * @return force
  **/
  @ApiModelProperty(value = "Whether to force overwriting of mismatched tables. Defaults to false.")
  public Boolean getForce() {
    return force;
  }

  public void setForce(Boolean force) {
    this.force = force;
  }

  public ApiHiveCloudReplicationArguments replicateData(Boolean replicateData) {
    this.replicateData = replicateData;
    return this;
  }

   /**
   * Whether to replicate table data stored in HDFS. Defaults to false. &lt;p/&gt; If set, the \&quot;hdfsArguments\&quot; property must be set to configure the HDFS replication job.
   * @return replicateData
  **/
  @ApiModelProperty(value = "Whether to replicate table data stored in HDFS. Defaults to false. <p/> If set, the \"hdfsArguments\" property must be set to configure the HDFS replication job.")
  public Boolean getReplicateData() {
    return replicateData;
  }

  public void setReplicateData(Boolean replicateData) {
    this.replicateData = replicateData;
  }

  public ApiHiveCloudReplicationArguments hdfsArguments(ApiHdfsReplicationArguments hdfsArguments) {
    this.hdfsArguments = hdfsArguments;
    return this;
  }

   /**
   * Arguments for the HDFS replication job. &lt;p/&gt; This must be provided when choosing to replicate table data stored in HDFS. The \&quot;sourceService\&quot;, \&quot;sourcePath\&quot; and \&quot;dryRun\&quot; properties of the HDFS arguments are ignored; their values are derived from the Hive replication&#39;s information. &lt;p/&gt; The \&quot;destinationPath\&quot; property is used slightly differently from the usual HDFS replication jobs. It is used to map the root path of the source service into the target service. It may be omitted, in which case the source and target paths will match. &lt;p/&gt; Example: if the destination path is set to \&quot;/new_root\&quot;, a \&quot;/foo/bar\&quot; path in the source will be stored in \&quot;/new_root/foo/bar\&quot; in the target.
   * @return hdfsArguments
  **/
  @ApiModelProperty(value = "Arguments for the HDFS replication job. <p/> This must be provided when choosing to replicate table data stored in HDFS. The \"sourceService\", \"sourcePath\" and \"dryRun\" properties of the HDFS arguments are ignored; their values are derived from the Hive replication's information. <p/> The \"destinationPath\" property is used slightly differently from the usual HDFS replication jobs. It is used to map the root path of the source service into the target service. It may be omitted, in which case the source and target paths will match. <p/> Example: if the destination path is set to \"/new_root\", a \"/foo/bar\" path in the source will be stored in \"/new_root/foo/bar\" in the target.")
  public ApiHdfsReplicationArguments getHdfsArguments() {
    return hdfsArguments;
  }

  public void setHdfsArguments(ApiHdfsReplicationArguments hdfsArguments) {
    this.hdfsArguments = hdfsArguments;
  }

  public ApiHiveCloudReplicationArguments replicateImpalaMetadata(Boolean replicateImpalaMetadata) {
    this.replicateImpalaMetadata = replicateImpalaMetadata;
    return this;
  }

   /**
   * Whether to replicate the impala metadata. (i.e. the metadata for impala UDFs and their corresponding binaries in HDFS).
   * @return replicateImpalaMetadata
  **/
  @ApiModelProperty(value = "Whether to replicate the impala metadata. (i.e. the metadata for impala UDFs and their corresponding binaries in HDFS).")
  public Boolean getReplicateImpalaMetadata() {
    return replicateImpalaMetadata;
  }

  public void setReplicateImpalaMetadata(Boolean replicateImpalaMetadata) {
    this.replicateImpalaMetadata = replicateImpalaMetadata;
  }

  public ApiHiveCloudReplicationArguments runInvalidateMetadata(Boolean runInvalidateMetadata) {
    this.runInvalidateMetadata = runInvalidateMetadata;
    return this;
  }

   /**
   * Whether to run invalidate metadata query or not
   * @return runInvalidateMetadata
  **/
  @ApiModelProperty(value = "Whether to run invalidate metadata query or not")
  public Boolean getRunInvalidateMetadata() {
    return runInvalidateMetadata;
  }

  public void setRunInvalidateMetadata(Boolean runInvalidateMetadata) {
    this.runInvalidateMetadata = runInvalidateMetadata;
  }

  public ApiHiveCloudReplicationArguments dryRun(Boolean dryRun) {
    this.dryRun = dryRun;
    return this;
  }

   /**
   * Whether to perform a dry run. Defaults to false
   * @return dryRun
  **/
  @ApiModelProperty(value = "Whether to perform a dry run. Defaults to false")
  public Boolean getDryRun() {
    return dryRun;
  }

  public void setDryRun(Boolean dryRun) {
    this.dryRun = dryRun;
  }

  public ApiHiveCloudReplicationArguments numThreads(java.math.BigDecimal numThreads) {
    this.numThreads = numThreads;
    return this;
  }

   /**
   * Number of threads to use in multi-threaded export/import phase
   * @return numThreads
  **/
  @ApiModelProperty(value = "Number of threads to use in multi-threaded export/import phase")
  public java.math.BigDecimal getNumThreads() {
    return numThreads;
  }

  public void setNumThreads(java.math.BigDecimal numThreads) {
    this.numThreads = numThreads;
  }

  public ApiHiveCloudReplicationArguments sentryMigration(Boolean sentryMigration) {
    this.sentryMigration = sentryMigration;
    return this;
  }

   /**
   * 
   * @return sentryMigration
  **/
  @ApiModelProperty(required = true, value = "")
  public Boolean getSentryMigration() {
    return sentryMigration;
  }

  public void setSentryMigration(Boolean sentryMigration) {
    this.sentryMigration = sentryMigration;
  }

  public ApiHiveCloudReplicationArguments skipUrlPermissions(Boolean skipUrlPermissions) {
    this.skipUrlPermissions = skipUrlPermissions;
    return this;
  }

   /**
   * Is skipUrlPermissions on.
   * @return skipUrlPermissions
  **/
  @ApiModelProperty(required = true, value = "Is skipUrlPermissions on.")
  public Boolean getSkipUrlPermissions() {
    return skipUrlPermissions;
  }

  public void setSkipUrlPermissions(Boolean skipUrlPermissions) {
    this.skipUrlPermissions = skipUrlPermissions;
  }

  public ApiHiveCloudReplicationArguments sourceAccount(String sourceAccount) {
    this.sourceAccount = sourceAccount;
    return this;
  }

   /**
   * 
   * @return sourceAccount
  **/
  @ApiModelProperty(value = "")
  public String getSourceAccount() {
    return sourceAccount;
  }

  public void setSourceAccount(String sourceAccount) {
    this.sourceAccount = sourceAccount;
  }

  public ApiHiveCloudReplicationArguments destinationAccount(String destinationAccount) {
    this.destinationAccount = destinationAccount;
    return this;
  }

   /**
   * 
   * @return destinationAccount
  **/
  @ApiModelProperty(value = "")
  public String getDestinationAccount() {
    return destinationAccount;
  }

  public void setDestinationAccount(String destinationAccount) {
    this.destinationAccount = destinationAccount;
  }

  public ApiHiveCloudReplicationArguments cloudRootPath(String cloudRootPath) {
    this.cloudRootPath = cloudRootPath;
    return this;
  }

   /**
   * 
   * @return cloudRootPath
  **/
  @ApiModelProperty(value = "")
  public String getCloudRootPath() {
    return cloudRootPath;
  }

  public void setCloudRootPath(String cloudRootPath) {
    this.cloudRootPath = cloudRootPath;
  }

  public ApiHiveCloudReplicationArguments replicationOption(ReplicationOption replicationOption) {
    this.replicationOption = replicationOption;
    return this;
  }

   /**
   * 
   * @return replicationOption
  **/
  @ApiModelProperty(value = "")
  public ReplicationOption getReplicationOption() {
    return replicationOption;
  }

  public void setReplicationOption(ReplicationOption replicationOption) {
    this.replicationOption = replicationOption;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiHiveCloudReplicationArguments apiHiveCloudReplicationArguments = (ApiHiveCloudReplicationArguments) o;
    return Objects.equals(this.sourceService, apiHiveCloudReplicationArguments.sourceService) &&
        Objects.equals(this.tableFilters, apiHiveCloudReplicationArguments.tableFilters) &&
        Objects.equals(this.exportDir, apiHiveCloudReplicationArguments.exportDir) &&
        Objects.equals(this.force, apiHiveCloudReplicationArguments.force) &&
        Objects.equals(this.replicateData, apiHiveCloudReplicationArguments.replicateData) &&
        Objects.equals(this.hdfsArguments, apiHiveCloudReplicationArguments.hdfsArguments) &&
        Objects.equals(this.replicateImpalaMetadata, apiHiveCloudReplicationArguments.replicateImpalaMetadata) &&
        Objects.equals(this.runInvalidateMetadata, apiHiveCloudReplicationArguments.runInvalidateMetadata) &&
        Objects.equals(this.dryRun, apiHiveCloudReplicationArguments.dryRun) &&
        Objects.equals(this.numThreads, apiHiveCloudReplicationArguments.numThreads) &&
        Objects.equals(this.sentryMigration, apiHiveCloudReplicationArguments.sentryMigration) &&
        Objects.equals(this.skipUrlPermissions, apiHiveCloudReplicationArguments.skipUrlPermissions) &&
        Objects.equals(this.sourceAccount, apiHiveCloudReplicationArguments.sourceAccount) &&
        Objects.equals(this.destinationAccount, apiHiveCloudReplicationArguments.destinationAccount) &&
        Objects.equals(this.cloudRootPath, apiHiveCloudReplicationArguments.cloudRootPath) &&
        Objects.equals(this.replicationOption, apiHiveCloudReplicationArguments.replicationOption);
  }

  @Override
  public int hashCode() {
    return Objects.hash(sourceService, tableFilters, exportDir, force, replicateData, hdfsArguments, replicateImpalaMetadata, runInvalidateMetadata, dryRun, numThreads, sentryMigration, skipUrlPermissions, sourceAccount, destinationAccount, cloudRootPath, replicationOption);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiHiveCloudReplicationArguments {\n");
    
    sb.append("    sourceService: ").append(toIndentedString(sourceService)).append("\n");
    sb.append("    tableFilters: ").append(toIndentedString(tableFilters)).append("\n");
    sb.append("    exportDir: ").append(toIndentedString(exportDir)).append("\n");
    sb.append("    force: ").append(toIndentedString(force)).append("\n");
    sb.append("    replicateData: ").append(toIndentedString(replicateData)).append("\n");
    sb.append("    hdfsArguments: ").append(toIndentedString(hdfsArguments)).append("\n");
    sb.append("    replicateImpalaMetadata: ").append(toIndentedString(replicateImpalaMetadata)).append("\n");
    sb.append("    runInvalidateMetadata: ").append(toIndentedString(runInvalidateMetadata)).append("\n");
    sb.append("    dryRun: ").append(toIndentedString(dryRun)).append("\n");
    sb.append("    numThreads: ").append(toIndentedString(numThreads)).append("\n");
    sb.append("    sentryMigration: ").append(toIndentedString(sentryMigration)).append("\n");
    sb.append("    skipUrlPermissions: ").append(toIndentedString(skipUrlPermissions)).append("\n");
    sb.append("    sourceAccount: ").append(toIndentedString(sourceAccount)).append("\n");
    sb.append("    destinationAccount: ").append(toIndentedString(destinationAccount)).append("\n");
    sb.append("    cloudRootPath: ").append(toIndentedString(cloudRootPath)).append("\n");
    sb.append("    replicationOption: ").append(toIndentedString(replicationOption)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
  
}

