/*
 * 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.ApiClusterTemplateClusterSpec;
import com.cloudera.api.swagger.model.ApiClusterTemplateHostTemplate;
import com.cloudera.api.swagger.model.ApiClusterTemplateInstantiator;
import com.cloudera.api.swagger.model.ApiClusterTemplateService;
import com.cloudera.api.swagger.model.ApiEntityTag;
import com.cloudera.api.swagger.model.ApiProductVersion;
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;
/**
 * Details of cluster template
 */
@Schema(description = "Details of cluster template")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiClusterTemplate {
  @SerializedName("cdhVersion")
  private String cdhVersion = null;

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

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

  @SerializedName("products")
  private List<ApiProductVersion> products = null;

  @SerializedName("services")
  private List<ApiClusterTemplateService> services = null;

  @SerializedName("hostTemplates")
  private List<ApiClusterTemplateHostTemplate> hostTemplates = null;

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

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

  @SerializedName("instantiator")
  private ApiClusterTemplateInstantiator instantiator = null;

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

  @SerializedName("clusterSpec")
  private ApiClusterTemplateClusterSpec clusterSpec = null;

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

  public ApiClusterTemplate cdhVersion(String cdhVersion) {
    this.cdhVersion = cdhVersion;
    return this;
  }

   /**
   * CDH version
   * @return cdhVersion
  **/
  @Schema(description = "CDH version")
  public String getCdhVersion() {
    return cdhVersion;
  }

  public void setCdhVersion(String cdhVersion) {
    this.cdhVersion = cdhVersion;
  }

  public ApiClusterTemplate experienceVersion(String experienceVersion) {
    this.experienceVersion = experienceVersion;
    return this;
  }

   /**
   * Deprecated. Use dataServicesVersion instead.
   * @return experienceVersion
  **/
  @Schema(description = "Deprecated. Use dataServicesVersion instead.")
  public String getExperienceVersion() {
    return experienceVersion;
  }

  public void setExperienceVersion(String experienceVersion) {
    this.experienceVersion = experienceVersion;
  }

  public ApiClusterTemplate dataServicesVersion(String dataServicesVersion) {
    this.dataServicesVersion = dataServicesVersion;
    return this;
  }

   /**
   * Data Services version
   * @return dataServicesVersion
  **/
  @Schema(description = "Data Services version")
  public String getDataServicesVersion() {
    return dataServicesVersion;
  }

  public void setDataServicesVersion(String dataServicesVersion) {
    this.dataServicesVersion = dataServicesVersion;
  }

  public ApiClusterTemplate products(List<ApiProductVersion> products) {
    this.products = products;
    return this;
  }

  public ApiClusterTemplate addProductsItem(ApiProductVersion productsItem) {
    if (this.products == null) {
      this.products = new ArrayList<>();
    }
    this.products.add(productsItem);
    return this;
  }

   /**
   * All the parcels that needs to be deployed and activated
   * @return products
  **/
  @Schema(description = "All the parcels that needs to be deployed and activated")
  public List<ApiProductVersion> getProducts() {
    return products;
  }

  public void setProducts(List<ApiProductVersion> products) {
    this.products = products;
  }

  public ApiClusterTemplate services(List<ApiClusterTemplateService> services) {
    this.services = services;
    return this;
  }

  public ApiClusterTemplate addServicesItem(ApiClusterTemplateService servicesItem) {
    if (this.services == null) {
      this.services = new ArrayList<>();
    }
    this.services.add(servicesItem);
    return this;
  }

   /**
   * All the services that needs to be deployed
   * @return services
  **/
  @Schema(description = "All the services that needs to be deployed")
  public List<ApiClusterTemplateService> getServices() {
    return services;
  }

  public void setServices(List<ApiClusterTemplateService> services) {
    this.services = services;
  }

  public ApiClusterTemplate hostTemplates(List<ApiClusterTemplateHostTemplate> hostTemplates) {
    this.hostTemplates = hostTemplates;
    return this;
  }

  public ApiClusterTemplate addHostTemplatesItem(ApiClusterTemplateHostTemplate hostTemplatesItem) {
    if (this.hostTemplates == null) {
      this.hostTemplates = new ArrayList<>();
    }
    this.hostTemplates.add(hostTemplatesItem);
    return this;
  }

   /**
   * All host templates
   * @return hostTemplates
  **/
  @Schema(description = "All host templates")
  public List<ApiClusterTemplateHostTemplate> getHostTemplates() {
    return hostTemplates;
  }

  public void setHostTemplates(List<ApiClusterTemplateHostTemplate> hostTemplates) {
    this.hostTemplates = hostTemplates;
  }

  public ApiClusterTemplate displayName(String displayName) {
    this.displayName = displayName;
    return this;
  }

   /**
   * Cluster display name
   * @return displayName
  **/
  @Schema(description = "Cluster display name")
  public String getDisplayName() {
    return displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

  public ApiClusterTemplate cmVersion(String cmVersion) {
    this.cmVersion = cmVersion;
    return this;
  }

   /**
   * CM version for which the template
   * @return cmVersion
  **/
  @Schema(description = "CM version for which the template")
  public String getCmVersion() {
    return cmVersion;
  }

  public void setCmVersion(String cmVersion) {
    this.cmVersion = cmVersion;
  }

  public ApiClusterTemplate instantiator(ApiClusterTemplateInstantiator instantiator) {
    this.instantiator = instantiator;
    return this;
  }

   /**
   * Get instantiator
   * @return instantiator
  **/
  @Schema(description = "")
  public ApiClusterTemplateInstantiator getInstantiator() {
    return instantiator;
  }

  public void setInstantiator(ApiClusterTemplateInstantiator instantiator) {
    this.instantiator = instantiator;
  }

  public ApiClusterTemplate repositories(List<String> repositories) {
    this.repositories = repositories;
    return this;
  }

  public ApiClusterTemplate addRepositoriesItem(String repositoriesItem) {
    if (this.repositories == null) {
      this.repositories = new ArrayList<>();
    }
    this.repositories.add(repositoriesItem);
    return this;
  }

   /**
   * List of all repositories registered with CM
   * @return repositories
  **/
  @Schema(description = "List of all repositories registered with CM")
  public List<String> getRepositories() {
    return repositories;
  }

  public void setRepositories(List<String> repositories) {
    this.repositories = repositories;
  }

  public ApiClusterTemplate clusterSpec(ApiClusterTemplateClusterSpec clusterSpec) {
    this.clusterSpec = clusterSpec;
    return this;
  }

   /**
   * Get clusterSpec
   * @return clusterSpec
  **/
  @Schema(description = "")
  public ApiClusterTemplateClusterSpec getClusterSpec() {
    return clusterSpec;
  }

  public void setClusterSpec(ApiClusterTemplateClusterSpec clusterSpec) {
    this.clusterSpec = clusterSpec;
  }

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

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

   /**
   * Tags associated with the cluster
   * @return tags
  **/
  @Schema(description = "Tags associated with the cluster")
  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;
    }
    ApiClusterTemplate apiClusterTemplate = (ApiClusterTemplate) o;
    return Objects.equals(this.cdhVersion, apiClusterTemplate.cdhVersion) &&
        Objects.equals(this.experienceVersion, apiClusterTemplate.experienceVersion) &&
        Objects.equals(this.dataServicesVersion, apiClusterTemplate.dataServicesVersion) &&
        Objects.equals(this.products, apiClusterTemplate.products) &&
        Objects.equals(this.services, apiClusterTemplate.services) &&
        Objects.equals(this.hostTemplates, apiClusterTemplate.hostTemplates) &&
        Objects.equals(this.displayName, apiClusterTemplate.displayName) &&
        Objects.equals(this.cmVersion, apiClusterTemplate.cmVersion) &&
        Objects.equals(this.instantiator, apiClusterTemplate.instantiator) &&
        Objects.equals(this.repositories, apiClusterTemplate.repositories) &&
        Objects.equals(this.clusterSpec, apiClusterTemplate.clusterSpec) &&
        Objects.equals(this.tags, apiClusterTemplate.tags);
  }

  @Override
  public int hashCode() {
    return Objects.hash(cdhVersion, experienceVersion, dataServicesVersion, products, services, hostTemplates, displayName, cmVersion, instantiator, repositories, clusterSpec, tags);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiClusterTemplate {\n");
    
    sb.append("    cdhVersion: ").append(toIndentedString(cdhVersion)).append("\n");
    sb.append("    experienceVersion: ").append(toIndentedString(experienceVersion)).append("\n");
    sb.append("    dataServicesVersion: ").append(toIndentedString(dataServicesVersion)).append("\n");
    sb.append("    products: ").append(toIndentedString(products)).append("\n");
    sb.append("    services: ").append(toIndentedString(services)).append("\n");
    sb.append("    hostTemplates: ").append(toIndentedString(hostTemplates)).append("\n");
    sb.append("    displayName: ").append(toIndentedString(displayName)).append("\n");
    sb.append("    cmVersion: ").append(toIndentedString(cmVersion)).append("\n");
    sb.append("    instantiator: ").append(toIndentedString(instantiator)).append("\n");
    sb.append("    repositories: ").append(toIndentedString(repositories)).append("\n");
    sb.append("    clusterSpec: ").append(toIndentedString(clusterSpec)).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    ");
  }

}
