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 PurchaseReservedInstancesOffering operation.

Purchases a Reserved Instance for use with your account. With Amazon EC2 Reserved Instances, you obtain a capacity reservation for a certain instance configuration over a specified period of time. You pay a lower usage rate than with On-Demand instances for the time that you actually use the capacity reservation.

Use DescribeReservedInstancesOfferings to get a list of Reserved Instance offerings that match your specifications. After you've purchased a Reserved Instance, you can check for your new Reserved Instance with DescribeReservedInstances.

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

 
The ID of the Reserved Instance offering to purchase.
 
     private String reservedInstancesOfferingId;

    
The number of Reserved Instances to purchase.
 
     private Integer instanceCount;

    
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.
 
     private ReservedInstanceLimitPrice limitPrice;

    
Default constructor for a new PurchaseReservedInstancesOfferingRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public PurchaseReservedInstancesOfferingRequest() {}
    
    
Constructs a new PurchaseReservedInstancesOfferingRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
reservedInstancesOfferingId The ID of the Reserved Instance offering to purchase.
instanceCount The number of Reserved Instances to purchase.
 
     public PurchaseReservedInstancesOfferingRequest(String reservedInstancesOfferingIdInteger instanceCount) {
         setReservedInstancesOfferingId(reservedInstancesOfferingId);
         setInstanceCount(instanceCount);
     }

    
The ID of the Reserved Instance offering to purchase.

Returns:
The ID of the Reserved Instance offering to purchase.
 
         return ;
     }
    
    
The ID of the Reserved Instance offering to purchase.

Parameters:
reservedInstancesOfferingId The ID of the Reserved Instance offering to purchase.
 
     public void setReservedInstancesOfferingId(String reservedInstancesOfferingId) {
        this. = reservedInstancesOfferingId;
    }
    
    
The ID of the Reserved Instance offering to purchase.

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

Parameters:
reservedInstancesOfferingId The ID of the Reserved Instance offering to purchase.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = reservedInstancesOfferingId;
        return this;
    }

    
The number of Reserved Instances to purchase.

Returns:
The number of Reserved Instances to purchase.
    public Integer getInstanceCount() {
        return ;
    }
    
    
The number of Reserved Instances to purchase.

Parameters:
instanceCount The number of Reserved Instances to purchase.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
The number of Reserved Instances to purchase.

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

Parameters:
instanceCount The number of Reserved Instances to purchase.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = instanceCount;
        return this;
    }

    
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.

Returns:
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.
        return ;
    }
    
    
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.

Parameters:
limitPrice Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.
    public void setLimitPrice(ReservedInstanceLimitPrice limitPrice) {
        this. = limitPrice;
    }
    
    
Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.

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

Parameters:
limitPrice Specified for Reserved Instance Marketplace offerings to limit the total order and ensure that the Reserved Instances are not purchased at unexpected prices.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = limitPrice;
        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 (getReservedInstancesOfferingId() != nullsb.append("ReservedInstancesOfferingId: " + getReservedInstancesOfferingId() + ",");
        if (getInstanceCount() != nullsb.append("InstanceCount: " + getInstanceCount() + ",");
        if (getLimitPrice() != nullsb.append("LimitPrice: " + getLimitPrice() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getReservedInstancesOfferingId() == null) ? 0 : getReservedInstancesOfferingId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); 
        hashCode = prime * hashCode + ((getLimitPrice() == null) ? 0 : getLimitPrice().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PurchaseReservedInstancesOfferingRequest == falsereturn false;
        
        if (other.getReservedInstancesOfferingId() == null ^ this.getReservedInstancesOfferingId() == nullreturn false;
        if (other.getReservedInstancesOfferingId() != null && other.getReservedInstancesOfferingId().equals(this.getReservedInstancesOfferingId()) == falsereturn false
        if (other.getInstanceCount() == null ^ this.getInstanceCount() == nullreturn false;
        if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == falsereturn false
        if (other.getLimitPrice() == null ^ this.getLimitPrice() == nullreturn false;
        if (other.getLimitPrice() != null && other.getLimitPrice().equals(this.getLimitPrice()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (PurchaseReservedInstancesOfferingRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X