
com.amazonaws.services.certificatemanager.model.ImportCertificateRequest Maven / Gradle / Ivy
/*
* 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.certificatemanager.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImportCertificateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name
* (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*
*/
private String certificateArn;
/**
*
* The certificate to import.
*
*/
private java.nio.ByteBuffer certificate;
/**
*
* The private key that matches the public key in the certificate.
*
*/
private java.nio.ByteBuffer privateKey;
/**
*
* The PEM encoded certificate chain.
*
*/
private java.nio.ByteBuffer certificateChain;
/**
*
* One or more resource tags to associate with the imported certificate.
*
*
* Note: You cannot apply tags when reimporting a certificate.
*
*/
private java.util.List tags;
/**
*
* The Amazon Resource Name
* (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*
*
* @param certificateArn
* The Amazon Resource
* Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*/
public void setCertificateArn(String certificateArn) {
this.certificateArn = certificateArn;
}
/**
*
* The Amazon Resource Name
* (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*
*
* @return The Amazon Resource
* Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*/
public String getCertificateArn() {
return this.certificateArn;
}
/**
*
* The Amazon Resource Name
* (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
*
*
* @param certificateArn
* The Amazon Resource
* Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withCertificateArn(String certificateArn) {
setCertificateArn(certificateArn);
return this;
}
/**
*
* The certificate to import.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param certificate
* The certificate to import.
*/
public void setCertificate(java.nio.ByteBuffer certificate) {
this.certificate = certificate;
}
/**
*
* The certificate to import.
*
*
* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
* using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
* {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
* Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
* {@code position}.
*
*
* @return The certificate to import.
*/
public java.nio.ByteBuffer getCertificate() {
return this.certificate;
}
/**
*
* The certificate to import.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param certificate
* The certificate to import.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withCertificate(java.nio.ByteBuffer certificate) {
setCertificate(certificate);
return this;
}
/**
*
* The private key that matches the public key in the certificate.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param privateKey
* The private key that matches the public key in the certificate.
*/
public void setPrivateKey(java.nio.ByteBuffer privateKey) {
this.privateKey = privateKey;
}
/**
*
* The private key that matches the public key in the certificate.
*
*
* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
* using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
* {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
* Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
* {@code position}.
*
*
* @return The private key that matches the public key in the certificate.
*/
public java.nio.ByteBuffer getPrivateKey() {
return this.privateKey;
}
/**
*
* The private key that matches the public key in the certificate.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param privateKey
* The private key that matches the public key in the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withPrivateKey(java.nio.ByteBuffer privateKey) {
setPrivateKey(privateKey);
return this;
}
/**
*
* The PEM encoded certificate chain.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param certificateChain
* The PEM encoded certificate chain.
*/
public void setCertificateChain(java.nio.ByteBuffer certificateChain) {
this.certificateChain = certificateChain;
}
/**
*
* The PEM encoded certificate chain.
*
*
* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
* using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
* {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
* Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
* {@code position}.
*
*
* @return The PEM encoded certificate chain.
*/
public java.nio.ByteBuffer getCertificateChain() {
return this.certificateChain;
}
/**
*
* The PEM encoded certificate chain.
*
*
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
*
*
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
*
*
* @param certificateChain
* The PEM encoded certificate chain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withCertificateChain(java.nio.ByteBuffer certificateChain) {
setCertificateChain(certificateChain);
return this;
}
/**
*
* One or more resource tags to associate with the imported certificate.
*
*
* Note: You cannot apply tags when reimporting a certificate.
*
*
* @return One or more resource tags to associate with the imported certificate.
*
* Note: You cannot apply tags when reimporting a certificate.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* One or more resource tags to associate with the imported certificate.
*
*
* Note: You cannot apply tags when reimporting a certificate.
*
*
* @param tags
* One or more resource tags to associate with the imported certificate.
*
* Note: You cannot apply tags when reimporting a certificate.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* One or more resource tags to associate with the imported certificate.
*
*
* Note: You cannot apply tags when reimporting a certificate.
*
*
* 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
* One or more resource tags to associate with the imported certificate.
*
* Note: You cannot apply tags when reimporting a certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* One or more resource tags to associate with the imported certificate.
*
*
* Note: You cannot apply tags when reimporting a certificate.
*
*
* @param tags
* One or more resource tags to associate with the imported certificate.
*
* Note: You cannot apply tags when reimporting a certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportCertificateRequest withTags(java.util.Collection tags) {
setTags(tags);
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 (getCertificateArn() != null)
sb.append("CertificateArn: ").append(getCertificateArn()).append(",");
if (getCertificate() != null)
sb.append("Certificate: ").append(getCertificate()).append(",");
if (getPrivateKey() != null)
sb.append("PrivateKey: ").append("***Sensitive Data Redacted***").append(",");
if (getCertificateChain() != null)
sb.append("CertificateChain: ").append(getCertificateChain()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImportCertificateRequest == false)
return false;
ImportCertificateRequest other = (ImportCertificateRequest) obj;
if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
return false;
if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == false)
return false;
if (other.getCertificate() == null ^ this.getCertificate() == null)
return false;
if (other.getCertificate() != null && other.getCertificate().equals(this.getCertificate()) == false)
return false;
if (other.getPrivateKey() == null ^ this.getPrivateKey() == null)
return false;
if (other.getPrivateKey() != null && other.getPrivateKey().equals(this.getPrivateKey()) == false)
return false;
if (other.getCertificateChain() == null ^ this.getCertificateChain() == null)
return false;
if (other.getCertificateChain() != null && other.getCertificateChain().equals(this.getCertificateChain()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
hashCode = prime * hashCode + ((getCertificate() == null) ? 0 : getCertificate().hashCode());
hashCode = prime * hashCode + ((getPrivateKey() == null) ? 0 : getPrivateKey().hashCode());
hashCode = prime * hashCode + ((getCertificateChain() == null) ? 0 : getCertificateChain().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public ImportCertificateRequest clone() {
return (ImportCertificateRequest) super.clone();
}
}