software.amazon.awssdk.services.drs.model.UpdateLaunchConfigurationResponse Maven / Gradle / Ivy
Show all versions of drs 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.drs.model;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateLaunchConfigurationResponse extends DrsResponse implements
ToCopyableBuilder {
private static final SdkField COPY_PRIVATE_IP_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("copyPrivateIp").getter(getter(UpdateLaunchConfigurationResponse::copyPrivateIp))
.setter(setter(Builder::copyPrivateIp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("copyPrivateIp").build()).build();
private static final SdkField COPY_TAGS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("copyTags").getter(getter(UpdateLaunchConfigurationResponse::copyTags)).setter(setter(Builder::copyTags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("copyTags").build()).build();
private static final SdkField EC2_LAUNCH_TEMPLATE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ec2LaunchTemplateID").getter(getter(UpdateLaunchConfigurationResponse::ec2LaunchTemplateID))
.setter(setter(Builder::ec2LaunchTemplateID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ec2LaunchTemplateID").build())
.build();
private static final SdkField LAUNCH_DISPOSITION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("launchDisposition").getter(getter(UpdateLaunchConfigurationResponse::launchDispositionAsString))
.setter(setter(Builder::launchDisposition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("launchDisposition").build()).build();
private static final SdkField LAUNCH_INTO_INSTANCE_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("launchIntoInstanceProperties")
.getter(getter(UpdateLaunchConfigurationResponse::launchIntoInstanceProperties))
.setter(setter(Builder::launchIntoInstanceProperties))
.constructor(LaunchIntoInstanceProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("launchIntoInstanceProperties")
.build()).build();
private static final SdkField LICENSING_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("licensing").getter(getter(UpdateLaunchConfigurationResponse::licensing))
.setter(setter(Builder::licensing)).constructor(Licensing::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("licensing").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(UpdateLaunchConfigurationResponse::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField POST_LAUNCH_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("postLaunchEnabled").getter(getter(UpdateLaunchConfigurationResponse::postLaunchEnabled))
.setter(setter(Builder::postLaunchEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("postLaunchEnabled").build()).build();
private static final SdkField SOURCE_SERVER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sourceServerID").getter(getter(UpdateLaunchConfigurationResponse::sourceServerID))
.setter(setter(Builder::sourceServerID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceServerID").build()).build();
private static final SdkField TARGET_INSTANCE_TYPE_RIGHT_SIZING_METHOD_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("targetInstanceTypeRightSizingMethod")
.getter(getter(UpdateLaunchConfigurationResponse::targetInstanceTypeRightSizingMethodAsString))
.setter(setter(Builder::targetInstanceTypeRightSizingMethod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("targetInstanceTypeRightSizingMethod").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COPY_PRIVATE_IP_FIELD,
COPY_TAGS_FIELD, EC2_LAUNCH_TEMPLATE_ID_FIELD, LAUNCH_DISPOSITION_FIELD, LAUNCH_INTO_INSTANCE_PROPERTIES_FIELD,
LICENSING_FIELD, NAME_FIELD, POST_LAUNCH_ENABLED_FIELD, SOURCE_SERVER_ID_FIELD,
TARGET_INSTANCE_TYPE_RIGHT_SIZING_METHOD_FIELD));
private final Boolean copyPrivateIp;
private final Boolean copyTags;
private final String ec2LaunchTemplateID;
private final String launchDisposition;
private final LaunchIntoInstanceProperties launchIntoInstanceProperties;
private final Licensing licensing;
private final String name;
private final Boolean postLaunchEnabled;
private final String sourceServerID;
private final String targetInstanceTypeRightSizingMethod;
private UpdateLaunchConfigurationResponse(BuilderImpl builder) {
super(builder);
this.copyPrivateIp = builder.copyPrivateIp;
this.copyTags = builder.copyTags;
this.ec2LaunchTemplateID = builder.ec2LaunchTemplateID;
this.launchDisposition = builder.launchDisposition;
this.launchIntoInstanceProperties = builder.launchIntoInstanceProperties;
this.licensing = builder.licensing;
this.name = builder.name;
this.postLaunchEnabled = builder.postLaunchEnabled;
this.sourceServerID = builder.sourceServerID;
this.targetInstanceTypeRightSizingMethod = builder.targetInstanceTypeRightSizingMethod;
}
/**
*
* Whether we should copy the Private IP of the Source Server to the Recovery Instance.
*
*
* @return Whether we should copy the Private IP of the Source Server to the Recovery Instance.
*/
public final Boolean copyPrivateIp() {
return copyPrivateIp;
}
/**
*
* Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.
*
*
* @return Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.
*/
public final Boolean copyTags() {
return copyTags;
}
/**
*
* The EC2 launch template ID of this launch configuration.
*
*
* @return The EC2 launch template ID of this launch configuration.
*/
public final String ec2LaunchTemplateID() {
return ec2LaunchTemplateID;
}
/**
*
* The state of the Recovery Instance in EC2 after the recovery operation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #launchDisposition}
* will return {@link LaunchDisposition#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #launchDispositionAsString}.
*
*
* @return The state of the Recovery Instance in EC2 after the recovery operation.
* @see LaunchDisposition
*/
public final LaunchDisposition launchDisposition() {
return LaunchDisposition.fromValue(launchDisposition);
}
/**
*
* The state of the Recovery Instance in EC2 after the recovery operation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #launchDisposition}
* will return {@link LaunchDisposition#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #launchDispositionAsString}.
*
*
* @return The state of the Recovery Instance in EC2 after the recovery operation.
* @see LaunchDisposition
*/
public final String launchDispositionAsString() {
return launchDisposition;
}
/**
*
* Launch into existing instance properties.
*
*
* @return Launch into existing instance properties.
*/
public final LaunchIntoInstanceProperties launchIntoInstanceProperties() {
return launchIntoInstanceProperties;
}
/**
*
* The licensing configuration to be used for this launch configuration.
*
*
* @return The licensing configuration to be used for this launch configuration.
*/
public final Licensing licensing() {
return licensing;
}
/**
*
* The name of the launch configuration.
*
*
* @return The name of the launch configuration.
*/
public final String name() {
return name;
}
/**
*
* Whether we want to activate post-launch actions for the Source Server.
*
*
* @return Whether we want to activate post-launch actions for the Source Server.
*/
public final Boolean postLaunchEnabled() {
return postLaunchEnabled;
}
/**
*
* The ID of the Source Server for this launch configuration.
*
*
* @return The ID of the Source Server for this launch configuration.
*/
public final String sourceServerID() {
return sourceServerID;
}
/**
*
* Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS,
* CPU, and RAM of your Source Server.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #targetInstanceTypeRightSizingMethod} will return
* {@link TargetInstanceTypeRightSizingMethod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #targetInstanceTypeRightSizingMethodAsString}.
*
*
* @return Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches
* the OS, CPU, and RAM of your Source Server.
* @see TargetInstanceTypeRightSizingMethod
*/
public final TargetInstanceTypeRightSizingMethod targetInstanceTypeRightSizingMethod() {
return TargetInstanceTypeRightSizingMethod.fromValue(targetInstanceTypeRightSizingMethod);
}
/**
*
* Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS,
* CPU, and RAM of your Source Server.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #targetInstanceTypeRightSizingMethod} will return
* {@link TargetInstanceTypeRightSizingMethod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #targetInstanceTypeRightSizingMethodAsString}.
*
*
* @return Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches
* the OS, CPU, and RAM of your Source Server.
* @see TargetInstanceTypeRightSizingMethod
*/
public final String targetInstanceTypeRightSizingMethodAsString() {
return targetInstanceTypeRightSizingMethod;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(copyPrivateIp());
hashCode = 31 * hashCode + Objects.hashCode(copyTags());
hashCode = 31 * hashCode + Objects.hashCode(ec2LaunchTemplateID());
hashCode = 31 * hashCode + Objects.hashCode(launchDispositionAsString());
hashCode = 31 * hashCode + Objects.hashCode(launchIntoInstanceProperties());
hashCode = 31 * hashCode + Objects.hashCode(licensing());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(postLaunchEnabled());
hashCode = 31 * hashCode + Objects.hashCode(sourceServerID());
hashCode = 31 * hashCode + Objects.hashCode(targetInstanceTypeRightSizingMethodAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateLaunchConfigurationResponse)) {
return false;
}
UpdateLaunchConfigurationResponse other = (UpdateLaunchConfigurationResponse) obj;
return Objects.equals(copyPrivateIp(), other.copyPrivateIp())
&& Objects.equals(copyTags(), other.copyTags())
&& Objects.equals(ec2LaunchTemplateID(), other.ec2LaunchTemplateID())
&& Objects.equals(launchDispositionAsString(), other.launchDispositionAsString())
&& Objects.equals(launchIntoInstanceProperties(), other.launchIntoInstanceProperties())
&& Objects.equals(licensing(), other.licensing())
&& Objects.equals(name(), other.name())
&& Objects.equals(postLaunchEnabled(), other.postLaunchEnabled())
&& Objects.equals(sourceServerID(), other.sourceServerID())
&& Objects.equals(targetInstanceTypeRightSizingMethodAsString(),
other.targetInstanceTypeRightSizingMethodAsString());
}
/**
* 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("UpdateLaunchConfigurationResponse").add("CopyPrivateIp", copyPrivateIp())
.add("CopyTags", copyTags()).add("Ec2LaunchTemplateID", ec2LaunchTemplateID())
.add("LaunchDisposition", launchDispositionAsString())
.add("LaunchIntoInstanceProperties", launchIntoInstanceProperties()).add("Licensing", licensing())
.add("Name", name()).add("PostLaunchEnabled", postLaunchEnabled()).add("SourceServerID", sourceServerID())
.add("TargetInstanceTypeRightSizingMethod", targetInstanceTypeRightSizingMethodAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "copyPrivateIp":
return Optional.ofNullable(clazz.cast(copyPrivateIp()));
case "copyTags":
return Optional.ofNullable(clazz.cast(copyTags()));
case "ec2LaunchTemplateID":
return Optional.ofNullable(clazz.cast(ec2LaunchTemplateID()));
case "launchDisposition":
return Optional.ofNullable(clazz.cast(launchDispositionAsString()));
case "launchIntoInstanceProperties":
return Optional.ofNullable(clazz.cast(launchIntoInstanceProperties()));
case "licensing":
return Optional.ofNullable(clazz.cast(licensing()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "postLaunchEnabled":
return Optional.ofNullable(clazz.cast(postLaunchEnabled()));
case "sourceServerID":
return Optional.ofNullable(clazz.cast(sourceServerID()));
case "targetInstanceTypeRightSizingMethod":
return Optional.ofNullable(clazz.cast(targetInstanceTypeRightSizingMethodAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function