aws_sdk_ec2/protocol_serde/
shape_vpc_encryption_control.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_vpc_encryption_control(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::VpcEncryptionControl, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::VpcEncryptionControl::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("vpcId") => {
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_vpc_id(var_1);
21 }
22 ,
23 s if s.matches("vpcEncryptionControlId") => {
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_vpc_encryption_control_id(var_2);
34 }
35 ,
36 s if s.matches("mode") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::VpcEncryptionControlMode, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::VpcEncryptionControlMode::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_mode(var_3);
48 }
49 ,
50 s if s.matches("state") => {
51 let var_4 =
52 Some(
53 Result::<crate::types::VpcEncryptionControlState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
54 crate::types::VpcEncryptionControlState::from(
55 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
56 )
57 )
58 ?
59 )
60 ;
61 builder = builder.set_state(var_4);
62 }
63 ,
64 s if s.matches("stateMessage") => {
65 let var_5 =
66 Some(
67 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
68 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
69 .into()
70 )
71 ?
72 )
73 ;
74 builder = builder.set_state_message(var_5);
75 }
76 ,
77 s if s.matches("resourceExclusions") => {
78 let var_6 =
79 Some(
80 crate::protocol_serde::shape_vpc_encryption_control_exclusions::de_vpc_encryption_control_exclusions(&mut tag)
81 ?
82 )
83 ;
84 builder = builder.set_resource_exclusions(var_6);
85 }
86 ,
87 s if s.matches("tagSet") => {
88 let var_7 =
89 Some(
90 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
91 ?
92 )
93 ;
94 builder = builder.set_tags(var_7);
95 }
96 ,
97 _ => {}
98 }
99 }
100 Ok(builder.build())
101}