/* * 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 an Amazon Elastic Block Store (Amazon EBS) volume recommendation. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class VolumeRecommendation implements Serializable, Cloneable, StructuredPojo { /** *

* The Amazon Resource Name (ARN) of the current volume. *

*/ private String volumeArn; /** *

* The Amazon Web Services account ID of the volume. *

*/ private String accountId; /** *

* An array of objects that describe the current configuration of the volume. *

*/ private VolumeConfiguration currentConfiguration; /** *

* The finding classification of the volume. *

*

* Findings for volumes include: *

* */ private String finding; /** *

* An array of objects that describe the utilization metrics of the volume. *

*/ private java.util.List utilizationMetrics; /** *

* The number of days for which utilization metrics were analyzed for the volume. *

*/ private Double lookBackPeriodInDays; /** *

* An array of objects that describe the recommendation options for the volume. *

*/ private java.util.List volumeRecommendationOptions; /** *

* The timestamp of when the volume recommendation was last generated. *

*/ private java.util.Date lastRefreshTimestamp; /** *

* The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the risk, the * more likely the current EBS volume doesn't have sufficient capacity. *

*/ private String currentPerformanceRisk; /** *

* A list of tags assigned to your Amazon EBS volume recommendations. *

*/ private java.util.List tags; /** *

* The Amazon Resource Name (ARN) of the current volume. *

* * @param volumeArn * The Amazon Resource Name (ARN) of the current volume. */ public void setVolumeArn(String volumeArn) { this.volumeArn = volumeArn; } /** *

* The Amazon Resource Name (ARN) of the current volume. *

* * @return The Amazon Resource Name (ARN) of the current volume. */ public String getVolumeArn() { return this.volumeArn; } /** *

* The Amazon Resource Name (ARN) of the current volume. *

* * @param volumeArn * The Amazon Resource Name (ARN) of the current volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withVolumeArn(String volumeArn) { setVolumeArn(volumeArn); return this; } /** *

* The Amazon Web Services account ID of the volume. *

* * @param accountId * The Amazon Web Services account ID of the volume. */ public void setAccountId(String accountId) { this.accountId = accountId; } /** *

* The Amazon Web Services account ID of the volume. *

* * @return The Amazon Web Services account ID of the volume. */ public String getAccountId() { return this.accountId; } /** *

* The Amazon Web Services account ID of the volume. *

* * @param accountId * The Amazon Web Services account ID of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withAccountId(String accountId) { setAccountId(accountId); return this; } /** *

* An array of objects that describe the current configuration of the volume. *

* * @param currentConfiguration * An array of objects that describe the current configuration of the volume. */ public void setCurrentConfiguration(VolumeConfiguration currentConfiguration) { this.currentConfiguration = currentConfiguration; } /** *

* An array of objects that describe the current configuration of the volume. *

* * @return An array of objects that describe the current configuration of the volume. */ public VolumeConfiguration getCurrentConfiguration() { return this.currentConfiguration; } /** *

* An array of objects that describe the current configuration of the volume. *

* * @param currentConfiguration * An array of objects that describe the current configuration of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withCurrentConfiguration(VolumeConfiguration currentConfiguration) { setCurrentConfiguration(currentConfiguration); return this; } /** *

* The finding classification of the volume. *

*

* Findings for volumes include: *

*
    *
  • *

    * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies a * recommendation that can provide better performance for your workload. *

    *
  • *
  • *

    * Optimized —An volume is considered optimized when Compute Optimizer determines that the * volume is correctly provisioned to run your workload based on the chosen volume type. For optimized resources, * Compute Optimizer might recommend a new generation volume type. *

    *
  • *
* * @param finding * The finding classification of the volume.

*

* Findings for volumes include: *

*
    *
  • *

    * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies * a recommendation that can provide better performance for your workload. *

    *
  • *
  • *

    * Optimized —An volume is considered optimized when Compute Optimizer determines that * the volume is correctly provisioned to run your workload based on the chosen volume type. For optimized * resources, Compute Optimizer might recommend a new generation volume type. *

    *
  • * @see EBSFinding */ public void setFinding(String finding) { this.finding = finding; } /** *

    * The finding classification of the volume. *

    *

    * Findings for volumes include: *

    *
      *
    • *

      * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies a * recommendation that can provide better performance for your workload. *

      *
    • *
    • *

      * Optimized —An volume is considered optimized when Compute Optimizer determines that the * volume is correctly provisioned to run your workload based on the chosen volume type. For optimized resources, * Compute Optimizer might recommend a new generation volume type. *

      *
    • *
    * * @return The finding classification of the volume.

    *

    * Findings for volumes include: *

    *
      *
    • *

      * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies * a recommendation that can provide better performance for your workload. *

      *
    • *
    • *

      * Optimized —An volume is considered optimized when Compute Optimizer determines that * the volume is correctly provisioned to run your workload based on the chosen volume type. For optimized * resources, Compute Optimizer might recommend a new generation volume type. *

      *
    • * @see EBSFinding */ public String getFinding() { return this.finding; } /** *

      * The finding classification of the volume. *

      *

      * Findings for volumes include: *

      *
        *
      • *

        * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies a * recommendation that can provide better performance for your workload. *

        *
      • *
      • *

        * Optimized —An volume is considered optimized when Compute Optimizer determines that the * volume is correctly provisioned to run your workload based on the chosen volume type. For optimized resources, * Compute Optimizer might recommend a new generation volume type. *

        *
      • *
      * * @param finding * The finding classification of the volume.

      *

      * Findings for volumes include: *

      *
        *
      • *

        * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies * a recommendation that can provide better performance for your workload. *

        *
      • *
      • *

        * Optimized —An volume is considered optimized when Compute Optimizer determines that * the volume is correctly provisioned to run your workload based on the chosen volume type. For optimized * resources, Compute Optimizer might recommend a new generation volume type. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see EBSFinding */ public VolumeRecommendation withFinding(String finding) { setFinding(finding); return this; } /** *

        * The finding classification of the volume. *

        *

        * Findings for volumes include: *

        *
          *
        • *

          * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies a * recommendation that can provide better performance for your workload. *

          *
        • *
        • *

          * Optimized —An volume is considered optimized when Compute Optimizer determines that the * volume is correctly provisioned to run your workload based on the chosen volume type. For optimized resources, * Compute Optimizer might recommend a new generation volume type. *

          *
        • *
        * * @param finding * The finding classification of the volume.

        *

        * Findings for volumes include: *

        *
          *
        • *

          * NotOptimized —A volume is considered not optimized when Compute Optimizer identifies * a recommendation that can provide better performance for your workload. *

          *
        • *
        • *

          * Optimized —An volume is considered optimized when Compute Optimizer determines that * the volume is correctly provisioned to run your workload based on the chosen volume type. For optimized * resources, Compute Optimizer might recommend a new generation volume type. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see EBSFinding */ public VolumeRecommendation withFinding(EBSFinding finding) { this.finding = finding.toString(); return this; } /** *

          * An array of objects that describe the utilization metrics of the volume. *

          * * @return An array of objects that describe the utilization metrics of the volume. */ public java.util.List getUtilizationMetrics() { return utilizationMetrics; } /** *

          * An array of objects that describe the utilization metrics of the volume. *

          * * @param utilizationMetrics * An array of objects that describe the utilization metrics of the volume. */ public void setUtilizationMetrics(java.util.Collection utilizationMetrics) { if (utilizationMetrics == null) { this.utilizationMetrics = null; return; } this.utilizationMetrics = new java.util.ArrayList(utilizationMetrics); } /** *

          * An array of objects that describe the utilization metrics of the volume. *

          *

          * NOTE: This method appends the values to the existing list (if any). Use * {@link #setUtilizationMetrics(java.util.Collection)} or {@link #withUtilizationMetrics(java.util.Collection)} if * you want to override the existing values. *

          * * @param utilizationMetrics * An array of objects that describe the utilization metrics of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withUtilizationMetrics(EBSUtilizationMetric... utilizationMetrics) { if (this.utilizationMetrics == null) { setUtilizationMetrics(new java.util.ArrayList(utilizationMetrics.length)); } for (EBSUtilizationMetric ele : utilizationMetrics) { this.utilizationMetrics.add(ele); } return this; } /** *

          * An array of objects that describe the utilization metrics of the volume. *

          * * @param utilizationMetrics * An array of objects that describe the utilization metrics of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withUtilizationMetrics(java.util.Collection utilizationMetrics) { setUtilizationMetrics(utilizationMetrics); return this; } /** *

          * The number of days for which utilization metrics were analyzed for the volume. *

          * * @param lookBackPeriodInDays * The number of days for which utilization metrics were analyzed for the volume. */ public void setLookBackPeriodInDays(Double lookBackPeriodInDays) { this.lookBackPeriodInDays = lookBackPeriodInDays; } /** *

          * The number of days for which utilization metrics were analyzed for the volume. *

          * * @return The number of days for which utilization metrics were analyzed for the volume. */ public Double getLookBackPeriodInDays() { return this.lookBackPeriodInDays; } /** *

          * The number of days for which utilization metrics were analyzed for the volume. *

          * * @param lookBackPeriodInDays * The number of days for which utilization metrics were analyzed for the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withLookBackPeriodInDays(Double lookBackPeriodInDays) { setLookBackPeriodInDays(lookBackPeriodInDays); return this; } /** *

          * An array of objects that describe the recommendation options for the volume. *

          * * @return An array of objects that describe the recommendation options for the volume. */ public java.util.List getVolumeRecommendationOptions() { return volumeRecommendationOptions; } /** *

          * An array of objects that describe the recommendation options for the volume. *

          * * @param volumeRecommendationOptions * An array of objects that describe the recommendation options for the volume. */ public void setVolumeRecommendationOptions(java.util.Collection volumeRecommendationOptions) { if (volumeRecommendationOptions == null) { this.volumeRecommendationOptions = null; return; } this.volumeRecommendationOptions = new java.util.ArrayList(volumeRecommendationOptions); } /** *

          * An array of objects that describe the recommendation options for the volume. *

          *

          * NOTE: This method appends the values to the existing list (if any). Use * {@link #setVolumeRecommendationOptions(java.util.Collection)} or * {@link #withVolumeRecommendationOptions(java.util.Collection)} if you want to override the existing values. *

          * * @param volumeRecommendationOptions * An array of objects that describe the recommendation options for the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withVolumeRecommendationOptions(VolumeRecommendationOption... volumeRecommendationOptions) { if (this.volumeRecommendationOptions == null) { setVolumeRecommendationOptions(new java.util.ArrayList(volumeRecommendationOptions.length)); } for (VolumeRecommendationOption ele : volumeRecommendationOptions) { this.volumeRecommendationOptions.add(ele); } return this; } /** *

          * An array of objects that describe the recommendation options for the volume. *

          * * @param volumeRecommendationOptions * An array of objects that describe the recommendation options for the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withVolumeRecommendationOptions(java.util.Collection volumeRecommendationOptions) { setVolumeRecommendationOptions(volumeRecommendationOptions); return this; } /** *

          * The timestamp of when the volume recommendation was last generated. *

          * * @param lastRefreshTimestamp * The timestamp of when the volume recommendation was last generated. */ public void setLastRefreshTimestamp(java.util.Date lastRefreshTimestamp) { this.lastRefreshTimestamp = lastRefreshTimestamp; } /** *

          * The timestamp of when the volume recommendation was last generated. *

          * * @return The timestamp of when the volume recommendation was last generated. */ public java.util.Date getLastRefreshTimestamp() { return this.lastRefreshTimestamp; } /** *

          * The timestamp of when the volume recommendation was last generated. *

          * * @param lastRefreshTimestamp * The timestamp of when the volume recommendation was last generated. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withLastRefreshTimestamp(java.util.Date lastRefreshTimestamp) { setLastRefreshTimestamp(lastRefreshTimestamp); return this; } /** *

          * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the risk, the * more likely the current EBS volume doesn't have sufficient capacity. *

          * * @param currentPerformanceRisk * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the * risk, the more likely the current EBS volume doesn't have sufficient capacity. * @see CurrentPerformanceRisk */ public void setCurrentPerformanceRisk(String currentPerformanceRisk) { this.currentPerformanceRisk = currentPerformanceRisk; } /** *

          * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the risk, the * more likely the current EBS volume doesn't have sufficient capacity. *

          * * @return The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the * risk, the more likely the current EBS volume doesn't have sufficient capacity. * @see CurrentPerformanceRisk */ public String getCurrentPerformanceRisk() { return this.currentPerformanceRisk; } /** *

          * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the risk, the * more likely the current EBS volume doesn't have sufficient capacity. *

          * * @param currentPerformanceRisk * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the * risk, the more likely the current EBS volume doesn't have sufficient capacity. * @return Returns a reference to this object so that method calls can be chained together. * @see CurrentPerformanceRisk */ public VolumeRecommendation withCurrentPerformanceRisk(String currentPerformanceRisk) { setCurrentPerformanceRisk(currentPerformanceRisk); return this; } /** *

          * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the risk, the * more likely the current EBS volume doesn't have sufficient capacity. *

          * * @param currentPerformanceRisk * The risk of the current EBS volume not meeting the performance needs of its workloads. The higher the * risk, the more likely the current EBS volume doesn't have sufficient capacity. * @return Returns a reference to this object so that method calls can be chained together. * @see CurrentPerformanceRisk */ public VolumeRecommendation withCurrentPerformanceRisk(CurrentPerformanceRisk currentPerformanceRisk) { this.currentPerformanceRisk = currentPerformanceRisk.toString(); return this; } /** *

          * A list of tags assigned to your Amazon EBS volume recommendations. *

          * * @return A list of tags assigned to your Amazon EBS volume recommendations. */ public java.util.List getTags() { return tags; } /** *

          * A list of tags assigned to your Amazon EBS volume recommendations. *

          * * @param tags * A list of tags assigned to your Amazon EBS volume recommendations. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

          * A list of tags assigned to your Amazon EBS volume recommendations. *

          *

          * NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

          * * @param tags * A list of tags assigned to your Amazon EBS volume recommendations. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

          * A list of tags assigned to your Amazon EBS volume recommendations. *

          * * @param tags * A list of tags assigned to your Amazon EBS volume recommendations. * @return Returns a reference to this object so that method calls can be chained together. */ public VolumeRecommendation withTags(java.util.Collection tags) { setTags(tags); 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 (getVolumeArn() != null) sb.append("VolumeArn: ").append(getVolumeArn()).append(","); if (getAccountId() != null) sb.append("AccountId: ").append(getAccountId()).append(","); if (getCurrentConfiguration() != null) sb.append("CurrentConfiguration: ").append(getCurrentConfiguration()).append(","); if (getFinding() != null) sb.append("Finding: ").append(getFinding()).append(","); if (getUtilizationMetrics() != null) sb.append("UtilizationMetrics: ").append(getUtilizationMetrics()).append(","); if (getLookBackPeriodInDays() != null) sb.append("LookBackPeriodInDays: ").append(getLookBackPeriodInDays()).append(","); if (getVolumeRecommendationOptions() != null) sb.append("VolumeRecommendationOptions: ").append(getVolumeRecommendationOptions()).append(","); if (getLastRefreshTimestamp() != null) sb.append("LastRefreshTimestamp: ").append(getLastRefreshTimestamp()).append(","); if (getCurrentPerformanceRisk() != null) sb.append("CurrentPerformanceRisk: ").append(getCurrentPerformanceRisk()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof VolumeRecommendation == false) return false; VolumeRecommendation other = (VolumeRecommendation) obj; if (other.getVolumeArn() == null ^ this.getVolumeArn() == null) return false; if (other.getVolumeArn() != null && other.getVolumeArn().equals(this.getVolumeArn()) == false) return false; if (other.getAccountId() == null ^ this.getAccountId() == null) return false; if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false) return false; if (other.getCurrentConfiguration() == null ^ this.getCurrentConfiguration() == null) return false; if (other.getCurrentConfiguration() != null && other.getCurrentConfiguration().equals(this.getCurrentConfiguration()) == false) return false; if (other.getFinding() == null ^ this.getFinding() == null) return false; if (other.getFinding() != null && other.getFinding().equals(this.getFinding()) == false) return false; if (other.getUtilizationMetrics() == null ^ this.getUtilizationMetrics() == null) return false; if (other.getUtilizationMetrics() != null && other.getUtilizationMetrics().equals(this.getUtilizationMetrics()) == false) return false; if (other.getLookBackPeriodInDays() == null ^ this.getLookBackPeriodInDays() == null) return false; if (other.getLookBackPeriodInDays() != null && other.getLookBackPeriodInDays().equals(this.getLookBackPeriodInDays()) == false) return false; if (other.getVolumeRecommendationOptions() == null ^ this.getVolumeRecommendationOptions() == null) return false; if (other.getVolumeRecommendationOptions() != null && other.getVolumeRecommendationOptions().equals(this.getVolumeRecommendationOptions()) == false) return false; if (other.getLastRefreshTimestamp() == null ^ this.getLastRefreshTimestamp() == null) return false; if (other.getLastRefreshTimestamp() != null && other.getLastRefreshTimestamp().equals(this.getLastRefreshTimestamp()) == false) return false; if (other.getCurrentPerformanceRisk() == null ^ this.getCurrentPerformanceRisk() == null) return false; if (other.getCurrentPerformanceRisk() != null && other.getCurrentPerformanceRisk().equals(this.getCurrentPerformanceRisk()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVolumeArn() == null) ? 0 : getVolumeArn().hashCode()); hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode()); hashCode = prime * hashCode + ((getCurrentConfiguration() == null) ? 0 : getCurrentConfiguration().hashCode()); hashCode = prime * hashCode + ((getFinding() == null) ? 0 : getFinding().hashCode()); hashCode = prime * hashCode + ((getUtilizationMetrics() == null) ? 0 : getUtilizationMetrics().hashCode()); hashCode = prime * hashCode + ((getLookBackPeriodInDays() == null) ? 0 : getLookBackPeriodInDays().hashCode()); hashCode = prime * hashCode + ((getVolumeRecommendationOptions() == null) ? 0 : getVolumeRecommendationOptions().hashCode()); hashCode = prime * hashCode + ((getLastRefreshTimestamp() == null) ? 0 : getLastRefreshTimestamp().hashCode()); hashCode = prime * hashCode + ((getCurrentPerformanceRisk() == null) ? 0 : getCurrentPerformanceRisk().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public VolumeRecommendation clone() { try { return (VolumeRecommendation) 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.VolumeRecommendationMarshaller.getInstance().marshall(this, protocolMarshaller); } }