aws_sdk_ec2/protocol_serde/
shape_ipam_pool.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_ipam_pool(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::IpamPool, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::IpamPool::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("ownerId") => {
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_owner_id(var_1);
21 }
22 ,
23 s if s.matches("ipamPoolId") => {
24 let var_2 =
25 Some(
26 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
28 .into()
29 )
30 ?
31 )
32 ;
33 builder = builder.set_ipam_pool_id(var_2);
34 }
35 ,
36 s if s.matches("sourceIpamPoolId") => {
37 let var_3 =
38 Some(
39 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41 .into()
42 )
43 ?
44 )
45 ;
46 builder = builder.set_source_ipam_pool_id(var_3);
47 }
48 ,
49 s if s.matches("ipamPoolArn") => {
50 let var_4 =
51 Some(
52 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
54 .into()
55 )
56 ?
57 )
58 ;
59 builder = builder.set_ipam_pool_arn(var_4);
60 }
61 ,
62 s if s.matches("ipamScopeArn") => {
63 let var_5 =
64 Some(
65 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
66 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
67 .into()
68 )
69 ?
70 )
71 ;
72 builder = builder.set_ipam_scope_arn(var_5);
73 }
74 ,
75 s if s.matches("ipamScopeType") => {
76 let var_6 =
77 Some(
78 Result::<crate::types::IpamScopeType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
79 crate::types::IpamScopeType::from(
80 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
81 )
82 )
83 ?
84 )
85 ;
86 builder = builder.set_ipam_scope_type(var_6);
87 }
88 ,
89 s if s.matches("ipamArn") => {
90 let var_7 =
91 Some(
92 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
94 .into()
95 )
96 ?
97 )
98 ;
99 builder = builder.set_ipam_arn(var_7);
100 }
101 ,
102 s if s.matches("ipamRegion") => {
103 let var_8 =
104 Some(
105 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
106 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
107 .into()
108 )
109 ?
110 )
111 ;
112 builder = builder.set_ipam_region(var_8);
113 }
114 ,
115 s if s.matches("locale") => {
116 let var_9 =
117 Some(
118 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
119 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
120 .into()
121 )
122 ?
123 )
124 ;
125 builder = builder.set_locale(var_9);
126 }
127 ,
128 s if s.matches("poolDepth") => {
129 let var_10 =
130 Some(
131 {
132 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
133 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
134 )
135 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
136 }
137 ?
138 )
139 ;
140 builder = builder.set_pool_depth(var_10);
141 }
142 ,
143 s if s.matches("state") => {
144 let var_11 =
145 Some(
146 Result::<crate::types::IpamPoolState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
147 crate::types::IpamPoolState::from(
148 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
149 )
150 )
151 ?
152 )
153 ;
154 builder = builder.set_state(var_11);
155 }
156 ,
157 s if s.matches("stateMessage") => {
158 let var_12 =
159 Some(
160 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
161 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
162 .into()
163 )
164 ?
165 )
166 ;
167 builder = builder.set_state_message(var_12);
168 }
169 ,
170 s if s.matches("description") => {
171 let var_13 =
172 Some(
173 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
174 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
175 .into()
176 )
177 ?
178 )
179 ;
180 builder = builder.set_description(var_13);
181 }
182 ,
183 s if s.matches("autoImport") => {
184 let var_14 =
185 Some(
186 {
187 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
188 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
189 )
190 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
191 }
192 ?
193 )
194 ;
195 builder = builder.set_auto_import(var_14);
196 }
197 ,
198 s if s.matches("publiclyAdvertisable") => {
199 let var_15 =
200 Some(
201 {
202 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
203 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
204 )
205 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
206 }
207 ?
208 )
209 ;
210 builder = builder.set_publicly_advertisable(var_15);
211 }
212 ,
213 s if s.matches("addressFamily") => {
214 let var_16 =
215 Some(
216 Result::<crate::types::AddressFamily, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
217 crate::types::AddressFamily::from(
218 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
219 )
220 )
221 ?
222 )
223 ;
224 builder = builder.set_address_family(var_16);
225 }
226 ,
227 s if s.matches("allocationMinNetmaskLength") => {
228 let var_17 =
229 Some(
230 {
231 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
232 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
233 )
234 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#IpamNetmaskLength`)"))
235 }
236 ?
237 )
238 ;
239 builder = builder.set_allocation_min_netmask_length(var_17);
240 }
241 ,
242 s if s.matches("allocationMaxNetmaskLength") => {
243 let var_18 =
244 Some(
245 {
246 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
247 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
248 )
249 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#IpamNetmaskLength`)"))
250 }
251 ?
252 )
253 ;
254 builder = builder.set_allocation_max_netmask_length(var_18);
255 }
256 ,
257 s if s.matches("allocationDefaultNetmaskLength") => {
258 let var_19 =
259 Some(
260 {
261 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
262 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
263 )
264 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#IpamNetmaskLength`)"))
265 }
266 ?
267 )
268 ;
269 builder = builder.set_allocation_default_netmask_length(var_19);
270 }
271 ,
272 s if s.matches("allocationResourceTagSet") => {
273 let var_20 =
274 Some(
275 crate::protocol_serde::shape_ipam_resource_tag_list::de_ipam_resource_tag_list(&mut tag)
276 ?
277 )
278 ;
279 builder = builder.set_allocation_resource_tags(var_20);
280 }
281 ,
282 s if s.matches("tagSet") => {
283 let var_21 =
284 Some(
285 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
286 ?
287 )
288 ;
289 builder = builder.set_tags(var_21);
290 }
291 ,
292 s if s.matches("awsService") => {
293 let var_22 =
294 Some(
295 Result::<crate::types::IpamPoolAwsService, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
296 crate::types::IpamPoolAwsService::from(
297 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
298 )
299 )
300 ?
301 )
302 ;
303 builder = builder.set_aws_service(var_22);
304 }
305 ,
306 s if s.matches("publicIpSource") => {
307 let var_23 =
308 Some(
309 Result::<crate::types::IpamPoolPublicIpSource, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
310 crate::types::IpamPoolPublicIpSource::from(
311 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
312 )
313 )
314 ?
315 )
316 ;
317 builder = builder.set_public_ip_source(var_23);
318 }
319 ,
320 s if s.matches("sourceResource") => {
321 let var_24 =
322 Some(
323 crate::protocol_serde::shape_ipam_pool_source_resource::de_ipam_pool_source_resource(&mut tag)
324 ?
325 )
326 ;
327 builder = builder.set_source_resource(var_24);
328 }
329 ,
330 _ => {}
331 }
332 }
333 Ok(builder.build())
334}