Struct aws_sdk_ec2::model::HostReservation
source · #[non_exhaustive]pub struct HostReservation { /* private fields */ }
Expand description
Details about the Dedicated Host Reservation and associated Dedicated Hosts.
Implementations§
source§impl HostReservation
impl HostReservation
sourcepub fn count(&self) -> Option<i32>
pub fn count(&self) -> Option<i32>
The number of Dedicated Hosts the reservation is associated with.
sourcepub fn currency_code(&self) -> Option<&CurrencyCodeValues>
pub fn currency_code(&self) -> Option<&CurrencyCodeValues>
The currency in which the upfrontPrice
and hourlyPrice
amounts are specified. At this time, the only supported currency is USD
.
sourcepub fn duration(&self) -> Option<i32>
pub fn duration(&self) -> Option<i32>
The length of the reservation's term, specified in seconds. Can be 31536000 (1 year)
| 94608000 (3 years)
.
sourcepub fn host_id_set(&self) -> Option<&[String]>
pub fn host_id_set(&self) -> Option<&[String]>
The IDs of the Dedicated Hosts associated with the reservation.
sourcepub fn host_reservation_id(&self) -> Option<&str>
pub fn host_reservation_id(&self) -> Option<&str>
The ID of the reservation that specifies the associated Dedicated Hosts.
sourcepub fn hourly_price(&self) -> Option<&str>
pub fn hourly_price(&self) -> Option<&str>
The hourly price of the reservation.
sourcepub fn instance_family(&self) -> Option<&str>
pub fn instance_family(&self) -> Option<&str>
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.
sourcepub fn offering_id(&self) -> Option<&str>
pub fn offering_id(&self) -> Option<&str>
The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it.
sourcepub fn payment_option(&self) -> Option<&PaymentOption>
pub fn payment_option(&self) -> Option<&PaymentOption>
The payment option selected for this reservation.
sourcepub fn state(&self) -> Option<&ReservationState>
pub fn state(&self) -> Option<&ReservationState>
The state of the reservation.
sourcepub fn upfront_price(&self) -> Option<&str>
pub fn upfront_price(&self) -> Option<&str>
The upfront price of the reservation.
Any tags assigned to the Dedicated Host Reservation.
source§impl HostReservation
impl HostReservation
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture HostReservation
.
Examples found in repository?
45650 45651 45652 45653 45654 45655 45656 45657 45658 45659 45660 45661 45662 45663 45664 45665 45666 45667 45668 45669 45670 45671 45672 45673 45674 45675 45676 45677 45678 45679 45680 45681 45682 45683 45684 45685 45686 45687 45688 45689 45690 45691 45692 45693 45694 45695 45696 45697 45698 45699 45700 45701 45702 45703 45704 45705 45706 45707 45708 45709 45710 45711 45712 45713 45714 45715 45716 45717 45718 45719 45720 45721 45722 45723 45724 45725 45726 45727 45728 45729 45730 45731 45732 45733 45734 45735 45736 45737 45738 45739 45740 45741 45742 45743 45744 45745 45746 45747 45748 45749 45750 45751 45752 45753 45754 45755 45756 45757 45758 45759 45760 45761 45762 45763 45764 45765 45766 45767 45768 45769 45770 45771 45772 45773 45774 45775 45776 45777 45778 45779 45780 45781 45782 45783 45784 45785 45786 45787 45788 45789 45790 45791 45792 45793 45794 45795 45796 45797 45798 45799 45800 45801 45802 45803 45804 45805 45806 45807 45808 45809 45810 45811 45812 45813 45814 45815 45816 45817 45818 45819 45820 45821 45822 45823 45824 45825 45826 45827 45828 45829 45830 45831 45832 45833 45834 45835 45836 45837 45838 45839 45840 45841 45842 45843 45844 45845 45846
pub fn deser_structure_crate_model_host_reservation(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::HostReservation, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::HostReservation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("count") /* Count com.amazonaws.ec2#HostReservation$Count */ => {
let var_2037 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_count(var_2037);
}
,
s if s.matches("currencyCode") /* CurrencyCode com.amazonaws.ec2#HostReservation$CurrencyCode */ => {
let var_2038 =
Some(
Result::<crate::model::CurrencyCodeValues, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::CurrencyCodeValues::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_currency_code(var_2038);
}
,
s if s.matches("duration") /* Duration com.amazonaws.ec2#HostReservation$Duration */ => {
let var_2039 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_duration(var_2039);
}
,
s if s.matches("end") /* End com.amazonaws.ec2#HostReservation$End */ => {
let var_2040 =
Some(
aws_smithy_types::DateTime::from_str(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, aws_smithy_types::date_time::Format::DateTime
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
?
)
;
builder = builder.set_end(var_2040);
}
,
s if s.matches("hostIdSet") /* HostIdSet com.amazonaws.ec2#HostReservation$HostIdSet */ => {
let var_2041 =
Some(
crate::xml_deser::deser_list_com_amazonaws_ec2_response_host_id_set(&mut tag)
?
)
;
builder = builder.set_host_id_set(var_2041);
}
,
s if s.matches("hostReservationId") /* HostReservationId com.amazonaws.ec2#HostReservation$HostReservationId */ => {
let var_2042 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_host_reservation_id(var_2042);
}
,
s if s.matches("hourlyPrice") /* HourlyPrice com.amazonaws.ec2#HostReservation$HourlyPrice */ => {
let var_2043 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_hourly_price(var_2043);
}
,
s if s.matches("instanceFamily") /* InstanceFamily com.amazonaws.ec2#HostReservation$InstanceFamily */ => {
let var_2044 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_instance_family(var_2044);
}
,
s if s.matches("offeringId") /* OfferingId com.amazonaws.ec2#HostReservation$OfferingId */ => {
let var_2045 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_offering_id(var_2045);
}
,
s if s.matches("paymentOption") /* PaymentOption com.amazonaws.ec2#HostReservation$PaymentOption */ => {
let var_2046 =
Some(
Result::<crate::model::PaymentOption, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::PaymentOption::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_payment_option(var_2046);
}
,
s if s.matches("start") /* Start com.amazonaws.ec2#HostReservation$Start */ => {
let var_2047 =
Some(
aws_smithy_types::DateTime::from_str(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, aws_smithy_types::date_time::Format::DateTime
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
?
)
;
builder = builder.set_start(var_2047);
}
,
s if s.matches("state") /* State com.amazonaws.ec2#HostReservation$State */ => {
let var_2048 =
Some(
Result::<crate::model::ReservationState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::ReservationState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_state(var_2048);
}
,
s if s.matches("upfrontPrice") /* UpfrontPrice com.amazonaws.ec2#HostReservation$UpfrontPrice */ => {
let var_2049 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_upfront_price(var_2049);
}
,
s if s.matches("tagSet") /* Tags com.amazonaws.ec2#HostReservation$Tags */ => {
let var_2050 =
Some(
crate::xml_deser::deser_list_com_amazonaws_ec2_tag_list(&mut tag)
?
)
;
builder = builder.set_tags(var_2050);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for HostReservation
impl Clone for HostReservation
source§fn clone(&self) -> HostReservation
fn clone(&self) -> HostReservation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more