aws_sdk_ec2/protocol_serde/
shape_vpc_block_public_access_exclusion.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_vpc_block_public_access_exclusion(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::VpcBlockPublicAccessExclusion, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::VpcBlockPublicAccessExclusion::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("exclusionId") => {
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_exclusion_id(var_1);
21 }
22 ,
23 s if s.matches("internetGatewayExclusionMode") => {
24 let var_2 =
25 Some(
26 Result::<crate::types::InternetGatewayExclusionMode, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
27 crate::types::InternetGatewayExclusionMode::from(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 )
30 )
31 ?
32 )
33 ;
34 builder = builder.set_internet_gateway_exclusion_mode(var_2);
35 }
36 ,
37 s if s.matches("resourceArn") => {
38 let var_3 =
39 Some(
40 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 .into()
43 )
44 ?
45 )
46 ;
47 builder = builder.set_resource_arn(var_3);
48 }
49 ,
50 s if s.matches("state") => {
51 let var_4 =
52 Some(
53 Result::<crate::types::VpcBlockPublicAccessExclusionState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
54 crate::types::VpcBlockPublicAccessExclusionState::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("reason") => {
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_reason(var_5);
75 }
76 ,
77 s if s.matches("creationTimestamp") => {
78 let var_6 =
79 Some(
80 ::aws_smithy_types::DateTime::from_str(
81 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
82 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
83 )
84 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
85 ?
86 )
87 ;
88 builder = builder.set_creation_timestamp(var_6);
89 }
90 ,
91 s if s.matches("lastUpdateTimestamp") => {
92 let var_7 =
93 Some(
94 ::aws_smithy_types::DateTime::from_str(
95 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
96 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
97 )
98 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
99 ?
100 )
101 ;
102 builder = builder.set_last_update_timestamp(var_7);
103 }
104 ,
105 s if s.matches("deletionTimestamp") => {
106 let var_8 =
107 Some(
108 ::aws_smithy_types::DateTime::from_str(
109 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
110 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
111 )
112 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
113 ?
114 )
115 ;
116 builder = builder.set_deletion_timestamp(var_8);
117 }
118 ,
119 s if s.matches("tagSet") => {
120 let var_9 =
121 Some(
122 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
123 ?
124 )
125 ;
126 builder = builder.set_tags(var_9);
127 }
128 ,
129 _ => {}
130 }
131 }
132 Ok(builder.build())
133}