/*
 * 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;
/**
 * Associates a hostname with its corresponding certificate and private key
 */
@Schema(description = "Associates a hostname with its corresponding certificate and private key")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiHostCertInfo {
  @SerializedName("hostname")
  private String hostname = null;

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

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

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

  public ApiHostCertInfo hostname(String hostname) {
    this.hostname = hostname;
    return this;
  }

   /**
   * The FQDN of a host in the deployment.
   * @return hostname
  **/
  @Schema(description = "The FQDN of a host in the deployment.")
  public String getHostname() {
    return hostname;
  }

  public void setHostname(String hostname) {
    this.hostname = hostname;
  }

  public ApiHostCertInfo certificate(String certificate) {
    this.certificate = certificate;
    return this;
  }

   /**
   * The certificate for this host in PEM format.
   * @return certificate
  **/
  @Schema(example = "host-cert.pem", description = "The certificate for this host in PEM format.")
  public String getCertificate() {
    return certificate;
  }

  public void setCertificate(String certificate) {
    this.certificate = certificate;
  }

  public ApiHostCertInfo key(String key) {
    this.key = key;
    return this;
  }

   /**
   * The private key for this host in PEM format.
   * @return key
  **/
  @Schema(example = "host-key.pem", description = "The private key for this host in PEM format.")
  public String getKey() {
    return key;
  }

  public void setKey(String key) {
    this.key = key;
  }

  public ApiHostCertInfo subjectAltNames(List<String> subjectAltNames) {
    this.subjectAltNames = subjectAltNames;
    return this;
  }

  public ApiHostCertInfo addSubjectAltNamesItem(String subjectAltNamesItem) {
    if (this.subjectAltNames == null) {
      this.subjectAltNames = new ArrayList<>();
    }
    this.subjectAltNames.add(subjectAltNamesItem);
    return this;
  }

   /**
   * A list of alt names for a host.
   * @return subjectAltNames
  **/
  @Schema(example = "DNS:example.cloudera.com", description = "A list of alt names for a host.")
  public List<String> getSubjectAltNames() {
    return subjectAltNames;
  }

  public void setSubjectAltNames(List<String> subjectAltNames) {
    this.subjectAltNames = subjectAltNames;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiHostCertInfo apiHostCertInfo = (ApiHostCertInfo) o;
    return Objects.equals(this.hostname, apiHostCertInfo.hostname) &&
        Objects.equals(this.certificate, apiHostCertInfo.certificate) &&
        Objects.equals(this.key, apiHostCertInfo.key) &&
        Objects.equals(this.subjectAltNames, apiHostCertInfo.subjectAltNames);
  }

  @Override
  public int hashCode() {
    return Objects.hash(hostname, certificate, key, subjectAltNames);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiHostCertInfo {\n");
    
    sb.append("    hostname: ").append(toIndentedString(hostname)).append("\n");
    sb.append("    certificate: ").append(toIndentedString(certificate)).append("\n");
    sb.append("    key: ").append(toIndentedString(key)).append("\n");
    sb.append("    subjectAltNames: ").append(toIndentedString(subjectAltNames)).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    ");
  }

}
