aws_sdk_ec2/protocol_serde/
shape_ebs_optimized_info.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_ebs_optimized_info(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::EbsOptimizedInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::EbsOptimizedInfo::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("baselineBandwidthInMbps") /* BaselineBandwidthInMbps com.amazonaws.ec2#EbsOptimizedInfo$BaselineBandwidthInMbps */ =>  {
11                let var_1 =
12                    Some(
13                         {
14                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
15                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
16                            )
17                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#BaselineBandwidthInMbps`)"))
18                        }
19                        ?
20                    )
21                ;
22                builder = builder.set_baseline_bandwidth_in_mbps(var_1);
23            }
24            ,
25            s if s.matches("baselineThroughputInMBps") /* BaselineThroughputInMBps com.amazonaws.ec2#EbsOptimizedInfo$BaselineThroughputInMBps */ =>  {
26                let var_2 =
27                    Some(
28                         {
29                            <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
30                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
31                            )
32                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.ec2#BaselineThroughputInMBps`)"))
33                        }
34                        ?
35                    )
36                ;
37                builder = builder.set_baseline_throughput_in_m_bps(var_2);
38            }
39            ,
40            s if s.matches("baselineIops") /* BaselineIops com.amazonaws.ec2#EbsOptimizedInfo$BaselineIops */ =>  {
41                let var_3 =
42                    Some(
43                         {
44                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
45                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
46                            )
47                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#BaselineIops`)"))
48                        }
49                        ?
50                    )
51                ;
52                builder = builder.set_baseline_iops(var_3);
53            }
54            ,
55            s if s.matches("maximumBandwidthInMbps") /* MaximumBandwidthInMbps com.amazonaws.ec2#EbsOptimizedInfo$MaximumBandwidthInMbps */ =>  {
56                let var_4 =
57                    Some(
58                         {
59                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
60                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
61                            )
62                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaximumBandwidthInMbps`)"))
63                        }
64                        ?
65                    )
66                ;
67                builder = builder.set_maximum_bandwidth_in_mbps(var_4);
68            }
69            ,
70            s if s.matches("maximumThroughputInMBps") /* MaximumThroughputInMBps com.amazonaws.ec2#EbsOptimizedInfo$MaximumThroughputInMBps */ =>  {
71                let var_5 =
72                    Some(
73                         {
74                            <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
75                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
76                            )
77                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.ec2#MaximumThroughputInMBps`)"))
78                        }
79                        ?
80                    )
81                ;
82                builder = builder.set_maximum_throughput_in_m_bps(var_5);
83            }
84            ,
85            s if s.matches("maximumIops") /* MaximumIops com.amazonaws.ec2#EbsOptimizedInfo$MaximumIops */ =>  {
86                let var_6 =
87                    Some(
88                         {
89                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
90                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
91                            )
92                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaximumIops`)"))
93                        }
94                        ?
95                    )
96                ;
97                builder = builder.set_maximum_iops(var_6);
98            }
99            ,
100            _ => {}
101        }
102    }
103    Ok(builder.build())
104}