/*
 * 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;
/**
 * This API class represents a request to retrieve Auto-TLS certificates for a given host. The request contains the host requesting the certificate, a valid token generated by the certmanager utility, and optionally a certificate signing request.  Currently, the certificate signing request argument is not supported.
 */
@Schema(description = "This API class represents a request to retrieve Auto-TLS certificates for a given host. The request contains the host requesting the certificate, a valid token generated by the certmanager utility, and optionally a certificate signing request.  Currently, the certificate signing request argument is not supported.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

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

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

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

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

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

   /**
   * Get the hostname of the host requesting certificates
   * @return hostname
  **/
  @Schema(description = "Get the hostname of the host requesting certificates")
  public String getHostname() {
    return hostname;
  }

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

  public ApiCertificateRequest csr(String csr) {
    this.csr = csr;
    return this;
  }

   /**
   * Get the certificate signing request in PEM format
   * @return csr
  **/
  @Schema(description = "Get the certificate signing request in PEM format")
  public String getCsr() {
    return csr;
  }

  public void setCsr(String csr) {
    this.csr = csr;
  }

  public ApiCertificateRequest token(String token) {
    this.token = token;
    return this;
  }

   /**
   * Get the certificate request token
   * @return token
  **/
  @Schema(description = "Get the certificate request token")
  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

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

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

   /**
   * Get subjectAltNames
   * @return subjectAltNames
  **/
  @Schema(description = "")
  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;
    }
    ApiCertificateRequest apiCertificateRequest = (ApiCertificateRequest) o;
    return Objects.equals(this.hostname, apiCertificateRequest.hostname) &&
        Objects.equals(this.csr, apiCertificateRequest.csr) &&
        Objects.equals(this.token, apiCertificateRequest.token) &&
        Objects.equals(this.subjectAltNames, apiCertificateRequest.subjectAltNames);
  }

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


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

}
