/*
 * 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.ApiClusterRef;
import com.cloudera.api.swagger.model.ApiRoleConfigGroupRef;
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;
/**
 * A host template belongs to a cluster and contains a set of role config groups for slave roles (such as DataNodes and TaskTrackers) from services in the cluster. At most one role config group per role type can be present in a host template. Host templates can be applied to fresh hosts (those with no roles on them) in order to create a role for each of the role groups on each host.
 */
@Schema(description = "A host template belongs to a cluster and contains a set of role config groups for slave roles (such as DataNodes and TaskTrackers) from services in the cluster. At most one role config group per role type can be present in a host template. Host templates can be applied to fresh hosts (those with no roles on them) in order to create a role for each of the role groups on each host.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

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

  @SerializedName("clusterRef")
  private ApiClusterRef clusterRef = null;

  @SerializedName("roleConfigGroupRefs")
  private List<ApiRoleConfigGroupRef> roleConfigGroupRefs = null;

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

   /**
   * The name of the host template. Unique across clusters.
   * @return name
  **/
  @Schema(description = "The name of the host template. Unique across clusters.")
  public String getName() {
    return name;
  }

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

  public ApiHostTemplate clusterRef(ApiClusterRef clusterRef) {
    this.clusterRef = clusterRef;
    return this;
  }

   /**
   * Get clusterRef
   * @return clusterRef
  **/
  @Schema(description = "")
  public ApiClusterRef getClusterRef() {
    return clusterRef;
  }

  public void setClusterRef(ApiClusterRef clusterRef) {
    this.clusterRef = clusterRef;
  }

  public ApiHostTemplate roleConfigGroupRefs(List<ApiRoleConfigGroupRef> roleConfigGroupRefs) {
    this.roleConfigGroupRefs = roleConfigGroupRefs;
    return this;
  }

  public ApiHostTemplate addRoleConfigGroupRefsItem(ApiRoleConfigGroupRef roleConfigGroupRefsItem) {
    if (this.roleConfigGroupRefs == null) {
      this.roleConfigGroupRefs = new ArrayList<>();
    }
    this.roleConfigGroupRefs.add(roleConfigGroupRefsItem);
    return this;
  }

   /**
   * The role config groups belonging to this host tempalte.
   * @return roleConfigGroupRefs
  **/
  @Schema(description = "The role config groups belonging to this host tempalte.")
  public List<ApiRoleConfigGroupRef> getRoleConfigGroupRefs() {
    return roleConfigGroupRefs;
  }

  public void setRoleConfigGroupRefs(List<ApiRoleConfigGroupRef> roleConfigGroupRefs) {
    this.roleConfigGroupRefs = roleConfigGroupRefs;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiHostTemplate apiHostTemplate = (ApiHostTemplate) o;
    return Objects.equals(this.name, apiHostTemplate.name) &&
        Objects.equals(this.clusterRef, apiHostTemplate.clusterRef) &&
        Objects.equals(this.roleConfigGroupRefs, apiHostTemplate.roleConfigGroupRefs);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, clusterRef, roleConfigGroupRefs);
  }


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

}
