Struct aws_sdk_ec2::model::Purchase

source ·
#[non_exhaustive]
pub struct Purchase { /* private fields */ }
Expand description

Describes the result of the purchase.

Implementations§

The currency in which the UpfrontPrice and HourlyPrice amounts are specified. At this time, the only supported currency is USD.

The duration of the reservation's term in seconds.

The IDs of the Dedicated Hosts associated with the reservation.

The ID of the reservation.

The hourly price of the reservation per hour.

The instance family on the Dedicated Host that the reservation can be associated with.

The payment option for the reservation.

The upfront price of the reservation.

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())
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more