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.

The newest version!
/*
 * Copyright 2013-2018 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.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.adapter.StandardMemberCopier;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

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

    private final String certificatePem;

    private final SdkBytes certificateWallet;

    private final List tags;

    private ImportCertificateRequest(BuilderImpl builder) {
        super(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. *

* * @return The location of the imported Oracle Wallet certificate for use with SSL. */ public SdkBytes certificateWallet() { return certificateWallet; } /** *

* 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 + Objects.hashCode(certificateIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(certificatePem()); hashCode = 31 * hashCode + Objects.hashCode(certificateWallet()); hashCode = 31 * hashCode + Objects.hashCode(tags()); 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; return Objects.equals(certificateIdentifier(), other.certificateIdentifier()) && Objects.equals(certificatePem(), other.certificatePem()) && Objects.equals(certificateWallet(), other.certificateWallet()) && Objects.equals(tags(), other.tags()); } @Override public String toString() { return ToString.builder("ImportCertificateRequest").add("CertificateIdentifier", certificateIdentifier()) .add("CertificatePem", certificatePem()).add("CertificateWallet", certificateWallet()).add("Tags", tags()) .build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CertificateIdentifier": return Optional.ofNullable(clazz.cast(certificateIdentifier())); case "CertificatePem": return Optional.ofNullable(clazz.cast(certificatePem())); case "CertificateWallet": return Optional.ofNullable(clazz.cast(certificateWallet())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } public interface Builder extends DatabaseMigrationRequest.Builder, 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. *

* * @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(SdkBytes 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); /** *

* The tags associated with the certificate. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to create * one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(List) */ Builder tags(Consumer... tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DatabaseMigrationRequest.BuilderImpl implements Builder { private String certificateIdentifier; private String certificatePem; private SdkBytes certificateWallet; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ImportCertificateRequest model) { super(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 == null ? null : certificateWallet.asByteBuffer(); } @Override public final Builder certificateWallet(SdkBytes certificateWallet) { this.certificateWallet = StandardMemberCopier.copy(certificateWallet); return this; } public final void setCertificateWallet(ByteBuffer certificateWallet) { certificateWallet(certificateWallet == null ? null : SdkBytes.fromByteBuffer(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; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public ImportCertificateRequest build() { return new ImportCertificateRequest(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy