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

software.amazon.awssdk.services.rds.model.Certificate Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon RDS module holds the client classes that are used for communicating with Amazon Relational Database Service

There is a newer version: 2.29.15
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.rds.model;

import java.io.Serializable;
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;

/**
 * 

* A CA certificate for an Amazon Web Services account. *

*

* For more information, see Using SSL/TLS to encrypt a * connection to a DB instance in the Amazon RDS User Guide and Using SSL/TLS to encrypt a * connection to a DB cluster in the Amazon Aurora User Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Certificate implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CERTIFICATE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CertificateIdentifier").getter(getter(Certificate::certificateIdentifier)) .setter(setter(Builder::certificateIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateIdentifier").build()) .build(); private static final SdkField CERTIFICATE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CertificateType").getter(getter(Certificate::certificateType)).setter(setter(Builder::certificateType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateType").build()).build(); private static final SdkField THUMBPRINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Thumbprint").getter(getter(Certificate::thumbprint)).setter(setter(Builder::thumbprint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Thumbprint").build()).build(); private static final SdkField VALID_FROM_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("ValidFrom").getter(getter(Certificate::validFrom)).setter(setter(Builder::validFrom)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValidFrom").build()).build(); private static final SdkField VALID_TILL_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("ValidTill").getter(getter(Certificate::validTill)).setter(setter(Builder::validTill)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValidTill").build()).build(); private static final SdkField CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CertificateArn").getter(getter(Certificate::certificateArn)).setter(setter(Builder::certificateArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateArn").build()).build(); private static final SdkField CUSTOMER_OVERRIDE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("CustomerOverride").getter(getter(Certificate::customerOverride)) .setter(setter(Builder::customerOverride)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomerOverride").build()).build(); private static final SdkField CUSTOMER_OVERRIDE_VALID_TILL_FIELD = SdkField . builder(MarshallingType.INSTANT).memberName("CustomerOverrideValidTill") .getter(getter(Certificate::customerOverrideValidTill)).setter(setter(Builder::customerOverrideValidTill)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomerOverrideValidTill").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CERTIFICATE_IDENTIFIER_FIELD, CERTIFICATE_TYPE_FIELD, THUMBPRINT_FIELD, VALID_FROM_FIELD, VALID_TILL_FIELD, CERTIFICATE_ARN_FIELD, CUSTOMER_OVERRIDE_FIELD, CUSTOMER_OVERRIDE_VALID_TILL_FIELD)); private static final long serialVersionUID = 1L; private final String certificateIdentifier; private final String certificateType; private final String thumbprint; private final Instant validFrom; private final Instant validTill; private final String certificateArn; private final Boolean customerOverride; private final Instant customerOverrideValidTill; private Certificate(BuilderImpl builder) { this.certificateIdentifier = builder.certificateIdentifier; this.certificateType = builder.certificateType; this.thumbprint = builder.thumbprint; this.validFrom = builder.validFrom; this.validTill = builder.validTill; this.certificateArn = builder.certificateArn; this.customerOverride = builder.customerOverride; this.customerOverrideValidTill = builder.customerOverrideValidTill; } /** *

* The unique key that identifies a certificate. *

* * @return The unique key that identifies a certificate. */ public final String certificateIdentifier() { return certificateIdentifier; } /** *

* The type of the certificate. *

* * @return The type of the certificate. */ public final String certificateType() { return certificateType; } /** *

* The thumbprint of the certificate. *

* * @return The thumbprint of the certificate. */ public final String thumbprint() { return thumbprint; } /** *

* The starting date from which the certificate is valid. *

* * @return The starting date from which the certificate is valid. */ public final Instant validFrom() { return validFrom; } /** *

* The final date that the certificate continues to be valid. *

* * @return The final date that the certificate continues to be valid. */ public final Instant validTill() { return validTill; } /** *

* The Amazon Resource Name (ARN) for the certificate. *

* * @return The Amazon Resource Name (ARN) for the certificate. */ public final String certificateArn() { return certificateArn; } /** *

* Indicates whether there is an override for the default certificate identifier. *

* * @return Indicates whether there is an override for the default certificate identifier. */ public final Boolean customerOverride() { return customerOverride; } /** *

* If there is an override for the default certificate identifier, when the override expires. *

* * @return If there is an override for the default certificate identifier, when the override expires. */ public final Instant customerOverrideValidTill() { return customerOverrideValidTill; } @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 + Objects.hashCode(certificateIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(certificateType()); hashCode = 31 * hashCode + Objects.hashCode(thumbprint()); hashCode = 31 * hashCode + Objects.hashCode(validFrom()); hashCode = 31 * hashCode + Objects.hashCode(validTill()); hashCode = 31 * hashCode + Objects.hashCode(certificateArn()); hashCode = 31 * hashCode + Objects.hashCode(customerOverride()); hashCode = 31 * hashCode + Objects.hashCode(customerOverrideValidTill()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Certificate)) { return false; } Certificate other = (Certificate) obj; return Objects.equals(certificateIdentifier(), other.certificateIdentifier()) && Objects.equals(certificateType(), other.certificateType()) && Objects.equals(thumbprint(), other.thumbprint()) && Objects.equals(validFrom(), other.validFrom()) && Objects.equals(validTill(), other.validTill()) && Objects.equals(certificateArn(), other.certificateArn()) && Objects.equals(customerOverride(), other.customerOverride()) && Objects.equals(customerOverrideValidTill(), other.customerOverrideValidTill()); } /** * 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("Certificate").add("CertificateIdentifier", certificateIdentifier()) .add("CertificateType", certificateType()).add("Thumbprint", thumbprint()).add("ValidFrom", validFrom()) .add("ValidTill", validTill()).add("CertificateArn", certificateArn()) .add("CustomerOverride", customerOverride()).add("CustomerOverrideValidTill", customerOverrideValidTill()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CertificateIdentifier": return Optional.ofNullable(clazz.cast(certificateIdentifier())); case "CertificateType": return Optional.ofNullable(clazz.cast(certificateType())); case "Thumbprint": return Optional.ofNullable(clazz.cast(thumbprint())); case "ValidFrom": return Optional.ofNullable(clazz.cast(validFrom())); case "ValidTill": return Optional.ofNullable(clazz.cast(validTill())); case "CertificateArn": return Optional.ofNullable(clazz.cast(certificateArn())); case "CustomerOverride": return Optional.ofNullable(clazz.cast(customerOverride())); case "CustomerOverrideValidTill": return Optional.ofNullable(clazz.cast(customerOverrideValidTill())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Certificate) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The unique key that identifies a certificate. *

* * @param certificateIdentifier * The unique key that identifies a certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificateIdentifier(String certificateIdentifier); /** *

* The type of the certificate. *

* * @param certificateType * The type of the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificateType(String certificateType); /** *

* The thumbprint of the certificate. *

* * @param thumbprint * The thumbprint of the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder thumbprint(String thumbprint); /** *

* The starting date from which the certificate is valid. *

* * @param validFrom * The starting date from which the certificate is valid. * @return Returns a reference to this object so that method calls can be chained together. */ Builder validFrom(Instant validFrom); /** *

* The final date that the certificate continues to be valid. *

* * @param validTill * The final date that the certificate continues to be valid. * @return Returns a reference to this object so that method calls can be chained together. */ Builder validTill(Instant validTill); /** *

* The Amazon Resource Name (ARN) for the certificate. *

* * @param certificateArn * The Amazon Resource Name (ARN) for the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder certificateArn(String certificateArn); /** *

* Indicates whether there is an override for the default certificate identifier. *

* * @param customerOverride * Indicates whether there is an override for the default certificate identifier. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerOverride(Boolean customerOverride); /** *

* If there is an override for the default certificate identifier, when the override expires. *

* * @param customerOverrideValidTill * If there is an override for the default certificate identifier, when the override expires. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerOverrideValidTill(Instant customerOverrideValidTill); } static final class BuilderImpl implements Builder { private String certificateIdentifier; private String certificateType; private String thumbprint; private Instant validFrom; private Instant validTill; private String certificateArn; private Boolean customerOverride; private Instant customerOverrideValidTill; private BuilderImpl() { } private BuilderImpl(Certificate model) { certificateIdentifier(model.certificateIdentifier); certificateType(model.certificateType); thumbprint(model.thumbprint); validFrom(model.validFrom); validTill(model.validTill); certificateArn(model.certificateArn); customerOverride(model.customerOverride); customerOverrideValidTill(model.customerOverrideValidTill); } public final String getCertificateIdentifier() { return certificateIdentifier; } public final void setCertificateIdentifier(String certificateIdentifier) { this.certificateIdentifier = certificateIdentifier; } @Override public final Builder certificateIdentifier(String certificateIdentifier) { this.certificateIdentifier = certificateIdentifier; return this; } public final String getCertificateType() { return certificateType; } public final void setCertificateType(String certificateType) { this.certificateType = certificateType; } @Override public final Builder certificateType(String certificateType) { this.certificateType = certificateType; return this; } public final String getThumbprint() { return thumbprint; } public final void setThumbprint(String thumbprint) { this.thumbprint = thumbprint; } @Override public final Builder thumbprint(String thumbprint) { this.thumbprint = thumbprint; return this; } public final Instant getValidFrom() { return validFrom; } public final void setValidFrom(Instant validFrom) { this.validFrom = validFrom; } @Override public final Builder validFrom(Instant validFrom) { this.validFrom = validFrom; return this; } public final Instant getValidTill() { return validTill; } public final void setValidTill(Instant validTill) { this.validTill = validTill; } @Override public final Builder validTill(Instant validTill) { this.validTill = validTill; return this; } public final String getCertificateArn() { return certificateArn; } public final void setCertificateArn(String certificateArn) { this.certificateArn = certificateArn; } @Override public final Builder certificateArn(String certificateArn) { this.certificateArn = certificateArn; return this; } public final Boolean getCustomerOverride() { return customerOverride; } public final void setCustomerOverride(Boolean customerOverride) { this.customerOverride = customerOverride; } @Override public final Builder customerOverride(Boolean customerOverride) { this.customerOverride = customerOverride; return this; } public final Instant getCustomerOverrideValidTill() { return customerOverrideValidTill; } public final void setCustomerOverrideValidTill(Instant customerOverrideValidTill) { this.customerOverrideValidTill = customerOverrideValidTill; } @Override public final Builder customerOverrideValidTill(Instant customerOverrideValidTill) { this.customerOverrideValidTill = customerOverrideValidTill; return this; } @Override public Certificate build() { return new Certificate(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy