/*
 * 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.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;
import java.util.ArrayList;
import java.util.List;
/**
 * Arguments used for Cluster Restart command.  Since V11: If both restartOnlyStaleServices and restartServiceNames are specified, a service must be specified in restartServiceNames and also be stale, in order to be restarted.
 */
@Schema(description = "Arguments used for Cluster Restart command.  Since V11: If both restartOnlyStaleServices and restartServiceNames are specified, a service must be specified in restartServiceNames and also be stale, in order to be restarted.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiRestartClusterArgs {
  @SerializedName("restartOnlyStaleServices")
  private Boolean restartOnlyStaleServices = null;

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

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

  public ApiRestartClusterArgs restartOnlyStaleServices(Boolean restartOnlyStaleServices) {
    this.restartOnlyStaleServices = restartOnlyStaleServices;
    return this;
  }

   /**
   * Only restart services that have stale configuration and their dependent services.
   * @return restartOnlyStaleServices
  **/
  @Schema(description = "Only restart services that have stale configuration and their dependent services.")
  public Boolean isRestartOnlyStaleServices() {
    return restartOnlyStaleServices;
  }

  public void setRestartOnlyStaleServices(Boolean restartOnlyStaleServices) {
    this.restartOnlyStaleServices = restartOnlyStaleServices;
  }

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

   /**
   * Re-deploy client configuration for all services in the cluster.
   * @return redeployClientConfiguration
  **/
  @Schema(description = "Re-deploy client configuration for all services in the cluster.")
  public Boolean isRedeployClientConfiguration() {
    return redeployClientConfiguration;
  }

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

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

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

   /**
   * Only restart services that are specified and their dependent services. Available since V11.
   * @return restartServiceNames
  **/
  @Schema(description = "Only restart services that are specified and their dependent services. Available since V11.")
  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;
    }
    ApiRestartClusterArgs apiRestartClusterArgs = (ApiRestartClusterArgs) o;
    return Objects.equals(this.restartOnlyStaleServices, apiRestartClusterArgs.restartOnlyStaleServices) &&
        Objects.equals(this.redeployClientConfiguration, apiRestartClusterArgs.redeployClientConfiguration) &&
        Objects.equals(this.restartServiceNames, apiRestartClusterArgs.restartServiceNames);
  }

  @Override
  public int hashCode() {
    return Objects.hash(restartOnlyStaleServices, redeployClientConfiguration, restartServiceNames);
  }


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

}
