aws_sdk_ec2/protocol_serde/
shape_route_server_route.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_route_server_route(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::RouteServerRoute, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::RouteServerRoute::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("routeServerEndpointId") => {
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_route_server_endpoint_id(var_1);
21 }
22 ,
23 s if s.matches("routeServerPeerId") => {
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_route_server_peer_id(var_2);
34 }
35 ,
36 s if s.matches("routeInstallationDetailSet") => {
37 let var_3 =
38 Some(
39 crate::protocol_serde::shape_route_server_route_installation_details::de_route_server_route_installation_details(&mut tag)
40 ?
41 )
42 ;
43 builder = builder.set_route_installation_details(var_3);
44 }
45 ,
46 s if s.matches("routeStatus") => {
47 let var_4 =
48 Some(
49 Result::<crate::types::RouteServerRouteStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
50 crate::types::RouteServerRouteStatus::from(
51 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
52 )
53 )
54 ?
55 )
56 ;
57 builder = builder.set_route_status(var_4);
58 }
59 ,
60 s if s.matches("prefix") => {
61 let var_5 =
62 Some(
63 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
64 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
65 .into()
66 )
67 ?
68 )
69 ;
70 builder = builder.set_prefix(var_5);
71 }
72 ,
73 s if s.matches("asPathSet") => {
74 let var_6 =
75 Some(
76 crate::protocol_serde::shape_as_path::de_as_path(&mut tag)
77 ?
78 )
79 ;
80 builder = builder.set_as_paths(var_6);
81 }
82 ,
83 s if s.matches("med") => {
84 let var_7 =
85 Some(
86 {
87 <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
88 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
89 )
90 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
91 }
92 ?
93 )
94 ;
95 builder = builder.set_med(var_7);
96 }
97 ,
98 s if s.matches("nextHopIp") => {
99 let var_8 =
100 Some(
101 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
102 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
103 .into()
104 )
105 ?
106 )
107 ;
108 builder = builder.set_next_hop_ip(var_8);
109 }
110 ,
111 _ => {}
112 }
113 }
114 Ok(builder.build())
115}