aws_sdk_ec2/protocol_serde/
shape_customer_gateway.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_customer_gateway(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::CustomerGateway, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::CustomerGateway::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("certificateArn") /* CertificateArn com.amazonaws.ec2#CustomerGateway$CertificateArn */ =>  {
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_certificate_arn(var_1);
21            }
22            ,
23            s if s.matches("deviceName") /* DeviceName com.amazonaws.ec2#CustomerGateway$DeviceName */ =>  {
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_device_name(var_2);
34            }
35            ,
36            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#CustomerGateway$Tags */ =>  {
37                let var_3 =
38                    Some(
39                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
40                        ?
41                    )
42                ;
43                builder = builder.set_tags(var_3);
44            }
45            ,
46            s if s.matches("bgpAsnExtended") /* BgpAsnExtended com.amazonaws.ec2#CustomerGateway$BgpAsnExtended */ =>  {
47                let var_4 =
48                    Some(
49                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
50                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
51                            .into()
52                        )
53                        ?
54                    )
55                ;
56                builder = builder.set_bgp_asn_extended(var_4);
57            }
58            ,
59            s if s.matches("customerGatewayId") /* CustomerGatewayId com.amazonaws.ec2#CustomerGateway$CustomerGatewayId */ =>  {
60                let var_5 =
61                    Some(
62                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
63                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
64                            .into()
65                        )
66                        ?
67                    )
68                ;
69                builder = builder.set_customer_gateway_id(var_5);
70            }
71            ,
72            s if s.matches("state") /* State com.amazonaws.ec2#CustomerGateway$State */ =>  {
73                let var_6 =
74                    Some(
75                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
76                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
77                            .into()
78                        )
79                        ?
80                    )
81                ;
82                builder = builder.set_state(var_6);
83            }
84            ,
85            s if s.matches("type") /* Type com.amazonaws.ec2#CustomerGateway$Type */ =>  {
86                let var_7 =
87                    Some(
88                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
89                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
90                            .into()
91                        )
92                        ?
93                    )
94                ;
95                builder = builder.set_type(var_7);
96            }
97            ,
98            s if s.matches("ipAddress") /* IpAddress com.amazonaws.ec2#CustomerGateway$IpAddress */ =>  {
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_ip_address(var_8);
109            }
110            ,
111            s if s.matches("bgpAsn") /* BgpAsn com.amazonaws.ec2#CustomerGateway$BgpAsn */ =>  {
112                let var_9 =
113                    Some(
114                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
115                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
116                            .into()
117                        )
118                        ?
119                    )
120                ;
121                builder = builder.set_bgp_asn(var_9);
122            }
123            ,
124            _ => {}
125        }
126    }
127    Ok(builder.build())
128}