
software.amazon.awssdk.services.cloudhsmv2.model.Certificates Maven / Gradle / Ivy
/*
* 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.cloudhsmv2.model;
import java.io.Serializable;
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;
/**
*
* Contains one or more certificates or a certificate signing request (CSR).
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Certificates implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CLUSTER_CSR_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterCsr").getter(getter(Certificates::clusterCsr)).setter(setter(Builder::clusterCsr))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterCsr").build()).build();
private static final SdkField HSM_CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HsmCertificate").getter(getter(Certificates::hsmCertificate)).setter(setter(Builder::hsmCertificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HsmCertificate").build()).build();
private static final SdkField AWS_HARDWARE_CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AwsHardwareCertificate").getter(getter(Certificates::awsHardwareCertificate))
.setter(setter(Builder::awsHardwareCertificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AwsHardwareCertificate").build())
.build();
private static final SdkField MANUFACTURER_HARDWARE_CERTIFICATE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ManufacturerHardwareCertificate")
.getter(getter(Certificates::manufacturerHardwareCertificate))
.setter(setter(Builder::manufacturerHardwareCertificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ManufacturerHardwareCertificate")
.build()).build();
private static final SdkField CLUSTER_CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterCertificate").getter(getter(Certificates::clusterCertificate))
.setter(setter(Builder::clusterCertificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterCertificate").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_CSR_FIELD,
HSM_CERTIFICATE_FIELD, AWS_HARDWARE_CERTIFICATE_FIELD, MANUFACTURER_HARDWARE_CERTIFICATE_FIELD,
CLUSTER_CERTIFICATE_FIELD));
private static final long serialVersionUID = 1L;
private final String clusterCsr;
private final String hsmCertificate;
private final String awsHardwareCertificate;
private final String manufacturerHardwareCertificate;
private final String clusterCertificate;
private Certificates(BuilderImpl builder) {
this.clusterCsr = builder.clusterCsr;
this.hsmCertificate = builder.hsmCertificate;
this.awsHardwareCertificate = builder.awsHardwareCertificate;
this.manufacturerHardwareCertificate = builder.manufacturerHardwareCertificate;
this.clusterCertificate = builder.clusterCertificate;
}
/**
*
* The cluster's certificate signing request (CSR). The CSR exists only when the cluster's state is
* UNINITIALIZED
.
*
*
* @return The cluster's certificate signing request (CSR). The CSR exists only when the cluster's state is
* UNINITIALIZED
.
*/
public final String clusterCsr() {
return clusterCsr;
}
/**
*
* The HSM certificate issued (signed) by the HSM hardware.
*
*
* @return The HSM certificate issued (signed) by the HSM hardware.
*/
public final String hsmCertificate() {
return hsmCertificate;
}
/**
*
* The HSM hardware certificate issued (signed) by AWS CloudHSM.
*
*
* @return The HSM hardware certificate issued (signed) by AWS CloudHSM.
*/
public final String awsHardwareCertificate() {
return awsHardwareCertificate;
}
/**
*
* The HSM hardware certificate issued (signed) by the hardware manufacturer.
*
*
* @return The HSM hardware certificate issued (signed) by the hardware manufacturer.
*/
public final String manufacturerHardwareCertificate() {
return manufacturerHardwareCertificate;
}
/**
*
* The cluster certificate issued (signed) by the issuing certificate authority (CA) of the cluster's owner.
*
*
* @return The cluster certificate issued (signed) by the issuing certificate authority (CA) of the cluster's owner.
*/
public final String clusterCertificate() {
return clusterCertificate;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(clusterCsr());
hashCode = 31 * hashCode + Objects.hashCode(hsmCertificate());
hashCode = 31 * hashCode + Objects.hashCode(awsHardwareCertificate());
hashCode = 31 * hashCode + Objects.hashCode(manufacturerHardwareCertificate());
hashCode = 31 * hashCode + Objects.hashCode(clusterCertificate());
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 Certificates)) {
return false;
}
Certificates other = (Certificates) obj;
return Objects.equals(clusterCsr(), other.clusterCsr()) && Objects.equals(hsmCertificate(), other.hsmCertificate())
&& Objects.equals(awsHardwareCertificate(), other.awsHardwareCertificate())
&& Objects.equals(manufacturerHardwareCertificate(), other.manufacturerHardwareCertificate())
&& Objects.equals(clusterCertificate(), other.clusterCertificate());
}
/**
* 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("Certificates").add("ClusterCsr", clusterCsr()).add("HsmCertificate", hsmCertificate())
.add("AwsHardwareCertificate", awsHardwareCertificate())
.add("ManufacturerHardwareCertificate", manufacturerHardwareCertificate())
.add("ClusterCertificate", clusterCertificate()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ClusterCsr":
return Optional.ofNullable(clazz.cast(clusterCsr()));
case "HsmCertificate":
return Optional.ofNullable(clazz.cast(hsmCertificate()));
case "AwsHardwareCertificate":
return Optional.ofNullable(clazz.cast(awsHardwareCertificate()));
case "ManufacturerHardwareCertificate":
return Optional.ofNullable(clazz.cast(manufacturerHardwareCertificate()));
case "ClusterCertificate":
return Optional.ofNullable(clazz.cast(clusterCertificate()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy