/*
 * 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.ApiRolesToInclude;
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 Restart Cluster command.
 */
@ApiModel(description = "Arguments used for Rolling Restart Cluster command.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiRollingRestartClusterArgs {
  @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("staleConfigsOnly")
  private Boolean staleConfigsOnly = null;

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

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

  @SerializedName("rolesToInclude")
  private ApiRolesToInclude rolesToInclude = null;

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

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

   /**
   * Number of hosts with slave roles to restart at a time. Must be greater than zero. Default is 1.
   * @return slaveBatchSize
  **/
  @ApiModelProperty(value = "Number of hosts with slave roles to restart 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 ApiRollingRestartClusterArgs sleepSeconds(java.math.BigDecimal sleepSeconds) {
    this.sleepSeconds = sleepSeconds;
    return this;
  }

   /**
   * Number of seconds to sleep between restarts of slave host batches. &lt;p&gt; 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. <p> 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 ApiRollingRestartClusterArgs 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. &lt;p&gt; 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. <p> 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 ApiRollingRestartClusterArgs staleConfigsOnly(Boolean staleConfigsOnly) {
    this.staleConfigsOnly = staleConfigsOnly;
    return this;
  }

   /**
   * Restart roles with stale configs only.
   * @return staleConfigsOnly
  **/
  @ApiModelProperty(value = "Restart roles with stale configs only.")
  public Boolean getStaleConfigsOnly() {
    return staleConfigsOnly;
  }

  public void setStaleConfigsOnly(Boolean staleConfigsOnly) {
    this.staleConfigsOnly = staleConfigsOnly;
  }

  public ApiRollingRestartClusterArgs unUpgradedOnly(Boolean unUpgradedOnly) {
    this.unUpgradedOnly = unUpgradedOnly;
    return this;
  }

   /**
   * Restart roles that haven&#39;t been upgraded yet.
   * @return unUpgradedOnly
  **/
  @ApiModelProperty(value = "Restart roles that haven't been upgraded yet.")
  public Boolean getUnUpgradedOnly() {
    return unUpgradedOnly;
  }

  public void setUnUpgradedOnly(Boolean unUpgradedOnly) {
    this.unUpgradedOnly = unUpgradedOnly;
  }

  public ApiRollingRestartClusterArgs redeployClientConfiguration(Boolean redeployClientConfiguration) {
    this.redeployClientConfiguration = redeployClientConfiguration;
    return this;
  }

   /**
   * Re-deploy client configuration. Available since API v6.
   * @return redeployClientConfiguration
  **/
  @ApiModelProperty(value = "Re-deploy client configuration. Available since API v6.")
  public Boolean getRedeployClientConfiguration() {
    return redeployClientConfiguration;
  }

  public void setRedeployClientConfiguration(Boolean redeployClientConfiguration) {
    this.redeployClientConfiguration = redeployClientConfiguration;
  }

  public ApiRollingRestartClusterArgs rolesToInclude(ApiRolesToInclude rolesToInclude) {
    this.rolesToInclude = rolesToInclude;
    return this;
  }

   /**
   * Role types to restart. Default is slave roles only.
   * @return rolesToInclude
  **/
  @ApiModelProperty(value = "Role types to restart. Default is slave roles only.")
  public ApiRolesToInclude getRolesToInclude() {
    return rolesToInclude;
  }

  public void setRolesToInclude(ApiRolesToInclude rolesToInclude) {
    this.rolesToInclude = rolesToInclude;
  }

  public ApiRollingRestartClusterArgs restartServiceNames(List<String> restartServiceNames) {
    this.restartServiceNames = restartServiceNames;
    return this;
  }

  public ApiRollingRestartClusterArgs addRestartServiceNamesItem(String restartServiceNamesItem) {
    if (this.restartServiceNames == null) {
      this.restartServiceNames = new ArrayList<String>();
    }
    this.restartServiceNames.add(restartServiceNamesItem);
    return this;
  }

   /**
   * List of services to restart.
   * @return restartServiceNames
  **/
  @ApiModelProperty(value = "List of services to restart.")
  public List<String> getRestartServiceNames() {
    return restartServiceNames;
  }

  public void setRestartServiceNames(List<String> restartServiceNames) {
    this.restartServiceNames = restartServiceNames;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiRollingRestartClusterArgs apiRollingRestartClusterArgs = (ApiRollingRestartClusterArgs) o;
    return Objects.equals(this.slaveBatchSize, apiRollingRestartClusterArgs.slaveBatchSize) &&
        Objects.equals(this.sleepSeconds, apiRollingRestartClusterArgs.sleepSeconds) &&
        Objects.equals(this.slaveFailCountThreshold, apiRollingRestartClusterArgs.slaveFailCountThreshold) &&
        Objects.equals(this.staleConfigsOnly, apiRollingRestartClusterArgs.staleConfigsOnly) &&
        Objects.equals(this.unUpgradedOnly, apiRollingRestartClusterArgs.unUpgradedOnly) &&
        Objects.equals(this.redeployClientConfiguration, apiRollingRestartClusterArgs.redeployClientConfiguration) &&
        Objects.equals(this.rolesToInclude, apiRollingRestartClusterArgs.rolesToInclude) &&
        Objects.equals(this.restartServiceNames, apiRollingRestartClusterArgs.restartServiceNames);
  }

  @Override
  public int hashCode() {
    return Objects.hash(slaveBatchSize, sleepSeconds, slaveFailCountThreshold, staleConfigsOnly, unUpgradedOnly, redeployClientConfiguration, rolesToInclude, restartServiceNames);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiRollingRestartClusterArgs {\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("    staleConfigsOnly: ").append(toIndentedString(staleConfigsOnly)).append("\n");
    sb.append("    unUpgradedOnly: ").append(toIndentedString(unUpgradedOnly)).append("\n");
    sb.append("    redeployClientConfiguration: ").append(toIndentedString(redeployClientConfiguration)).append("\n");
    sb.append("    rolesToInclude: ").append(toIndentedString(rolesToInclude)).append("\n");
    sb.append("    restartServiceNames: ").append(toIndentedString(restartServiceNames)).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    ");
  }
  
}

