com.amazonaws.services.ec2.model.DescribeHostReservationOfferingsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2011-2016 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 com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.DescribeHostReservationOfferingsRequestMarshaller;
/**
*
*/
public class DescribeHostReservationOfferingsRequest extends
AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* The ID of the reservation offering.
*
*/
private String offeringId;
/**
*
* This is the minimum duration of the reservation you'd like to purchase,
* specified in seconds. Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 94608000 for 3 years.
*
*/
private Integer minDuration;
/**
*
* This is the maximum duration of the reservation you'd like to purchase,
* specified in seconds.Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 157680000 for 5 years.
*
*/
private Integer maxDuration;
/**
*
* One or more filters.
*
*
* -
*
* instance-family - The instance family of the offering (e.g.,
* m4).
*
*
* -
*
* payment-option - The payment option (No Upfront
* | Partial Upfront | All Upfront).
*
*
*
*/
private com.amazonaws.internal.SdkInternalList filter;
/**
*
* The maximum number of results to return for the request in a single page.
* The remaining results can be seen by sending another request with the
* returned nextToken value. This value can be between 5 and
* 500; if maxResults is given a larger value than 500, you
* will receive an error.
*
*/
private Integer maxResults;
/**
*
* The token to use to retrieve the next page of results.
*
*/
private String nextToken;
/**
*
* The ID of the reservation offering.
*
*
* @param offeringId
* The ID of the reservation offering.
*/
public void setOfferingId(String offeringId) {
this.offeringId = offeringId;
}
/**
*
* The ID of the reservation offering.
*
*
* @return The ID of the reservation offering.
*/
public String getOfferingId() {
return this.offeringId;
}
/**
*
* The ID of the reservation offering.
*
*
* @param offeringId
* The ID of the reservation offering.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withOfferingId(
String offeringId) {
setOfferingId(offeringId);
return this;
}
/**
*
* This is the minimum duration of the reservation you'd like to purchase,
* specified in seconds. Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 94608000 for 3 years.
*
*
* @param minDuration
* This is the minimum duration of the reservation you'd like to
* purchase, specified in seconds. Reservations are available in 1,
* 3, and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 94608000
* for 3 years.
*/
public void setMinDuration(Integer minDuration) {
this.minDuration = minDuration;
}
/**
*
* This is the minimum duration of the reservation you'd like to purchase,
* specified in seconds. Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 94608000 for 3 years.
*
*
* @return This is the minimum duration of the reservation you'd like to
* purchase, specified in seconds. Reservations are available in 1,
* 3, and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 94608000
* for 3 years.
*/
public Integer getMinDuration() {
return this.minDuration;
}
/**
*
* This is the minimum duration of the reservation you'd like to purchase,
* specified in seconds. Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 94608000 for 3 years.
*
*
* @param minDuration
* This is the minimum duration of the reservation you'd like to
* purchase, specified in seconds. Reservations are available in 1,
* 3, and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 94608000
* for 3 years.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withMinDuration(
Integer minDuration) {
setMinDuration(minDuration);
return this;
}
/**
*
* This is the maximum duration of the reservation you'd like to purchase,
* specified in seconds.Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 157680000 for 5 years.
*
*
* @param maxDuration
* This is the maximum duration of the reservation you'd like to
* purchase, specified in seconds.Reservations are available in 1, 3,
* and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 157680000
* for 5 years.
*/
public void setMaxDuration(Integer maxDuration) {
this.maxDuration = maxDuration;
}
/**
*
* This is the maximum duration of the reservation you'd like to purchase,
* specified in seconds.Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 157680000 for 5 years.
*
*
* @return This is the maximum duration of the reservation you'd like to
* purchase, specified in seconds.Reservations are available in 1,
* 3, and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 157680000
* for 5 years.
*/
public Integer getMaxDuration() {
return this.maxDuration;
}
/**
*
* This is the maximum duration of the reservation you'd like to purchase,
* specified in seconds.Reservations are available in 1, 3, and 5 year
* terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1, 3, or 5).
* For example, specify 157680000 for 5 years.
*
*
* @param maxDuration
* This is the maximum duration of the reservation you'd like to
* purchase, specified in seconds.Reservations are available in 1, 3,
* and 5 year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the
* supported durations (1, 3, or 5). For example, specify 157680000
* for 5 years.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withMaxDuration(
Integer maxDuration) {
setMaxDuration(maxDuration);
return this;
}
/**
*
* One or more filters.
*
*
* -
*
* instance-family - The instance family of the offering (e.g.,
* m4).
*
*
* -
*
* payment-option - The payment option (No Upfront
* | Partial Upfront | All Upfront).
*
*
*
*
* @return One or more filters.
*
* -
*
* instance-family - The instance family of the
* offering (e.g., m4).
*
*
* -
*
* payment-option - The payment option (
* No Upfront | Partial Upfront |
* All Upfront).
*
*
*/
public java.util.List getFilter() {
if (filter == null) {
filter = new com.amazonaws.internal.SdkInternalList();
}
return filter;
}
/**
*
* One or more filters.
*
*
* -
*
* instance-family - The instance family of the offering (e.g.,
* m4).
*
*
* -
*
* payment-option - The payment option (No Upfront
* | Partial Upfront | All Upfront).
*
*
*
*
* @param filter
* One or more filters.
*
* -
*
* instance-family - The instance family of the offering
* (e.g., m4).
*
*
* -
*
* payment-option - The payment option (
* No Upfront | Partial Upfront |
* All Upfront).
*
*
*/
public void setFilter(java.util.Collection filter) {
if (filter == null) {
this.filter = null;
return;
}
this.filter = new com.amazonaws.internal.SdkInternalList(filter);
}
/**
*
* One or more filters.
*
*
* -
*
* instance-family - The instance family of the offering (e.g.,
* m4).
*
*
* -
*
* payment-option - The payment option (No Upfront
* | Partial Upfront | All Upfront).
*
*
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setFilter(java.util.Collection)} or
* {@link #withFilter(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param filter
* One or more filters.
*
* -
*
* instance-family - The instance family of the offering
* (e.g., m4).
*
*
* -
*
* payment-option - The payment option (
* No Upfront | Partial Upfront |
* All Upfront).
*
*
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withFilter(Filter... filter) {
if (this.filter == null) {
setFilter(new com.amazonaws.internal.SdkInternalList(
filter.length));
}
for (Filter ele : filter) {
this.filter.add(ele);
}
return this;
}
/**
*
* One or more filters.
*
*
* -
*
* instance-family - The instance family of the offering (e.g.,
* m4).
*
*
* -
*
* payment-option - The payment option (No Upfront
* | Partial Upfront | All Upfront).
*
*
*
*
* @param filter
* One or more filters.
*
* -
*
* instance-family - The instance family of the offering
* (e.g., m4).
*
*
* -
*
* payment-option - The payment option (
* No Upfront | Partial Upfront |
* All Upfront).
*
*
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withFilter(
java.util.Collection filter) {
setFilter(filter);
return this;
}
/**
*
* The maximum number of results to return for the request in a single page.
* The remaining results can be seen by sending another request with the
* returned nextToken value. This value can be between 5 and
* 500; if maxResults is given a larger value than 500, you
* will receive an error.
*
*
* @param maxResults
* The maximum number of results to return for the request in a
* single page. The remaining results can be seen by sending another
* request with the returned nextToken value. This value
* can be between 5 and 500; if maxResults is given a
* larger value than 500, you will receive an error.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of results to return for the request in a single page.
* The remaining results can be seen by sending another request with the
* returned nextToken value. This value can be between 5 and
* 500; if maxResults is given a larger value than 500, you
* will receive an error.
*
*
* @return The maximum number of results to return for the request in a
* single page. The remaining results can be seen by sending another
* request with the returned nextToken value. This
* value can be between 5 and 500; if maxResults is
* given a larger value than 500, you will receive an error.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of results to return for the request in a single page.
* The remaining results can be seen by sending another request with the
* returned nextToken value. This value can be between 5 and
* 500; if maxResults is given a larger value than 500, you
* will receive an error.
*
*
* @param maxResults
* The maximum number of results to return for the request in a
* single page. The remaining results can be seen by sending another
* request with the returned nextToken value. This value
* can be between 5 and 500; if maxResults is given a
* larger value than 500, you will receive an error.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withMaxResults(
Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The token to use to retrieve the next page of results.
*
*
* @param nextToken
* The token to use to retrieve the next page of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The token to use to retrieve the next page of results.
*
*
* @return The token to use to retrieve the next page of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The token to use to retrieve the next page of results.
*
*
* @param nextToken
* The token to use to retrieve the next page of results.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DescribeHostReservationOfferingsRequest withNextToken(
String nextToken) {
setNextToken(nextToken);
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 DescribeHostReservationOfferingsRequestMarshaller()
.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 (getOfferingId() != null)
sb.append("OfferingId: " + getOfferingId() + ",");
if (getMinDuration() != null)
sb.append("MinDuration: " + getMinDuration() + ",");
if (getMaxDuration() != null)
sb.append("MaxDuration: " + getMaxDuration() + ",");
if (getFilter() != null)
sb.append("Filter: " + getFilter() + ",");
if (getMaxResults() != null)
sb.append("MaxResults: " + getMaxResults() + ",");
if (getNextToken() != null)
sb.append("NextToken: " + 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 DescribeHostReservationOfferingsRequest == false)
return false;
DescribeHostReservationOfferingsRequest other = (DescribeHostReservationOfferingsRequest) obj;
if (other.getOfferingId() == null ^ this.getOfferingId() == null)
return false;
if (other.getOfferingId() != null
&& other.getOfferingId().equals(this.getOfferingId()) == false)
return false;
if (other.getMinDuration() == null ^ this.getMinDuration() == null)
return false;
if (other.getMinDuration() != null
&& other.getMinDuration().equals(this.getMinDuration()) == false)
return false;
if (other.getMaxDuration() == null ^ this.getMaxDuration() == null)
return false;
if (other.getMaxDuration() != null
&& other.getMaxDuration().equals(this.getMaxDuration()) == false)
return false;
if (other.getFilter() == null ^ this.getFilter() == null)
return false;
if (other.getFilter() != null
&& other.getFilter().equals(this.getFilter()) == 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
+ ((getOfferingId() == null) ? 0 : getOfferingId().hashCode());
hashCode = prime
* hashCode
+ ((getMinDuration() == null) ? 0 : getMinDuration().hashCode());
hashCode = prime
* hashCode
+ ((getMaxDuration() == null) ? 0 : getMaxDuration().hashCode());
hashCode = prime * hashCode
+ ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode
+ ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode
+ ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public DescribeHostReservationOfferingsRequest clone() {
return (DescribeHostReservationOfferingsRequest) super.clone();
}
}