/*
 * 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.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;

/**
 * Arguments used for Rolling Upgrade command.
 */
@ApiModel(description = "Arguments used for Rolling Upgrade command.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiRollingUpgradeServicesArgs {
  @SerializedName("upgradeFromCdhVersion")
  private String upgradeFromCdhVersion = null;

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

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

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

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

  @SerializedName("upgradeServiceNames")
  private List<String> upgradeServiceNames = null;

  public ApiRollingUpgradeServicesArgs upgradeFromCdhVersion(String upgradeFromCdhVersion) {
    this.upgradeFromCdhVersion = upgradeFromCdhVersion;
    return this;
  }

   /**
   * Current CDH Version of the services. Example versions are: \&quot;5.1.0\&quot;, \&quot;5.2.2\&quot; or \&quot;5.4.0\&quot;
   * @return upgradeFromCdhVersion
  **/
  @ApiModelProperty(value = "Current CDH Version of the services. Example versions are: \"5.1.0\", \"5.2.2\" or \"5.4.0\"")
  public String getUpgradeFromCdhVersion() {
    return upgradeFromCdhVersion;
  }

  public void setUpgradeFromCdhVersion(String upgradeFromCdhVersion) {
    this.upgradeFromCdhVersion = upgradeFromCdhVersion;
  }

  public ApiRollingUpgradeServicesArgs upgradeToCdhVersion(String upgradeToCdhVersion) {
    this.upgradeToCdhVersion = upgradeToCdhVersion;
    return this;
  }

   /**
   * Target CDH Version for the services. The CDH version should already be present and activated on the nodes. Example versions are: \&quot;5.1.0\&quot;, \&quot;5.2.2\&quot; or \&quot;5.4.0\&quot;
   * @return upgradeToCdhVersion
  **/
  @ApiModelProperty(value = "Target CDH Version for the services. The CDH version should already be present and activated on the nodes. Example versions are: \"5.1.0\", \"5.2.2\" or \"5.4.0\"")
  public String getUpgradeToCdhVersion() {
    return upgradeToCdhVersion;
  }

  public void setUpgradeToCdhVersion(String upgradeToCdhVersion) {
    this.upgradeToCdhVersion = upgradeToCdhVersion;
  }

  public ApiRollingUpgradeServicesArgs slaveBatchSize(java.math.BigDecimal slaveBatchSize) {
    this.slaveBatchSize = slaveBatchSize;
    return this;
  }

   /**
   * Number of hosts with slave roles to upgrade at a time. Must be greater than zero. Default is 1.
   * @return slaveBatchSize
  **/
  @ApiModelProperty(value = "Number of hosts with slave roles to upgrade at a time. Must be greater than zero. Default is 1.")
  public java.math.BigDecimal getSlaveBatchSize() {
    return slaveBatchSize;
  }

  public void setSlaveBatchSize(java.math.BigDecimal slaveBatchSize) {
    this.slaveBatchSize = slaveBatchSize;
  }

  public ApiRollingUpgradeServicesArgs sleepSeconds(java.math.BigDecimal sleepSeconds) {
    this.sleepSeconds = sleepSeconds;
    return this;
  }

   /**
   * Number of seconds to sleep between restarts of slave host batches.  Must be greater than or equal to 0. Default is 0.
   * @return sleepSeconds
  **/
  @ApiModelProperty(value = "Number of seconds to sleep between restarts of slave host batches.  Must be greater than or equal to 0. Default is 0.")
  public java.math.BigDecimal getSleepSeconds() {
    return sleepSeconds;
  }

  public void setSleepSeconds(java.math.BigDecimal sleepSeconds) {
    this.sleepSeconds = sleepSeconds;
  }

  public ApiRollingUpgradeServicesArgs slaveFailCountThreshold(java.math.BigDecimal slaveFailCountThreshold) {
    this.slaveFailCountThreshold = slaveFailCountThreshold;
    return this;
  }

   /**
   * The threshold for number of slave host batches that are allowed to fail to restart before the entire command is considered failed.  Must be greater than or equal to 0. Default is 0. &lt;p&gt; This argument is for ADVANCED users only. &lt;/p&gt;
   * @return slaveFailCountThreshold
  **/
  @ApiModelProperty(value = "The threshold for number of slave host batches that are allowed to fail to restart before the entire command is considered failed.  Must be greater than or equal to 0. Default is 0. <p> This argument is for ADVANCED users only. </p>")
  public java.math.BigDecimal getSlaveFailCountThreshold() {
    return slaveFailCountThreshold;
  }

  public void setSlaveFailCountThreshold(java.math.BigDecimal slaveFailCountThreshold) {
    this.slaveFailCountThreshold = slaveFailCountThreshold;
  }

  public ApiRollingUpgradeServicesArgs upgradeServiceNames(List<String> upgradeServiceNames) {
    this.upgradeServiceNames = upgradeServiceNames;
    return this;
  }

  public ApiRollingUpgradeServicesArgs addUpgradeServiceNamesItem(String upgradeServiceNamesItem) {
    if (this.upgradeServiceNames == null) {
      this.upgradeServiceNames = new ArrayList<String>();
    }
    this.upgradeServiceNames.add(upgradeServiceNamesItem);
    return this;
  }

   /**
   * List of services to upgrade. Only the services that support rolling upgrade should be included.
   * @return upgradeServiceNames
  **/
  @ApiModelProperty(value = "List of services to upgrade. Only the services that support rolling upgrade should be included.")
  public List<String> getUpgradeServiceNames() {
    return upgradeServiceNames;
  }

  public void setUpgradeServiceNames(List<String> upgradeServiceNames) {
    this.upgradeServiceNames = upgradeServiceNames;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiRollingUpgradeServicesArgs apiRollingUpgradeServicesArgs = (ApiRollingUpgradeServicesArgs) o;
    return Objects.equals(this.upgradeFromCdhVersion, apiRollingUpgradeServicesArgs.upgradeFromCdhVersion) &&
        Objects.equals(this.upgradeToCdhVersion, apiRollingUpgradeServicesArgs.upgradeToCdhVersion) &&
        Objects.equals(this.slaveBatchSize, apiRollingUpgradeServicesArgs.slaveBatchSize) &&
        Objects.equals(this.sleepSeconds, apiRollingUpgradeServicesArgs.sleepSeconds) &&
        Objects.equals(this.slaveFailCountThreshold, apiRollingUpgradeServicesArgs.slaveFailCountThreshold) &&
        Objects.equals(this.upgradeServiceNames, apiRollingUpgradeServicesArgs.upgradeServiceNames);
  }

  @Override
  public int hashCode() {
    return Objects.hash(upgradeFromCdhVersion, upgradeToCdhVersion, slaveBatchSize, sleepSeconds, slaveFailCountThreshold, upgradeServiceNames);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiRollingUpgradeServicesArgs {\n");
    
    sb.append("    upgradeFromCdhVersion: ").append(toIndentedString(upgradeFromCdhVersion)).append("\n");
    sb.append("    upgradeToCdhVersion: ").append(toIndentedString(upgradeToCdhVersion)).append("\n");
    sb.append("    slaveBatchSize: ").append(toIndentedString(slaveBatchSize)).append("\n");
    sb.append("    sleepSeconds: ").append(toIndentedString(sleepSeconds)).append("\n");
    sb.append("    slaveFailCountThreshold: ").append(toIndentedString(slaveFailCountThreshold)).append("\n");
    sb.append("    upgradeServiceNames: ").append(toIndentedString(upgradeServiceNames)).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    ");
  }
  
}

