com.amazonaws.services.autoscalingplans.model.DescribeScalingPlansRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscalingplans 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.autoscalingplans.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 DescribeScalingPlansRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan
* names.
*
*/
private java.util.List scalingPlanNames;
/**
*
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
*
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*
*/
private Long scalingPlanVersion;
/**
*
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application
* sources.
*
*/
private java.util.List applicationSources;
/**
*
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.
*
*/
private Integer maxResults;
/**
*
* The token for the next set of results.
*
*/
private String nextToken;
/**
*
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan
* names.
*
*
* @return The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling
* plan names.
*/
public java.util.List getScalingPlanNames() {
return scalingPlanNames;
}
/**
*
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan
* names.
*
*
* @param scalingPlanNames
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling
* plan names.
*/
public void setScalingPlanNames(java.util.Collection scalingPlanNames) {
if (scalingPlanNames == null) {
this.scalingPlanNames = null;
return;
}
this.scalingPlanNames = new java.util.ArrayList(scalingPlanNames);
}
/**
*
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan
* names.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setScalingPlanNames(java.util.Collection)} or {@link #withScalingPlanNames(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param scalingPlanNames
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling
* plan names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withScalingPlanNames(String... scalingPlanNames) {
if (this.scalingPlanNames == null) {
setScalingPlanNames(new java.util.ArrayList(scalingPlanNames.length));
}
for (String ele : scalingPlanNames) {
this.scalingPlanNames.add(ele);
}
return this;
}
/**
*
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling plan
* names.
*
*
* @param scalingPlanNames
* The names of the scaling plans (up to 10). If you specify application sources, you cannot specify scaling
* plan names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withScalingPlanNames(java.util.Collection scalingPlanNames) {
setScalingPlanNames(scalingPlanNames);
return this;
}
/**
*
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
*
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*
*
* @param scalingPlanVersion
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*/
public void setScalingPlanVersion(Long scalingPlanVersion) {
this.scalingPlanVersion = scalingPlanVersion;
}
/**
*
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
*
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*
*
* @return The version number of the scaling plan. Currently, the only valid value is 1
.
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*/
public Long getScalingPlanVersion() {
return this.scalingPlanVersion;
}
/**
*
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
*
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
*
*
* @param scalingPlanVersion
* The version number of the scaling plan. Currently, the only valid value is 1
.
*
* If you specify a scaling plan version, you must also specify a scaling plan name.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withScalingPlanVersion(Long scalingPlanVersion) {
setScalingPlanVersion(scalingPlanVersion);
return this;
}
/**
*
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application
* sources.
*
*
* @return The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify
* application sources.
*/
public java.util.List getApplicationSources() {
return applicationSources;
}
/**
*
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application
* sources.
*
*
* @param applicationSources
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify
* application sources.
*/
public void setApplicationSources(java.util.Collection applicationSources) {
if (applicationSources == null) {
this.applicationSources = null;
return;
}
this.applicationSources = new java.util.ArrayList(applicationSources);
}
/**
*
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application
* sources.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setApplicationSources(java.util.Collection)} or {@link #withApplicationSources(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param applicationSources
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify
* application sources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withApplicationSources(ApplicationSource... applicationSources) {
if (this.applicationSources == null) {
setApplicationSources(new java.util.ArrayList(applicationSources.length));
}
for (ApplicationSource ele : applicationSources) {
this.applicationSources.add(ele);
}
return this;
}
/**
*
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify application
* sources.
*
*
* @param applicationSources
* The sources for the applications (up to 10). If you specify scaling plan names, you cannot specify
* application sources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withApplicationSources(java.util.Collection applicationSources) {
setApplicationSources(applicationSources);
return this;
}
/**
*
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.
*
*
* @param maxResults
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value
* is 50.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.
*
*
* @return The maximum number of scalable resources to return. This value can be between 1 and 50. The default value
* is 50.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value is 50.
*
*
* @param maxResults
* The maximum number of scalable resources to return. This value can be between 1 and 50. The default value
* is 50.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The token for the next set of results.
*
*
* @param nextToken
* The token for the next set of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The token for the next set of results.
*
*
* @return The token for the next set of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The token for the next set of results.
*
*
* @param nextToken
* The token for the next set of results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeScalingPlansRequest withNextToken(String nextToken) {
setNextToken(nextToken);
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 (getScalingPlanNames() != null)
sb.append("ScalingPlanNames: ").append(getScalingPlanNames()).append(",");
if (getScalingPlanVersion() != null)
sb.append("ScalingPlanVersion: ").append(getScalingPlanVersion()).append(",");
if (getApplicationSources() != null)
sb.append("ApplicationSources: ").append(getApplicationSources()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribeScalingPlansRequest == false)
return false;
DescribeScalingPlansRequest other = (DescribeScalingPlansRequest) obj;
if (other.getScalingPlanNames() == null ^ this.getScalingPlanNames() == null)
return false;
if (other.getScalingPlanNames() != null && other.getScalingPlanNames().equals(this.getScalingPlanNames()) == false)
return false;
if (other.getScalingPlanVersion() == null ^ this.getScalingPlanVersion() == null)
return false;
if (other.getScalingPlanVersion() != null && other.getScalingPlanVersion().equals(this.getScalingPlanVersion()) == false)
return false;
if (other.getApplicationSources() == null ^ this.getApplicationSources() == null)
return false;
if (other.getApplicationSources() != null && other.getApplicationSources().equals(this.getApplicationSources()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getScalingPlanNames() == null) ? 0 : getScalingPlanNames().hashCode());
hashCode = prime * hashCode + ((getScalingPlanVersion() == null) ? 0 : getScalingPlanVersion().hashCode());
hashCode = prime * hashCode + ((getApplicationSources() == null) ? 0 : getApplicationSources().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public DescribeScalingPlansRequest clone() {
return (DescribeScalingPlansRequest) super.clone();
}
}