/* * Copyright 2018-2023 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; /** *
* Describes a Reserved Instance. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ReservedInstances implements Serializable, Cloneable { /** ** The Availability Zone in which the Reserved Instance can be used. *
*/ private String availabilityZone; /** ** The duration of the Reserved Instance, in seconds. *
*/ private Long duration; /** ** The time when the Reserved Instance expires. *
*/ private java.util.Date end; /** ** The purchase price of the Reserved Instance. *
*/ private Float fixedPrice; /** ** The number of reservations purchased. *
*/ private Integer instanceCount; /** ** The instance type on which the Reserved Instance can be used. *
*/ private String instanceType; /** ** The Reserved Instance product platform description. *
*/ private String productDescription; /** ** The ID of the Reserved Instance. *
*/ private String reservedInstancesId; /** ** The date and time the Reserved Instance started. *
*/ private java.util.Date start; /** ** The state of the Reserved Instance purchase. *
*/ private String state; /** ** The usage price of the Reserved Instance, per hour. *
*/ private Float usagePrice; /** *
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
* The tenancy of the instance. *
*/ private String instanceTenancy; /** ** The offering class of the Reserved Instance. *
*/ private String offeringClass; /** ** The Reserved Instance offering type. *
*/ private String offeringType; /** ** The recurring charge tag assigned to the resource. *
*/ private com.amazonaws.internal.SdkInternalList* The scope of the Reserved Instance. *
*/ private String scope; /** ** Any tags assigned to the resource. *
*/ private com.amazonaws.internal.SdkInternalList* The Availability Zone in which the Reserved Instance can be used. *
* * @param availabilityZone * The Availability Zone in which the Reserved Instance can be used. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** ** The Availability Zone in which the Reserved Instance can be used. *
* * @return The Availability Zone in which the Reserved Instance can be used. */ public String getAvailabilityZone() { return this.availabilityZone; } /** ** The Availability Zone in which the Reserved Instance can be used. *
* * @param availabilityZone * The Availability Zone in which the Reserved Instance can be used. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** ** The duration of the Reserved Instance, in seconds. *
* * @param duration * The duration of the Reserved Instance, in seconds. */ public void setDuration(Long duration) { this.duration = duration; } /** ** The duration of the Reserved Instance, in seconds. *
* * @return The duration of the Reserved Instance, in seconds. */ public Long getDuration() { return this.duration; } /** ** The duration of the Reserved Instance, in seconds. *
* * @param duration * The duration of the Reserved Instance, in seconds. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withDuration(Long duration) { setDuration(duration); return this; } /** ** The time when the Reserved Instance expires. *
* * @param end * The time when the Reserved Instance expires. */ public void setEnd(java.util.Date end) { this.end = end; } /** ** The time when the Reserved Instance expires. *
* * @return The time when the Reserved Instance expires. */ public java.util.Date getEnd() { return this.end; } /** ** The time when the Reserved Instance expires. *
* * @param end * The time when the Reserved Instance expires. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withEnd(java.util.Date end) { setEnd(end); return this; } /** ** The purchase price of the Reserved Instance. *
* * @param fixedPrice * The purchase price of the Reserved Instance. */ public void setFixedPrice(Float fixedPrice) { this.fixedPrice = fixedPrice; } /** ** The purchase price of the Reserved Instance. *
* * @return The purchase price of the Reserved Instance. */ public Float getFixedPrice() { return this.fixedPrice; } /** ** The purchase price of the Reserved Instance. *
* * @param fixedPrice * The purchase price of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withFixedPrice(Float fixedPrice) { setFixedPrice(fixedPrice); return this; } /** ** The number of reservations purchased. *
* * @param instanceCount * The number of reservations purchased. */ public void setInstanceCount(Integer instanceCount) { this.instanceCount = instanceCount; } /** ** The number of reservations purchased. *
* * @return The number of reservations purchased. */ public Integer getInstanceCount() { return this.instanceCount; } /** ** The number of reservations purchased. *
* * @param instanceCount * The number of reservations purchased. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withInstanceCount(Integer instanceCount) { setInstanceCount(instanceCount); return this; } /** ** The instance type on which the Reserved Instance can be used. *
* * @param instanceType * The instance type on which the Reserved Instance can be used. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** ** The instance type on which the Reserved Instance can be used. *
* * @return The instance type on which the Reserved Instance can be used. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** ** The instance type on which the Reserved Instance can be used. *
* * @param instanceType * The instance type on which the Reserved Instance can be used. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public ReservedInstances withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** ** The instance type on which the Reserved Instance can be used. *
* * @param instanceType * The instance type on which the Reserved Instance can be used. * @see InstanceType */ public void setInstanceType(InstanceType instanceType) { withInstanceType(instanceType); } /** ** The instance type on which the Reserved Instance can be used. *
* * @param instanceType * The instance type on which the Reserved Instance can be used. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public ReservedInstances withInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** ** The Reserved Instance product platform description. *
* * @param productDescription * The Reserved Instance product platform description. * @see RIProductDescription */ public void setProductDescription(String productDescription) { this.productDescription = productDescription; } /** ** The Reserved Instance product platform description. *
* * @return The Reserved Instance product platform description. * @see RIProductDescription */ public String getProductDescription() { return this.productDescription; } /** ** The Reserved Instance product platform description. *
* * @param productDescription * The Reserved Instance product platform description. * @return Returns a reference to this object so that method calls can be chained together. * @see RIProductDescription */ public ReservedInstances withProductDescription(String productDescription) { setProductDescription(productDescription); return this; } /** ** The Reserved Instance product platform description. *
* * @param productDescription * The Reserved Instance product platform description. * @see RIProductDescription */ public void setProductDescription(RIProductDescription productDescription) { withProductDescription(productDescription); } /** ** The Reserved Instance product platform description. *
* * @param productDescription * The Reserved Instance product platform description. * @return Returns a reference to this object so that method calls can be chained together. * @see RIProductDescription */ public ReservedInstances withProductDescription(RIProductDescription productDescription) { this.productDescription = productDescription.toString(); return this; } /** ** The ID of the Reserved Instance. *
* * @param reservedInstancesId * The ID of the Reserved Instance. */ public void setReservedInstancesId(String reservedInstancesId) { this.reservedInstancesId = reservedInstancesId; } /** ** The ID of the Reserved Instance. *
* * @return The ID of the Reserved Instance. */ public String getReservedInstancesId() { return this.reservedInstancesId; } /** ** The ID of the Reserved Instance. *
* * @param reservedInstancesId * The ID of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withReservedInstancesId(String reservedInstancesId) { setReservedInstancesId(reservedInstancesId); return this; } /** ** The date and time the Reserved Instance started. *
* * @param start * The date and time the Reserved Instance started. */ public void setStart(java.util.Date start) { this.start = start; } /** ** The date and time the Reserved Instance started. *
* * @return The date and time the Reserved Instance started. */ public java.util.Date getStart() { return this.start; } /** ** The date and time the Reserved Instance started. *
* * @param start * The date and time the Reserved Instance started. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withStart(java.util.Date start) { setStart(start); return this; } /** ** The state of the Reserved Instance purchase. *
* * @param state * The state of the Reserved Instance purchase. * @see ReservedInstanceState */ public void setState(String state) { this.state = state; } /** ** The state of the Reserved Instance purchase. *
* * @return The state of the Reserved Instance purchase. * @see ReservedInstanceState */ public String getState() { return this.state; } /** ** The state of the Reserved Instance purchase. *
* * @param state * The state of the Reserved Instance purchase. * @return Returns a reference to this object so that method calls can be chained together. * @see ReservedInstanceState */ public ReservedInstances withState(String state) { setState(state); return this; } /** ** The state of the Reserved Instance purchase. *
* * @param state * The state of the Reserved Instance purchase. * @see ReservedInstanceState */ public void setState(ReservedInstanceState state) { withState(state); } /** ** The state of the Reserved Instance purchase. *
* * @param state * The state of the Reserved Instance purchase. * @return Returns a reference to this object so that method calls can be chained together. * @see ReservedInstanceState */ public ReservedInstances withState(ReservedInstanceState state) { this.state = state.toString(); return this; } /** ** The usage price of the Reserved Instance, per hour. *
* * @param usagePrice * The usage price of the Reserved Instance, per hour. */ public void setUsagePrice(Float usagePrice) { this.usagePrice = usagePrice; } /** ** The usage price of the Reserved Instance, per hour. *
* * @return The usage price of the Reserved Instance, per hour. */ public Float getUsagePrice() { return this.usagePrice; } /** ** The usage price of the Reserved Instance, per hour. *
* * @param usagePrice * The usage price of the Reserved Instance, per hour. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withUsagePrice(Float usagePrice) { setUsagePrice(usagePrice); return this; } /** *
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
USD
.
* @see CurrencyCodeValues
*/
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
/**
*
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
USD
.
* @see CurrencyCodeValues
*/
public String getCurrencyCode() {
return this.currencyCode;
}
/**
*
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
USD
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CurrencyCodeValues
*/
public ReservedInstances withCurrencyCode(String currencyCode) {
setCurrencyCode(currencyCode);
return this;
}
/**
*
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
USD
.
* @see CurrencyCodeValues
*/
public void setCurrencyCode(CurrencyCodeValues currencyCode) {
withCurrencyCode(currencyCode);
}
/**
*
* The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the
* only supported currency is USD
.
*
USD
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CurrencyCodeValues
*/
public ReservedInstances withCurrencyCode(CurrencyCodeValues currencyCode) {
this.currencyCode = currencyCode.toString();
return this;
}
/**
* * The tenancy of the instance. *
* * @param instanceTenancy * The tenancy of the instance. * @see Tenancy */ public void setInstanceTenancy(String instanceTenancy) { this.instanceTenancy = instanceTenancy; } /** ** The tenancy of the instance. *
* * @return The tenancy of the instance. * @see Tenancy */ public String getInstanceTenancy() { return this.instanceTenancy; } /** ** The tenancy of the instance. *
* * @param instanceTenancy * The tenancy of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see Tenancy */ public ReservedInstances withInstanceTenancy(String instanceTenancy) { setInstanceTenancy(instanceTenancy); return this; } /** ** The tenancy of the instance. *
* * @param instanceTenancy * The tenancy of the instance. * @see Tenancy */ public void setInstanceTenancy(Tenancy instanceTenancy) { withInstanceTenancy(instanceTenancy); } /** ** The tenancy of the instance. *
* * @param instanceTenancy * The tenancy of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see Tenancy */ public ReservedInstances withInstanceTenancy(Tenancy instanceTenancy) { this.instanceTenancy = instanceTenancy.toString(); return this; } /** ** The offering class of the Reserved Instance. *
* * @param offeringClass * The offering class of the Reserved Instance. * @see OfferingClassType */ public void setOfferingClass(String offeringClass) { this.offeringClass = offeringClass; } /** ** The offering class of the Reserved Instance. *
* * @return The offering class of the Reserved Instance. * @see OfferingClassType */ public String getOfferingClass() { return this.offeringClass; } /** ** The offering class of the Reserved Instance. *
* * @param offeringClass * The offering class of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. * @see OfferingClassType */ public ReservedInstances withOfferingClass(String offeringClass) { setOfferingClass(offeringClass); return this; } /** ** The offering class of the Reserved Instance. *
* * @param offeringClass * The offering class of the Reserved Instance. * @see OfferingClassType */ public void setOfferingClass(OfferingClassType offeringClass) { withOfferingClass(offeringClass); } /** ** The offering class of the Reserved Instance. *
* * @param offeringClass * The offering class of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. * @see OfferingClassType */ public ReservedInstances withOfferingClass(OfferingClassType offeringClass) { this.offeringClass = offeringClass.toString(); return this; } /** ** The Reserved Instance offering type. *
* * @param offeringType * The Reserved Instance offering type. * @see OfferingTypeValues */ public void setOfferingType(String offeringType) { this.offeringType = offeringType; } /** ** The Reserved Instance offering type. *
* * @return The Reserved Instance offering type. * @see OfferingTypeValues */ public String getOfferingType() { return this.offeringType; } /** ** The Reserved Instance offering type. *
* * @param offeringType * The Reserved Instance offering type. * @return Returns a reference to this object so that method calls can be chained together. * @see OfferingTypeValues */ public ReservedInstances withOfferingType(String offeringType) { setOfferingType(offeringType); return this; } /** ** The Reserved Instance offering type. *
* * @param offeringType * The Reserved Instance offering type. * @see OfferingTypeValues */ public void setOfferingType(OfferingTypeValues offeringType) { withOfferingType(offeringType); } /** ** The Reserved Instance offering type. *
* * @param offeringType * The Reserved Instance offering type. * @return Returns a reference to this object so that method calls can be chained together. * @see OfferingTypeValues */ public ReservedInstances withOfferingType(OfferingTypeValues offeringType) { this.offeringType = offeringType.toString(); return this; } /** ** The recurring charge tag assigned to the resource. *
* * @return The recurring charge tag assigned to the resource. */ public java.util.List* The recurring charge tag assigned to the resource. *
* * @param recurringCharges * The recurring charge tag assigned to the resource. */ public void setRecurringCharges(java.util.Collection* The recurring charge tag assigned to the resource. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRecurringCharges(java.util.Collection)} or {@link #withRecurringCharges(java.util.Collection)} if you * want to override the existing values. *
* * @param recurringCharges * The recurring charge tag assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withRecurringCharges(RecurringCharge... recurringCharges) { if (this.recurringCharges == null) { setRecurringCharges(new com.amazonaws.internal.SdkInternalList* The recurring charge tag assigned to the resource. *
* * @param recurringCharges * The recurring charge tag assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withRecurringCharges(java.util.Collection* The scope of the Reserved Instance. *
* * @param scope * The scope of the Reserved Instance. * @see Scope */ public void setScope(String scope) { this.scope = scope; } /** ** The scope of the Reserved Instance. *
* * @return The scope of the Reserved Instance. * @see Scope */ public String getScope() { return this.scope; } /** ** The scope of the Reserved Instance. *
* * @param scope * The scope of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. * @see Scope */ public ReservedInstances withScope(String scope) { setScope(scope); return this; } /** ** The scope of the Reserved Instance. *
* * @param scope * The scope of the Reserved Instance. * @see Scope */ public void setScope(Scope scope) { withScope(scope); } /** ** The scope of the Reserved Instance. *
* * @param scope * The scope of the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. * @see Scope */ public ReservedInstances withScope(Scope scope) { this.scope = scope.toString(); return this; } /** ** Any tags assigned to the resource. *
* * @return Any tags assigned to the resource. */ public java.util.List* Any tags assigned to the resource. *
* * @param tags * Any tags assigned to the resource. */ public void setTags(java.util.Collection* Any tags assigned to the resource. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * Any tags assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList* Any tags assigned to the resource. *
* * @param tags * Any tags assigned to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public ReservedInstances withTags(java.util.Collection