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

Creates a listing for Amazon EC2 Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Reserved Instance listing at a time. To get a list of your Reserved Instances, you can use the DescribeReservedInstances operation.

The Reserved Instance Marketplace matches sellers who want to resell Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.

To sell your Reserved Instances, you must first register as a seller in the Reserved Instance Marketplace. After completing the registration process, you can create a Reserved Instance Marketplace listing of some or all of your Reserved Instances, and specify the upfront price to receive for them. Your Reserved Instance listings then become available for purchase. To view the details of your Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.

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

 
 public class CreateReservedInstancesListingRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The ID of the active Reserved Instance.
 
     private String reservedInstancesId;

    
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.
 
     private Integer instanceCount;

    
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.
 
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
 
     private String clientToken;

    
The ID of the active Reserved Instance.

Returns:
The ID of the active Reserved Instance.
 
     public String getReservedInstancesId() {
         return ;
     }
    
    
The ID of the active Reserved Instance.

Parameters:
reservedInstancesId The ID of the active Reserved Instance.
 
     public void setReservedInstancesId(String reservedInstancesId) {
         this. = reservedInstancesId;
    }
    
    
The ID of the active Reserved Instance.

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

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

    
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.

Returns:
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.
    public Integer getInstanceCount() {
        return ;
    }
    
    
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.

Parameters:
instanceCount The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.

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

Parameters:
instanceCount The number of instances that are a part of a Reserved Instance account to be listed in the Reserved Instance Marketplace. This number should be less than or equal to the instance count associated with the Reserved Instance ID specified in this call.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = instanceCount;
        return this;
    }

    
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.

Returns:
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.

Parameters:
priceSchedules A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.
    public void setPriceSchedules(java.util.Collection<PriceScheduleSpecificationpriceSchedules) {
        if (priceSchedules == null) {
            this. = null;
            return;
        }
        priceSchedulesCopy.addAll(priceSchedules);
        this. = priceSchedulesCopy;
    }
    
    
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.

NOTE: This method appends the values to the existing list (if any). Use setPriceSchedules(java.util.Collection) or withPriceSchedules(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:
priceSchedules A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getPriceSchedules() == nullsetPriceSchedules(new java.util.ArrayList<PriceScheduleSpecification>(priceSchedules.length));
        for (PriceScheduleSpecification value : priceSchedules) {
            getPriceSchedules().add(value);
        }
        return this;
    }
    
    
A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.

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

Parameters:
priceSchedules A list specifying the price of the Reserved Instance for each month remaining in the Reserved Instance term.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (priceSchedules == null) {
            this. = null;
        } else {
            priceSchedulesCopy.addAll(priceSchedules);
            this. = priceSchedulesCopy;
        }
        return this;
    }

    
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

Returns:
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
    public String getClientToken() {
        return ;
    }
    
    
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

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

Parameters:
clientToken Unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = clientToken;
        return this;
    }

    
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 (getReservedInstancesId() != nullsb.append("ReservedInstancesId: " + getReservedInstancesId() + ",");
        if (getInstanceCount() != nullsb.append("InstanceCount: " + getInstanceCount() + ",");
        if (getPriceSchedules() != nullsb.append("PriceSchedules: " + getPriceSchedules() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getReservedInstancesId() == null) ? 0 : getReservedInstancesId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); 
        hashCode = prime * hashCode + ((getPriceSchedules() == null) ? 0 : getPriceSchedules().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateReservedInstancesListingRequest == falsereturn false;
        
        if (other.getReservedInstancesId() == null ^ this.getReservedInstancesId() == nullreturn false;
        if (other.getReservedInstancesId() != null && other.getReservedInstancesId().equals(this.getReservedInstancesId()) == falsereturn false
        if (other.getInstanceCount() == null ^ this.getInstanceCount() == nullreturn false;
        if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == falsereturn false
        if (other.getPriceSchedules() == null ^ this.getPriceSchedules() == nullreturn false;
        if (other.getPriceSchedules() != null && other.getPriceSchedules().equals(this.getPriceSchedules()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreateReservedInstancesListingRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X