software.amazon.awssdk.services.securityhub.model.AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails 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.securityhub.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;
/**
*
* Provides details about the market (purchasing) options for Spot Instances.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails
implements
SdkPojo,
Serializable,
ToCopyableBuilder {
private static final SdkField BLOCK_DURATION_MINUTES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("BlockDurationMinutes")
.getter(getter(AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails::blockDurationMinutes))
.setter(setter(Builder::blockDurationMinutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlockDurationMinutes").build())
.build();
private static final SdkField INSTANCE_INTERRUPTION_BEHAVIOR_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("InstanceInterruptionBehavior")
.getter(getter(AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails::instanceInterruptionBehavior))
.setter(setter(Builder::instanceInterruptionBehavior))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceInterruptionBehavior")
.build()).build();
private static final SdkField MAX_PRICE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MaxPrice").getter(getter(AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails::maxPrice))
.setter(setter(Builder::maxPrice))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxPrice").build()).build();
private static final SdkField SPOT_INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SpotInstanceType")
.getter(getter(AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails::spotInstanceType))
.setter(setter(Builder::spotInstanceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SpotInstanceType").build()).build();
private static final SdkField VALID_UNTIL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ValidUntil").getter(getter(AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails::validUntil))
.setter(setter(Builder::validUntil))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValidUntil").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BLOCK_DURATION_MINUTES_FIELD,
INSTANCE_INTERRUPTION_BEHAVIOR_FIELD, MAX_PRICE_FIELD, SPOT_INSTANCE_TYPE_FIELD, VALID_UNTIL_FIELD));
private static final long serialVersionUID = 1L;
private final Integer blockDurationMinutes;
private final String instanceInterruptionBehavior;
private final String maxPrice;
private final String spotInstanceType;
private final String validUntil;
private AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails(BuilderImpl builder) {
this.blockDurationMinutes = builder.blockDurationMinutes;
this.instanceInterruptionBehavior = builder.instanceInterruptionBehavior;
this.maxPrice = builder.maxPrice;
this.spotInstanceType = builder.spotInstanceType;
this.validUntil = builder.validUntil;
}
/**
*
* Deprecated.
*
*
* @return Deprecated.
*/
public final Integer blockDurationMinutes() {
return blockDurationMinutes;
}
/**
*
* The behavior when a Spot Instance is interrupted.
*
*
* @return The behavior when a Spot Instance is interrupted.
*/
public final String instanceInterruptionBehavior() {
return instanceInterruptionBehavior;
}
/**
*
* The maximum hourly price you're willing to pay for the Spot Instances.
*
*
* @return The maximum hourly price you're willing to pay for the Spot Instances.
*/
public final String maxPrice() {
return maxPrice;
}
/**
*
* The Spot Instance request type.
*
*
* @return The Spot Instance request type.
*/
public final String spotInstanceType() {
return spotInstanceType;
}
/**
*
* The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ), for persistent requests.
*
*
* @return The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ), for persistent requests.
*/
public final String validUntil() {
return validUntil;
}
@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(blockDurationMinutes());
hashCode = 31 * hashCode + Objects.hashCode(instanceInterruptionBehavior());
hashCode = 31 * hashCode + Objects.hashCode(maxPrice());
hashCode = 31 * hashCode + Objects.hashCode(spotInstanceType());
hashCode = 31 * hashCode + Objects.hashCode(validUntil());
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 AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails)) {
return false;
}
AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails other = (AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails) obj;
return Objects.equals(blockDurationMinutes(), other.blockDurationMinutes())
&& Objects.equals(instanceInterruptionBehavior(), other.instanceInterruptionBehavior())
&& Objects.equals(maxPrice(), other.maxPrice()) && Objects.equals(spotInstanceType(), other.spotInstanceType())
&& Objects.equals(validUntil(), other.validUntil());
}
/**
* 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("AwsEc2LaunchTemplateDataInstanceMarketOptionsSpotOptionsDetails")
.add("BlockDurationMinutes", blockDurationMinutes())
.add("InstanceInterruptionBehavior", instanceInterruptionBehavior()).add("MaxPrice", maxPrice())
.add("SpotInstanceType", spotInstanceType()).add("ValidUntil", validUntil()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BlockDurationMinutes":
return Optional.ofNullable(clazz.cast(blockDurationMinutes()));
case "InstanceInterruptionBehavior":
return Optional.ofNullable(clazz.cast(instanceInterruptionBehavior()));
case "MaxPrice":
return Optional.ofNullable(clazz.cast(maxPrice()));
case "SpotInstanceType":
return Optional.ofNullable(clazz.cast(spotInstanceType()));
case "ValidUntil":
return Optional.ofNullable(clazz.cast(validUntil()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function © 2015 - 2025 Weber Informatics LLC | Privacy Policy