software.amazon.awssdk.services.resiliencehub.model.RecommendationDisruptionCompliance Maven / Gradle / Ivy
Show all versions of resiliencehub 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.resiliencehub.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;
/**
*
* Defines a disruption compliance recommendation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecommendationDisruptionCompliance implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField EXPECTED_COMPLIANCE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("expectedComplianceStatus")
.getter(getter(RecommendationDisruptionCompliance::expectedComplianceStatusAsString))
.setter(setter(Builder::expectedComplianceStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expectedComplianceStatus").build())
.build();
private static final SdkField EXPECTED_RPO_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("expectedRpoDescription").getter(getter(RecommendationDisruptionCompliance::expectedRpoDescription))
.setter(setter(Builder::expectedRpoDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expectedRpoDescription").build())
.build();
private static final SdkField EXPECTED_RPO_IN_SECS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("expectedRpoInSecs").getter(getter(RecommendationDisruptionCompliance::expectedRpoInSecs))
.setter(setter(Builder::expectedRpoInSecs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expectedRpoInSecs").build()).build();
private static final SdkField EXPECTED_RTO_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("expectedRtoDescription").getter(getter(RecommendationDisruptionCompliance::expectedRtoDescription))
.setter(setter(Builder::expectedRtoDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expectedRtoDescription").build())
.build();
private static final SdkField EXPECTED_RTO_IN_SECS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("expectedRtoInSecs").getter(getter(RecommendationDisruptionCompliance::expectedRtoInSecs))
.setter(setter(Builder::expectedRtoInSecs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expectedRtoInSecs").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
EXPECTED_COMPLIANCE_STATUS_FIELD, EXPECTED_RPO_DESCRIPTION_FIELD, EXPECTED_RPO_IN_SECS_FIELD,
EXPECTED_RTO_DESCRIPTION_FIELD, EXPECTED_RTO_IN_SECS_FIELD));
private static final long serialVersionUID = 1L;
private final String expectedComplianceStatus;
private final String expectedRpoDescription;
private final Integer expectedRpoInSecs;
private final String expectedRtoDescription;
private final Integer expectedRtoInSecs;
private RecommendationDisruptionCompliance(BuilderImpl builder) {
this.expectedComplianceStatus = builder.expectedComplianceStatus;
this.expectedRpoDescription = builder.expectedRpoDescription;
this.expectedRpoInSecs = builder.expectedRpoInSecs;
this.expectedRtoDescription = builder.expectedRtoDescription;
this.expectedRtoInSecs = builder.expectedRtoInSecs;
}
/**
*
* The expected compliance status after applying the recommended configuration change.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #expectedComplianceStatus} will return {@link ComplianceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #expectedComplianceStatusAsString}.
*
*
* @return The expected compliance status after applying the recommended configuration change.
* @see ComplianceStatus
*/
public final ComplianceStatus expectedComplianceStatus() {
return ComplianceStatus.fromValue(expectedComplianceStatus);
}
/**
*
* The expected compliance status after applying the recommended configuration change.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #expectedComplianceStatus} will return {@link ComplianceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #expectedComplianceStatusAsString}.
*
*
* @return The expected compliance status after applying the recommended configuration change.
* @see ComplianceStatus
*/
public final String expectedComplianceStatusAsString() {
return expectedComplianceStatus;
}
/**
*
* The expected Recovery Point Objective (RPO) description after applying the recommended configuration change.
*
*
* @return The expected Recovery Point Objective (RPO) description after applying the recommended configuration
* change.
*/
public final String expectedRpoDescription() {
return expectedRpoDescription;
}
/**
*
* The expected RPO after applying the recommended configuration change.
*
*
* @return The expected RPO after applying the recommended configuration change.
*/
public final Integer expectedRpoInSecs() {
return expectedRpoInSecs;
}
/**
*
* The expected Recovery Time Objective (RTO) description after applying the recommended configuration change.
*
*
* @return The expected Recovery Time Objective (RTO) description after applying the recommended configuration
* change.
*/
public final String expectedRtoDescription() {
return expectedRtoDescription;
}
/**
*
* The expected RTO after applying the recommended configuration change.
*
*
* @return The expected RTO after applying the recommended configuration change.
*/
public final Integer expectedRtoInSecs() {
return expectedRtoInSecs;
}
@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(expectedComplianceStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(expectedRpoDescription());
hashCode = 31 * hashCode + Objects.hashCode(expectedRpoInSecs());
hashCode = 31 * hashCode + Objects.hashCode(expectedRtoDescription());
hashCode = 31 * hashCode + Objects.hashCode(expectedRtoInSecs());
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 RecommendationDisruptionCompliance)) {
return false;
}
RecommendationDisruptionCompliance other = (RecommendationDisruptionCompliance) obj;
return Objects.equals(expectedComplianceStatusAsString(), other.expectedComplianceStatusAsString())
&& Objects.equals(expectedRpoDescription(), other.expectedRpoDescription())
&& Objects.equals(expectedRpoInSecs(), other.expectedRpoInSecs())
&& Objects.equals(expectedRtoDescription(), other.expectedRtoDescription())
&& Objects.equals(expectedRtoInSecs(), other.expectedRtoInSecs());
}
/**
* 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("RecommendationDisruptionCompliance")
.add("ExpectedComplianceStatus", expectedComplianceStatusAsString())
.add("ExpectedRpoDescription", expectedRpoDescription()).add("ExpectedRpoInSecs", expectedRpoInSecs())
.add("ExpectedRtoDescription", expectedRtoDescription()).add("ExpectedRtoInSecs", expectedRtoInSecs()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "expectedComplianceStatus":
return Optional.ofNullable(clazz.cast(expectedComplianceStatusAsString()));
case "expectedRpoDescription":
return Optional.ofNullable(clazz.cast(expectedRpoDescription()));
case "expectedRpoInSecs":
return Optional.ofNullable(clazz.cast(expectedRpoInSecs()));
case "expectedRtoDescription":
return Optional.ofNullable(clazz.cast(expectedRtoDescription()));
case "expectedRtoInSecs":
return Optional.ofNullable(clazz.cast(expectedRtoInSecs()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function