aws-sdk-ec2 1.251.0

AWS SDK for Amazon Elastic Compute Cloud
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::needless_question_mark)]
pub fn de_reserved_capacity_options(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::ReservedCapacityOptions, ::aws_smithy_xml::decode::XmlDecodeError> {
    if depth >= 128u32 {
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
    }
    #[allow(unused_mut)]
    let mut builder = crate::types::ReservedCapacityOptions::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("allocationStrategy") /* AllocationStrategy com.amazonaws.ec2#ReservedCapacityOptions$AllocationStrategy */ =>  {
                let var_1 =
                    Some(
                        Result::<crate::types::ReservedCapacityAllocationStrategy, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::ReservedCapacityAllocationStrategy::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_allocation_strategy(var_1);
            }
            ,
            s if s.matches("reservationTypeSet") /* ReservationTypes com.amazonaws.ec2#ReservedCapacityOptions$ReservationTypes */ =>  {
                let var_2 =
                    Some(
                        crate::protocol_serde::shape_reservation_type_list::de_reservation_type_list(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_reservation_types(var_2);
            }
            ,
            s if s.matches("reservedCapacityFallbackOptions") /* ReservedCapacityFallbackOptions com.amazonaws.ec2#ReservedCapacityOptions$ReservedCapacityFallbackOptions */ =>  {
                let var_3 =
                    Some(
                        crate::protocol_serde::shape_reserved_capacity_fallback_options::de_reserved_capacity_fallback_options(&mut tag, depth + 1)
                        ?
                    )
                ;
                builder = builder.set_reserved_capacity_fallback_options(var_3);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}