All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.databasemigration.model.ImportCertificateRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 2.0.0-preview-11
Show newest version
/*
 * Copyright 2012-2017 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 software.amazon.awssdk.services.databasemigration.model;

import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import software.amazon.awssdk.core.AmazonWebServiceRequest;
import software.amazon.awssdk.core.runtime.StandardMemberCopier;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public class ImportCertificateRequest extends AmazonWebServiceRequest implements
        ToCopyableBuilder {
    private final String certificateIdentifier;

    private final String certificatePem;

    private final ByteBuffer certificateWallet;

    private final List tags;

    private ImportCertificateRequest(BuilderImpl builder) {
        this.certificateIdentifier = builder.certificateIdentifier;
        this.certificatePem = builder.certificatePem;
        this.certificateWallet = builder.certificateWallet;
        this.tags = builder.tags;
    }

    /**
     * 

* The customer-assigned name of the certificate. Valid characters are A-z and 0-9. *

* * @return The customer-assigned name of the certificate. Valid characters are A-z and 0-9. */ public String certificateIdentifier() { return certificateIdentifier; } /** *

* The contents of the .pem X.509 certificate file for the certificate. *

* * @return The contents of the .pem X.509 certificate file for the certificate. */ public String certificatePem() { return certificatePem; } /** *

* The location of the imported Oracle Wallet certificate for use with SSL. *

*

* This method will return a new read-only {@code ByteBuffer} each time it is invoked. *

* * @return The location of the imported Oracle Wallet certificate for use with SSL. */ public ByteBuffer certificateWallet() { return certificateWallet == null ? null : certificateWallet.asReadOnlyBuffer(); } /** *

* The tags associated with the certificate. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The tags associated with the certificate. */ public List tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + ((certificateIdentifier() == null) ? 0 : certificateIdentifier().hashCode()); hashCode = 31 * hashCode + ((certificatePem() == null) ? 0 : certificatePem().hashCode()); hashCode = 31 * hashCode + ((certificateWallet() == null) ? 0 : certificateWallet().hashCode()); hashCode = 31 * hashCode + ((tags() == null) ? 0 : tags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ImportCertificateRequest)) { return false; } ImportCertificateRequest other = (ImportCertificateRequest) obj; if (other.certificateIdentifier() == null ^ this.certificateIdentifier() == null) { return false; } if (other.certificateIdentifier() != null && !other.certificateIdentifier().equals(this.certificateIdentifier())) { return false; } if (other.certificatePem() == null ^ this.certificatePem() == null) { return false; } if (other.certificatePem() != null && !other.certificatePem().equals(this.certificatePem())) { return false; } if (other.certificateWallet() == null ^ this.certificateWallet() == null) { return false; } if (other.certificateWallet() != null && !other.certificateWallet().equals(this.certificateWallet())) { return false; } if (other.tags() == null ^ this.tags() == null) { return false; } if (other.tags() != null && !other.tags().equals(this.tags())) { return false; } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder("{"); if (certificateIdentifier() != null) { sb.append("CertificateIdentifier: ").append(certificateIdentifier()).append(","); } if (certificatePem() != null) { sb.append("CertificatePem: ").append(certificatePem()).append(","); } if (certificateWallet() != null) { sb.append("CertificateWallet: ").append(certificateWallet()).append(","); } if (tags() != null) { sb.append("Tags: ").append(tags()).append(","); } if (sb.length() > 1) { sb.setLength(sb.length() - 1); } sb.append("}"); return sb.toString(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CertificateIdentifier": return Optional.of(clazz.cast(certificateIdentifier())); case "CertificatePem": return Optional.of(clazz.cast(certificatePem())); case "CertificateWallet": return Optional.of(clazz.cast(certificateWallet())); case "Tags": return Optional.of(clazz.cast(tags())); default: return Optional.empty(); } } public interface Builder extends CopyableBuilder { /** *

* The customer-assigned name of the certificate. Valid characters are A-z and 0-9. *

* * @param certificateIdentifier * The customer-assigned name of the certificate. Valid characters are A-z and 0-9. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificateIdentifier(String certificateIdentifier); /** *

* The contents of the .pem X.509 certificate file for the certificate. *

* * @param certificatePem * The contents of the .pem X.509 certificate file for the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificatePem(String certificatePem); /** *

* The location of the imported Oracle Wallet certificate for use with SSL. *

*

* To preserve immutability, the remaining bytes in the provided buffer will be copied into a new buffer when * set. *

* * @param certificateWallet * The location of the imported Oracle Wallet certificate for use with SSL. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificateWallet(ByteBuffer certificateWallet); /** *

* The tags associated with the certificate. *

* * @param tags * The tags associated with the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* The tags associated with the certificate. *

* * @param tags * The tags associated with the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); } static final class BuilderImpl implements Builder { private String certificateIdentifier; private String certificatePem; private ByteBuffer certificateWallet; private List tags; private BuilderImpl() { } private BuilderImpl(ImportCertificateRequest model) { certificateIdentifier(model.certificateIdentifier); certificatePem(model.certificatePem); certificateWallet(model.certificateWallet); tags(model.tags); } public final String getCertificateIdentifier() { return certificateIdentifier; } @Override public final Builder certificateIdentifier(String certificateIdentifier) { this.certificateIdentifier = certificateIdentifier; return this; } public final void setCertificateIdentifier(String certificateIdentifier) { this.certificateIdentifier = certificateIdentifier; } public final String getCertificatePem() { return certificatePem; } @Override public final Builder certificatePem(String certificatePem) { this.certificatePem = certificatePem; return this; } public final void setCertificatePem(String certificatePem) { this.certificatePem = certificatePem; } public final ByteBuffer getCertificateWallet() { return certificateWallet; } @Override public final Builder certificateWallet(ByteBuffer certificateWallet) { this.certificateWallet = StandardMemberCopier.copy(certificateWallet); return this; } public final void setCertificateWallet(ByteBuffer certificateWallet) { this.certificateWallet = StandardMemberCopier.copy(certificateWallet); } public final Collection getTags() { return tags != null ? tags.stream().map(Tag::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public ImportCertificateRequest build() { return new ImportCertificateRequest(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy