/* * 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.transfer.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 { /** *

* Specifies whether this certificate is used for signing or encryption. *

*/ private String usage; /** * */ private String certificate; /** *

* An optional list of certificates that make up the chain for the certificate that's being imported. *

*/ private String certificateChain; /** * */ private String privateKey; /** *

* An optional date that specifies when the certificate becomes active. *

*/ private java.util.Date activeDate; /** *

* An optional date that specifies when the certificate becomes inactive. *

*/ private java.util.Date inactiveDate; /** *

* A short description that helps identify the certificate. *

*/ private String description; /** *

* Key-value pairs that can be used to group and search for certificates. *

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

* Specifies whether this certificate is used for signing or encryption. *

* * @param usage * Specifies whether this certificate is used for signing or encryption. * @see CertificateUsageType */ public void setUsage(String usage) { this.usage = usage; } /** *

* Specifies whether this certificate is used for signing or encryption. *

* * @return Specifies whether this certificate is used for signing or encryption. * @see CertificateUsageType */ public String getUsage() { return this.usage; } /** *

* Specifies whether this certificate is used for signing or encryption. *

* * @param usage * Specifies whether this certificate is used for signing or encryption. * @return Returns a reference to this object so that method calls can be chained together. * @see CertificateUsageType */ public ImportCertificateRequest withUsage(String usage) { setUsage(usage); return this; } /** *

* Specifies whether this certificate is used for signing or encryption. *

* * @param usage * Specifies whether this certificate is used for signing or encryption. * @return Returns a reference to this object so that method calls can be chained together. * @see CertificateUsageType */ public ImportCertificateRequest withUsage(CertificateUsageType usage) { this.usage = usage.toString(); return this; } /** * * * @param certificate *
  • *

    * For the CLI, provide a file path for a certificate in URI format. For example, * --certificate file://encryption-cert.pem. Alternatively, you can provide the raw content. *

    *
  • *

    * For the SDK, specify the raw content of a certificate file. For example, * --certificate "`cat encryption-cert.pem`". *

    *
  • */ public void setCertificate(String certificate) { this.certificate = certificate; } /** * * * @return
  • *

    * For the CLI, provide a file path for a certificate in URI format. For example, * --certificate file://encryption-cert.pem. Alternatively, you can provide the raw content. *

    *
  • *

    * For the SDK, specify the raw content of a certificate file. For example, * --certificate "`cat encryption-cert.pem`". *

    *
  • */ public String getCertificate() { return this.certificate; } /** * * * @param certificate *
  • *

    * For the CLI, provide a file path for a certificate in URI format. For example, * --certificate file://encryption-cert.pem. Alternatively, you can provide the raw content. *

    *
  • *

    * For the SDK, specify the raw content of a certificate file. For example, * --certificate "`cat encryption-cert.pem`". *

    *
  • * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withCertificate(String certificate) { setCertificate(certificate); return this; } /** *

    * An optional list of certificates that make up the chain for the certificate that's being imported. *

    * * @param certificateChain * An optional list of certificates that make up the chain for the certificate that's being imported. */ public void setCertificateChain(String certificateChain) { this.certificateChain = certificateChain; } /** *

    * An optional list of certificates that make up the chain for the certificate that's being imported. *

    * * @return An optional list of certificates that make up the chain for the certificate that's being imported. */ public String getCertificateChain() { return this.certificateChain; } /** *

    * An optional list of certificates that make up the chain for the certificate that's being imported. *

    * * @param certificateChain * An optional list of certificates that make up the chain for the certificate that's being imported. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withCertificateChain(String certificateChain) { setCertificateChain(certificateChain); return this; } /** * * * @param privateKey *
  • *

    * For the CLI, provide a file path for a private key in URI format.For example, * --private-key file://encryption-key.pem. Alternatively, you can provide the raw content of * the private key file. *

    *
  • *

    * For the SDK, specify the raw content of a private key file. For example, * --private-key "`cat encryption-key.pem`" *

    *
  • */ public void setPrivateKey(String privateKey) { this.privateKey = privateKey; } /** * * * @return
  • *

    * For the CLI, provide a file path for a private key in URI format.For example, * --private-key file://encryption-key.pem. Alternatively, you can provide the raw content of * the private key file. *

    *
  • *

    * For the SDK, specify the raw content of a private key file. For example, * --private-key "`cat encryption-key.pem`" *

    *
  • */ public String getPrivateKey() { return this.privateKey; } /** * * * @param privateKey *
  • *

    * For the CLI, provide a file path for a private key in URI format.For example, * --private-key file://encryption-key.pem. Alternatively, you can provide the raw content of * the private key file. *

    *
  • *

    * For the SDK, specify the raw content of a private key file. For example, * --private-key "`cat encryption-key.pem`" *

    *
  • * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withPrivateKey(String privateKey) { setPrivateKey(privateKey); return this; } /** *

    * An optional date that specifies when the certificate becomes active. *

    * * @param activeDate * An optional date that specifies when the certificate becomes active. */ public void setActiveDate(java.util.Date activeDate) { this.activeDate = activeDate; } /** *

    * An optional date that specifies when the certificate becomes active. *

    * * @return An optional date that specifies when the certificate becomes active. */ public java.util.Date getActiveDate() { return this.activeDate; } /** *

    * An optional date that specifies when the certificate becomes active. *

    * * @param activeDate * An optional date that specifies when the certificate becomes active. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withActiveDate(java.util.Date activeDate) { setActiveDate(activeDate); return this; } /** *

    * An optional date that specifies when the certificate becomes inactive. *

    * * @param inactiveDate * An optional date that specifies when the certificate becomes inactive. */ public void setInactiveDate(java.util.Date inactiveDate) { this.inactiveDate = inactiveDate; } /** *

    * An optional date that specifies when the certificate becomes inactive. *

    * * @return An optional date that specifies when the certificate becomes inactive. */ public java.util.Date getInactiveDate() { return this.inactiveDate; } /** *

    * An optional date that specifies when the certificate becomes inactive. *

    * * @param inactiveDate * An optional date that specifies when the certificate becomes inactive. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withInactiveDate(java.util.Date inactiveDate) { setInactiveDate(inactiveDate); return this; } /** *

    * A short description that helps identify the certificate. *

    * * @param description * A short description that helps identify the certificate. */ public void setDescription(String description) { this.description = description; } /** *

    * A short description that helps identify the certificate. *

    * * @return A short description that helps identify the certificate. */ public String getDescription() { return this.description; } /** *

    * A short description that helps identify the certificate. *

    * * @param description * A short description that helps identify the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportCertificateRequest withDescription(String description) { setDescription(description); return this; } /** *

    * Key-value pairs that can be used to group and search for certificates. *

    * * @return Key-value pairs that can be used to group and search for certificates. */ public java.util.List getTags() { return tags; } /** *

    * Key-value pairs that can be used to group and search for certificates. *

    * * @param tags * Key-value pairs that can be used to group and search for certificates. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

    * Key-value pairs that can be used to group and search for certificates. *

    *

    * 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 * Key-value pairs that can be used to group and search for certificates. * @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; } /** *

    * Key-value pairs that can be used to group and search for certificates. *

    * * @param tags * Key-value pairs that can be used to group and search for certificates. * @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 (getUsage() != null) sb.append("Usage: ").append(getUsage()).append(","); if (getCertificate() != null) sb.append("Certificate: ").append("***Sensitive Data Redacted***").append(","); if (getCertificateChain() != null) sb.append("CertificateChain: ").append("***Sensitive Data Redacted***").append(","); if (getPrivateKey() != null) sb.append("PrivateKey: ").append("***Sensitive Data Redacted***").append(","); if (getActiveDate() != null) sb.append("ActiveDate: ").append(getActiveDate()).append(","); if (getInactiveDate() != null) sb.append("InactiveDate: ").append(getInactiveDate()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).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.getUsage() == null ^ this.getUsage() == null) return false; if (other.getUsage() != null && other.getUsage().equals(this.getUsage()) == 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.getCertificateChain() == null ^ this.getCertificateChain() == null) return false; if (other.getCertificateChain() != null && other.getCertificateChain().equals(this.getCertificateChain()) == 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.getActiveDate() == null ^ this.getActiveDate() == null) return false; if (other.getActiveDate() != null && other.getActiveDate().equals(this.getActiveDate()) == false) return false; if (other.getInactiveDate() == null ^ this.getInactiveDate() == null) return false; if (other.getInactiveDate() != null && other.getInactiveDate().equals(this.getInactiveDate()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == 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 + ((getUsage() == null) ? 0 : getUsage().hashCode()); hashCode = prime * hashCode + ((getCertificate() == null) ? 0 : getCertificate().hashCode()); hashCode = prime * hashCode + ((getCertificateChain() == null) ? 0 : getCertificateChain().hashCode()); hashCode = prime * hashCode + ((getPrivateKey() == null) ? 0 : getPrivateKey().hashCode()); hashCode = prime * hashCode + ((getActiveDate() == null) ? 0 : getActiveDate().hashCode()); hashCode = prime * hashCode + ((getInactiveDate() == null) ? 0 : getInactiveDate().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public ImportCertificateRequest clone() { return (ImportCertificateRequest) super.clone(); } }