com.amazonaws.services.ec2.model.DescribeLaunchTemplatesRequest Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.DescribeLaunchTemplatesRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeLaunchTemplatesRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* One or more launch template IDs.
*
*/
private com.amazonaws.internal.SdkInternalList launchTemplateIds;
/**
*
* One or more launch template names.
*
*/
private com.amazonaws.internal.SdkInternalList launchTemplateNames;
/**
*
* One or more filters.
*
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource. Specify
* the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag
* Purpose=X, specify tag:Purpose
for the filter name and X
for the filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is),
* and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose is X, see the
* tag
:key=value filter.
*
*
*
*/
private com.amazonaws.internal.SdkInternalList filters;
/**
*
* The token to request the next page of results.
*
*/
private String nextToken;
/**
*
* The maximum number of results to return in a single call. To retrieve the remaining results, make another call
* with the returned NextToken
value. This value can be between 5 and 1000.
*
*/
private Integer maxResults;
/**
*
* One or more launch template IDs.
*
*
* @return One or more launch template IDs.
*/
public java.util.List getLaunchTemplateIds() {
if (launchTemplateIds == null) {
launchTemplateIds = new com.amazonaws.internal.SdkInternalList();
}
return launchTemplateIds;
}
/**
*
* One or more launch template IDs.
*
*
* @param launchTemplateIds
* One or more launch template IDs.
*/
public void setLaunchTemplateIds(java.util.Collection launchTemplateIds) {
if (launchTemplateIds == null) {
this.launchTemplateIds = null;
return;
}
this.launchTemplateIds = new com.amazonaws.internal.SdkInternalList(launchTemplateIds);
}
/**
*
* One or more launch template IDs.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLaunchTemplateIds(java.util.Collection)} or {@link #withLaunchTemplateIds(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param launchTemplateIds
* One or more launch template IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withLaunchTemplateIds(String... launchTemplateIds) {
if (this.launchTemplateIds == null) {
setLaunchTemplateIds(new com.amazonaws.internal.SdkInternalList(launchTemplateIds.length));
}
for (String ele : launchTemplateIds) {
this.launchTemplateIds.add(ele);
}
return this;
}
/**
*
* One or more launch template IDs.
*
*
* @param launchTemplateIds
* One or more launch template IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withLaunchTemplateIds(java.util.Collection launchTemplateIds) {
setLaunchTemplateIds(launchTemplateIds);
return this;
}
/**
*
* One or more launch template names.
*
*
* @return One or more launch template names.
*/
public java.util.List getLaunchTemplateNames() {
if (launchTemplateNames == null) {
launchTemplateNames = new com.amazonaws.internal.SdkInternalList();
}
return launchTemplateNames;
}
/**
*
* One or more launch template names.
*
*
* @param launchTemplateNames
* One or more launch template names.
*/
public void setLaunchTemplateNames(java.util.Collection launchTemplateNames) {
if (launchTemplateNames == null) {
this.launchTemplateNames = null;
return;
}
this.launchTemplateNames = new com.amazonaws.internal.SdkInternalList(launchTemplateNames);
}
/**
*
* One or more launch template names.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLaunchTemplateNames(java.util.Collection)} or {@link #withLaunchTemplateNames(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param launchTemplateNames
* One or more launch template names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withLaunchTemplateNames(String... launchTemplateNames) {
if (this.launchTemplateNames == null) {
setLaunchTemplateNames(new com.amazonaws.internal.SdkInternalList(launchTemplateNames.length));
}
for (String ele : launchTemplateNames) {
this.launchTemplateNames.add(ele);
}
return this;
}
/**
*
* One or more launch template names.
*
*
* @param launchTemplateNames
* One or more launch template names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withLaunchTemplateNames(java.util.Collection launchTemplateNames) {
setLaunchTemplateNames(launchTemplateNames);
return this;
}
/**
*
* One or more filters.
*
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource. Specify
* the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag
* Purpose=X, specify tag:Purpose
for the filter name and X
for the filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is),
* and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose is X, see the
* tag
:key=value filter.
*
*
*
*
* @return One or more filters.
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource.
* Specify the key of the tag in the filter name and the value of the tag in the filter value. For example,
* for the tag Purpose=X, specify tag:Purpose
for the filter name and X
for the
* filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's
* value is), and the tag value X (regardless of the tag's key). If you want to list only resources where
* Purpose is X, see the tag
:key=value filter.
*
*
*/
public java.util.List getFilters() {
if (filters == null) {
filters = new com.amazonaws.internal.SdkInternalList();
}
return filters;
}
/**
*
* One or more filters.
*
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource. Specify
* the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag
* Purpose=X, specify tag:Purpose
for the filter name and X
for the filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is),
* and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose is X, see the
* tag
:key=value filter.
*
*
*
*
* @param filters
* One or more filters.
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource.
* Specify the key of the tag in the filter name and the value of the tag in the filter value. For example,
* for the tag Purpose=X, specify tag:Purpose
for the filter name and X
for the
* filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value
* is), and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose
* is X, see the tag
:key=value filter.
*
*
*/
public void setFilters(java.util.Collection filters) {
if (filters == null) {
this.filters = null;
return;
}
this.filters = new com.amazonaws.internal.SdkInternalList(filters);
}
/**
*
* One or more filters.
*
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource. Specify
* the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag
* Purpose=X, specify tag:Purpose
for the filter name and X
for the filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is),
* and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose is X, see the
* tag
:key=value filter.
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFilters(java.util.Collection)} or {@link #withFilters(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param filters
* One or more filters.
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource.
* Specify the key of the tag in the filter name and the value of the tag in the filter value. For example,
* for the tag Purpose=X, specify tag:Purpose
for the filter name and X
for the
* filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value
* is), and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose
* is X, see the tag
:key=value filter.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withFilters(Filter... filters) {
if (this.filters == null) {
setFilters(new com.amazonaws.internal.SdkInternalList(filters.length));
}
for (Filter ele : filters) {
this.filters.add(ele);
}
return this;
}
/**
*
* One or more filters.
*
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource. Specify
* the key of the tag in the filter name and the value of the tag in the filter value. For example, for the tag
* Purpose=X, specify tag:Purpose
for the filter name and X
for the filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is),
* and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose is X, see the
* tag
:key=value filter.
*
*
*
*
* @param filters
* One or more filters.
*
* -
*
* create-time
- The time the launch template was created.
*
*
* -
*
* launch-template-name
- The name of the launch template.
*
*
* -
*
* tag
:key=value - The key/value combination of a tag assigned to the resource.
* Specify the key of the tag in the filter name and the value of the tag in the filter value. For example,
* for the tag Purpose=X, specify tag:Purpose
for the filter name and X
for the
* filter value.
*
*
* -
*
* tag-key
- The key of a tag assigned to the resource. This filter is independent of the
* tag-value
filter. For example, if you use both the filter "tag-key=Purpose" and the filter
* "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value
* is), and the tag value X (regardless of the tag's key). If you want to list only resources where Purpose
* is X, see the tag
:key=value filter.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withFilters(java.util.Collection filters) {
setFilters(filters);
return this;
}
/**
*
* The token to request the next page of results.
*
*
* @param nextToken
* The token to request the next page of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The token to request the next page of results.
*
*
* @return The token to request the next page of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The token to request the next page of results.
*
*
* @param nextToken
* The token to request the next page of results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The maximum number of results to return in a single call. To retrieve the remaining results, make another call
* with the returned NextToken
value. This value can be between 5 and 1000.
*
*
* @param maxResults
* The maximum number of results to return in a single call. To retrieve the remaining results, make another
* call with the returned NextToken
value. This value can be between 5 and 1000.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of results to return in a single call. To retrieve the remaining results, make another call
* with the returned NextToken
value. This value can be between 5 and 1000.
*
*
* @return The maximum number of results to return in a single call. To retrieve the remaining results, make another
* call with the returned NextToken
value. This value can be between 5 and 1000.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of results to return in a single call. To retrieve the remaining results, make another call
* with the returned NextToken
value. This value can be between 5 and 1000.
*
*
* @param maxResults
* The maximum number of results to return in a single call. To retrieve the remaining results, make another
* call with the returned NextToken
value. This value can be between 5 and 1000.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeLaunchTemplatesRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
@Override
public Request getDryRunRequest() {
Request request = new DescribeLaunchTemplatesRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getLaunchTemplateIds() != null)
sb.append("LaunchTemplateIds: ").append(getLaunchTemplateIds()).append(",");
if (getLaunchTemplateNames() != null)
sb.append("LaunchTemplateNames: ").append(getLaunchTemplateNames()).append(",");
if (getFilters() != null)
sb.append("Filters: ").append(getFilters()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribeLaunchTemplatesRequest == false)
return false;
DescribeLaunchTemplatesRequest other = (DescribeLaunchTemplatesRequest) obj;
if (other.getLaunchTemplateIds() == null ^ this.getLaunchTemplateIds() == null)
return false;
if (other.getLaunchTemplateIds() != null && other.getLaunchTemplateIds().equals(this.getLaunchTemplateIds()) == false)
return false;
if (other.getLaunchTemplateNames() == null ^ this.getLaunchTemplateNames() == null)
return false;
if (other.getLaunchTemplateNames() != null && other.getLaunchTemplateNames().equals(this.getLaunchTemplateNames()) == false)
return false;
if (other.getFilters() == null ^ this.getFilters() == null)
return false;
if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLaunchTemplateIds() == null) ? 0 : getLaunchTemplateIds().hashCode());
hashCode = prime * hashCode + ((getLaunchTemplateNames() == null) ? 0 : getLaunchTemplateNames().hashCode());
hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
return hashCode;
}
@Override
public DescribeLaunchTemplatesRequest clone() {
return (DescribeLaunchTemplatesRequest) super.clone();
}
}