/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.iot.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *

* The input to the RegisterCACertificate operation. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RegisterCACertificateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The CA certificate. *

*/ private String caCertificate; /** *

* The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is DEFAULT * or not provided, the verificationCertificate field must not be empty. *

*/ private String verificationCertificate; /** *

* A boolean value that specifies if the CA certificate is set to active. *

*

* Valid values: ACTIVE | INACTIVE *

*/ private Boolean setAsActive; /** *

* Allows this CA certificate to be used for auto registration of device certificates. *

*/ private Boolean allowAutoRegistration; /** *

* Information about the registration configuration. *

*/ private RegistrationConfig registrationConfig; /** *

* Metadata which can be used to manage the CA certificate. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*
*/ private java.util.List tags; /** *

* Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not provided, it * defaults to DEFAULT. All the device certificates that are registered using this CA will be * registered in the same certificate mode as the CA. For more information about certificate mode for device * certificates, see certificate mode. *

*/ private String certificateMode; /** *

* The CA certificate. *

* * @param caCertificate * The CA certificate. */ public void setCaCertificate(String caCertificate) { this.caCertificate = caCertificate; } /** *

* The CA certificate. *

* * @return The CA certificate. */ public String getCaCertificate() { return this.caCertificate; } /** *

* The CA certificate. *

* * @param caCertificate * The CA certificate. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withCaCertificate(String caCertificate) { setCaCertificate(caCertificate); return this; } /** *

* The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is DEFAULT * or not provided, the verificationCertificate field must not be empty. *

* * @param verificationCertificate * The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is * DEFAULT or not provided, the verificationCertificate field must not be empty. */ public void setVerificationCertificate(String verificationCertificate) { this.verificationCertificate = verificationCertificate; } /** *

* The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is DEFAULT * or not provided, the verificationCertificate field must not be empty. *

* * @return The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is * DEFAULT or not provided, the verificationCertificate field must not be empty. */ public String getVerificationCertificate() { return this.verificationCertificate; } /** *

* The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is DEFAULT * or not provided, the verificationCertificate field must not be empty. *

* * @param verificationCertificate * The private key verification certificate. If certificateMode is SNI_ONLY, the * verificationCertificate field must be empty. If certificateMode is * DEFAULT or not provided, the verificationCertificate field must not be empty. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withVerificationCertificate(String verificationCertificate) { setVerificationCertificate(verificationCertificate); return this; } /** *

* A boolean value that specifies if the CA certificate is set to active. *

*

* Valid values: ACTIVE | INACTIVE *

* * @param setAsActive * A boolean value that specifies if the CA certificate is set to active.

*

* Valid values: ACTIVE | INACTIVE */ public void setSetAsActive(Boolean setAsActive) { this.setAsActive = setAsActive; } /** *

* A boolean value that specifies if the CA certificate is set to active. *

*

* Valid values: ACTIVE | INACTIVE *

* * @return A boolean value that specifies if the CA certificate is set to active.

*

* Valid values: ACTIVE | INACTIVE */ public Boolean getSetAsActive() { return this.setAsActive; } /** *

* A boolean value that specifies if the CA certificate is set to active. *

*

* Valid values: ACTIVE | INACTIVE *

* * @param setAsActive * A boolean value that specifies if the CA certificate is set to active.

*

* Valid values: ACTIVE | INACTIVE * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withSetAsActive(Boolean setAsActive) { setSetAsActive(setAsActive); return this; } /** *

* A boolean value that specifies if the CA certificate is set to active. *

*

* Valid values: ACTIVE | INACTIVE *

* * @return A boolean value that specifies if the CA certificate is set to active.

*

* Valid values: ACTIVE | INACTIVE */ public Boolean isSetAsActive() { return this.setAsActive; } /** *

* Allows this CA certificate to be used for auto registration of device certificates. *

* * @param allowAutoRegistration * Allows this CA certificate to be used for auto registration of device certificates. */ public void setAllowAutoRegistration(Boolean allowAutoRegistration) { this.allowAutoRegistration = allowAutoRegistration; } /** *

* Allows this CA certificate to be used for auto registration of device certificates. *

* * @return Allows this CA certificate to be used for auto registration of device certificates. */ public Boolean getAllowAutoRegistration() { return this.allowAutoRegistration; } /** *

* Allows this CA certificate to be used for auto registration of device certificates. *

* * @param allowAutoRegistration * Allows this CA certificate to be used for auto registration of device certificates. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withAllowAutoRegistration(Boolean allowAutoRegistration) { setAllowAutoRegistration(allowAutoRegistration); return this; } /** *

* Allows this CA certificate to be used for auto registration of device certificates. *

* * @return Allows this CA certificate to be used for auto registration of device certificates. */ public Boolean isAllowAutoRegistration() { return this.allowAutoRegistration; } /** *

* Information about the registration configuration. *

* * @param registrationConfig * Information about the registration configuration. */ public void setRegistrationConfig(RegistrationConfig registrationConfig) { this.registrationConfig = registrationConfig; } /** *

* Information about the registration configuration. *

* * @return Information about the registration configuration. */ public RegistrationConfig getRegistrationConfig() { return this.registrationConfig; } /** *

* Information about the registration configuration. *

* * @param registrationConfig * Information about the registration configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withRegistrationConfig(RegistrationConfig registrationConfig) { setRegistrationConfig(registrationConfig); return this; } /** *

* Metadata which can be used to manage the CA certificate. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*
* * @return Metadata which can be used to manage the CA certificate.

*

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*/ public java.util.List getTags() { return tags; } /** *

* Metadata which can be used to manage the CA certificate. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*
* * @param tags * Metadata which can be used to manage the CA certificate.

*

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*/ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Metadata which can be used to manage the CA certificate. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*
*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * Metadata which can be used to manage the CA certificate.

*

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

* @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* Metadata which can be used to manage the CA certificate. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

*
* * @param tags * Metadata which can be used to manage the CA certificate.

*

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." *

* @return Returns a reference to this object so that method calls can be chained together. */ public RegisterCACertificateRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not provided, it * defaults to DEFAULT. All the device certificates that are registered using this CA will be * registered in the same certificate mode as the CA. For more information about certificate mode for device * certificates, see certificate mode. *

* * @param certificateMode * Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not * provided, it defaults to DEFAULT. All the device certificates that are registered using this * CA will be registered in the same certificate mode as the CA. For more information about certificate mode * for device certificates, see certificate mode. * @see CertificateMode */ public void setCertificateMode(String certificateMode) { this.certificateMode = certificateMode; } /** *

* Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not provided, it * defaults to DEFAULT. All the device certificates that are registered using this CA will be * registered in the same certificate mode as the CA. For more information about certificate mode for device * certificates, see certificate mode. *

* * @return Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not * provided, it defaults to DEFAULT. All the device certificates that are registered using this * CA will be registered in the same certificate mode as the CA. For more information about certificate mode * for device certificates, see certificate mode. * @see CertificateMode */ public String getCertificateMode() { return this.certificateMode; } /** *

* Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not provided, it * defaults to DEFAULT. All the device certificates that are registered using this CA will be * registered in the same certificate mode as the CA. For more information about certificate mode for device * certificates, see certificate mode. *

* * @param certificateMode * Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not * provided, it defaults to DEFAULT. All the device certificates that are registered using this * CA will be registered in the same certificate mode as the CA. For more information about certificate mode * for device certificates, see certificate mode. * @return Returns a reference to this object so that method calls can be chained together. * @see CertificateMode */ public RegisterCACertificateRequest withCertificateMode(String certificateMode) { setCertificateMode(certificateMode); return this; } /** *

* Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not provided, it * defaults to DEFAULT. All the device certificates that are registered using this CA will be * registered in the same certificate mode as the CA. For more information about certificate mode for device * certificates, see certificate mode. *

* * @param certificateMode * Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the * verificationCertificate field is not provided, set certificateMode to be * SNI_ONLY. If the verificationCertificate field is provided, set * certificateMode to be DEFAULT. When certificateMode is not * provided, it defaults to DEFAULT. All the device certificates that are registered using this * CA will be registered in the same certificate mode as the CA. For more information about certificate mode * for device certificates, see certificate mode. * @return Returns a reference to this object so that method calls can be chained together. * @see CertificateMode */ public RegisterCACertificateRequest withCertificateMode(CertificateMode certificateMode) { this.certificateMode = certificateMode.toString(); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCaCertificate() != null) sb.append("CaCertificate: ").append(getCaCertificate()).append(","); if (getVerificationCertificate() != null) sb.append("VerificationCertificate: ").append(getVerificationCertificate()).append(","); if (getSetAsActive() != null) sb.append("SetAsActive: ").append(getSetAsActive()).append(","); if (getAllowAutoRegistration() != null) sb.append("AllowAutoRegistration: ").append(getAllowAutoRegistration()).append(","); if (getRegistrationConfig() != null) sb.append("RegistrationConfig: ").append(getRegistrationConfig()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getCertificateMode() != null) sb.append("CertificateMode: ").append(getCertificateMode()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RegisterCACertificateRequest == false) return false; RegisterCACertificateRequest other = (RegisterCACertificateRequest) obj; if (other.getCaCertificate() == null ^ this.getCaCertificate() == null) return false; if (other.getCaCertificate() != null && other.getCaCertificate().equals(this.getCaCertificate()) == false) return false; if (other.getVerificationCertificate() == null ^ this.getVerificationCertificate() == null) return false; if (other.getVerificationCertificate() != null && other.getVerificationCertificate().equals(this.getVerificationCertificate()) == false) return false; if (other.getSetAsActive() == null ^ this.getSetAsActive() == null) return false; if (other.getSetAsActive() != null && other.getSetAsActive().equals(this.getSetAsActive()) == false) return false; if (other.getAllowAutoRegistration() == null ^ this.getAllowAutoRegistration() == null) return false; if (other.getAllowAutoRegistration() != null && other.getAllowAutoRegistration().equals(this.getAllowAutoRegistration()) == false) return false; if (other.getRegistrationConfig() == null ^ this.getRegistrationConfig() == null) return false; if (other.getRegistrationConfig() != null && other.getRegistrationConfig().equals(this.getRegistrationConfig()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getCertificateMode() == null ^ this.getCertificateMode() == null) return false; if (other.getCertificateMode() != null && other.getCertificateMode().equals(this.getCertificateMode()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCaCertificate() == null) ? 0 : getCaCertificate().hashCode()); hashCode = prime * hashCode + ((getVerificationCertificate() == null) ? 0 : getVerificationCertificate().hashCode()); hashCode = prime * hashCode + ((getSetAsActive() == null) ? 0 : getSetAsActive().hashCode()); hashCode = prime * hashCode + ((getAllowAutoRegistration() == null) ? 0 : getAllowAutoRegistration().hashCode()); hashCode = prime * hashCode + ((getRegistrationConfig() == null) ? 0 : getRegistrationConfig().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getCertificateMode() == null) ? 0 : getCertificateMode().hashCode()); return hashCode; } @Override public RegisterCACertificateRequest clone() { return (RegisterCACertificateRequest) super.clone(); } }