com.amazonaws.services.computeoptimizer.model.GetEC2RecommendationProjectedMetricsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-computeoptimizer Show documentation
/*
* Copyright 2019-2024 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.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetEC2RecommendationProjectedMetricsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*
*/
private String instanceArn;
/**
*
* The statistic of the projected metrics.
*
*/
private String stat;
/**
*
* The granularity, in seconds, of the projected metrics data points.
*
*/
private Integer period;
/**
*
* The timestamp of the first projected metrics data point to return.
*
*/
private java.util.Date startTime;
/**
*
* The timestamp of the last projected metrics data point to return.
*
*/
private java.util.Date endTime;
/**
*
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*
*/
private RecommendationPreferences recommendationPreferences;
/**
*
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*
*
* @param instanceArn
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*/
public void setInstanceArn(String instanceArn) {
this.instanceArn = instanceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*
*
* @return The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*/
public String getInstanceArn() {
return this.instanceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
*
*
* @param instanceArn
* The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetEC2RecommendationProjectedMetricsRequest withInstanceArn(String instanceArn) {
setInstanceArn(instanceArn);
return this;
}
/**
*
* The statistic of the projected metrics.
*
*
* @param stat
* The statistic of the projected metrics.
* @see MetricStatistic
*/
public void setStat(String stat) {
this.stat = stat;
}
/**
*
* The statistic of the projected metrics.
*
*
* @return The statistic of the projected metrics.
* @see MetricStatistic
*/
public String getStat() {
return this.stat;
}
/**
*
* The statistic of the projected metrics.
*
*
* @param stat
* The statistic of the projected metrics.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MetricStatistic
*/
public GetEC2RecommendationProjectedMetricsRequest withStat(String stat) {
setStat(stat);
return this;
}
/**
*
* The statistic of the projected metrics.
*
*
* @param stat
* The statistic of the projected metrics.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MetricStatistic
*/
public GetEC2RecommendationProjectedMetricsRequest withStat(MetricStatistic stat) {
this.stat = stat.toString();
return this;
}
/**
*
* The granularity, in seconds, of the projected metrics data points.
*
*
* @param period
* The granularity, in seconds, of the projected metrics data points.
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The granularity, in seconds, of the projected metrics data points.
*
*
* @return The granularity, in seconds, of the projected metrics data points.
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The granularity, in seconds, of the projected metrics data points.
*
*
* @param period
* The granularity, in seconds, of the projected metrics data points.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetEC2RecommendationProjectedMetricsRequest withPeriod(Integer period) {
setPeriod(period);
return this;
}
/**
*
* The timestamp of the first projected metrics data point to return.
*
*
* @param startTime
* The timestamp of the first projected metrics data point to return.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The timestamp of the first projected metrics data point to return.
*
*
* @return The timestamp of the first projected metrics data point to return.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The timestamp of the first projected metrics data point to return.
*
*
* @param startTime
* The timestamp of the first projected metrics data point to return.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetEC2RecommendationProjectedMetricsRequest withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The timestamp of the last projected metrics data point to return.
*
*
* @param endTime
* The timestamp of the last projected metrics data point to return.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The timestamp of the last projected metrics data point to return.
*
*
* @return The timestamp of the last projected metrics data point to return.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The timestamp of the last projected metrics data point to return.
*
*
* @param endTime
* The timestamp of the last projected metrics data point to return.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetEC2RecommendationProjectedMetricsRequest withEndTime(java.util.Date endTime) {
setEndTime(endTime);
return this;
}
/**
*
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*
*
* @param recommendationPreferences
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*/
public void setRecommendationPreferences(RecommendationPreferences recommendationPreferences) {
this.recommendationPreferences = recommendationPreferences;
}
/**
*
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*
*
* @return An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*/
public RecommendationPreferences getRecommendationPreferences() {
return this.recommendationPreferences;
}
/**
*
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
*
*
* @param recommendationPreferences
* An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the
* response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetEC2RecommendationProjectedMetricsRequest withRecommendationPreferences(RecommendationPreferences recommendationPreferences) {
setRecommendationPreferences(recommendationPreferences);
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 (getInstanceArn() != null)
sb.append("InstanceArn: ").append(getInstanceArn()).append(",");
if (getStat() != null)
sb.append("Stat: ").append(getStat()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getRecommendationPreferences() != null)
sb.append("RecommendationPreferences: ").append(getRecommendationPreferences());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetEC2RecommendationProjectedMetricsRequest == false)
return false;
GetEC2RecommendationProjectedMetricsRequest other = (GetEC2RecommendationProjectedMetricsRequest) obj;
if (other.getInstanceArn() == null ^ this.getInstanceArn() == null)
return false;
if (other.getInstanceArn() != null && other.getInstanceArn().equals(this.getInstanceArn()) == false)
return false;
if (other.getStat() == null ^ this.getStat() == null)
return false;
if (other.getStat() != null && other.getStat().equals(this.getStat()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
if (other.getRecommendationPreferences() == null ^ this.getRecommendationPreferences() == null)
return false;
if (other.getRecommendationPreferences() != null && other.getRecommendationPreferences().equals(this.getRecommendationPreferences()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceArn() == null) ? 0 : getInstanceArn().hashCode());
hashCode = prime * hashCode + ((getStat() == null) ? 0 : getStat().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getRecommendationPreferences() == null) ? 0 : getRecommendationPreferences().hashCode());
return hashCode;
}
@Override
public GetEC2RecommendationProjectedMetricsRequest clone() {
return (GetEC2RecommendationProjectedMetricsRequest) super.clone();
}
}