software.amazon.awssdk.services.ssmsap.model.Resilience Maven / Gradle / Ivy
Show all versions of ssmsap Show documentation
/*
* 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.ssmsap.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* Details of the SAP HANA system replication for the instance.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Resilience implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField HSR_TIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HsrTier").getter(getter(Resilience::hsrTier)).setter(setter(Builder::hsrTier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HsrTier").build()).build();
private static final SdkField HSR_REPLICATION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HsrReplicationMode").getter(getter(Resilience::hsrReplicationModeAsString))
.setter(setter(Builder::hsrReplicationMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HsrReplicationMode").build())
.build();
private static final SdkField HSR_OPERATION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HsrOperationMode").getter(getter(Resilience::hsrOperationModeAsString))
.setter(setter(Builder::hsrOperationMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HsrOperationMode").build()).build();
private static final SdkField CLUSTER_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterStatus").getter(getter(Resilience::clusterStatusAsString)).setter(setter(Builder::clusterStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterStatus").build()).build();
private static final SdkField ENQUEUE_REPLICATION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EnqueueReplication").getter(getter(Resilience::enqueueReplication))
.setter(setter(Builder::enqueueReplication))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnqueueReplication").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(HSR_TIER_FIELD,
HSR_REPLICATION_MODE_FIELD, HSR_OPERATION_MODE_FIELD, CLUSTER_STATUS_FIELD, ENQUEUE_REPLICATION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("HsrTier", HSR_TIER_FIELD);
put("HsrReplicationMode", HSR_REPLICATION_MODE_FIELD);
put("HsrOperationMode", HSR_OPERATION_MODE_FIELD);
put("ClusterStatus", CLUSTER_STATUS_FIELD);
put("EnqueueReplication", ENQUEUE_REPLICATION_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String hsrTier;
private final String hsrReplicationMode;
private final String hsrOperationMode;
private final String clusterStatus;
private final Boolean enqueueReplication;
private Resilience(BuilderImpl builder) {
this.hsrTier = builder.hsrTier;
this.hsrReplicationMode = builder.hsrReplicationMode;
this.hsrOperationMode = builder.hsrOperationMode;
this.clusterStatus = builder.clusterStatus;
this.enqueueReplication = builder.enqueueReplication;
}
/**
*
* The tier of the component.
*
*
* @return The tier of the component.
*/
public final String hsrTier() {
return hsrTier;
}
/**
*
* The replication mode of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #hsrReplicationMode} will return {@link ReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by
* the service is available from {@link #hsrReplicationModeAsString}.
*
*
* @return The replication mode of the component.
* @see ReplicationMode
*/
public final ReplicationMode hsrReplicationMode() {
return ReplicationMode.fromValue(hsrReplicationMode);
}
/**
*
* The replication mode of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #hsrReplicationMode} will return {@link ReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by
* the service is available from {@link #hsrReplicationModeAsString}.
*
*
* @return The replication mode of the component.
* @see ReplicationMode
*/
public final String hsrReplicationModeAsString() {
return hsrReplicationMode;
}
/**
*
* The operation mode of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #hsrOperationMode}
* will return {@link OperationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #hsrOperationModeAsString}.
*
*
* @return The operation mode of the component.
* @see OperationMode
*/
public final OperationMode hsrOperationMode() {
return OperationMode.fromValue(hsrOperationMode);
}
/**
*
* The operation mode of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #hsrOperationMode}
* will return {@link OperationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #hsrOperationModeAsString}.
*
*
* @return The operation mode of the component.
* @see OperationMode
*/
public final String hsrOperationModeAsString() {
return hsrOperationMode;
}
/**
*
* The cluster status of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #clusterStatus}
* will return {@link ClusterStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #clusterStatusAsString}.
*
*
* @return The cluster status of the component.
* @see ClusterStatus
*/
public final ClusterStatus clusterStatus() {
return ClusterStatus.fromValue(clusterStatus);
}
/**
*
* The cluster status of the component.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #clusterStatus}
* will return {@link ClusterStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #clusterStatusAsString}.
*
*
* @return The cluster status of the component.
* @see ClusterStatus
*/
public final String clusterStatusAsString() {
return clusterStatus;
}
/**
*
* Indicates if or not enqueue replication is enabled for the ASCS component.
*
*
* @return Indicates if or not enqueue replication is enabled for the ASCS component.
*/
public final Boolean enqueueReplication() {
return enqueueReplication;
}
@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(hsrTier());
hashCode = 31 * hashCode + Objects.hashCode(hsrReplicationModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(hsrOperationModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(clusterStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(enqueueReplication());
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 Resilience)) {
return false;
}
Resilience other = (Resilience) obj;
return Objects.equals(hsrTier(), other.hsrTier())
&& Objects.equals(hsrReplicationModeAsString(), other.hsrReplicationModeAsString())
&& Objects.equals(hsrOperationModeAsString(), other.hsrOperationModeAsString())
&& Objects.equals(clusterStatusAsString(), other.clusterStatusAsString())
&& Objects.equals(enqueueReplication(), other.enqueueReplication());
}
/**
* 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("Resilience").add("HsrTier", hsrTier()).add("HsrReplicationMode", hsrReplicationModeAsString())
.add("HsrOperationMode", hsrOperationModeAsString()).add("ClusterStatus", clusterStatusAsString())
.add("EnqueueReplication", enqueueReplication()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "HsrTier":
return Optional.ofNullable(clazz.cast(hsrTier()));
case "HsrReplicationMode":
return Optional.ofNullable(clazz.cast(hsrReplicationModeAsString()));
case "HsrOperationMode":
return Optional.ofNullable(clazz.cast(hsrOperationModeAsString()));
case "ClusterStatus":
return Optional.ofNullable(clazz.cast(clusterStatusAsString()));
case "EnqueueReplication":
return Optional.ofNullable(clazz.cast(enqueueReplication()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function