/* * Copyright 2018-2023 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 com.amazonaws.services.computeoptimizer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes the effective recommendation preferences for a resource. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EffectiveRecommendationPreferences implements Serializable, Cloneable, StructuredPojo { /** ** Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the activation status of the enhanced infrastructure metrics preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh, and
* a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced * infrastructure metrics in the Compute Optimizer User Guide. *
*/ private String enhancedInfrastructureMetrics; /** ** Describes the activation status of the inferred workload types preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh. A
* status of Inactive
confirms that it's not yet applied to recommendations.
*
* An object that describes the external metrics recommendation preference. *
*
* If the preference is applied in the latest recommendation refresh, an object with a valid source
* value appears in the response. If the preference isn't applied to the recommendations already, then this object
* doesn't appear in the response.
*
* Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute * Optimizer returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization * metrics for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, * Compute Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute * Optimizer returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization * metrics for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setCpuVendorArchitectures(java.util.Collection)} or * {@link #withCpuVendorArchitectures(java.util.Collection)} if you want to override the existing values. *
* * @param cpuVendorArchitectures * Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute * Optimizer returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization * metrics for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute * Optimizer returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization * metrics for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the CPU vendor and architecture for an instance or Auto Scaling group recommendations. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute Optimizer * returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization metrics * for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
*
* For example, when you specify AWS_ARM64
with:
*
* A GetEC2InstanceRecommendations or GetAutoScalingGroupRecommendations request, Compute * Optimizer returns recommendations that consist of Graviton2 instance types only. *
** A GetEC2RecommendationProjectedMetrics request, Compute Optimizer returns projected utilization * metrics for Graviton2 instance type recommendations only. *
** A ExportEC2InstanceRecommendations or ExportAutoScalingGroupRecommendations request, Compute * Optimizer exports recommendations that consist of Graviton2 instance types only. *
** Describes the activation status of the enhanced infrastructure metrics preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh, and
* a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced * infrastructure metrics in the Compute Optimizer User Guide. *
* * @param enhancedInfrastructureMetrics * Describes the activation status of the enhanced infrastructure metrics preference. *
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh, and a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide. * @see EnhancedInfrastructureMetrics */ public void setEnhancedInfrastructureMetrics(String enhancedInfrastructureMetrics) { this.enhancedInfrastructureMetrics = enhancedInfrastructureMetrics; } /** *
* Describes the activation status of the enhanced infrastructure metrics preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh, and
* a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced * infrastructure metrics in the Compute Optimizer User Guide. *
* * @return Describes the activation status of the enhanced infrastructure metrics preference. *
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh, and a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide. * @see EnhancedInfrastructureMetrics */ public String getEnhancedInfrastructureMetrics() { return this.enhancedInfrastructureMetrics; } /** *
* Describes the activation status of the enhanced infrastructure metrics preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh, and
* a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced * infrastructure metrics in the Compute Optimizer User Guide. *
* * @param enhancedInfrastructureMetrics * Describes the activation status of the enhanced infrastructure metrics preference. *
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh, and a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide. * @return Returns a reference to this object so that method calls can be chained together. * @see EnhancedInfrastructureMetrics */ public EffectiveRecommendationPreferences withEnhancedInfrastructureMetrics(String enhancedInfrastructureMetrics) { setEnhancedInfrastructureMetrics(enhancedInfrastructureMetrics); return this; } /** *
* Describes the activation status of the enhanced infrastructure metrics preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh, and
* a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced * infrastructure metrics in the Compute Optimizer User Guide. *
* * @param enhancedInfrastructureMetrics * Describes the activation status of the enhanced infrastructure metrics preference. *
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh, and a status of Inactive
confirms that it's not yet applied to recommendations.
*
* For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide. * @return Returns a reference to this object so that method calls can be chained together. * @see EnhancedInfrastructureMetrics */ public EffectiveRecommendationPreferences withEnhancedInfrastructureMetrics(EnhancedInfrastructureMetrics enhancedInfrastructureMetrics) { this.enhancedInfrastructureMetrics = enhancedInfrastructureMetrics.toString(); return this; } /** *
* Describes the activation status of the inferred workload types preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh. A
* status of Inactive
confirms that it's not yet applied to recommendations.
*
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh. A status of Inactive
confirms that it's not yet applied to recommendations.
* @see InferredWorkloadTypesPreference
*/
public void setInferredWorkloadTypes(String inferredWorkloadTypes) {
this.inferredWorkloadTypes = inferredWorkloadTypes;
}
/**
*
* Describes the activation status of the inferred workload types preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh. A
* status of Inactive
confirms that it's not yet applied to recommendations.
*
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh. A status of Inactive
confirms that it's not yet applied to recommendations.
* @see InferredWorkloadTypesPreference
*/
public String getInferredWorkloadTypes() {
return this.inferredWorkloadTypes;
}
/**
*
* Describes the activation status of the inferred workload types preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh. A
* status of Inactive
confirms that it's not yet applied to recommendations.
*
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh. A status of Inactive
confirms that it's not yet applied to recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InferredWorkloadTypesPreference
*/
public EffectiveRecommendationPreferences withInferredWorkloadTypes(String inferredWorkloadTypes) {
setInferredWorkloadTypes(inferredWorkloadTypes);
return this;
}
/**
*
* Describes the activation status of the inferred workload types preference. *
*
* A status of Active
confirms that the preference is applied in the latest recommendation refresh. A
* status of Inactive
confirms that it's not yet applied to recommendations.
*
* A status of Active
confirms that the preference is applied in the latest recommendation
* refresh. A status of Inactive
confirms that it's not yet applied to recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InferredWorkloadTypesPreference
*/
public EffectiveRecommendationPreferences withInferredWorkloadTypes(InferredWorkloadTypesPreference inferredWorkloadTypes) {
this.inferredWorkloadTypes = inferredWorkloadTypes.toString();
return this;
}
/**
*
* An object that describes the external metrics recommendation preference. *
*
* If the preference is applied in the latest recommendation refresh, an object with a valid source
* value appears in the response. If the preference isn't applied to the recommendations already, then this object
* doesn't appear in the response.
*
* If the preference is applied in the latest recommendation refresh, an object with a valid
* source
value appears in the response. If the preference isn't applied to the recommendations
* already, then this object doesn't appear in the response.
*/
public void setExternalMetricsPreference(ExternalMetricsPreference externalMetricsPreference) {
this.externalMetricsPreference = externalMetricsPreference;
}
/**
*
* An object that describes the external metrics recommendation preference. *
*
* If the preference is applied in the latest recommendation refresh, an object with a valid source
* value appears in the response. If the preference isn't applied to the recommendations already, then this object
* doesn't appear in the response.
*
* If the preference is applied in the latest recommendation refresh, an object with a valid
* source
value appears in the response. If the preference isn't applied to the recommendations
* already, then this object doesn't appear in the response.
*/
public ExternalMetricsPreference getExternalMetricsPreference() {
return this.externalMetricsPreference;
}
/**
*
* An object that describes the external metrics recommendation preference. *
*
* If the preference is applied in the latest recommendation refresh, an object with a valid source
* value appears in the response. If the preference isn't applied to the recommendations already, then this object
* doesn't appear in the response.
*
* If the preference is applied in the latest recommendation refresh, an object with a valid
* source
value appears in the response. If the preference isn't applied to the recommendations
* already, then this object doesn't appear in the response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EffectiveRecommendationPreferences withExternalMetricsPreference(ExternalMetricsPreference externalMetricsPreference) {
setExternalMetricsPreference(externalMetricsPreference);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCpuVendorArchitectures() != null)
sb.append("CpuVendorArchitectures: ").append(getCpuVendorArchitectures()).append(",");
if (getEnhancedInfrastructureMetrics() != null)
sb.append("EnhancedInfrastructureMetrics: ").append(getEnhancedInfrastructureMetrics()).append(",");
if (getInferredWorkloadTypes() != null)
sb.append("InferredWorkloadTypes: ").append(getInferredWorkloadTypes()).append(",");
if (getExternalMetricsPreference() != null)
sb.append("ExternalMetricsPreference: ").append(getExternalMetricsPreference());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EffectiveRecommendationPreferences == false)
return false;
EffectiveRecommendationPreferences other = (EffectiveRecommendationPreferences) obj;
if (other.getCpuVendorArchitectures() == null ^ this.getCpuVendorArchitectures() == null)
return false;
if (other.getCpuVendorArchitectures() != null && other.getCpuVendorArchitectures().equals(this.getCpuVendorArchitectures()) == false)
return false;
if (other.getEnhancedInfrastructureMetrics() == null ^ this.getEnhancedInfrastructureMetrics() == null)
return false;
if (other.getEnhancedInfrastructureMetrics() != null
&& other.getEnhancedInfrastructureMetrics().equals(this.getEnhancedInfrastructureMetrics()) == false)
return false;
if (other.getInferredWorkloadTypes() == null ^ this.getInferredWorkloadTypes() == null)
return false;
if (other.getInferredWorkloadTypes() != null && other.getInferredWorkloadTypes().equals(this.getInferredWorkloadTypes()) == false)
return false;
if (other.getExternalMetricsPreference() == null ^ this.getExternalMetricsPreference() == null)
return false;
if (other.getExternalMetricsPreference() != null && other.getExternalMetricsPreference().equals(this.getExternalMetricsPreference()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCpuVendorArchitectures() == null) ? 0 : getCpuVendorArchitectures().hashCode());
hashCode = prime * hashCode + ((getEnhancedInfrastructureMetrics() == null) ? 0 : getEnhancedInfrastructureMetrics().hashCode());
hashCode = prime * hashCode + ((getInferredWorkloadTypes() == null) ? 0 : getInferredWorkloadTypes().hashCode());
hashCode = prime * hashCode + ((getExternalMetricsPreference() == null) ? 0 : getExternalMetricsPreference().hashCode());
return hashCode;
}
@Override
public EffectiveRecommendationPreferences clone() {
try {
return (EffectiveRecommendationPreferences) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.computeoptimizer.model.transform.EffectiveRecommendationPreferencesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}