software.amazon.awssdk.services.connect.model.ReplicationStatusSummary Maven / Gradle / Ivy
Show all versions of connect 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.connect.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;
/**
*
* Status information about the replication process, where you use the ReplicateInstance API
* to create a replica of your Amazon Connect instance in another Amazon Web Services Region. For more information, see
* Set up Amazon
* Connect Global Resiliency in the Amazon Connect Administrator Guide.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReplicationStatusSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region")
.getter(getter(ReplicationStatusSummary::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField REPLICATION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationStatus").getter(getter(ReplicationStatusSummary::replicationStatusAsString))
.setter(setter(Builder::replicationStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationStatus").build()).build();
private static final SdkField REPLICATION_STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationStatusReason").getter(getter(ReplicationStatusSummary::replicationStatusReason))
.setter(setter(Builder::replicationStatusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationStatusReason").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REGION_FIELD,
REPLICATION_STATUS_FIELD, REPLICATION_STATUS_REASON_FIELD));
private static final long serialVersionUID = 1L;
private final String region;
private final String replicationStatus;
private final String replicationStatusReason;
private ReplicationStatusSummary(BuilderImpl builder) {
this.region = builder.region;
this.replicationStatus = builder.replicationStatus;
this.replicationStatusReason = builder.replicationStatusReason;
}
/**
*
* The Amazon Web Services Region. This can be either the source or the replica Region, depending where it appears
* in the summary list.
*
*
* @return The Amazon Web Services Region. This can be either the source or the replica Region, depending where it
* appears in the summary list.
*/
public final String region() {
return region;
}
/**
*
* The state of the replication.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
* will return {@link InstanceReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #replicationStatusAsString}.
*
*
* @return The state of the replication.
* @see InstanceReplicationStatus
*/
public final InstanceReplicationStatus replicationStatus() {
return InstanceReplicationStatus.fromValue(replicationStatus);
}
/**
*
* The state of the replication.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus}
* will return {@link InstanceReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #replicationStatusAsString}.
*
*
* @return The state of the replication.
* @see InstanceReplicationStatus
*/
public final String replicationStatusAsString() {
return replicationStatus;
}
/**
*
* A description of the replication status. Use this information to resolve any issues that are preventing the
* successful replication of your Amazon Connect instance to another Region.
*
*
* @return A description of the replication status. Use this information to resolve any issues that are preventing
* the successful replication of your Amazon Connect instance to another Region.
*/
public final String replicationStatusReason() {
return replicationStatusReason;
}
@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(region());
hashCode = 31 * hashCode + Objects.hashCode(replicationStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(replicationStatusReason());
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 ReplicationStatusSummary)) {
return false;
}
ReplicationStatusSummary other = (ReplicationStatusSummary) obj;
return Objects.equals(region(), other.region())
&& Objects.equals(replicationStatusAsString(), other.replicationStatusAsString())
&& Objects.equals(replicationStatusReason(), other.replicationStatusReason());
}
/**
* 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("ReplicationStatusSummary").add("Region", region())
.add("ReplicationStatus", replicationStatusAsString()).add("ReplicationStatusReason", replicationStatusReason())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "ReplicationStatus":
return Optional.ofNullable(clazz.cast(replicationStatusAsString()));
case "ReplicationStatusReason":
return Optional.ofNullable(clazz.cast(replicationStatusReason()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function