aws_sdk_ec2/protocol_serde/
shape_capacity_reservation_specification_response.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_capacity_reservation_specification_response(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::CapacityReservationSpecificationResponse, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::CapacityReservationSpecificationResponse::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationPreference */ =>  {
11                let var_1 =
12                    Some(
13                        Result::<crate::types::CapacityReservationPreference, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14                            crate::types::CapacityReservationPreference::from(
15                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16                            )
17                        )
18                        ?
19                    )
20                ;
21                builder = builder.set_capacity_reservation_preference(var_1);
22            }
23            ,
24            s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationTarget */ =>  {
25                let var_2 =
26                    Some(
27                        crate::protocol_serde::shape_capacity_reservation_target_response::de_capacity_reservation_target_response(&mut tag)
28                        ?
29                    )
30                ;
31                builder = builder.set_capacity_reservation_target(var_2);
32            }
33            ,
34            _ => {}
35        }
36    }
37    Ok(builder.build())
38}