aws_sdk_ec2/protocol_serde/
shape_network_info.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_network_info(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::NetworkInfo, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::NetworkInfo::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("networkPerformance") => {
11 let var_1 =
12 Some(
13 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
14 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
15 .into()
16 )
17 ?
18 )
19 ;
20 builder = builder.set_network_performance(var_1);
21 }
22 ,
23 s if s.matches("maximumNetworkInterfaces") => {
24 let var_2 =
25 Some(
26 {
27 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 )
30 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaxNetworkInterfaces`)"))
31 }
32 ?
33 )
34 ;
35 builder = builder.set_maximum_network_interfaces(var_2);
36 }
37 ,
38 s if s.matches("maximumNetworkCards") => {
39 let var_3 =
40 Some(
41 {
42 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
43 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
44 )
45 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaximumNetworkCards`)"))
46 }
47 ?
48 )
49 ;
50 builder = builder.set_maximum_network_cards(var_3);
51 }
52 ,
53 s if s.matches("defaultNetworkCardIndex") => {
54 let var_4 =
55 Some(
56 {
57 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
58 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
59 )
60 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#DefaultNetworkCardIndex`)"))
61 }
62 ?
63 )
64 ;
65 builder = builder.set_default_network_card_index(var_4);
66 }
67 ,
68 s if s.matches("networkCards") => {
69 let var_5 =
70 Some(
71 crate::protocol_serde::shape_network_card_info_list::de_network_card_info_list(&mut tag)
72 ?
73 )
74 ;
75 builder = builder.set_network_cards(var_5);
76 }
77 ,
78 s if s.matches("ipv4AddressesPerInterface") => {
79 let var_6 =
80 Some(
81 {
82 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
83 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
84 )
85 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaxIpv4AddrPerInterface`)"))
86 }
87 ?
88 )
89 ;
90 builder = builder.set_ipv4_addresses_per_interface(var_6);
91 }
92 ,
93 s if s.matches("ipv6AddressesPerInterface") => {
94 let var_7 =
95 Some(
96 {
97 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
98 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
99 )
100 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#MaxIpv6AddrPerInterface`)"))
101 }
102 ?
103 )
104 ;
105 builder = builder.set_ipv6_addresses_per_interface(var_7);
106 }
107 ,
108 s if s.matches("ipv6Supported") => {
109 let var_8 =
110 Some(
111 {
112 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
113 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
114 )
115 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Ipv6Flag`)"))
116 }
117 ?
118 )
119 ;
120 builder = builder.set_ipv6_supported(var_8);
121 }
122 ,
123 s if s.matches("enaSupport") => {
124 let var_9 =
125 Some(
126 Result::<crate::types::EnaSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
127 crate::types::EnaSupport::from(
128 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
129 )
130 )
131 ?
132 )
133 ;
134 builder = builder.set_ena_support(var_9);
135 }
136 ,
137 s if s.matches("efaSupported") => {
138 let var_10 =
139 Some(
140 {
141 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
142 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
143 )
144 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#EfaSupportedFlag`)"))
145 }
146 ?
147 )
148 ;
149 builder = builder.set_efa_supported(var_10);
150 }
151 ,
152 s if s.matches("efaInfo") => {
153 let var_11 =
154 Some(
155 crate::protocol_serde::shape_efa_info::de_efa_info(&mut tag)
156 ?
157 )
158 ;
159 builder = builder.set_efa_info(var_11);
160 }
161 ,
162 s if s.matches("encryptionInTransitSupported") => {
163 let var_12 =
164 Some(
165 {
166 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
167 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
168 )
169 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#EncryptionInTransitSupported`)"))
170 }
171 ?
172 )
173 ;
174 builder = builder.set_encryption_in_transit_supported(var_12);
175 }
176 ,
177 s if s.matches("enaSrdSupported") => {
178 let var_13 =
179 Some(
180 {
181 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
182 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
183 )
184 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#EnaSrdSupported`)"))
185 }
186 ?
187 )
188 ;
189 builder = builder.set_ena_srd_supported(var_13);
190 }
191 ,
192 s if s.matches("bandwidthWeightings") => {
193 let var_14 =
194 Some(
195 crate::protocol_serde::shape_bandwidth_weighting_type_list::de_bandwidth_weighting_type_list(&mut tag)
196 ?
197 )
198 ;
199 builder = builder.set_bandwidth_weightings(var_14);
200 }
201 ,
202 s if s.matches("flexibleEnaQueuesSupport") => {
203 let var_15 =
204 Some(
205 Result::<crate::types::FlexibleEnaQueuesSupport, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
206 crate::types::FlexibleEnaQueuesSupport::from(
207 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
208 )
209 )
210 ?
211 )
212 ;
213 builder = builder.set_flexible_ena_queues_support(var_15);
214 }
215 ,
216 _ => {}
217 }
218 }
219 Ok(builder.build())
220}