All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendationOption Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Compute Optimizer module holds the client classes that are used for communicating with Compute Optimizer.

There is a newer version: 2.28.3
Show newest version
/*
 * 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.computeoptimizer.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes a recommendation option for an Auto Scaling group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AutoScalingGroupRecommendationOption implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("configuration") .getter(getter(AutoScalingGroupRecommendationOption::configuration)).setter(setter(Builder::configuration)) .constructor(AutoScalingGroupConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("configuration").build()).build(); private static final SdkField INSTANCE_GPU_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("instanceGpuInfo").getter(getter(AutoScalingGroupRecommendationOption::instanceGpuInfo)) .setter(setter(Builder::instanceGpuInfo)).constructor(GpuInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceGpuInfo").build()).build(); private static final SdkField> PROJECTED_UTILIZATION_METRICS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("projectedUtilizationMetrics") .getter(getter(AutoScalingGroupRecommendationOption::projectedUtilizationMetrics)) .setter(setter(Builder::projectedUtilizationMetrics)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("projectedUtilizationMetrics") .build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(UtilizationMetric::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField PERFORMANCE_RISK_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("performanceRisk").getter(getter(AutoScalingGroupRecommendationOption::performanceRisk)) .setter(setter(Builder::performanceRisk)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("performanceRisk").build()).build(); private static final SdkField RANK_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("rank") .getter(getter(AutoScalingGroupRecommendationOption::rank)).setter(setter(Builder::rank)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("rank").build()).build(); private static final SdkField SAVINGS_OPPORTUNITY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("savingsOpportunity") .getter(getter(AutoScalingGroupRecommendationOption::savingsOpportunity)).setter(setter(Builder::savingsOpportunity)) .constructor(SavingsOpportunity::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("savingsOpportunity").build()) .build(); private static final SdkField SAVINGS_OPPORTUNITY_AFTER_DISCOUNTS_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("savingsOpportunityAfterDiscounts") .getter(getter(AutoScalingGroupRecommendationOption::savingsOpportunityAfterDiscounts)) .setter(setter(Builder::savingsOpportunityAfterDiscounts)) .constructor(AutoScalingGroupSavingsOpportunityAfterDiscounts::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("savingsOpportunityAfterDiscounts") .build()).build(); private static final SdkField MIGRATION_EFFORT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("migrationEffort").getter(getter(AutoScalingGroupRecommendationOption::migrationEffortAsString)) .setter(setter(Builder::migrationEffort)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("migrationEffort").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONFIGURATION_FIELD, INSTANCE_GPU_INFO_FIELD, PROJECTED_UTILIZATION_METRICS_FIELD, PERFORMANCE_RISK_FIELD, RANK_FIELD, SAVINGS_OPPORTUNITY_FIELD, SAVINGS_OPPORTUNITY_AFTER_DISCOUNTS_FIELD, MIGRATION_EFFORT_FIELD)); private static final long serialVersionUID = 1L; private final AutoScalingGroupConfiguration configuration; private final GpuInfo instanceGpuInfo; private final List projectedUtilizationMetrics; private final Double performanceRisk; private final Integer rank; private final SavingsOpportunity savingsOpportunity; private final AutoScalingGroupSavingsOpportunityAfterDiscounts savingsOpportunityAfterDiscounts; private final String migrationEffort; private AutoScalingGroupRecommendationOption(BuilderImpl builder) { this.configuration = builder.configuration; this.instanceGpuInfo = builder.instanceGpuInfo; this.projectedUtilizationMetrics = builder.projectedUtilizationMetrics; this.performanceRisk = builder.performanceRisk; this.rank = builder.rank; this.savingsOpportunity = builder.savingsOpportunity; this.savingsOpportunityAfterDiscounts = builder.savingsOpportunityAfterDiscounts; this.migrationEffort = builder.migrationEffort; } /** *

* An array of objects that describe an Auto Scaling group configuration. *

* * @return An array of objects that describe an Auto Scaling group configuration. */ public final AutoScalingGroupConfiguration configuration() { return configuration; } /** *

* Describes the GPU accelerator settings for the recommended instance type of the Auto Scaling group. *

* * @return Describes the GPU accelerator settings for the recommended instance type of the Auto Scaling group. */ public final GpuInfo instanceGpuInfo() { return instanceGpuInfo; } /** * For responses, this returns true if the service returned a value for the ProjectedUtilizationMetrics 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 hasProjectedUtilizationMetrics() { return projectedUtilizationMetrics != null && !(projectedUtilizationMetrics instanceof SdkAutoConstructList); } /** *

* An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation * option. *

* *

* The Cpu and Memory metrics are the only projected utilization metrics returned. * Additionally, the Memory metric is returned only for resources that have the unified CloudWatch * agent installed on them. For more information, see Enabling Memory Utilization * with the CloudWatch Agent. *

*
*

* 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 #hasProjectedUtilizationMetrics} method. *

* * @return An array of objects that describe the projected utilization metrics of the Auto Scaling group * recommendation option.

*

* The Cpu and Memory metrics are the only projected utilization metrics returned. * Additionally, the Memory metric is returned only for resources that have the unified * CloudWatch agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

*/ public final List projectedUtilizationMetrics() { return projectedUtilizationMetrics; } /** *

* The performance risk of the Auto Scaling group configuration recommendation. *

*

* Performance risk indicates the likelihood of the recommended instance type not meeting the resource needs of your * workload. Compute Optimizer calculates an individual performance risk score for each specification of the * recommended instance, including CPU, memory, EBS throughput, EBS IOPS, disk throughput, disk IOPS, network * throughput, and network PPS. The performance risk of the recommended instance is calculated as the maximum * performance risk score across the analyzed resource specifications. *

*

* The value ranges from 0 - 4, with 0 meaning that the recommended resource * is predicted to always provide enough hardware capability. The higher the performance risk is, the more likely * you should validate whether the recommendation will meet the performance requirements of your workload before * migrating your resource. *

* * @return The performance risk of the Auto Scaling group configuration recommendation.

*

* Performance risk indicates the likelihood of the recommended instance type not meeting the resource needs * of your workload. Compute Optimizer calculates an individual performance risk score for each * specification of the recommended instance, including CPU, memory, EBS throughput, EBS IOPS, disk * throughput, disk IOPS, network throughput, and network PPS. The performance risk of the recommended * instance is calculated as the maximum performance risk score across the analyzed resource specifications. *

*

* The value ranges from 0 - 4, with 0 meaning that the recommended * resource is predicted to always provide enough hardware capability. The higher the performance risk is, * the more likely you should validate whether the recommendation will meet the performance requirements of * your workload before migrating your resource. */ public final Double performanceRisk() { return performanceRisk; } /** *

* The rank of the Auto Scaling group recommendation option. *

*

* The top recommendation option is ranked as 1. *

* * @return The rank of the Auto Scaling group recommendation option.

*

* The top recommendation option is ranked as 1. */ public final Integer rank() { return rank; } /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option. Savings * opportunity includes the estimated monthly savings amount and percentage. *

* * @return An object that describes the savings opportunity for the Auto Scaling group recommendation option. * Savings opportunity includes the estimated monthly savings amount and percentage. */ public final SavingsOpportunity savingsOpportunity() { return savingsOpportunity; } /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option that includes * Savings Plans and Reserved Instances discounts. Savings opportunity includes the estimated monthly savings and * percentage. *

* * @return An object that describes the savings opportunity for the Auto Scaling group recommendation option that * includes Savings Plans and Reserved Instances discounts. Savings opportunity includes the estimated * monthly savings and percentage. */ public final AutoScalingGroupSavingsOpportunityAfterDiscounts savingsOpportunityAfterDiscounts() { return savingsOpportunityAfterDiscounts; } /** *

* The level of effort required to migrate from the current instance type to the recommended instance type. *

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an Amazon * Web Services Graviton instance type is recommended. The migration effort is Medium if a workload * type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. The migration effort * is VeryLow if both the current and recommended instance types are of the same CPU architecture. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #migrationEffort} * will return {@link MigrationEffort#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #migrationEffortAsString}. *

* * @return The level of effort required to migrate from the current instance type to the recommended instance * type.

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an * Amazon Web Services Graviton instance type is recommended. The migration effort is Medium if * a workload type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. * The migration effort is VeryLow if both the current and recommended instance types are of * the same CPU architecture. * @see MigrationEffort */ public final MigrationEffort migrationEffort() { return MigrationEffort.fromValue(migrationEffort); } /** *

* The level of effort required to migrate from the current instance type to the recommended instance type. *

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an Amazon * Web Services Graviton instance type is recommended. The migration effort is Medium if a workload * type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. The migration effort * is VeryLow if both the current and recommended instance types are of the same CPU architecture. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #migrationEffort} * will return {@link MigrationEffort#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #migrationEffortAsString}. *

* * @return The level of effort required to migrate from the current instance type to the recommended instance * type.

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an * Amazon Web Services Graviton instance type is recommended. The migration effort is Medium if * a workload type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. * The migration effort is VeryLow if both the current and recommended instance types are of * the same CPU architecture. * @see MigrationEffort */ public final String migrationEffortAsString() { return migrationEffort; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(configuration()); hashCode = 31 * hashCode + Objects.hashCode(instanceGpuInfo()); hashCode = 31 * hashCode + Objects.hashCode(hasProjectedUtilizationMetrics() ? projectedUtilizationMetrics() : null); hashCode = 31 * hashCode + Objects.hashCode(performanceRisk()); hashCode = 31 * hashCode + Objects.hashCode(rank()); hashCode = 31 * hashCode + Objects.hashCode(savingsOpportunity()); hashCode = 31 * hashCode + Objects.hashCode(savingsOpportunityAfterDiscounts()); hashCode = 31 * hashCode + Objects.hashCode(migrationEffortAsString()); 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 AutoScalingGroupRecommendationOption)) { return false; } AutoScalingGroupRecommendationOption other = (AutoScalingGroupRecommendationOption) obj; return Objects.equals(configuration(), other.configuration()) && Objects.equals(instanceGpuInfo(), other.instanceGpuInfo()) && hasProjectedUtilizationMetrics() == other.hasProjectedUtilizationMetrics() && Objects.equals(projectedUtilizationMetrics(), other.projectedUtilizationMetrics()) && Objects.equals(performanceRisk(), other.performanceRisk()) && Objects.equals(rank(), other.rank()) && Objects.equals(savingsOpportunity(), other.savingsOpportunity()) && Objects.equals(savingsOpportunityAfterDiscounts(), other.savingsOpportunityAfterDiscounts()) && Objects.equals(migrationEffortAsString(), other.migrationEffortAsString()); } /** * 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("AutoScalingGroupRecommendationOption").add("Configuration", configuration()) .add("InstanceGpuInfo", instanceGpuInfo()) .add("ProjectedUtilizationMetrics", hasProjectedUtilizationMetrics() ? projectedUtilizationMetrics() : null) .add("PerformanceRisk", performanceRisk()).add("Rank", rank()).add("SavingsOpportunity", savingsOpportunity()) .add("SavingsOpportunityAfterDiscounts", savingsOpportunityAfterDiscounts()) .add("MigrationEffort", migrationEffortAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "configuration": return Optional.ofNullable(clazz.cast(configuration())); case "instanceGpuInfo": return Optional.ofNullable(clazz.cast(instanceGpuInfo())); case "projectedUtilizationMetrics": return Optional.ofNullable(clazz.cast(projectedUtilizationMetrics())); case "performanceRisk": return Optional.ofNullable(clazz.cast(performanceRisk())); case "rank": return Optional.ofNullable(clazz.cast(rank())); case "savingsOpportunity": return Optional.ofNullable(clazz.cast(savingsOpportunity())); case "savingsOpportunityAfterDiscounts": return Optional.ofNullable(clazz.cast(savingsOpportunityAfterDiscounts())); case "migrationEffort": return Optional.ofNullable(clazz.cast(migrationEffortAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AutoScalingGroupRecommendationOption) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* An array of objects that describe an Auto Scaling group configuration. *

* * @param configuration * An array of objects that describe an Auto Scaling group configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configuration(AutoScalingGroupConfiguration configuration); /** *

* An array of objects that describe an Auto Scaling group configuration. *

* This is a convenience method that creates an instance of the {@link AutoScalingGroupConfiguration.Builder} * avoiding the need to create one manually via {@link AutoScalingGroupConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link AutoScalingGroupConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #configuration(AutoScalingGroupConfiguration)}. * * @param configuration * a consumer that will call methods on {@link AutoScalingGroupConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #configuration(AutoScalingGroupConfiguration) */ default Builder configuration(Consumer configuration) { return configuration(AutoScalingGroupConfiguration.builder().applyMutation(configuration).build()); } /** *

* Describes the GPU accelerator settings for the recommended instance type of the Auto Scaling group. *

* * @param instanceGpuInfo * Describes the GPU accelerator settings for the recommended instance type of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceGpuInfo(GpuInfo instanceGpuInfo); /** *

* Describes the GPU accelerator settings for the recommended instance type of the Auto Scaling group. *

* This is a convenience method that creates an instance of the {@link GpuInfo.Builder} avoiding the need to * create one manually via {@link GpuInfo#builder()}. * *

* When the {@link Consumer} completes, {@link GpuInfo.Builder#build()} is called immediately and its result is * passed to {@link #instanceGpuInfo(GpuInfo)}. * * @param instanceGpuInfo * a consumer that will call methods on {@link GpuInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instanceGpuInfo(GpuInfo) */ default Builder instanceGpuInfo(Consumer instanceGpuInfo) { return instanceGpuInfo(GpuInfo.builder().applyMutation(instanceGpuInfo).build()); } /** *

* An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation * option. *

* *

* The Cpu and Memory metrics are the only projected utilization metrics returned. * Additionally, the Memory metric is returned only for resources that have the unified CloudWatch * agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

*
* * @param projectedUtilizationMetrics * An array of objects that describe the projected utilization metrics of the Auto Scaling group * recommendation option.

*

* The Cpu and Memory metrics are the only projected utilization metrics * returned. Additionally, the Memory metric is returned only for resources that have the * unified CloudWatch agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder projectedUtilizationMetrics(Collection projectedUtilizationMetrics); /** *

* An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation * option. *

* *

* The Cpu and Memory metrics are the only projected utilization metrics returned. * Additionally, the Memory metric is returned only for resources that have the unified CloudWatch * agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

*
* * @param projectedUtilizationMetrics * An array of objects that describe the projected utilization metrics of the Auto Scaling group * recommendation option.

*

* The Cpu and Memory metrics are the only projected utilization metrics * returned. Additionally, the Memory metric is returned only for resources that have the * unified CloudWatch agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder projectedUtilizationMetrics(UtilizationMetric... projectedUtilizationMetrics); /** *

* An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation * option. *

* *

* The Cpu and Memory metrics are the only projected utilization metrics returned. * Additionally, the Memory metric is returned only for resources that have the unified CloudWatch * agent installed on them. For more information, see Enabling Memory * Utilization with the CloudWatch Agent. *

*
This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder#build()} is called * immediately and its result is passed to {@link #projectedUtilizationMetrics(List)}. * * @param projectedUtilizationMetrics * a consumer that will call methods on * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #projectedUtilizationMetrics(java.util.Collection) */ Builder projectedUtilizationMetrics(Consumer... projectedUtilizationMetrics); /** *

* The performance risk of the Auto Scaling group configuration recommendation. *

*

* Performance risk indicates the likelihood of the recommended instance type not meeting the resource needs of * your workload. Compute Optimizer calculates an individual performance risk score for each specification of * the recommended instance, including CPU, memory, EBS throughput, EBS IOPS, disk throughput, disk IOPS, * network throughput, and network PPS. The performance risk of the recommended instance is calculated as the * maximum performance risk score across the analyzed resource specifications. *

*

* The value ranges from 0 - 4, with 0 meaning that the recommended * resource is predicted to always provide enough hardware capability. The higher the performance risk is, the * more likely you should validate whether the recommendation will meet the performance requirements of your * workload before migrating your resource. *

* * @param performanceRisk * The performance risk of the Auto Scaling group configuration recommendation.

*

* Performance risk indicates the likelihood of the recommended instance type not meeting the resource * needs of your workload. Compute Optimizer calculates an individual performance risk score for each * specification of the recommended instance, including CPU, memory, EBS throughput, EBS IOPS, disk * throughput, disk IOPS, network throughput, and network PPS. The performance risk of the recommended * instance is calculated as the maximum performance risk score across the analyzed resource * specifications. *

*

* The value ranges from 0 - 4, with 0 meaning that the * recommended resource is predicted to always provide enough hardware capability. The higher the * performance risk is, the more likely you should validate whether the recommendation will meet the * performance requirements of your workload before migrating your resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder performanceRisk(Double performanceRisk); /** *

* The rank of the Auto Scaling group recommendation option. *

*

* The top recommendation option is ranked as 1. *

* * @param rank * The rank of the Auto Scaling group recommendation option.

*

* The top recommendation option is ranked as 1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rank(Integer rank); /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option. Savings * opportunity includes the estimated monthly savings amount and percentage. *

* * @param savingsOpportunity * An object that describes the savings opportunity for the Auto Scaling group recommendation option. * Savings opportunity includes the estimated monthly savings amount and percentage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder savingsOpportunity(SavingsOpportunity savingsOpportunity); /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option. Savings * opportunity includes the estimated monthly savings amount and percentage. *

* This is a convenience method that creates an instance of the {@link SavingsOpportunity.Builder} avoiding the * need to create one manually via {@link SavingsOpportunity#builder()}. * *

* When the {@link Consumer} completes, {@link SavingsOpportunity.Builder#build()} is called immediately and its * result is passed to {@link #savingsOpportunity(SavingsOpportunity)}. * * @param savingsOpportunity * a consumer that will call methods on {@link SavingsOpportunity.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #savingsOpportunity(SavingsOpportunity) */ default Builder savingsOpportunity(Consumer savingsOpportunity) { return savingsOpportunity(SavingsOpportunity.builder().applyMutation(savingsOpportunity).build()); } /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option that * includes Savings Plans and Reserved Instances discounts. Savings opportunity includes the estimated monthly * savings and percentage. *

* * @param savingsOpportunityAfterDiscounts * An object that describes the savings opportunity for the Auto Scaling group recommendation option that * includes Savings Plans and Reserved Instances discounts. Savings opportunity includes the estimated * monthly savings and percentage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder savingsOpportunityAfterDiscounts(AutoScalingGroupSavingsOpportunityAfterDiscounts savingsOpportunityAfterDiscounts); /** *

* An object that describes the savings opportunity for the Auto Scaling group recommendation option that * includes Savings Plans and Reserved Instances discounts. Savings opportunity includes the estimated monthly * savings and percentage. *

* This is a convenience method that creates an instance of the * {@link AutoScalingGroupSavingsOpportunityAfterDiscounts.Builder} avoiding the need to create one manually via * {@link AutoScalingGroupSavingsOpportunityAfterDiscounts#builder()}. * *

* When the {@link Consumer} completes, {@link AutoScalingGroupSavingsOpportunityAfterDiscounts.Builder#build()} * is called immediately and its result is passed to * {@link #savingsOpportunityAfterDiscounts(AutoScalingGroupSavingsOpportunityAfterDiscounts)}. * * @param savingsOpportunityAfterDiscounts * a consumer that will call methods on {@link AutoScalingGroupSavingsOpportunityAfterDiscounts.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #savingsOpportunityAfterDiscounts(AutoScalingGroupSavingsOpportunityAfterDiscounts) */ default Builder savingsOpportunityAfterDiscounts( Consumer savingsOpportunityAfterDiscounts) { return savingsOpportunityAfterDiscounts(AutoScalingGroupSavingsOpportunityAfterDiscounts.builder() .applyMutation(savingsOpportunityAfterDiscounts).build()); } /** *

* The level of effort required to migrate from the current instance type to the recommended instance type. *

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an * Amazon Web Services Graviton instance type is recommended. The migration effort is Medium if a * workload type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. The * migration effort is VeryLow if both the current and recommended instance types are of the same * CPU architecture. *

* * @param migrationEffort * The level of effort required to migrate from the current instance type to the recommended instance * type.

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and * an Amazon Web Services Graviton instance type is recommended. The migration effort is * Medium if a workload type couldn't be inferred but an Amazon Web Services Graviton * instance type is recommended. The migration effort is VeryLow if both the current and * recommended instance types are of the same CPU architecture. * @see MigrationEffort * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationEffort */ Builder migrationEffort(String migrationEffort); /** *

* The level of effort required to migrate from the current instance type to the recommended instance type. *

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and an * Amazon Web Services Graviton instance type is recommended. The migration effort is Medium if a * workload type couldn't be inferred but an Amazon Web Services Graviton instance type is recommended. The * migration effort is VeryLow if both the current and recommended instance types are of the same * CPU architecture. *

* * @param migrationEffort * The level of effort required to migrate from the current instance type to the recommended instance * type.

*

* For example, the migration effort is Low if Amazon EMR is the inferred workload type and * an Amazon Web Services Graviton instance type is recommended. The migration effort is * Medium if a workload type couldn't be inferred but an Amazon Web Services Graviton * instance type is recommended. The migration effort is VeryLow if both the current and * recommended instance types are of the same CPU architecture. * @see MigrationEffort * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationEffort */ Builder migrationEffort(MigrationEffort migrationEffort); } static final class BuilderImpl implements Builder { private AutoScalingGroupConfiguration configuration; private GpuInfo instanceGpuInfo; private List projectedUtilizationMetrics = DefaultSdkAutoConstructList.getInstance(); private Double performanceRisk; private Integer rank; private SavingsOpportunity savingsOpportunity; private AutoScalingGroupSavingsOpportunityAfterDiscounts savingsOpportunityAfterDiscounts; private String migrationEffort; private BuilderImpl() { } private BuilderImpl(AutoScalingGroupRecommendationOption model) { configuration(model.configuration); instanceGpuInfo(model.instanceGpuInfo); projectedUtilizationMetrics(model.projectedUtilizationMetrics); performanceRisk(model.performanceRisk); rank(model.rank); savingsOpportunity(model.savingsOpportunity); savingsOpportunityAfterDiscounts(model.savingsOpportunityAfterDiscounts); migrationEffort(model.migrationEffort); } public final AutoScalingGroupConfiguration.Builder getConfiguration() { return configuration != null ? configuration.toBuilder() : null; } public final void setConfiguration(AutoScalingGroupConfiguration.BuilderImpl configuration) { this.configuration = configuration != null ? configuration.build() : null; } @Override public final Builder configuration(AutoScalingGroupConfiguration configuration) { this.configuration = configuration; return this; } public final GpuInfo.Builder getInstanceGpuInfo() { return instanceGpuInfo != null ? instanceGpuInfo.toBuilder() : null; } public final void setInstanceGpuInfo(GpuInfo.BuilderImpl instanceGpuInfo) { this.instanceGpuInfo = instanceGpuInfo != null ? instanceGpuInfo.build() : null; } @Override public final Builder instanceGpuInfo(GpuInfo instanceGpuInfo) { this.instanceGpuInfo = instanceGpuInfo; return this; } public final List getProjectedUtilizationMetrics() { List result = ProjectedUtilizationMetricsCopier .copyToBuilder(this.projectedUtilizationMetrics); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setProjectedUtilizationMetrics(Collection projectedUtilizationMetrics) { this.projectedUtilizationMetrics = ProjectedUtilizationMetricsCopier.copyFromBuilder(projectedUtilizationMetrics); } @Override public final Builder projectedUtilizationMetrics(Collection projectedUtilizationMetrics) { this.projectedUtilizationMetrics = ProjectedUtilizationMetricsCopier.copy(projectedUtilizationMetrics); return this; } @Override @SafeVarargs public final Builder projectedUtilizationMetrics(UtilizationMetric... projectedUtilizationMetrics) { projectedUtilizationMetrics(Arrays.asList(projectedUtilizationMetrics)); return this; } @Override @SafeVarargs public final Builder projectedUtilizationMetrics(Consumer... projectedUtilizationMetrics) { projectedUtilizationMetrics(Stream.of(projectedUtilizationMetrics) .map(c -> UtilizationMetric.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Double getPerformanceRisk() { return performanceRisk; } public final void setPerformanceRisk(Double performanceRisk) { this.performanceRisk = performanceRisk; } @Override public final Builder performanceRisk(Double performanceRisk) { this.performanceRisk = performanceRisk; return this; } public final Integer getRank() { return rank; } public final void setRank(Integer rank) { this.rank = rank; } @Override public final Builder rank(Integer rank) { this.rank = rank; return this; } public final SavingsOpportunity.Builder getSavingsOpportunity() { return savingsOpportunity != null ? savingsOpportunity.toBuilder() : null; } public final void setSavingsOpportunity(SavingsOpportunity.BuilderImpl savingsOpportunity) { this.savingsOpportunity = savingsOpportunity != null ? savingsOpportunity.build() : null; } @Override public final Builder savingsOpportunity(SavingsOpportunity savingsOpportunity) { this.savingsOpportunity = savingsOpportunity; return this; } public final AutoScalingGroupSavingsOpportunityAfterDiscounts.Builder getSavingsOpportunityAfterDiscounts() { return savingsOpportunityAfterDiscounts != null ? savingsOpportunityAfterDiscounts.toBuilder() : null; } public final void setSavingsOpportunityAfterDiscounts( AutoScalingGroupSavingsOpportunityAfterDiscounts.BuilderImpl savingsOpportunityAfterDiscounts) { this.savingsOpportunityAfterDiscounts = savingsOpportunityAfterDiscounts != null ? savingsOpportunityAfterDiscounts .build() : null; } @Override public final Builder savingsOpportunityAfterDiscounts( AutoScalingGroupSavingsOpportunityAfterDiscounts savingsOpportunityAfterDiscounts) { this.savingsOpportunityAfterDiscounts = savingsOpportunityAfterDiscounts; return this; } public final String getMigrationEffort() { return migrationEffort; } public final void setMigrationEffort(String migrationEffort) { this.migrationEffort = migrationEffort; } @Override public final Builder migrationEffort(String migrationEffort) { this.migrationEffort = migrationEffort; return this; } @Override public final Builder migrationEffort(MigrationEffort migrationEffort) { this.migrationEffort(migrationEffort == null ? null : migrationEffort.toString()); return this; } @Override public AutoScalingGroupRecommendationOption build() { return new AutoScalingGroupRecommendationOption(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy