aws-sdk-ec2 1.218.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_reserved_instances_listing(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::ReservedInstancesListing, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::ReservedInstancesListing::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("clientToken") /* ClientToken com.amazonaws.ec2#ReservedInstancesListing$ClientToken */ =>  {
                let var_1 =
                    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_client_token(var_1);
            }
            ,
            s if s.matches("createDate") /* CreateDate com.amazonaws.ec2#ReservedInstancesListing$CreateDate */ =>  {
                let var_2 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_create_date(var_2);
            }
            ,
            s if s.matches("instanceCounts") /* InstanceCounts com.amazonaws.ec2#ReservedInstancesListing$InstanceCounts */ =>  {
                let var_3 =
                    Some(
                        crate::protocol_serde::shape_instance_count_list::de_instance_count_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_instance_counts(var_3);
            }
            ,
            s if s.matches("priceSchedules") /* PriceSchedules com.amazonaws.ec2#ReservedInstancesListing$PriceSchedules */ =>  {
                let var_4 =
                    Some(
                        crate::protocol_serde::shape_price_schedule_list::de_price_schedule_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_price_schedules(var_4);
            }
            ,
            s if s.matches("reservedInstancesId") /* ReservedInstancesId com.amazonaws.ec2#ReservedInstancesListing$ReservedInstancesId */ =>  {
                let var_5 =
                    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_reserved_instances_id(var_5);
            }
            ,
            s if s.matches("reservedInstancesListingId") /* ReservedInstancesListingId com.amazonaws.ec2#ReservedInstancesListing$ReservedInstancesListingId */ =>  {
                let var_6 =
                    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_reserved_instances_listing_id(var_6);
            }
            ,
            s if s.matches("status") /* Status com.amazonaws.ec2#ReservedInstancesListing$Status */ =>  {
                let var_7 =
                    Some(
                        Result::<crate::types::ListingStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ListingStatus::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_status(var_7);
            }
            ,
            s if s.matches("statusMessage") /* StatusMessage com.amazonaws.ec2#ReservedInstancesListing$StatusMessage */ =>  {
                let var_8 =
                    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_status_message(var_8);
            }
            ,
            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#ReservedInstancesListing$Tags */ =>  {
                let var_9 =
                    Some(
                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_tags(var_9);
            }
            ,
            s if s.matches("updateDate") /* UpdateDate com.amazonaws.ec2#ReservedInstancesListing$UpdateDate */ =>  {
                let var_10 =
                    Some(
                        ::aws_smithy_types::DateTime::from_str(
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
                        )
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
                        ?
                    )
                ;
                builder = builder.set_update_date(var_10);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}