/* * 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; /** *
* Details about the Dedicated Host Reservation and associated Dedicated Hosts. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HostReservation implements Serializable, Cloneable { /** ** The number of Dedicated Hosts the reservation is associated with. *
*/ private Integer count; /** *
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
* The length of the reservation's term, specified in seconds. Can be 31536000 (1 year)
|
* 94608000 (3 years)
.
*
* The date and time that the reservation ends. *
*/ private java.util.Date end; /** ** The IDs of the Dedicated Hosts associated with the reservation. *
*/ private com.amazonaws.internal.SdkInternalList* The ID of the reservation that specifies the associated Dedicated Hosts. *
*/ private String hostReservationId; /** ** The hourly price of the reservation. *
*/ private String hourlyPrice; /** ** The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same * in order for it to benefit from the reservation. *
*/ private String instanceFamily; /** ** The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it. *
*/ private String offeringId; /** ** The payment option selected for this reservation. *
*/ private String paymentOption; /** ** The date and time that the reservation started. *
*/ private java.util.Date start; /** ** The state of the reservation. *
*/ private String state; /** ** The upfront price of the reservation. *
*/ private String upfrontPrice; /** ** Any tags assigned to the Dedicated Host Reservation. *
*/ private com.amazonaws.internal.SdkInternalList* The number of Dedicated Hosts the reservation is associated with. *
* * @param count * The number of Dedicated Hosts the reservation is associated with. */ public void setCount(Integer count) { this.count = count; } /** ** The number of Dedicated Hosts the reservation is associated with. *
* * @return The number of Dedicated Hosts the reservation is associated with. */ public Integer getCount() { return this.count; } /** ** The number of Dedicated Hosts the reservation is associated with. *
* * @param count * The number of Dedicated Hosts the reservation is associated with. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withCount(Integer count) { setCount(count); return this; } /** *
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
upfrontPrice
and hourlyPrice
amounts are specified. At
* this time, the only supported currency is USD
.
* @see CurrencyCodeValues
*/
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
/**
*
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
upfrontPrice
and hourlyPrice
amounts are specified.
* At this time, the only supported currency is USD
.
* @see CurrencyCodeValues
*/
public String getCurrencyCode() {
return this.currencyCode;
}
/**
*
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
upfrontPrice
and hourlyPrice
amounts are specified. At
* this time, the only supported currency is USD
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CurrencyCodeValues
*/
public HostReservation withCurrencyCode(String currencyCode) {
setCurrencyCode(currencyCode);
return this;
}
/**
*
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
upfrontPrice
and hourlyPrice
amounts are specified. At
* this time, the only supported currency is USD
.
* @see CurrencyCodeValues
*/
public void setCurrencyCode(CurrencyCodeValues currencyCode) {
withCurrencyCode(currencyCode);
}
/**
*
* The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this
* time, the only supported currency is USD
.
*
upfrontPrice
and hourlyPrice
amounts are specified. At
* this time, the only supported currency is USD
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CurrencyCodeValues
*/
public HostReservation withCurrencyCode(CurrencyCodeValues currencyCode) {
this.currencyCode = currencyCode.toString();
return this;
}
/**
*
* The length of the reservation's term, specified in seconds. Can be 31536000 (1 year)
|
* 94608000 (3 years)
.
*
31536000 (1 year)
|
* 94608000 (3 years)
.
*/
public void setDuration(Integer duration) {
this.duration = duration;
}
/**
*
* The length of the reservation's term, specified in seconds. Can be 31536000 (1 year)
|
* 94608000 (3 years)
.
*
31536000 (1 year)
|
* 94608000 (3 years)
.
*/
public Integer getDuration() {
return this.duration;
}
/**
*
* The length of the reservation's term, specified in seconds. Can be 31536000 (1 year)
|
* 94608000 (3 years)
.
*
31536000 (1 year)
|
* 94608000 (3 years)
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public HostReservation withDuration(Integer duration) {
setDuration(duration);
return this;
}
/**
* * The date and time that the reservation ends. *
* * @param end * The date and time that the reservation ends. */ public void setEnd(java.util.Date end) { this.end = end; } /** ** The date and time that the reservation ends. *
* * @return The date and time that the reservation ends. */ public java.util.Date getEnd() { return this.end; } /** ** The date and time that the reservation ends. *
* * @param end * The date and time that the reservation ends. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withEnd(java.util.Date end) { setEnd(end); return this; } /** ** The IDs of the Dedicated Hosts associated with the reservation. *
* * @return The IDs of the Dedicated Hosts associated with the reservation. */ public java.util.List* The IDs of the Dedicated Hosts associated with the reservation. *
* * @param hostIdSet * The IDs of the Dedicated Hosts associated with the reservation. */ public void setHostIdSet(java.util.Collection* The IDs of the Dedicated Hosts associated with the reservation. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setHostIdSet(java.util.Collection)} or {@link #withHostIdSet(java.util.Collection)} if you want to * override the existing values. *
* * @param hostIdSet * The IDs of the Dedicated Hosts associated with the reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withHostIdSet(String... hostIdSet) { if (this.hostIdSet == null) { setHostIdSet(new com.amazonaws.internal.SdkInternalList* The IDs of the Dedicated Hosts associated with the reservation. *
* * @param hostIdSet * The IDs of the Dedicated Hosts associated with the reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withHostIdSet(java.util.Collection* The ID of the reservation that specifies the associated Dedicated Hosts. *
* * @param hostReservationId * The ID of the reservation that specifies the associated Dedicated Hosts. */ public void setHostReservationId(String hostReservationId) { this.hostReservationId = hostReservationId; } /** ** The ID of the reservation that specifies the associated Dedicated Hosts. *
* * @return The ID of the reservation that specifies the associated Dedicated Hosts. */ public String getHostReservationId() { return this.hostReservationId; } /** ** The ID of the reservation that specifies the associated Dedicated Hosts. *
* * @param hostReservationId * The ID of the reservation that specifies the associated Dedicated Hosts. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withHostReservationId(String hostReservationId) { setHostReservationId(hostReservationId); return this; } /** ** The hourly price of the reservation. *
* * @param hourlyPrice * The hourly price of the reservation. */ public void setHourlyPrice(String hourlyPrice) { this.hourlyPrice = hourlyPrice; } /** ** The hourly price of the reservation. *
* * @return The hourly price of the reservation. */ public String getHourlyPrice() { return this.hourlyPrice; } /** ** The hourly price of the reservation. *
* * @param hourlyPrice * The hourly price of the reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withHourlyPrice(String hourlyPrice) { setHourlyPrice(hourlyPrice); return this; } /** ** The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same * in order for it to benefit from the reservation. *
* * @param instanceFamily * The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be * the same in order for it to benefit from the reservation. */ public void setInstanceFamily(String instanceFamily) { this.instanceFamily = instanceFamily; } /** ** The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same * in order for it to benefit from the reservation. *
* * @return The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be * the same in order for it to benefit from the reservation. */ public String getInstanceFamily() { return this.instanceFamily; } /** ** The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same * in order for it to benefit from the reservation. *
* * @param instanceFamily * The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be * the same in order for it to benefit from the reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withInstanceFamily(String instanceFamily) { setInstanceFamily(instanceFamily); return this; } /** ** The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it. *
* * @param offeringId * The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with * it. */ public void setOfferingId(String offeringId) { this.offeringId = offeringId; } /** ** The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it. *
* * @return The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with * it. */ public String getOfferingId() { return this.offeringId; } /** ** The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it. *
* * @param offeringId * The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with * it. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withOfferingId(String offeringId) { setOfferingId(offeringId); return this; } /** ** The payment option selected for this reservation. *
* * @param paymentOption * The payment option selected for this reservation. * @see PaymentOption */ public void setPaymentOption(String paymentOption) { this.paymentOption = paymentOption; } /** ** The payment option selected for this reservation. *
* * @return The payment option selected for this reservation. * @see PaymentOption */ public String getPaymentOption() { return this.paymentOption; } /** ** The payment option selected for this reservation. *
* * @param paymentOption * The payment option selected for this reservation. * @return Returns a reference to this object so that method calls can be chained together. * @see PaymentOption */ public HostReservation withPaymentOption(String paymentOption) { setPaymentOption(paymentOption); return this; } /** ** The payment option selected for this reservation. *
* * @param paymentOption * The payment option selected for this reservation. * @see PaymentOption */ public void setPaymentOption(PaymentOption paymentOption) { withPaymentOption(paymentOption); } /** ** The payment option selected for this reservation. *
* * @param paymentOption * The payment option selected for this reservation. * @return Returns a reference to this object so that method calls can be chained together. * @see PaymentOption */ public HostReservation withPaymentOption(PaymentOption paymentOption) { this.paymentOption = paymentOption.toString(); return this; } /** ** The date and time that the reservation started. *
* * @param start * The date and time that the reservation started. */ public void setStart(java.util.Date start) { this.start = start; } /** ** The date and time that the reservation started. *
* * @return The date and time that the reservation started. */ public java.util.Date getStart() { return this.start; } /** ** The date and time that the reservation started. *
* * @param start * The date and time that the reservation started. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withStart(java.util.Date start) { setStart(start); return this; } /** ** The state of the reservation. *
* * @param state * The state of the reservation. * @see ReservationState */ public void setState(String state) { this.state = state; } /** ** The state of the reservation. *
* * @return The state of the reservation. * @see ReservationState */ public String getState() { return this.state; } /** ** The state of the reservation. *
* * @param state * The state of the reservation. * @return Returns a reference to this object so that method calls can be chained together. * @see ReservationState */ public HostReservation withState(String state) { setState(state); return this; } /** ** The state of the reservation. *
* * @param state * The state of the reservation. * @see ReservationState */ public void setState(ReservationState state) { withState(state); } /** ** The state of the reservation. *
* * @param state * The state of the reservation. * @return Returns a reference to this object so that method calls can be chained together. * @see ReservationState */ public HostReservation withState(ReservationState state) { this.state = state.toString(); return this; } /** ** The upfront price of the reservation. *
* * @param upfrontPrice * The upfront price of the reservation. */ public void setUpfrontPrice(String upfrontPrice) { this.upfrontPrice = upfrontPrice; } /** ** The upfront price of the reservation. *
* * @return The upfront price of the reservation. */ public String getUpfrontPrice() { return this.upfrontPrice; } /** ** The upfront price of the reservation. *
* * @param upfrontPrice * The upfront price of the reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withUpfrontPrice(String upfrontPrice) { setUpfrontPrice(upfrontPrice); return this; } /** ** Any tags assigned to the Dedicated Host Reservation. *
* * @return Any tags assigned to the Dedicated Host Reservation. */ public java.util.List* Any tags assigned to the Dedicated Host Reservation. *
* * @param tags * Any tags assigned to the Dedicated Host Reservation. */ public void setTags(java.util.Collection* Any tags assigned to the Dedicated Host Reservation. *
** 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 Dedicated Host Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList* Any tags assigned to the Dedicated Host Reservation. *
* * @param tags * Any tags assigned to the Dedicated Host Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public HostReservation withTags(java.util.Collection