aws_sdk_ec2/protocol_serde/
shape_internet_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_internet_gateway(
4    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::InternetGateway, ::aws_smithy_xml::decode::XmlDecodeError> {
6    #[allow(unused_mut)]
7    let mut builder = crate::types::InternetGateway::builder();
8    while let Some(mut tag) = decoder.next_tag() {
9        match tag.start_el() {
10            s if s.matches("attachmentSet") /* Attachments com.amazonaws.ec2#InternetGateway$Attachments */ =>  {
11                let var_1 =
12                    Some(
13                        crate::protocol_serde::shape_internet_gateway_attachment_list::de_internet_gateway_attachment_list(&mut tag)
14                        ?
15                    )
16                ;
17                builder = builder.set_attachments(var_1);
18            }
19            ,
20            s if s.matches("internetGatewayId") /* InternetGatewayId com.amazonaws.ec2#InternetGateway$InternetGatewayId */ =>  {
21                let var_2 =
22                    Some(
23                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
24                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
25                            .into()
26                        )
27                        ?
28                    )
29                ;
30                builder = builder.set_internet_gateway_id(var_2);
31            }
32            ,
33            s if s.matches("ownerId") /* OwnerId com.amazonaws.ec2#InternetGateway$OwnerId */ =>  {
34                let var_3 =
35                    Some(
36                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
37                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
38                            .into()
39                        )
40                        ?
41                    )
42                ;
43                builder = builder.set_owner_id(var_3);
44            }
45            ,
46            s if s.matches("tagSet") /* Tags com.amazonaws.ec2#InternetGateway$Tags */ =>  {
47                let var_4 =
48                    Some(
49                        crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
50                        ?
51                    )
52                ;
53                builder = builder.set_tags(var_4);
54            }
55            ,
56            _ => {}
57        }
58    }
59    Ok(builder.build())
60}