Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 
 
Container for the parameters to the DescribeReservedInstances operation.

Describes one or more of the Reserved Instances that you purchased.

For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute Cloud User Guide for Linux .

 
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

 
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

 
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

 
     private String offeringType;

    
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

Returns:
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

 
     public java.util.List<StringgetReservedInstancesIds() {
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

Parameters:
reservedInstancesIds One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

    public void setReservedInstancesIds(java.util.Collection<StringreservedInstancesIds) {
        if (reservedInstancesIds == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringreservedInstancesIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(reservedInstancesIds.size());
        reservedInstancesIdsCopy.addAll(reservedInstancesIds);
        this. = reservedInstancesIdsCopy;
    }
    
    
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

NOTE: This method appends the values to the existing list (if any). Use setReservedInstancesIds(java.util.Collection) or withReservedInstancesIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
reservedInstancesIds One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeReservedInstancesRequest withReservedInstancesIds(String... reservedInstancesIds) {
        if (getReservedInstancesIds() == nullsetReservedInstancesIds(new java.util.ArrayList<String>(reservedInstancesIds.length));
        for (String value : reservedInstancesIds) {
            getReservedInstancesIds().add(value);
        }
        return this;
    }
    
    
One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

Returns a reference to this object so that method calls can be chained together.

Parameters:
reservedInstancesIds One or more Reserved Instance IDs.

Default: Describes all your Reserved Instances, or only those otherwise specified.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (reservedInstancesIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringreservedInstancesIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(reservedInstancesIds.size());
            reservedInstancesIdsCopy.addAll(reservedInstancesIds);
            this. = reservedInstancesIdsCopy;
        }
        return this;
    }

    
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

Returns:
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

    public java.util.List<FiltergetFilters() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Filter>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

    public void setFilters(java.util.Collection<Filterfilters) {
        if (filters == null) {
            this. = null;
            return;
        }
        filtersCopy.addAll(filters);
        this. = filtersCopy;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

NOTE: This method appends the values to the existing list (if any). Use setFilters(java.util.Collection) or withFilters(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeReservedInstancesRequest withFilters(Filter... filters) {
        if (getFilters() == nullsetFilters(new java.util.ArrayList<Filter>(filters.length));
        for (Filter value : filters) {
            getFilters().add(value);
        }
        return this;
    }
    
    
One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

Returns a reference to this object so that method calls can be chained together.

Parameters:
filters One or more filters.
  • availability-zone - The Availability Zone where the Reserved Instance can be used.

  • duration - The duration of the Reserved Instance (one year or three years), in seconds (31536000 | 94608000).

  • end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z).

  • fixed-price - The purchase price of the Reserved Instance (for example, 9800.0).

  • instance-type - The instance type on which the Reserved Instance can be used.

  • product-description - The product description of the Reserved Instance (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)).

  • reserved-instances-id - The ID of the Reserved Instance.

  • start - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).

  • state - The state of the Reserved Instance (pending-payment | active | payment-failed | retired).

  • tag:key=value - The key/value combination of a tag assigned to the resource.

  • 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 what the tag's key is). If you want to list only resources where Purpose is X, see the tag:key=value filter.

  • tag-value - The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

  • usage-price - The usage price of the Reserved Instance, per hour (for example, 0.84).

Returns:
A reference to this updated object so that method calls can be chained together.
        if (filters == null) {
            this. = null;
        } else {
            filtersCopy.addAll(filters);
            this. = filtersCopy;
        }
        return this;
    }

    
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Returns:
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.
See also:
OfferingTypeValues
    public String getOfferingType() {
        return ;
    }
    
    
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.
See also:
OfferingTypeValues
    public void setOfferingType(String offeringType) {
        this. = offeringType;
    }
    
    
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OfferingTypeValues
        this. = offeringType;
        return this;
    }

    
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.
See also:
OfferingTypeValues
    public void setOfferingType(OfferingTypeValues offeringType) {
        this. = offeringType.toString();
    }
    
    
The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the Medium Utilization Reserved Instance offering type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OfferingTypeValues
        this. = offeringType.toString();
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getReservedInstancesIds() != nullsb.append("ReservedInstancesIds: " + getReservedInstancesIds() + ",");
        if (getFilters() != nullsb.append("Filters: " + getFilters() + ",");
        if (getOfferingType() != nullsb.append("OfferingType: " + getOfferingType() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getReservedInstancesIds() == null) ? 0 : getReservedInstancesIds().hashCode()); 
        hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode()); 
        hashCode = prime * hashCode + ((getOfferingType() == null) ? 0 : getOfferingType().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeReservedInstancesRequest == falsereturn false;
        
        if (other.getReservedInstancesIds() == null ^ this.getReservedInstancesIds() == nullreturn false;
        if (other.getReservedInstancesIds() != null && other.getReservedInstancesIds().equals(this.getReservedInstancesIds()) == falsereturn false
        if (other.getFilters() == null ^ this.getFilters() == nullreturn false;
        if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == falsereturn false
        if (other.getOfferingType() == null ^ this.getOfferingType() == nullreturn false;
        if (other.getOfferingType() != null && other.getOfferingType().equals(this.getOfferingType()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (DescribeReservedInstancesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X