/*
 * 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.ApiHealthCheck;
import com.cloudera.api.swagger.model.ApiHealthSummary;
import com.cloudera.api.swagger.model.ApiRoleRef;
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;
/**
 * Provides information about an HDFS nameservice. &lt;p&gt; Nameservices can be either a stand-alone NameNode, a NameNode paired with a SecondaryNameNode, or a high-availability pair formed by an active and a stand-by NameNode. &lt;p&gt; The following fields are only available in the object&#x27;s full view: &lt;ul&gt; &lt;li&gt;healthSummary&lt;/li&gt; &lt;li&gt;healthChecks&lt;/li&gt; &lt;/ul&gt;
 */
@Schema(description = "Provides information about an HDFS nameservice. <p> Nameservices can be either a stand-alone NameNode, a NameNode paired with a SecondaryNameNode, or a high-availability pair formed by an active and a stand-by NameNode. <p> The following fields are only available in the object's full view: <ul> <li>healthSummary</li> <li>healthChecks</li> </ul>")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiNameservice {
  @SerializedName("name")
  private String name = null;

  @SerializedName("active")
  private ApiRoleRef active = null;

  @SerializedName("activeFailoverController")
  private ApiRoleRef activeFailoverController = null;

  @SerializedName("standBy")
  private ApiRoleRef standBy = null;

  @SerializedName("standByFailoverController")
  private ApiRoleRef standByFailoverController = null;

  @SerializedName("secondary")
  private ApiRoleRef secondary = null;

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

  @SerializedName("healthSummary")
  private ApiHealthSummary healthSummary = null;

  @SerializedName("healthChecks")
  private List<ApiHealthCheck> healthChecks = null;

  public ApiNameservice name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Name of the nameservice.
   * @return name
  **/
  @Schema(description = "Name of the nameservice.")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public ApiNameservice active(ApiRoleRef active) {
    this.active = active;
    return this;
  }

   /**
   * Get active
   * @return active
  **/
  @Schema(description = "")
  public ApiRoleRef getActive() {
    return active;
  }

  public void setActive(ApiRoleRef active) {
    this.active = active;
  }

  public ApiNameservice activeFailoverController(ApiRoleRef activeFailoverController) {
    this.activeFailoverController = activeFailoverController;
    return this;
  }

   /**
   * Get activeFailoverController
   * @return activeFailoverController
  **/
  @Schema(description = "")
  public ApiRoleRef getActiveFailoverController() {
    return activeFailoverController;
  }

  public void setActiveFailoverController(ApiRoleRef activeFailoverController) {
    this.activeFailoverController = activeFailoverController;
  }

  public ApiNameservice standBy(ApiRoleRef standBy) {
    this.standBy = standBy;
    return this;
  }

   /**
   * Get standBy
   * @return standBy
  **/
  @Schema(description = "")
  public ApiRoleRef getStandBy() {
    return standBy;
  }

  public void setStandBy(ApiRoleRef standBy) {
    this.standBy = standBy;
  }

  public ApiNameservice standByFailoverController(ApiRoleRef standByFailoverController) {
    this.standByFailoverController = standByFailoverController;
    return this;
  }

   /**
   * Get standByFailoverController
   * @return standByFailoverController
  **/
  @Schema(description = "")
  public ApiRoleRef getStandByFailoverController() {
    return standByFailoverController;
  }

  public void setStandByFailoverController(ApiRoleRef standByFailoverController) {
    this.standByFailoverController = standByFailoverController;
  }

  public ApiNameservice secondary(ApiRoleRef secondary) {
    this.secondary = secondary;
    return this;
  }

   /**
   * Get secondary
   * @return secondary
  **/
  @Schema(description = "")
  public ApiRoleRef getSecondary() {
    return secondary;
  }

  public void setSecondary(ApiRoleRef secondary) {
    this.secondary = secondary;
  }

  public ApiNameservice mountPoints(List<String> mountPoints) {
    this.mountPoints = mountPoints;
    return this;
  }

  public ApiNameservice addMountPointsItem(String mountPointsItem) {
    if (this.mountPoints == null) {
      this.mountPoints = new ArrayList<>();
    }
    this.mountPoints.add(mountPointsItem);
    return this;
  }

   /**
   * Mount points assigned to this nameservice in a federation.
   * @return mountPoints
  **/
  @Schema(description = "Mount points assigned to this nameservice in a federation.")
  public List<String> getMountPoints() {
    return mountPoints;
  }

  public void setMountPoints(List<String> mountPoints) {
    this.mountPoints = mountPoints;
  }

  public ApiNameservice healthSummary(ApiHealthSummary healthSummary) {
    this.healthSummary = healthSummary;
    return this;
  }

   /**
   * Get healthSummary
   * @return healthSummary
  **/
  @Schema(description = "")
  public ApiHealthSummary getHealthSummary() {
    return healthSummary;
  }

  public void setHealthSummary(ApiHealthSummary healthSummary) {
    this.healthSummary = healthSummary;
  }

  public ApiNameservice healthChecks(List<ApiHealthCheck> healthChecks) {
    this.healthChecks = healthChecks;
    return this;
  }

  public ApiNameservice addHealthChecksItem(ApiHealthCheck healthChecksItem) {
    if (this.healthChecks == null) {
      this.healthChecks = new ArrayList<>();
    }
    this.healthChecks.add(healthChecksItem);
    return this;
  }

   /**
   * Requires \&quot;full\&quot; view. List of health checks performed on the nameservice.
   * @return healthChecks
  **/
  @Schema(description = "Requires \"full\" view. List of health checks performed on the nameservice.")
  public List<ApiHealthCheck> getHealthChecks() {
    return healthChecks;
  }

  public void setHealthChecks(List<ApiHealthCheck> healthChecks) {
    this.healthChecks = healthChecks;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiNameservice apiNameservice = (ApiNameservice) o;
    return Objects.equals(this.name, apiNameservice.name) &&
        Objects.equals(this.active, apiNameservice.active) &&
        Objects.equals(this.activeFailoverController, apiNameservice.activeFailoverController) &&
        Objects.equals(this.standBy, apiNameservice.standBy) &&
        Objects.equals(this.standByFailoverController, apiNameservice.standByFailoverController) &&
        Objects.equals(this.secondary, apiNameservice.secondary) &&
        Objects.equals(this.mountPoints, apiNameservice.mountPoints) &&
        Objects.equals(this.healthSummary, apiNameservice.healthSummary) &&
        Objects.equals(this.healthChecks, apiNameservice.healthChecks);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, active, activeFailoverController, standBy, standByFailoverController, secondary, mountPoints, healthSummary, healthChecks);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiNameservice {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    active: ").append(toIndentedString(active)).append("\n");
    sb.append("    activeFailoverController: ").append(toIndentedString(activeFailoverController)).append("\n");
    sb.append("    standBy: ").append(toIndentedString(standBy)).append("\n");
    sb.append("    standByFailoverController: ").append(toIndentedString(standByFailoverController)).append("\n");
    sb.append("    secondary: ").append(toIndentedString(secondary)).append("\n");
    sb.append("    mountPoints: ").append(toIndentedString(mountPoints)).append("\n");
    sb.append("    healthSummary: ").append(toIndentedString(healthSummary)).append("\n");
    sb.append("    healthChecks: ").append(toIndentedString(healthChecks)).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    ");
  }

}
