/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.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 com.cloudera.api.swagger.model.ApiHostCertInfo;
import com.cloudera.api.swagger.model.BaseApiSshCmdArguments;
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.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Arguments to generate a Cloudera Manager Certificate Authority (CMCA).
 */
@ApiModel(description = "Arguments to generate a Cloudera Manager Certificate Authority (CMCA).")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiGenerateCmcaArguments {
  @SerializedName("sshPort")
  private java.math.BigDecimal sshPort = null;

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

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

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

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

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

  @SerializedName("customCA")
  private Boolean customCA = null;

  @SerializedName("interpretAsFilenames")
  private Boolean interpretAsFilenames = null;

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

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

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

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

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

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

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

  @SerializedName("hostCerts")
  private List<ApiHostCertInfo> hostCerts = null;

  @SerializedName("configureAllServices")
  private Boolean configureAllServices = null;

  public ApiGenerateCmcaArguments sshPort(java.math.BigDecimal sshPort) {
    this.sshPort = sshPort;
    return this;
  }

   /**
   * SSH port. If unset, defaults to 22.
   * @return sshPort
  **/
  @ApiModelProperty(example = "22", value = "SSH port. If unset, defaults to 22.")
  public java.math.BigDecimal getSshPort() {
    return sshPort;
  }

  public void setSshPort(java.math.BigDecimal sshPort) {
    this.sshPort = sshPort;
  }

  public ApiGenerateCmcaArguments userName(String userName) {
    this.userName = userName;
    return this;
  }

   /**
   * The username used to authenticate with the hosts. Root access to your hosts is required to install Cloudera packages. The installer will connect to your hosts via SSH and log in either directly as root or as another user with password-less sudo privileges to become root.
   * @return userName
  **/
  @ApiModelProperty(value = "The username used to authenticate with the hosts. Root access to your hosts is required to install Cloudera packages. The installer will connect to your hosts via SSH and log in either directly as root or as another user with password-less sudo privileges to become root.")
  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public ApiGenerateCmcaArguments password(String password) {
    this.password = password;
    return this;
  }

   /**
   * The password used to authenticate with the hosts. Specify either this or a private key. For password-less login, use an empty string as password.
   * @return password
  **/
  @ApiModelProperty(value = "The password used to authenticate with the hosts. Specify either this or a private key. For password-less login, use an empty string as password.")
  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public ApiGenerateCmcaArguments privateKey(String privateKey) {
    this.privateKey = privateKey;
    return this;
  }

   /**
   * The private key to authenticate with the hosts. Specify either this or a password. &lt;br&gt; The private key, if specified, needs to be a standard PEM-encoded key as a single string, with all line breaks replaced with the line-feed control character &#39;\\n&#39;. &lt;br&gt; A value will typically look like the following string: &lt;br&gt; -----BEGIN RSA PRIVATE KEY-----\\n[base-64 encoded key]\\n-----END RSA PRIVATE KEY----- &lt;br&gt;
   * @return privateKey
  **/
  @ApiModelProperty(value = "The private key to authenticate with the hosts. Specify either this or a password. <br> The private key, if specified, needs to be a standard PEM-encoded key as a single string, with all line breaks replaced with the line-feed control character '\\n'. <br> A value will typically look like the following string: <br> -----BEGIN RSA PRIVATE KEY-----\\n[base-64 encoded key]\\n-----END RSA PRIVATE KEY----- <br>")
  public String getPrivateKey() {
    return privateKey;
  }

  public void setPrivateKey(String privateKey) {
    this.privateKey = privateKey;
  }

  public ApiGenerateCmcaArguments passphrase(String passphrase) {
    this.passphrase = passphrase;
    return this;
  }

   /**
   * The passphrase associated with the private key used to authenticate with the hosts (optional).
   * @return passphrase
  **/
  @ApiModelProperty(value = "The passphrase associated with the private key used to authenticate with the hosts (optional).")
  public String getPassphrase() {
    return passphrase;
  }

  public void setPassphrase(String passphrase) {
    this.passphrase = passphrase;
  }

  public ApiGenerateCmcaArguments location(String location) {
    this.location = location;
    return this;
  }

   /**
   * The location on disk to store the CMCA directory. If there is already a CMCA created there, it will be backed up, and a new one will be created in its place.
   * @return location
  **/
  @ApiModelProperty(example = "/opt/cloudera/CMCA", value = "The location on disk to store the CMCA directory. If there is already a CMCA created there, it will be backed up, and a new one will be created in its place.")
  public String getLocation() {
    return location;
  }

  public void setLocation(String location) {
    this.location = location;
  }

  public ApiGenerateCmcaArguments customCA(Boolean customCA) {
    this.customCA = customCA;
    return this;
  }

   /**
   * Whether to generate an internal CMCA (false) or use user-provided certificates (true).  When set to true (user-provided certificates), the following other arguments must be given: * cmHostCert * cmHostKey * caCert * keystorePasswd * truststorePasswd
   * @return customCA
  **/
  @ApiModelProperty(example = "false", value = "Whether to generate an internal CMCA (false) or use user-provided certificates (true).  When set to true (user-provided certificates), the following other arguments must be given: * cmHostCert * cmHostKey * caCert * keystorePasswd * truststorePasswd")
  public Boolean getCustomCA() {
    return customCA;
  }

  public void setCustomCA(Boolean customCA) {
    this.customCA = customCA;
  }

  public ApiGenerateCmcaArguments interpretAsFilenames(Boolean interpretAsFilenames) {
    this.interpretAsFilenames = interpretAsFilenames;
    return this;
  }

   /**
   * Whether the following arguments are interpreted as filenames local to the Cloudera Manager host (true, default) or as the actual data for that argument: * cmHostCert * cmHostKey * caCert * keystorePasswd * truststorePasswd * trustedCaCerts * hostCerts.hostCert * hostCerts.hostKey  If HTTPS has not been enabled on the Cloudera Manager Admin Console and API, we *strongly* recommend that you pass the arguments as filenames local to the Cloudera Manager host (i.e. set to true) to avoid leaking sensitive information over the wire in plaintext.
   * @return interpretAsFilenames
  **/
  @ApiModelProperty(example = "true", value = "Whether the following arguments are interpreted as filenames local to the Cloudera Manager host (true, default) or as the actual data for that argument: * cmHostCert * cmHostKey * caCert * keystorePasswd * truststorePasswd * trustedCaCerts * hostCerts.hostCert * hostCerts.hostKey  If HTTPS has not been enabled on the Cloudera Manager Admin Console and API, we *strongly* recommend that you pass the arguments as filenames local to the Cloudera Manager host (i.e. set to true) to avoid leaking sensitive information over the wire in plaintext.")
  public Boolean getInterpretAsFilenames() {
    return interpretAsFilenames;
  }

  public void setInterpretAsFilenames(Boolean interpretAsFilenames) {
    this.interpretAsFilenames = interpretAsFilenames;
  }

  public ApiGenerateCmcaArguments cmHostCert(String cmHostCert) {
    this.cmHostCert = cmHostCert;
    return this;
  }

   /**
   * The certificate for the CM host in PEM format. Only used if customCA &#x3D;&#x3D; true.
   * @return cmHostCert
  **/
  @ApiModelProperty(example = "host-cert.pem", value = "The certificate for the CM host in PEM format. Only used if customCA == true.")
  public String getCmHostCert() {
    return cmHostCert;
  }

  public void setCmHostCert(String cmHostCert) {
    this.cmHostCert = cmHostCert;
  }

  public ApiGenerateCmcaArguments cmHostKey(String cmHostKey) {
    this.cmHostKey = cmHostKey;
    return this;
  }

   /**
   * The private key for the CM host in PEM format. Only used if customCA &#x3D;&#x3D; true.
   * @return cmHostKey
  **/
  @ApiModelProperty(example = "host-key.pem", value = "The private key for the CM host in PEM format. Only used if customCA == true.")
  public String getCmHostKey() {
    return cmHostKey;
  }

  public void setCmHostKey(String cmHostKey) {
    this.cmHostKey = cmHostKey;
  }

  public ApiGenerateCmcaArguments caCert(String caCert) {
    this.caCert = caCert;
    return this;
  }

   /**
   * The certificate for the user-provided certificate authority in PEM format. Only used if customCA &#x3D;&#x3D; true.
   * @return caCert
  **/
  @ApiModelProperty(example = "ca-cert.pem", value = "The certificate for the user-provided certificate authority in PEM format. Only used if customCA == true.")
  public String getCaCert() {
    return caCert;
  }

  public void setCaCert(String caCert) {
    this.caCert = caCert;
  }

  public ApiGenerateCmcaArguments keystorePasswd(String keystorePasswd) {
    this.keystorePasswd = keystorePasswd;
    return this;
  }

   /**
   * The password used for all Auto-TLS keystores. Only used if customCA &#x3D;&#x3D; true.
   * @return keystorePasswd
  **/
  @ApiModelProperty(example = "keystore.pw.txt", value = "The password used for all Auto-TLS keystores. Only used if customCA == true.")
  public String getKeystorePasswd() {
    return keystorePasswd;
  }

  public void setKeystorePasswd(String keystorePasswd) {
    this.keystorePasswd = keystorePasswd;
  }

  public ApiGenerateCmcaArguments truststorePasswd(String truststorePasswd) {
    this.truststorePasswd = truststorePasswd;
    return this;
  }

   /**
   * The password used for all Auto-TLS truststores. Only used if customCA &#x3D;&#x3D; true.
   * @return truststorePasswd
  **/
  @ApiModelProperty(example = "truststore.pw.txt", value = "The password used for all Auto-TLS truststores. Only used if customCA == true.")
  public String getTruststorePasswd() {
    return truststorePasswd;
  }

  public void setTruststorePasswd(String truststorePasswd) {
    this.truststorePasswd = truststorePasswd;
  }

  public ApiGenerateCmcaArguments trustedCaCerts(String trustedCaCerts) {
    this.trustedCaCerts = trustedCaCerts;
    return this;
  }

   /**
   * A list of CA certificates that will be imported into the Auto-TLS truststore and distributed to all hosts.
   * @return trustedCaCerts
  **/
  @ApiModelProperty(example = "cacerts.pem", value = "A list of CA certificates that will be imported into the Auto-TLS truststore and distributed to all hosts.")
  public String getTrustedCaCerts() {
    return trustedCaCerts;
  }

  public void setTrustedCaCerts(String trustedCaCerts) {
    this.trustedCaCerts = trustedCaCerts;
  }

  public ApiGenerateCmcaArguments additionalArguments(List<String> additionalArguments) {
    this.additionalArguments = additionalArguments;
    return this;
  }

  public ApiGenerateCmcaArguments addAdditionalArgumentsItem(String additionalArgumentsItem) {
    if (this.additionalArguments == null) {
      this.additionalArguments = new ArrayList<String>();
    }
    this.additionalArguments.add(additionalArgumentsItem);
    return this;
  }

   /**
   * A list of additional arguments that can be passed to the certificate manager
   * @return additionalArguments
  **/
  @ApiModelProperty(example = "\"--override\"", value = "A list of additional arguments that can be passed to the certificate manager")
  public List<String> getAdditionalArguments() {
    return additionalArguments;
  }

  public void setAdditionalArguments(List<String> additionalArguments) {
    this.additionalArguments = additionalArguments;
  }

  public ApiGenerateCmcaArguments hostCerts(List<ApiHostCertInfo> hostCerts) {
    this.hostCerts = hostCerts;
    return this;
  }

  public ApiGenerateCmcaArguments addHostCertsItem(ApiHostCertInfo hostCertsItem) {
    if (this.hostCerts == null) {
      this.hostCerts = new ArrayList<ApiHostCertInfo>();
    }
    this.hostCerts.add(hostCertsItem);
    return this;
  }

   /**
   * A list of HostCertInfo objects, which associate a hostname with the corresponding certificate and private key. Only used if customCA &#x3D;&#x3D; true.
   * @return hostCerts
  **/
  @ApiModelProperty(value = "A list of HostCertInfo objects, which associate a hostname with the corresponding certificate and private key. Only used if customCA == true.")
  public List<ApiHostCertInfo> getHostCerts() {
    return hostCerts;
  }

  public void setHostCerts(List<ApiHostCertInfo> hostCerts) {
    this.hostCerts = hostCerts;
  }

  public ApiGenerateCmcaArguments configureAllServices(Boolean configureAllServices) {
    this.configureAllServices = configureAllServices;
    return this;
  }

   /**
   * Whether to configure all existing services to use Auto-TLS. Defaults to false.  If false, only MGMT services will be configured to use Auto-TLS. Use the cluster-level ConfigureAutoTlsServices command to configure Auto-TLS services for a single cluster only.  All future services will be configured to use Auto-TLS regardless of this setting.
   * @return configureAllServices
  **/
  @ApiModelProperty(value = "Whether to configure all existing services to use Auto-TLS. Defaults to false.  If false, only MGMT services will be configured to use Auto-TLS. Use the cluster-level ConfigureAutoTlsServices command to configure Auto-TLS services for a single cluster only.  All future services will be configured to use Auto-TLS regardless of this setting.")
  public Boolean getConfigureAllServices() {
    return configureAllServices;
  }

  public void setConfigureAllServices(Boolean configureAllServices) {
    this.configureAllServices = configureAllServices;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiGenerateCmcaArguments apiGenerateCmcaArguments = (ApiGenerateCmcaArguments) o;
    return Objects.equals(this.sshPort, apiGenerateCmcaArguments.sshPort) &&
        Objects.equals(this.userName, apiGenerateCmcaArguments.userName) &&
        Objects.equals(this.password, apiGenerateCmcaArguments.password) &&
        Objects.equals(this.privateKey, apiGenerateCmcaArguments.privateKey) &&
        Objects.equals(this.passphrase, apiGenerateCmcaArguments.passphrase) &&
        Objects.equals(this.location, apiGenerateCmcaArguments.location) &&
        Objects.equals(this.customCA, apiGenerateCmcaArguments.customCA) &&
        Objects.equals(this.interpretAsFilenames, apiGenerateCmcaArguments.interpretAsFilenames) &&
        Objects.equals(this.cmHostCert, apiGenerateCmcaArguments.cmHostCert) &&
        Objects.equals(this.cmHostKey, apiGenerateCmcaArguments.cmHostKey) &&
        Objects.equals(this.caCert, apiGenerateCmcaArguments.caCert) &&
        Objects.equals(this.keystorePasswd, apiGenerateCmcaArguments.keystorePasswd) &&
        Objects.equals(this.truststorePasswd, apiGenerateCmcaArguments.truststorePasswd) &&
        Objects.equals(this.trustedCaCerts, apiGenerateCmcaArguments.trustedCaCerts) &&
        Objects.equals(this.additionalArguments, apiGenerateCmcaArguments.additionalArguments) &&
        Objects.equals(this.hostCerts, apiGenerateCmcaArguments.hostCerts) &&
        Objects.equals(this.configureAllServices, apiGenerateCmcaArguments.configureAllServices);
  }

  @Override
  public int hashCode() {
    return Objects.hash(sshPort, userName, password, privateKey, passphrase, location, customCA, interpretAsFilenames, cmHostCert, cmHostKey, caCert, keystorePasswd, truststorePasswd, trustedCaCerts, additionalArguments, hostCerts, configureAllServices);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiGenerateCmcaArguments {\n");
    
    sb.append("    sshPort: ").append(toIndentedString(sshPort)).append("\n");
    sb.append("    userName: ").append(toIndentedString(userName)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    privateKey: ").append(toIndentedString(privateKey)).append("\n");
    sb.append("    passphrase: ").append(toIndentedString(passphrase)).append("\n");
    sb.append("    location: ").append(toIndentedString(location)).append("\n");
    sb.append("    customCA: ").append(toIndentedString(customCA)).append("\n");
    sb.append("    interpretAsFilenames: ").append(toIndentedString(interpretAsFilenames)).append("\n");
    sb.append("    cmHostCert: ").append(toIndentedString(cmHostCert)).append("\n");
    sb.append("    cmHostKey: ").append(toIndentedString(cmHostKey)).append("\n");
    sb.append("    caCert: ").append(toIndentedString(caCert)).append("\n");
    sb.append("    keystorePasswd: ").append(toIndentedString(keystorePasswd)).append("\n");
    sb.append("    truststorePasswd: ").append(toIndentedString(truststorePasswd)).append("\n");
    sb.append("    trustedCaCerts: ").append(toIndentedString(trustedCaCerts)).append("\n");
    sb.append("    additionalArguments: ").append(toIndentedString(additionalArguments)).append("\n");
    sb.append("    hostCerts: ").append(toIndentedString(hostCerts)).append("\n");
    sb.append("    configureAllServices: ").append(toIndentedString(configureAllServices)).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    ");
  }
  
}

