aws-sdk-ec2 1.222.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_data_response(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::DataResponse, ::aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::types::DataResponse::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("id") /* Id com.amazonaws.ec2#DataResponse$Id */ =>  {
                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_id(var_1);
            }
            ,
            s if s.matches("source") /* Source com.amazonaws.ec2#DataResponse$Source */ =>  {
                let var_2 =
                    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_source(var_2);
            }
            ,
            s if s.matches("destination") /* Destination com.amazonaws.ec2#DataResponse$Destination */ =>  {
                let var_3 =
                    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_destination(var_3);
            }
            ,
            s if s.matches("metric") /* Metric com.amazonaws.ec2#DataResponse$Metric */ =>  {
                let var_4 =
                    Some(
                        Result::<crate::types::MetricType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::MetricType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_metric(var_4);
            }
            ,
            s if s.matches("statistic") /* Statistic com.amazonaws.ec2#DataResponse$Statistic */ =>  {
                let var_5 =
                    Some(
                        Result::<crate::types::StatisticType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::StatisticType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_statistic(var_5);
            }
            ,
            s if s.matches("period") /* Period com.amazonaws.ec2#DataResponse$Period */ =>  {
                let var_6 =
                    Some(
                        Result::<crate::types::PeriodType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::PeriodType::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_period(var_6);
            }
            ,
            s if s.matches("metricPointSet") /* MetricPoints com.amazonaws.ec2#DataResponse$MetricPoints */ =>  {
                let var_7 =
                    Some(
                        crate::protocol_serde::shape_metric_points::de_metric_points(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_metric_points(var_7);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}