Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.drs.model.RecoveryInstance 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.drs.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
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.Consumer;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A Recovery Instance is a replica of a Source Server running on EC2.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecoveryInstance implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(RecoveryInstance::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField DATA_REPLICATION_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("dataReplicationInfo")
.getter(getter(RecoveryInstance::dataReplicationInfo)).setter(setter(Builder::dataReplicationInfo))
.constructor(RecoveryInstanceDataReplicationInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataReplicationInfo").build())
.build();
private static final SdkField EC2_INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ec2InstanceID").getter(getter(RecoveryInstance::ec2InstanceID)).setter(setter(Builder::ec2InstanceID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ec2InstanceID").build()).build();
private static final SdkField EC2_INSTANCE_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ec2InstanceState").getter(getter(RecoveryInstance::ec2InstanceStateAsString))
.setter(setter(Builder::ec2InstanceState))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ec2InstanceState").build()).build();
private static final SdkField FAILBACK_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("failback")
.getter(getter(RecoveryInstance::failback)).setter(setter(Builder::failback))
.constructor(RecoveryInstanceFailback::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failback").build()).build();
private static final SdkField IS_DRILL_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("isDrill").getter(getter(RecoveryInstance::isDrill)).setter(setter(Builder::isDrill))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isDrill").build()).build();
private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("jobID")
.getter(getter(RecoveryInstance::jobID)).setter(setter(Builder::jobID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobID").build()).build();
private static final SdkField ORIGIN_AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("originAvailabilityZone").getter(getter(RecoveryInstance::originAvailabilityZone))
.setter(setter(Builder::originAvailabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("originAvailabilityZone").build())
.build();
private static final SdkField ORIGIN_ENVIRONMENT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("originEnvironment").getter(getter(RecoveryInstance::originEnvironmentAsString))
.setter(setter(Builder::originEnvironment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("originEnvironment").build()).build();
private static final SdkField POINT_IN_TIME_SNAPSHOT_DATE_TIME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("pointInTimeSnapshotDateTime")
.getter(getter(RecoveryInstance::pointInTimeSnapshotDateTime))
.setter(setter(Builder::pointInTimeSnapshotDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pointInTimeSnapshotDateTime")
.build()).build();
private static final SdkField RECOVERY_INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("recoveryInstanceID").getter(getter(RecoveryInstance::recoveryInstanceID))
.setter(setter(Builder::recoveryInstanceID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recoveryInstanceID").build())
.build();
private static final SdkField RECOVERY_INSTANCE_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("recoveryInstanceProperties")
.getter(getter(RecoveryInstance::recoveryInstanceProperties))
.setter(setter(Builder::recoveryInstanceProperties))
.constructor(RecoveryInstanceProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recoveryInstanceProperties").build())
.build();
private static final SdkField SOURCE_SERVER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sourceServerID").getter(getter(RecoveryInstance::sourceServerID))
.setter(setter(Builder::sourceServerID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceServerID").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(RecoveryInstance::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD,
DATA_REPLICATION_INFO_FIELD, EC2_INSTANCE_ID_FIELD, EC2_INSTANCE_STATE_FIELD, FAILBACK_FIELD, IS_DRILL_FIELD,
JOB_ID_FIELD, ORIGIN_AVAILABILITY_ZONE_FIELD, ORIGIN_ENVIRONMENT_FIELD, POINT_IN_TIME_SNAPSHOT_DATE_TIME_FIELD,
RECOVERY_INSTANCE_ID_FIELD, RECOVERY_INSTANCE_PROPERTIES_FIELD, SOURCE_SERVER_ID_FIELD, TAGS_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final RecoveryInstanceDataReplicationInfo dataReplicationInfo;
private final String ec2InstanceID;
private final String ec2InstanceState;
private final RecoveryInstanceFailback failback;
private final Boolean isDrill;
private final String jobID;
private final String originAvailabilityZone;
private final String originEnvironment;
private final String pointInTimeSnapshotDateTime;
private final String recoveryInstanceID;
private final RecoveryInstanceProperties recoveryInstanceProperties;
private final String sourceServerID;
private final Map tags;
private RecoveryInstance(BuilderImpl builder) {
this.arn = builder.arn;
this.dataReplicationInfo = builder.dataReplicationInfo;
this.ec2InstanceID = builder.ec2InstanceID;
this.ec2InstanceState = builder.ec2InstanceState;
this.failback = builder.failback;
this.isDrill = builder.isDrill;
this.jobID = builder.jobID;
this.originAvailabilityZone = builder.originAvailabilityZone;
this.originEnvironment = builder.originEnvironment;
this.pointInTimeSnapshotDateTime = builder.pointInTimeSnapshotDateTime;
this.recoveryInstanceID = builder.recoveryInstanceID;
this.recoveryInstanceProperties = builder.recoveryInstanceProperties;
this.sourceServerID = builder.sourceServerID;
this.tags = builder.tags;
}
/**
*
* The ARN of the Recovery Instance.
*
*
* @return The ARN of the Recovery Instance.
*/
public final String arn() {
return arn;
}
/**
*
* The Data Replication Info of the Recovery Instance.
*
*
* @return The Data Replication Info of the Recovery Instance.
*/
public final RecoveryInstanceDataReplicationInfo dataReplicationInfo() {
return dataReplicationInfo;
}
/**
*
* The EC2 instance ID of the Recovery Instance.
*
*
* @return The EC2 instance ID of the Recovery Instance.
*/
public final String ec2InstanceID() {
return ec2InstanceID;
}
/**
*
* The state of the EC2 instance for this Recovery Instance.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #ec2InstanceState}
* will return {@link EC2InstanceState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #ec2InstanceStateAsString}.
*
*
* @return The state of the EC2 instance for this Recovery Instance.
* @see EC2InstanceState
*/
public final EC2InstanceState ec2InstanceState() {
return EC2InstanceState.fromValue(ec2InstanceState);
}
/**
*
* The state of the EC2 instance for this Recovery Instance.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #ec2InstanceState}
* will return {@link EC2InstanceState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #ec2InstanceStateAsString}.
*
*
* @return The state of the EC2 instance for this Recovery Instance.
* @see EC2InstanceState
*/
public final String ec2InstanceStateAsString() {
return ec2InstanceState;
}
/**
*
* An object representing failback related information of the Recovery Instance.
*
*
* @return An object representing failback related information of the Recovery Instance.
*/
public final RecoveryInstanceFailback failback() {
return failback;
}
/**
*
* Whether this Recovery Instance was created for a drill or for an actual Recovery event.
*
*
* @return Whether this Recovery Instance was created for a drill or for an actual Recovery event.
*/
public final Boolean isDrill() {
return isDrill;
}
/**
*
* The ID of the Job that created the Recovery Instance.
*
*
* @return The ID of the Job that created the Recovery Instance.
*/
public final String jobID() {
return jobID;
}
/**
*
* AWS availability zone associated with the recovery instance.
*
*
* @return AWS availability zone associated with the recovery instance.
*/
public final String originAvailabilityZone() {
return originAvailabilityZone;
}
/**
*
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #originEnvironment}
* will return {@link OriginEnvironment#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #originEnvironmentAsString}.
*
*
* @return Environment (On Premises / AWS) of the instance that the recovery instance originated from.
* @see OriginEnvironment
*/
public final OriginEnvironment originEnvironment() {
return OriginEnvironment.fromValue(originEnvironment);
}
/**
*
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #originEnvironment}
* will return {@link OriginEnvironment#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #originEnvironmentAsString}.
*
*
* @return Environment (On Premises / AWS) of the instance that the recovery instance originated from.
* @see OriginEnvironment
*/
public final String originEnvironmentAsString() {
return originEnvironment;
}
/**
*
* The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.
*
*
* @return The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.
*/
public final String pointInTimeSnapshotDateTime() {
return pointInTimeSnapshotDateTime;
}
/**
*
* The ID of the Recovery Instance.
*
*
* @return The ID of the Recovery Instance.
*/
public final String recoveryInstanceID() {
return recoveryInstanceID;
}
/**
*
* Properties of the Recovery Instance machine.
*
*
* @return Properties of the Recovery Instance machine.
*/
public final RecoveryInstanceProperties recoveryInstanceProperties() {
return recoveryInstanceProperties;
}
/**
*
* The Source Server ID that this Recovery Instance is associated with.
*
*
* @return The Source Server ID that this Recovery Instance is associated with.
*/
public final String sourceServerID() {
return sourceServerID;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* An array of tags that are associated with the Recovery Instance.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return An array of tags that are associated with the Recovery Instance.
*/
public final Map tags() {
return tags;
}
@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(arn());
hashCode = 31 * hashCode + Objects.hashCode(dataReplicationInfo());
hashCode = 31 * hashCode + Objects.hashCode(ec2InstanceID());
hashCode = 31 * hashCode + Objects.hashCode(ec2InstanceStateAsString());
hashCode = 31 * hashCode + Objects.hashCode(failback());
hashCode = 31 * hashCode + Objects.hashCode(isDrill());
hashCode = 31 * hashCode + Objects.hashCode(jobID());
hashCode = 31 * hashCode + Objects.hashCode(originAvailabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(originEnvironmentAsString());
hashCode = 31 * hashCode + Objects.hashCode(pointInTimeSnapshotDateTime());
hashCode = 31 * hashCode + Objects.hashCode(recoveryInstanceID());
hashCode = 31 * hashCode + Objects.hashCode(recoveryInstanceProperties());
hashCode = 31 * hashCode + Objects.hashCode(sourceServerID());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 RecoveryInstance)) {
return false;
}
RecoveryInstance other = (RecoveryInstance) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(dataReplicationInfo(), other.dataReplicationInfo())
&& Objects.equals(ec2InstanceID(), other.ec2InstanceID())
&& Objects.equals(ec2InstanceStateAsString(), other.ec2InstanceStateAsString())
&& Objects.equals(failback(), other.failback()) && Objects.equals(isDrill(), other.isDrill())
&& Objects.equals(jobID(), other.jobID())
&& Objects.equals(originAvailabilityZone(), other.originAvailabilityZone())
&& Objects.equals(originEnvironmentAsString(), other.originEnvironmentAsString())
&& Objects.equals(pointInTimeSnapshotDateTime(), other.pointInTimeSnapshotDateTime())
&& Objects.equals(recoveryInstanceID(), other.recoveryInstanceID())
&& Objects.equals(recoveryInstanceProperties(), other.recoveryInstanceProperties())
&& Objects.equals(sourceServerID(), other.sourceServerID()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("RecoveryInstance").add("Arn", arn()).add("DataReplicationInfo", dataReplicationInfo())
.add("Ec2InstanceID", ec2InstanceID()).add("Ec2InstanceState", ec2InstanceStateAsString())
.add("Failback", failback()).add("IsDrill", isDrill()).add("JobID", jobID())
.add("OriginAvailabilityZone", originAvailabilityZone()).add("OriginEnvironment", originEnvironmentAsString())
.add("PointInTimeSnapshotDateTime", pointInTimeSnapshotDateTime())
.add("RecoveryInstanceID", recoveryInstanceID()).add("RecoveryInstanceProperties", recoveryInstanceProperties())
.add("SourceServerID", sourceServerID()).add("Tags", tags() == null ? null : "*** Sensitive Data Redacted ***")
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "dataReplicationInfo":
return Optional.ofNullable(clazz.cast(dataReplicationInfo()));
case "ec2InstanceID":
return Optional.ofNullable(clazz.cast(ec2InstanceID()));
case "ec2InstanceState":
return Optional.ofNullable(clazz.cast(ec2InstanceStateAsString()));
case "failback":
return Optional.ofNullable(clazz.cast(failback()));
case "isDrill":
return Optional.ofNullable(clazz.cast(isDrill()));
case "jobID":
return Optional.ofNullable(clazz.cast(jobID()));
case "originAvailabilityZone":
return Optional.ofNullable(clazz.cast(originAvailabilityZone()));
case "originEnvironment":
return Optional.ofNullable(clazz.cast(originEnvironmentAsString()));
case "pointInTimeSnapshotDateTime":
return Optional.ofNullable(clazz.cast(pointInTimeSnapshotDateTime()));
case "recoveryInstanceID":
return Optional.ofNullable(clazz.cast(recoveryInstanceID()));
case "recoveryInstanceProperties":
return Optional.ofNullable(clazz.cast(recoveryInstanceProperties()));
case "sourceServerID":
return Optional.ofNullable(clazz.cast(sourceServerID()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((RecoveryInstance) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The ARN of the Recovery Instance.
*
*
* @param arn
* The ARN of the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder arn(String arn);
/**
*
* The Data Replication Info of the Recovery Instance.
*
*
* @param dataReplicationInfo
* The Data Replication Info of the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder dataReplicationInfo(RecoveryInstanceDataReplicationInfo dataReplicationInfo);
/**
*
* The Data Replication Info of the Recovery Instance.
*
* This is a convenience method that creates an instance of the
* {@link RecoveryInstanceDataReplicationInfo.Builder} avoiding the need to create one manually via
* {@link RecoveryInstanceDataReplicationInfo#builder()}.
*
*
* When the {@link Consumer} completes, {@link RecoveryInstanceDataReplicationInfo.Builder#build()} is called
* immediately and its result is passed to {@link #dataReplicationInfo(RecoveryInstanceDataReplicationInfo)}.
*
* @param dataReplicationInfo
* a consumer that will call methods on {@link RecoveryInstanceDataReplicationInfo.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #dataReplicationInfo(RecoveryInstanceDataReplicationInfo)
*/
default Builder dataReplicationInfo(Consumer dataReplicationInfo) {
return dataReplicationInfo(RecoveryInstanceDataReplicationInfo.builder().applyMutation(dataReplicationInfo).build());
}
/**
*
* The EC2 instance ID of the Recovery Instance.
*
*
* @param ec2InstanceID
* The EC2 instance ID of the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ec2InstanceID(String ec2InstanceID);
/**
*
* The state of the EC2 instance for this Recovery Instance.
*
*
* @param ec2InstanceState
* The state of the EC2 instance for this Recovery Instance.
* @see EC2InstanceState
* @return Returns a reference to this object so that method calls can be chained together.
* @see EC2InstanceState
*/
Builder ec2InstanceState(String ec2InstanceState);
/**
*
* The state of the EC2 instance for this Recovery Instance.
*
*
* @param ec2InstanceState
* The state of the EC2 instance for this Recovery Instance.
* @see EC2InstanceState
* @return Returns a reference to this object so that method calls can be chained together.
* @see EC2InstanceState
*/
Builder ec2InstanceState(EC2InstanceState ec2InstanceState);
/**
*
* An object representing failback related information of the Recovery Instance.
*
*
* @param failback
* An object representing failback related information of the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder failback(RecoveryInstanceFailback failback);
/**
*
* An object representing failback related information of the Recovery Instance.
*
* This is a convenience method that creates an instance of the {@link RecoveryInstanceFailback.Builder}
* avoiding the need to create one manually via {@link RecoveryInstanceFailback#builder()}.
*
*
* When the {@link Consumer} completes, {@link RecoveryInstanceFailback.Builder#build()} is called immediately
* and its result is passed to {@link #failback(RecoveryInstanceFailback)}.
*
* @param failback
* a consumer that will call methods on {@link RecoveryInstanceFailback.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #failback(RecoveryInstanceFailback)
*/
default Builder failback(Consumer failback) {
return failback(RecoveryInstanceFailback.builder().applyMutation(failback).build());
}
/**
*
* Whether this Recovery Instance was created for a drill or for an actual Recovery event.
*
*
* @param isDrill
* Whether this Recovery Instance was created for a drill or for an actual Recovery event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder isDrill(Boolean isDrill);
/**
*
* The ID of the Job that created the Recovery Instance.
*
*
* @param jobID
* The ID of the Job that created the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder jobID(String jobID);
/**
*
* AWS availability zone associated with the recovery instance.
*
*
* @param originAvailabilityZone
* AWS availability zone associated with the recovery instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder originAvailabilityZone(String originAvailabilityZone);
/**
*
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
*
*
* @param originEnvironment
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
* @see OriginEnvironment
* @return Returns a reference to this object so that method calls can be chained together.
* @see OriginEnvironment
*/
Builder originEnvironment(String originEnvironment);
/**
*
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
*
*
* @param originEnvironment
* Environment (On Premises / AWS) of the instance that the recovery instance originated from.
* @see OriginEnvironment
* @return Returns a reference to this object so that method calls can be chained together.
* @see OriginEnvironment
*/
Builder originEnvironment(OriginEnvironment originEnvironment);
/**
*
* The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.
*
*
* @param pointInTimeSnapshotDateTime
* The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder pointInTimeSnapshotDateTime(String pointInTimeSnapshotDateTime);
/**
*
* The ID of the Recovery Instance.
*
*
* @param recoveryInstanceID
* The ID of the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recoveryInstanceID(String recoveryInstanceID);
/**
*
* Properties of the Recovery Instance machine.
*
*
* @param recoveryInstanceProperties
* Properties of the Recovery Instance machine.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recoveryInstanceProperties(RecoveryInstanceProperties recoveryInstanceProperties);
/**
*
* Properties of the Recovery Instance machine.
*
* This is a convenience method that creates an instance of the {@link RecoveryInstanceProperties.Builder}
* avoiding the need to create one manually via {@link RecoveryInstanceProperties#builder()}.
*
*
* When the {@link Consumer} completes, {@link RecoveryInstanceProperties.Builder#build()} is called immediately
* and its result is passed to {@link #recoveryInstanceProperties(RecoveryInstanceProperties)}.
*
* @param recoveryInstanceProperties
* a consumer that will call methods on {@link RecoveryInstanceProperties.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recoveryInstanceProperties(RecoveryInstanceProperties)
*/
default Builder recoveryInstanceProperties(Consumer recoveryInstanceProperties) {
return recoveryInstanceProperties(RecoveryInstanceProperties.builder().applyMutation(recoveryInstanceProperties)
.build());
}
/**
*
* The Source Server ID that this Recovery Instance is associated with.
*
*
* @param sourceServerID
* The Source Server ID that this Recovery Instance is associated with.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourceServerID(String sourceServerID);
/**
*
* An array of tags that are associated with the Recovery Instance.
*
*
* @param tags
* An array of tags that are associated with the Recovery Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl implements Builder {
private String arn;
private RecoveryInstanceDataReplicationInfo dataReplicationInfo;
private String ec2InstanceID;
private String ec2InstanceState;
private RecoveryInstanceFailback failback;
private Boolean isDrill;
private String jobID;
private String originAvailabilityZone;
private String originEnvironment;
private String pointInTimeSnapshotDateTime;
private String recoveryInstanceID;
private RecoveryInstanceProperties recoveryInstanceProperties;
private String sourceServerID;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(RecoveryInstance model) {
arn(model.arn);
dataReplicationInfo(model.dataReplicationInfo);
ec2InstanceID(model.ec2InstanceID);
ec2InstanceState(model.ec2InstanceState);
failback(model.failback);
isDrill(model.isDrill);
jobID(model.jobID);
originAvailabilityZone(model.originAvailabilityZone);
originEnvironment(model.originEnvironment);
pointInTimeSnapshotDateTime(model.pointInTimeSnapshotDateTime);
recoveryInstanceID(model.recoveryInstanceID);
recoveryInstanceProperties(model.recoveryInstanceProperties);
sourceServerID(model.sourceServerID);
tags(model.tags);
}
public final String getArn() {
return arn;
}
public final void setArn(String arn) {
this.arn = arn;
}
@Override
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final RecoveryInstanceDataReplicationInfo.Builder getDataReplicationInfo() {
return dataReplicationInfo != null ? dataReplicationInfo.toBuilder() : null;
}
public final void setDataReplicationInfo(RecoveryInstanceDataReplicationInfo.BuilderImpl dataReplicationInfo) {
this.dataReplicationInfo = dataReplicationInfo != null ? dataReplicationInfo.build() : null;
}
@Override
public final Builder dataReplicationInfo(RecoveryInstanceDataReplicationInfo dataReplicationInfo) {
this.dataReplicationInfo = dataReplicationInfo;
return this;
}
public final String getEc2InstanceID() {
return ec2InstanceID;
}
public final void setEc2InstanceID(String ec2InstanceID) {
this.ec2InstanceID = ec2InstanceID;
}
@Override
public final Builder ec2InstanceID(String ec2InstanceID) {
this.ec2InstanceID = ec2InstanceID;
return this;
}
public final String getEc2InstanceState() {
return ec2InstanceState;
}
public final void setEc2InstanceState(String ec2InstanceState) {
this.ec2InstanceState = ec2InstanceState;
}
@Override
public final Builder ec2InstanceState(String ec2InstanceState) {
this.ec2InstanceState = ec2InstanceState;
return this;
}
@Override
public final Builder ec2InstanceState(EC2InstanceState ec2InstanceState) {
this.ec2InstanceState(ec2InstanceState == null ? null : ec2InstanceState.toString());
return this;
}
public final RecoveryInstanceFailback.Builder getFailback() {
return failback != null ? failback.toBuilder() : null;
}
public final void setFailback(RecoveryInstanceFailback.BuilderImpl failback) {
this.failback = failback != null ? failback.build() : null;
}
@Override
public final Builder failback(RecoveryInstanceFailback failback) {
this.failback = failback;
return this;
}
public final Boolean getIsDrill() {
return isDrill;
}
public final void setIsDrill(Boolean isDrill) {
this.isDrill = isDrill;
}
@Override
public final Builder isDrill(Boolean isDrill) {
this.isDrill = isDrill;
return this;
}
public final String getJobID() {
return jobID;
}
public final void setJobID(String jobID) {
this.jobID = jobID;
}
@Override
public final Builder jobID(String jobID) {
this.jobID = jobID;
return this;
}
public final String getOriginAvailabilityZone() {
return originAvailabilityZone;
}
public final void setOriginAvailabilityZone(String originAvailabilityZone) {
this.originAvailabilityZone = originAvailabilityZone;
}
@Override
public final Builder originAvailabilityZone(String originAvailabilityZone) {
this.originAvailabilityZone = originAvailabilityZone;
return this;
}
public final String getOriginEnvironment() {
return originEnvironment;
}
public final void setOriginEnvironment(String originEnvironment) {
this.originEnvironment = originEnvironment;
}
@Override
public final Builder originEnvironment(String originEnvironment) {
this.originEnvironment = originEnvironment;
return this;
}
@Override
public final Builder originEnvironment(OriginEnvironment originEnvironment) {
this.originEnvironment(originEnvironment == null ? null : originEnvironment.toString());
return this;
}
public final String getPointInTimeSnapshotDateTime() {
return pointInTimeSnapshotDateTime;
}
public final void setPointInTimeSnapshotDateTime(String pointInTimeSnapshotDateTime) {
this.pointInTimeSnapshotDateTime = pointInTimeSnapshotDateTime;
}
@Override
public final Builder pointInTimeSnapshotDateTime(String pointInTimeSnapshotDateTime) {
this.pointInTimeSnapshotDateTime = pointInTimeSnapshotDateTime;
return this;
}
public final String getRecoveryInstanceID() {
return recoveryInstanceID;
}
public final void setRecoveryInstanceID(String recoveryInstanceID) {
this.recoveryInstanceID = recoveryInstanceID;
}
@Override
public final Builder recoveryInstanceID(String recoveryInstanceID) {
this.recoveryInstanceID = recoveryInstanceID;
return this;
}
public final RecoveryInstanceProperties.Builder getRecoveryInstanceProperties() {
return recoveryInstanceProperties != null ? recoveryInstanceProperties.toBuilder() : null;
}
public final void setRecoveryInstanceProperties(RecoveryInstanceProperties.BuilderImpl recoveryInstanceProperties) {
this.recoveryInstanceProperties = recoveryInstanceProperties != null ? recoveryInstanceProperties.build() : null;
}
@Override
public final Builder recoveryInstanceProperties(RecoveryInstanceProperties recoveryInstanceProperties) {
this.recoveryInstanceProperties = recoveryInstanceProperties;
return this;
}
public final String getSourceServerID() {
return sourceServerID;
}
public final void setSourceServerID(String sourceServerID) {
this.sourceServerID = sourceServerID;
}
@Override
public final Builder sourceServerID(String sourceServerID) {
this.sourceServerID = sourceServerID;
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsMapCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsMapCopier.copy(tags);
return this;
}
@Override
public RecoveryInstance build() {
return new RecoveryInstance(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}