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

software.amazon.awssdk.services.paymentcryptography.model.GetParametersForExportResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Payment Cryptography module holds the client classes that are used for communicating with Payment Cryptography.

There is a newer version: 2.28.5
Show newest version
/*
 * Copyright 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.paymentcryptography.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
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 GetParametersForExportResponse extends PaymentCryptographyResponse implements
        ToCopyableBuilder {
    private static final SdkField SIGNING_KEY_CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SigningKeyCertificate").getter(getter(GetParametersForExportResponse::signingKeyCertificate))
            .setter(setter(Builder::signingKeyCertificate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SigningKeyCertificate").build())
            .build();

    private static final SdkField SIGNING_KEY_CERTIFICATE_CHAIN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("SigningKeyCertificateChain")
            .getter(getter(GetParametersForExportResponse::signingKeyCertificateChain))
            .setter(setter(Builder::signingKeyCertificateChain))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SigningKeyCertificateChain").build())
            .build();

    private static final SdkField SIGNING_KEY_ALGORITHM_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SigningKeyAlgorithm").getter(getter(GetParametersForExportResponse::signingKeyAlgorithmAsString))
            .setter(setter(Builder::signingKeyAlgorithm))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SigningKeyAlgorithm").build())
            .build();

    private static final SdkField EXPORT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ExportToken").getter(getter(GetParametersForExportResponse::exportToken))
            .setter(setter(Builder::exportToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExportToken").build()).build();

    private static final SdkField PARAMETERS_VALID_UNTIL_TIMESTAMP_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("ParametersValidUntilTimestamp")
            .getter(getter(GetParametersForExportResponse::parametersValidUntilTimestamp))
            .setter(setter(Builder::parametersValidUntilTimestamp))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParametersValidUntilTimestamp")
                    .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SIGNING_KEY_CERTIFICATE_FIELD,
            SIGNING_KEY_CERTIFICATE_CHAIN_FIELD, SIGNING_KEY_ALGORITHM_FIELD, EXPORT_TOKEN_FIELD,
            PARAMETERS_VALID_UNTIL_TIMESTAMP_FIELD));

    private final String signingKeyCertificate;

    private final String signingKeyCertificateChain;

    private final String signingKeyAlgorithm;

    private final String exportToken;

    private final Instant parametersValidUntilTimestamp;

    private GetParametersForExportResponse(BuilderImpl builder) {
        super(builder);
        this.signingKeyCertificate = builder.signingKeyCertificate;
        this.signingKeyCertificateChain = builder.signingKeyCertificateChain;
        this.signingKeyAlgorithm = builder.signingKeyAlgorithm;
        this.exportToken = builder.exportToken;
        this.parametersValidUntilTimestamp = builder.parametersValidUntilTimestamp;
    }

    /**
     * 

* The signing key certificate in PEM format (base64 encoded) of the public key for signature within the TR-34 key * block. The certificate expires after 7 days. *

* * @return The signing key certificate in PEM format (base64 encoded) of the public key for signature within the * TR-34 key block. The certificate expires after 7 days. */ public final String signingKeyCertificate() { return signingKeyCertificate; } /** *

* The root certificate authority (CA) that signed the signing key certificate in PEM format (base64 encoded). *

* * @return The root certificate authority (CA) that signed the signing key certificate in PEM format (base64 * encoded). */ public final String signingKeyCertificateChain() { return signingKeyCertificateChain; } /** *

* The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is the * only signing key algorithm allowed. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #signingKeyAlgorithm} will return {@link KeyAlgorithm#UNKNOWN_TO_SDK_VERSION}. The raw value returned by * the service is available from {@link #signingKeyAlgorithmAsString}. *

* * @return The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 * is the only signing key algorithm allowed. * @see KeyAlgorithm */ public final KeyAlgorithm signingKeyAlgorithm() { return KeyAlgorithm.fromValue(signingKeyAlgorithm); } /** *

* The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is the * only signing key algorithm allowed. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #signingKeyAlgorithm} will return {@link KeyAlgorithm#UNKNOWN_TO_SDK_VERSION}. The raw value returned by * the service is available from {@link #signingKeyAlgorithmAsString}. *

* * @return The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 * is the only signing key algorithm allowed. * @see KeyAlgorithm */ public final String signingKeyAlgorithmAsString() { return signingKeyAlgorithm; } /** *

* The export token to initiate key export from Amazon Web Services Payment Cryptography. The export token expires * after 7 days. You can use the same export token to export multiple keys from the same service account. *

* * @return The export token to initiate key export from Amazon Web Services Payment Cryptography. The export token * expires after 7 days. You can use the same export token to export multiple keys from the same service * account. */ public final String exportToken() { return exportToken; } /** *

* The validity period of the export token. *

* * @return The validity period of the export token. */ public final Instant parametersValidUntilTimestamp() { return parametersValidUntilTimestamp; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(signingKeyCertificate()); hashCode = 31 * hashCode + Objects.hashCode(signingKeyCertificateChain()); hashCode = 31 * hashCode + Objects.hashCode(signingKeyAlgorithmAsString()); hashCode = 31 * hashCode + Objects.hashCode(exportToken()); hashCode = 31 * hashCode + Objects.hashCode(parametersValidUntilTimestamp()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetParametersForExportResponse)) { return false; } GetParametersForExportResponse other = (GetParametersForExportResponse) obj; return Objects.equals(signingKeyCertificate(), other.signingKeyCertificate()) && Objects.equals(signingKeyCertificateChain(), other.signingKeyCertificateChain()) && Objects.equals(signingKeyAlgorithmAsString(), other.signingKeyAlgorithmAsString()) && Objects.equals(exportToken(), other.exportToken()) && Objects.equals(parametersValidUntilTimestamp(), other.parametersValidUntilTimestamp()); } /** * 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. */ @Override public final String toString() { return ToString .builder("GetParametersForExportResponse") .add("SigningKeyCertificate", signingKeyCertificate() == null ? null : "*** Sensitive Data Redacted ***") .add("SigningKeyCertificateChain", signingKeyCertificateChain() == null ? null : "*** Sensitive Data Redacted ***") .add("SigningKeyAlgorithm", signingKeyAlgorithmAsString()).add("ExportToken", exportToken()) .add("ParametersValidUntilTimestamp", parametersValidUntilTimestamp()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SigningKeyCertificate": return Optional.ofNullable(clazz.cast(signingKeyCertificate())); case "SigningKeyCertificateChain": return Optional.ofNullable(clazz.cast(signingKeyCertificateChain())); case "SigningKeyAlgorithm": return Optional.ofNullable(clazz.cast(signingKeyAlgorithmAsString())); case "ExportToken": return Optional.ofNullable(clazz.cast(exportToken())); case "ParametersValidUntilTimestamp": return Optional.ofNullable(clazz.cast(parametersValidUntilTimestamp())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetParametersForExportResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends PaymentCryptographyResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The signing key certificate in PEM format (base64 encoded) of the public key for signature within the TR-34 * key block. The certificate expires after 7 days. *

* * @param signingKeyCertificate * The signing key certificate in PEM format (base64 encoded) of the public key for signature within the * TR-34 key block. The certificate expires after 7 days. * @return Returns a reference to this object so that method calls can be chained together. */ Builder signingKeyCertificate(String signingKeyCertificate); /** *

* The root certificate authority (CA) that signed the signing key certificate in PEM format (base64 encoded). *

* * @param signingKeyCertificateChain * The root certificate authority (CA) that signed the signing key certificate in PEM format (base64 * encoded). * @return Returns a reference to this object so that method calls can be chained together. */ Builder signingKeyCertificateChain(String signingKeyCertificateChain); /** *

* The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is * the only signing key algorithm allowed. *

* * @param signingKeyAlgorithm * The algorithm of the signing key certificate for use in TR-34 key block generation. * RSA_2048 is the only signing key algorithm allowed. * @see KeyAlgorithm * @return Returns a reference to this object so that method calls can be chained together. * @see KeyAlgorithm */ Builder signingKeyAlgorithm(String signingKeyAlgorithm); /** *

* The algorithm of the signing key certificate for use in TR-34 key block generation. RSA_2048 is * the only signing key algorithm allowed. *

* * @param signingKeyAlgorithm * The algorithm of the signing key certificate for use in TR-34 key block generation. * RSA_2048 is the only signing key algorithm allowed. * @see KeyAlgorithm * @return Returns a reference to this object so that method calls can be chained together. * @see KeyAlgorithm */ Builder signingKeyAlgorithm(KeyAlgorithm signingKeyAlgorithm); /** *

* The export token to initiate key export from Amazon Web Services Payment Cryptography. The export token * expires after 7 days. You can use the same export token to export multiple keys from the same service * account. *

* * @param exportToken * The export token to initiate key export from Amazon Web Services Payment Cryptography. The export * token expires after 7 days. You can use the same export token to export multiple keys from the same * service account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportToken(String exportToken); /** *

* The validity period of the export token. *

* * @param parametersValidUntilTimestamp * The validity period of the export token. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parametersValidUntilTimestamp(Instant parametersValidUntilTimestamp); } static final class BuilderImpl extends PaymentCryptographyResponse.BuilderImpl implements Builder { private String signingKeyCertificate; private String signingKeyCertificateChain; private String signingKeyAlgorithm; private String exportToken; private Instant parametersValidUntilTimestamp; private BuilderImpl() { } private BuilderImpl(GetParametersForExportResponse model) { super(model); signingKeyCertificate(model.signingKeyCertificate); signingKeyCertificateChain(model.signingKeyCertificateChain); signingKeyAlgorithm(model.signingKeyAlgorithm); exportToken(model.exportToken); parametersValidUntilTimestamp(model.parametersValidUntilTimestamp); } public final String getSigningKeyCertificate() { return signingKeyCertificate; } public final void setSigningKeyCertificate(String signingKeyCertificate) { this.signingKeyCertificate = signingKeyCertificate; } @Override public final Builder signingKeyCertificate(String signingKeyCertificate) { this.signingKeyCertificate = signingKeyCertificate; return this; } public final String getSigningKeyCertificateChain() { return signingKeyCertificateChain; } public final void setSigningKeyCertificateChain(String signingKeyCertificateChain) { this.signingKeyCertificateChain = signingKeyCertificateChain; } @Override public final Builder signingKeyCertificateChain(String signingKeyCertificateChain) { this.signingKeyCertificateChain = signingKeyCertificateChain; return this; } public final String getSigningKeyAlgorithm() { return signingKeyAlgorithm; } public final void setSigningKeyAlgorithm(String signingKeyAlgorithm) { this.signingKeyAlgorithm = signingKeyAlgorithm; } @Override public final Builder signingKeyAlgorithm(String signingKeyAlgorithm) { this.signingKeyAlgorithm = signingKeyAlgorithm; return this; } @Override public final Builder signingKeyAlgorithm(KeyAlgorithm signingKeyAlgorithm) { this.signingKeyAlgorithm(signingKeyAlgorithm == null ? null : signingKeyAlgorithm.toString()); return this; } public final String getExportToken() { return exportToken; } public final void setExportToken(String exportToken) { this.exportToken = exportToken; } @Override public final Builder exportToken(String exportToken) { this.exportToken = exportToken; return this; } public final Instant getParametersValidUntilTimestamp() { return parametersValidUntilTimestamp; } public final void setParametersValidUntilTimestamp(Instant parametersValidUntilTimestamp) { this.parametersValidUntilTimestamp = parametersValidUntilTimestamp; } @Override public final Builder parametersValidUntilTimestamp(Instant parametersValidUntilTimestamp) { this.parametersValidUntilTimestamp = parametersValidUntilTimestamp; return this; } @Override public GetParametersForExportResponse build() { return new GetParametersForExportResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy