aws_sdk_ec2/protocol_serde/
shape_security_group.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_security_group(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::SecurityGroup, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::SecurityGroup::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("groupId") => {
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_group_id(var_1);
21 }
22 ,
23 s if s.matches("ipPermissionsEgress") => {
24 let var_2 =
25 Some(
26 crate::protocol_serde::shape_ip_permission_list::de_ip_permission_list(&mut tag)
27 ?
28 )
29 ;
30 builder = builder.set_ip_permissions_egress(var_2);
31 }
32 ,
33 s if s.matches("tagSet") => {
34 let var_3 =
35 Some(
36 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
37 ?
38 )
39 ;
40 builder = builder.set_tags(var_3);
41 }
42 ,
43 s if s.matches("vpcId") => {
44 let var_4 =
45 Some(
46 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
47 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
48 .into()
49 )
50 ?
51 )
52 ;
53 builder = builder.set_vpc_id(var_4);
54 }
55 ,
56 s if s.matches("securityGroupArn") => {
57 let var_5 =
58 Some(
59 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
60 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
61 .into()
62 )
63 ?
64 )
65 ;
66 builder = builder.set_security_group_arn(var_5);
67 }
68 ,
69 s if s.matches("ownerId") => {
70 let var_6 =
71 Some(
72 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
73 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
74 .into()
75 )
76 ?
77 )
78 ;
79 builder = builder.set_owner_id(var_6);
80 }
81 ,
82 s if s.matches("groupName") => {
83 let var_7 =
84 Some(
85 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
86 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
87 .into()
88 )
89 ?
90 )
91 ;
92 builder = builder.set_group_name(var_7);
93 }
94 ,
95 s if s.matches("groupDescription") => {
96 let var_8 =
97 Some(
98 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
99 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
100 .into()
101 )
102 ?
103 )
104 ;
105 builder = builder.set_description(var_8);
106 }
107 ,
108 s if s.matches("ipPermissions") => {
109 let var_9 =
110 Some(
111 crate::protocol_serde::shape_ip_permission_list::de_ip_permission_list(&mut tag)
112 ?
113 )
114 ;
115 builder = builder.set_ip_permissions(var_9);
116 }
117 ,
118 _ => {}
119 }
120 }
121 Ok(builder.build())
122}