Struct aws_sdk_ec2::model::Purchase
source · #[non_exhaustive]pub struct Purchase { /* private fields */ }
Expand description
Describes the result of the purchase.
Implementations§
source§impl Purchase
impl Purchase
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 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.
sourcepub fn hourly_price(&self) -> Option<&str>
pub fn hourly_price(&self) -> Option<&str>
The hourly price of the reservation per hour.
sourcepub fn instance_family(&self) -> Option<&str>
pub fn instance_family(&self) -> Option<&str>
The instance family on the Dedicated Host that the reservation can be associated with.
sourcepub fn payment_option(&self) -> Option<&PaymentOption>
pub fn payment_option(&self) -> Option<&PaymentOption>
The payment option for the reservation.
sourcepub fn upfront_price(&self) -> Option<&str>
pub fn upfront_price(&self) -> Option<&str>
The upfront price of the reservation.
source§impl Purchase
impl Purchase
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture Purchase
.
Examples found in repository?
src/xml_deser.rs (line 52295)
52291 52292 52293 52294 52295 52296 52297 52298 52299 52300 52301 52302 52303 52304 52305 52306 52307 52308 52309 52310 52311 52312 52313 52314 52315 52316 52317 52318 52319 52320 52321 52322 52323 52324 52325 52326 52327 52328 52329 52330 52331 52332 52333 52334 52335 52336 52337 52338 52339 52340 52341 52342 52343 52344 52345 52346 52347 52348 52349 52350 52351 52352 52353 52354 52355 52356 52357 52358 52359 52360 52361 52362 52363 52364 52365 52366 52367 52368 52369 52370 52371 52372 52373 52374 52375 52376 52377 52378 52379 52380 52381 52382 52383 52384 52385 52386 52387 52388 52389 52390 52391 52392 52393 52394 52395 52396 52397 52398 52399 52400 52401 52402 52403 52404 52405 52406 52407
pub fn deser_structure_crate_model_purchase(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::Purchase, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::Purchase::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("currencyCode") /* CurrencyCode com.amazonaws.ec2#Purchase$CurrencyCode */ => {
let var_2493 =
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_2493);
}
,
s if s.matches("duration") /* Duration com.amazonaws.ec2#Purchase$Duration */ => {
let var_2494 =
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_2494);
}
,
s if s.matches("hostIdSet") /* HostIdSet com.amazonaws.ec2#Purchase$HostIdSet */ => {
let var_2495 =
Some(
crate::xml_deser::deser_list_com_amazonaws_ec2_response_host_id_set(&mut tag)
?
)
;
builder = builder.set_host_id_set(var_2495);
}
,
s if s.matches("hostReservationId") /* HostReservationId com.amazonaws.ec2#Purchase$HostReservationId */ => {
let var_2496 =
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_2496);
}
,
s if s.matches("hourlyPrice") /* HourlyPrice com.amazonaws.ec2#Purchase$HourlyPrice */ => {
let var_2497 =
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_2497);
}
,
s if s.matches("instanceFamily") /* InstanceFamily com.amazonaws.ec2#Purchase$InstanceFamily */ => {
let var_2498 =
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_2498);
}
,
s if s.matches("paymentOption") /* PaymentOption com.amazonaws.ec2#Purchase$PaymentOption */ => {
let var_2499 =
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_2499);
}
,
s if s.matches("upfrontPrice") /* UpfrontPrice com.amazonaws.ec2#Purchase$UpfrontPrice */ => {
let var_2500 =
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_2500);
}
,
_ => {}
}
}
Ok(builder.build())
}