aws_sdk_ec2/protocol_serde/
shape_ipam_address_history_record.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_ipam_address_history_record(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::IpamAddressHistoryRecord, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::IpamAddressHistoryRecord::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("resourceOwnerId") => {
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_resource_owner_id(var_1);
21 }
22 ,
23 s if s.matches("resourceRegion") => {
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_resource_region(var_2);
34 }
35 ,
36 s if s.matches("resourceType") => {
37 let var_3 =
38 Some(
39 Result::<crate::types::IpamAddressHistoryResourceType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 crate::types::IpamAddressHistoryResourceType::from(
41 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
42 )
43 )
44 ?
45 )
46 ;
47 builder = builder.set_resource_type(var_3);
48 }
49 ,
50 s if s.matches("resourceId") => {
51 let var_4 =
52 Some(
53 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 .into()
56 )
57 ?
58 )
59 ;
60 builder = builder.set_resource_id(var_4);
61 }
62 ,
63 s if s.matches("resourceCidr") => {
64 let var_5 =
65 Some(
66 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
67 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
68 .into()
69 )
70 ?
71 )
72 ;
73 builder = builder.set_resource_cidr(var_5);
74 }
75 ,
76 s if s.matches("resourceName") => {
77 let var_6 =
78 Some(
79 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
80 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
81 .into()
82 )
83 ?
84 )
85 ;
86 builder = builder.set_resource_name(var_6);
87 }
88 ,
89 s if s.matches("resourceComplianceStatus") => {
90 let var_7 =
91 Some(
92 Result::<crate::types::IpamComplianceStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93 crate::types::IpamComplianceStatus::from(
94 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
95 )
96 )
97 ?
98 )
99 ;
100 builder = builder.set_resource_compliance_status(var_7);
101 }
102 ,
103 s if s.matches("resourceOverlapStatus") => {
104 let var_8 =
105 Some(
106 Result::<crate::types::IpamOverlapStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
107 crate::types::IpamOverlapStatus::from(
108 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
109 )
110 )
111 ?
112 )
113 ;
114 builder = builder.set_resource_overlap_status(var_8);
115 }
116 ,
117 s if s.matches("vpcId") => {
118 let var_9 =
119 Some(
120 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
121 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
122 .into()
123 )
124 ?
125 )
126 ;
127 builder = builder.set_vpc_id(var_9);
128 }
129 ,
130 s if s.matches("sampledStartTime") => {
131 let var_10 =
132 Some(
133 ::aws_smithy_types::DateTime::from_str(
134 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
135 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
136 )
137 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
138 ?
139 )
140 ;
141 builder = builder.set_sampled_start_time(var_10);
142 }
143 ,
144 s if s.matches("sampledEndTime") => {
145 let var_11 =
146 Some(
147 ::aws_smithy_types::DateTime::from_str(
148 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
149 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
150 )
151 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
152 ?
153 )
154 ;
155 builder = builder.set_sampled_end_time(var_11);
156 }
157 ,
158 _ => {}
159 }
160 }
161 Ok(builder.build())
162}