aws_sdk_ec2/protocol_serde/
shape_local_gateway_virtual_interface.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_local_gateway_virtual_interface(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::LocalGatewayVirtualInterface, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::LocalGatewayVirtualInterface::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("localGatewayVirtualInterfaceId") /* LocalGatewayVirtualInterfaceId com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalGatewayVirtualInterfaceId */ =>  {
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_local_gateway_virtual_interface_id(var_1);
21            }
22            ,
23            s if s.matches("localGatewayId") /* LocalGatewayId com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalGatewayId */ =>  {
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_local_gateway_id(var_2);
34            }
35            ,
36            s if s.matches("localGatewayVirtualInterfaceGroupId") /* LocalGatewayVirtualInterfaceGroupId com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalGatewayVirtualInterfaceGroupId */ =>  {
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_local_gateway_virtual_interface_group_id(var_3);
47            }
48            ,
49            s if s.matches("localGatewayVirtualInterfaceArn") /* LocalGatewayVirtualInterfaceArn com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalGatewayVirtualInterfaceArn */ =>  {
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_local_gateway_virtual_interface_arn(var_4);
60            }
61            ,
62            s if s.matches("outpostLagId") /* OutpostLagId com.amazonaws.ec2#LocalGatewayVirtualInterface$OutpostLagId */ =>  {
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_outpost_lag_id(var_5);
73            }
74            ,
75            s if s.matches("vlan") /* Vlan com.amazonaws.ec2#LocalGatewayVirtualInterface$Vlan */ =>  {
76                let var_6 =
77                    Some(
78                         {
79                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
80                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
81                            )
82                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
83                        }
84                        ?
85                    )
86                ;
87                builder = builder.set_vlan(var_6);
88            }
89            ,
90            s if s.matches("localAddress") /* LocalAddress com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalAddress */ =>  {
91                let var_7 =
92                    Some(
93                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
94                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
95                            .into()
96                        )
97                        ?
98                    )
99                ;
100                builder = builder.set_local_address(var_7);
101            }
102            ,
103            s if s.matches("peerAddress") /* PeerAddress com.amazonaws.ec2#LocalGatewayVirtualInterface$PeerAddress */ =>  {
104                let var_8 =
105                    Some(
106                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
107                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
108                            .into()
109                        )
110                        ?
111                    )
112                ;
113                builder = builder.set_peer_address(var_8);
114            }
115            ,
116            s if s.matches("localBgpAsn") /* LocalBgpAsn com.amazonaws.ec2#LocalGatewayVirtualInterface$LocalBgpAsn */ =>  {
117                let var_9 =
118                    Some(
119                         {
120                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
121                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
122                            )
123                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
124                        }
125                        ?
126                    )
127                ;
128                builder = builder.set_local_bgp_asn(var_9);
129            }
130            ,
131            s if s.matches("peerBgpAsn") /* PeerBgpAsn com.amazonaws.ec2#LocalGatewayVirtualInterface$PeerBgpAsn */ =>  {
132                let var_10 =
133                    Some(
134                         {
135                            <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
136                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
137                            )
138                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
139                        }
140                        ?
141                    )
142                ;
143                builder = builder.set_peer_bgp_asn(var_10);
144            }
145            ,
146            s if s.matches("peerBgpAsnExtended") /* PeerBgpAsnExtended com.amazonaws.ec2#LocalGatewayVirtualInterface$PeerBgpAsnExtended */ =>  {
147                let var_11 =
148                    Some(
149                         {
150                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
151                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
152                            )
153                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.ec2#Long`)"))
154                        }
155                        ?
156                    )
157                ;
158                builder = builder.set_peer_bgp_asn_extended(var_11);
159            }
160            ,
161            s if s.matches("ownerId") /* OwnerId com.amazonaws.ec2#LocalGatewayVirtualInterface$OwnerId */ =>  {
162                let var_12 =
163                    Some(
164                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
165                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
166                            .into()
167                        )
168                        ?
169                    )
170                ;
171                builder = builder.set_owner_id(var_12);
172            }
173            ,
174            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#LocalGatewayVirtualInterface$Tags */ =>  {
175                let var_13 =
176                    Some(
177                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
178                        ?
179                    )
180                ;
181                builder = builder.set_tags(var_13);
182            }
183            ,
184            s if s.matches("configurationState") /* ConfigurationState com.amazonaws.ec2#LocalGatewayVirtualInterface$ConfigurationState */ =>  {
185                let var_14 =
186                    Some(
187                        Result::<crate::types::LocalGatewayVirtualInterfaceConfigurationState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
188                            crate::types::LocalGatewayVirtualInterfaceConfigurationState::from(
189                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
190                            )
191                        )
192                        ?
193                    )
194                ;
195                builder = builder.set_configuration_state(var_14);
196            }
197            ,
198            _ => {}
199        }
200    }
201    Ok(builder.build())
202}