/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.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 java.util.Arrays;
import com.cloudera.api.swagger.model.ApiRollingUpgradeClusterArgs;
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.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
 * Arguments used for the CDH Upgrade command.
 */
@Schema(description = "Arguments used for the CDH Upgrade command.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiCdhUpgradeArgs {
  @SerializedName("cdhParcelVersion")
  private String cdhParcelVersion = null;

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

  @SerializedName("rollingRestartArgs")
  private ApiRollingUpgradeClusterArgs rollingRestartArgs = null;

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

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

  public ApiCdhUpgradeArgs cdhParcelVersion(String cdhParcelVersion) {
    this.cdhParcelVersion = cdhParcelVersion;
    return this;
  }

   /**
   * If using parcels, the full version of an already distributed parcel for the next major CDH version. Default is null, which indicates this is a package upgrade. Example versions are: &#x27;5.0.0-1.cdh5.0.0.p0.11&#x27; or &#x27;5.0.2-1.cdh5.0.2.p0.32&#x27;
   * @return cdhParcelVersion
  **/
  @Schema(description = "If using parcels, the full version of an already distributed parcel for the next major CDH version. Default is null, which indicates this is a package upgrade. Example versions are: '5.0.0-1.cdh5.0.0.p0.11' or '5.0.2-1.cdh5.0.2.p0.32'")
  public String getCdhParcelVersion() {
    return cdhParcelVersion;
  }

  public void setCdhParcelVersion(String cdhParcelVersion) {
    this.cdhParcelVersion = cdhParcelVersion;
  }

  public ApiCdhUpgradeArgs cdhPackageVersion(String cdhPackageVersion) {
    this.cdhPackageVersion = cdhPackageVersion;
    return this;
  }

   /**
   * If using packages, the full version of the CDH packages being upgraded to, such as \&quot;5.1.2\&quot;. These packages must already be installed on the cluster before running the upgrade command. For backwards compatibility, if \&quot;5.0.0\&quot; is specified here, then the upgrade command will relax validation of installed packages to match v6 behavior, only checking major version. &lt;p&gt; Introduced in v9. Has no effect in older API versions, which assume \&quot;5.0.0\&quot;
   * @return cdhPackageVersion
  **/
  @Schema(description = "If using packages, the full version of the CDH packages being upgraded to, such as \"5.1.2\". These packages must already be installed on the cluster before running the upgrade command. For backwards compatibility, if \"5.0.0\" is specified here, then the upgrade command will relax validation of installed packages to match v6 behavior, only checking major version. <p> Introduced in v9. Has no effect in older API versions, which assume \"5.0.0\"")
  public String getCdhPackageVersion() {
    return cdhPackageVersion;
  }

  public void setCdhPackageVersion(String cdhPackageVersion) {
    this.cdhPackageVersion = cdhPackageVersion;
  }

  public ApiCdhUpgradeArgs rollingRestartArgs(ApiRollingUpgradeClusterArgs rollingRestartArgs) {
    this.rollingRestartArgs = rollingRestartArgs;
    return this;
  }

   /**
   * Get rollingRestartArgs
   * @return rollingRestartArgs
  **/
  @Schema(description = "")
  public ApiRollingUpgradeClusterArgs getRollingRestartArgs() {
    return rollingRestartArgs;
  }

  public void setRollingRestartArgs(ApiRollingUpgradeClusterArgs rollingRestartArgs) {
    this.rollingRestartArgs = rollingRestartArgs;
  }

  public ApiCdhUpgradeArgs deployClientConfig(Boolean deployClientConfig) {
    this.deployClientConfig = deployClientConfig;
    return this;
  }

   /**
   * Not used starting in v9 - Client config is always deployed as part of upgrade. For older versions, determines whether client configuration should be deployed as part of upgrade. Default is true.
   * @return deployClientConfig
  **/
  @Schema(description = "Not used starting in v9 - Client config is always deployed as part of upgrade. For older versions, determines whether client configuration should be deployed as part of upgrade. Default is true.")
  public Boolean isDeployClientConfig() {
    return deployClientConfig;
  }

  public void setDeployClientConfig(Boolean deployClientConfig) {
    this.deployClientConfig = deployClientConfig;
  }

  public ApiCdhUpgradeArgs startAllServices(Boolean startAllServices) {
    this.startAllServices = startAllServices;
    return this;
  }

   /**
   * Not used starting in v9 - All servies are always started as part of upgrade. For older versions, determines whether all services should be started should be deployed as part of upgrade. Default is true.
   * @return startAllServices
  **/
  @Schema(description = "Not used starting in v9 - All servies are always started as part of upgrade. For older versions, determines whether all services should be started should be deployed as part of upgrade. Default is true.")
  public Boolean isStartAllServices() {
    return startAllServices;
  }

  public void setStartAllServices(Boolean startAllServices) {
    this.startAllServices = startAllServices;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiCdhUpgradeArgs apiCdhUpgradeArgs = (ApiCdhUpgradeArgs) o;
    return Objects.equals(this.cdhParcelVersion, apiCdhUpgradeArgs.cdhParcelVersion) &&
        Objects.equals(this.cdhPackageVersion, apiCdhUpgradeArgs.cdhPackageVersion) &&
        Objects.equals(this.rollingRestartArgs, apiCdhUpgradeArgs.rollingRestartArgs) &&
        Objects.equals(this.deployClientConfig, apiCdhUpgradeArgs.deployClientConfig) &&
        Objects.equals(this.startAllServices, apiCdhUpgradeArgs.startAllServices);
  }

  @Override
  public int hashCode() {
    return Objects.hash(cdhParcelVersion, cdhPackageVersion, rollingRestartArgs, deployClientConfig, startAllServices);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiCdhUpgradeArgs {\n");
    
    sb.append("    cdhParcelVersion: ").append(toIndentedString(cdhParcelVersion)).append("\n");
    sb.append("    cdhPackageVersion: ").append(toIndentedString(cdhPackageVersion)).append("\n");
    sb.append("    rollingRestartArgs: ").append(toIndentedString(rollingRestartArgs)).append("\n");
    sb.append("    deployClientConfig: ").append(toIndentedString(deployClientConfig)).append("\n");
    sb.append("    startAllServices: ").append(toIndentedString(startAllServices)).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    ");
  }

}
