/*
 * 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.ApiEntityTag;
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;
/**
 * Host templates will contain information about the role config groups that should be applied to a host. This basically means a host will have a role corresponding to each config group.
 */
@Schema(description = "Host templates will contain information about the role config groups that should be applied to a host. This basically means a host will have a role corresponding to each config group.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiClusterTemplateHostTemplate {
  @SerializedName("refName")
  private String refName = null;

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

  @SerializedName("cardinality")
  private java.math.BigDecimal cardinality = null;

  @SerializedName("tags")
  private List<ApiEntityTag> tags = null;

  public ApiClusterTemplateHostTemplate refName(String refName) {
    this.refName = refName;
    return this;
  }

   /**
   * Reference name
   * @return refName
  **/
  @Schema(description = "Reference name")
  public String getRefName() {
    return refName;
  }

  public void setRefName(String refName) {
    this.refName = refName;
  }

  public ApiClusterTemplateHostTemplate roleConfigGroupsRefNames(List<String> roleConfigGroupsRefNames) {
    this.roleConfigGroupsRefNames = roleConfigGroupsRefNames;
    return this;
  }

  public ApiClusterTemplateHostTemplate addRoleConfigGroupsRefNamesItem(String roleConfigGroupsRefNamesItem) {
    if (this.roleConfigGroupsRefNames == null) {
      this.roleConfigGroupsRefNames = new ArrayList<>();
    }
    this.roleConfigGroupsRefNames.add(roleConfigGroupsRefNamesItem);
    return this;
  }

   /**
   * List of role config groups
   * @return roleConfigGroupsRefNames
  **/
  @Schema(description = "List of role config groups")
  public List<String> getRoleConfigGroupsRefNames() {
    return roleConfigGroupsRefNames;
  }

  public void setRoleConfigGroupsRefNames(List<String> roleConfigGroupsRefNames) {
    this.roleConfigGroupsRefNames = roleConfigGroupsRefNames;
  }

  public ApiClusterTemplateHostTemplate cardinality(java.math.BigDecimal cardinality) {
    this.cardinality = cardinality;
    return this;
  }

   /**
   * Represent the cardinality of this host template on source. Defaults to 0.
   * @return cardinality
  **/
  @Schema(description = "Represent the cardinality of this host template on source. Defaults to 0.")
  public java.math.BigDecimal getCardinality() {
    return cardinality;
  }

  public void setCardinality(java.math.BigDecimal cardinality) {
    this.cardinality = cardinality;
  }

  public ApiClusterTemplateHostTemplate tags(List<ApiEntityTag> tags) {
    this.tags = tags;
    return this;
  }

  public ApiClusterTemplateHostTemplate addTagsItem(ApiEntityTag tagsItem) {
    if (this.tags == null) {
      this.tags = new ArrayList<>();
    }
    this.tags.add(tagsItem);
    return this;
  }

   /**
   * The tags to be added to hosts when this template is applied
   * @return tags
  **/
  @Schema(description = "The tags to be added to hosts when this template is applied")
  public List<ApiEntityTag> getTags() {
    return tags;
  }

  public void setTags(List<ApiEntityTag> tags) {
    this.tags = tags;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiClusterTemplateHostTemplate apiClusterTemplateHostTemplate = (ApiClusterTemplateHostTemplate) o;
    return Objects.equals(this.refName, apiClusterTemplateHostTemplate.refName) &&
        Objects.equals(this.roleConfigGroupsRefNames, apiClusterTemplateHostTemplate.roleConfigGroupsRefNames) &&
        Objects.equals(this.cardinality, apiClusterTemplateHostTemplate.cardinality) &&
        Objects.equals(this.tags, apiClusterTemplateHostTemplate.tags);
  }

  @Override
  public int hashCode() {
    return Objects.hash(refName, roleConfigGroupsRefNames, cardinality, tags);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiClusterTemplateHostTemplate {\n");
    
    sb.append("    refName: ").append(toIndentedString(refName)).append("\n");
    sb.append("    roleConfigGroupsRefNames: ").append(toIndentedString(roleConfigGroupsRefNames)).append("\n");
    sb.append("    cardinality: ").append(toIndentedString(cardinality)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).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    ");
  }

}
