com.amazonaws.services.ec2.model.DescribeHostReservationOfferingsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2014-2019 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.DescribeHostReservationOfferingsRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeHostReservationOfferingsRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* One or more filters.
*
*
* -
*
* instance-family
- The instance family of the offering (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*
*/
private com.amazonaws.internal.SdkInternalList filter;
/**
*
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in
* one-year and three-year terms. The number of seconds specified must be the number of seconds in a year
* (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.
*
*/
private Integer maxDuration;
/**
*
* 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 receive an error.
*
*/
private Integer maxResults;
/**
*
* This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations are
* available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.
*
*/
private Integer minDuration;
/**
*
* The token to use to retrieve the next page of results.
*
*/
private String nextToken;
/**
*
* The ID of the reservation offering.
*
*/
private String offeringId;
/**
*
* One or more filters.
*
*
* -
*
* instance-family
- The instance family of the offering (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*
*
* @return One or more filters.
*
* -
*
* instance-family
- The instance family of the offering (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*/
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 (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*
*
* @param filter
* One or more filters.
*
* -
*
* instance-family
- The instance family of the offering (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*/
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 (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*
*
* 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 (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
* @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 (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
*
*
* @param filter
* One or more filters.
*
* -
*
* instance-family
- The instance family of the offering (for example, m4
).
*
*
* -
*
* payment-option
- The payment option (NoUpfront
| PartialUpfront
|
* AllUpfront
).
*
*
* @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;
}
/**
*
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in
* one-year and three-year terms. The number of seconds specified must be the number of seconds in a year
* (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.
*
*
* @param maxDuration
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are
* available in one-year and three-year terms. The number of seconds specified must be the number of seconds
* in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for
* three years.
*/
public void setMaxDuration(Integer maxDuration) {
this.maxDuration = maxDuration;
}
/**
*
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in
* one-year and three-year terms. The number of seconds specified must be the number of seconds in a year
* (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.
*
*
* @return This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are
* available in one-year and three-year terms. The number of seconds specified must be the number of seconds
* in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for
* three years.
*/
public Integer getMaxDuration() {
return this.maxDuration;
}
/**
*
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are available in
* one-year and three-year terms. The number of seconds specified must be the number of seconds in a year
* (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for three years.
*
*
* @param maxDuration
* This is the maximum duration of the reservation to purchase, specified in seconds. Reservations are
* available in one-year and three-year terms. The number of seconds specified must be the number of seconds
* in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 94608000 for
* three 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;
}
/**
*
* 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 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 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 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 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 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 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;
}
/**
*
* This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations are
* available in one-year and three-year terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.
*
*
* @param minDuration
* This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations
* are available in one-year and three-year terms. The number of seconds specified must be the number of
* seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify
* 31536000 for one year.
*/
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 one-year and three-year terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.
*
*
* @return This is the minimum duration of the reservation you'd like to purchase, specified in seconds.
* Reservations are available in one-year and three-year terms. The number of seconds specified must be the
* number of seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example,
* specify 31536000 for one year.
*/
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 one-year and three-year terms. The number of seconds specified must be the number of seconds in a
* year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify 31536000 for one year.
*
*
* @param minDuration
* This is the minimum duration of the reservation you'd like to purchase, specified in seconds. Reservations
* are available in one-year and three-year terms. The number of seconds specified must be the number of
* seconds in a year (365x24x60x60) times one of the supported durations (1 or 3). For example, specify
* 31536000 for one year.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeHostReservationOfferingsRequest withMinDuration(Integer minDuration) {
setMinDuration(minDuration);
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;
}
/**
*
* 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 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. 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 (getFilter() != null)
sb.append("Filter: ").append(getFilter()).append(",");
if (getMaxDuration() != null)
sb.append("MaxDuration: ").append(getMaxDuration()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getMinDuration() != null)
sb.append("MinDuration: ").append(getMinDuration()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getOfferingId() != null)
sb.append("OfferingId: ").append(getOfferingId());
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.getFilter() == null ^ this.getFilter() == null)
return false;
if (other.getFilter() != null && other.getFilter().equals(this.getFilter()) == 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.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == 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.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getOfferingId() == null ^ this.getOfferingId() == null)
return false;
if (other.getOfferingId() != null && other.getOfferingId().equals(this.getOfferingId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode + ((getMaxDuration() == null) ? 0 : getMaxDuration().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getMinDuration() == null) ? 0 : getMinDuration().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getOfferingId() == null) ? 0 : getOfferingId().hashCode());
return hashCode;
}
@Override
public DescribeHostReservationOfferingsRequest clone() {
return (DescribeHostReservationOfferingsRequest) super.clone();
}
}