aws_sdk_ec2/protocol_serde/
shape_ec2_instance_connect_endpoint.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_ec2_instance_connect_endpoint(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::Ec2InstanceConnectEndpoint, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::Ec2InstanceConnectEndpoint::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("ownerId") => {
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_owner_id(var_1);
21 }
22 ,
23 s if s.matches("instanceConnectEndpointId") => {
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_instance_connect_endpoint_id(var_2);
34 }
35 ,
36 s if s.matches("instanceConnectEndpointArn") => {
37 let var_3 =
38 Some(
39 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
40 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
41 .into()
42 )
43 ?
44 )
45 ;
46 builder = builder.set_instance_connect_endpoint_arn(var_3);
47 }
48 ,
49 s if s.matches("state") => {
50 let var_4 =
51 Some(
52 Result::<crate::types::Ec2InstanceConnectEndpointState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53 crate::types::Ec2InstanceConnectEndpointState::from(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 )
56 )
57 ?
58 )
59 ;
60 builder = builder.set_state(var_4);
61 }
62 ,
63 s if s.matches("stateMessage") => {
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_state_message(var_5);
74 }
75 ,
76 s if s.matches("dnsName") => {
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_dns_name(var_6);
87 }
88 ,
89 s if s.matches("fipsDnsName") => {
90 let var_7 =
91 Some(
92 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
93 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
94 .into()
95 )
96 ?
97 )
98 ;
99 builder = builder.set_fips_dns_name(var_7);
100 }
101 ,
102 s if s.matches("networkInterfaceIdSet") => {
103 let var_8 =
104 Some(
105 crate::protocol_serde::shape_network_interface_id_set::de_network_interface_id_set(&mut tag)
106 ?
107 )
108 ;
109 builder = builder.set_network_interface_ids(var_8);
110 }
111 ,
112 s if s.matches("vpcId") => {
113 let var_9 =
114 Some(
115 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
116 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
117 .into()
118 )
119 ?
120 )
121 ;
122 builder = builder.set_vpc_id(var_9);
123 }
124 ,
125 s if s.matches("availabilityZone") => {
126 let var_10 =
127 Some(
128 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
129 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
130 .into()
131 )
132 ?
133 )
134 ;
135 builder = builder.set_availability_zone(var_10);
136 }
137 ,
138 s if s.matches("createdAt") => {
139 let var_11 =
140 Some(
141 ::aws_smithy_types::DateTime::from_str(
142 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
143 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
144 )
145 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
146 ?
147 )
148 ;
149 builder = builder.set_created_at(var_11);
150 }
151 ,
152 s if s.matches("subnetId") => {
153 let var_12 =
154 Some(
155 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
156 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
157 .into()
158 )
159 ?
160 )
161 ;
162 builder = builder.set_subnet_id(var_12);
163 }
164 ,
165 s if s.matches("preserveClientIp") => {
166 let var_13 =
167 Some(
168 {
169 <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
170 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
171 )
172 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
173 }
174 ?
175 )
176 ;
177 builder = builder.set_preserve_client_ip(var_13);
178 }
179 ,
180 s if s.matches("securityGroupIdSet") => {
181 let var_14 =
182 Some(
183 crate::protocol_serde::shape_security_group_id_set::de_security_group_id_set(&mut tag)
184 ?
185 )
186 ;
187 builder = builder.set_security_group_ids(var_14);
188 }
189 ,
190 s if s.matches("tagSet") => {
191 let var_15 =
192 Some(
193 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
194 ?
195 )
196 ;
197 builder = builder.set_tags(var_15);
198 }
199 ,
200 s if s.matches("ipAddressType") => {
201 let var_16 =
202 Some(
203 Result::<crate::types::IpAddressType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
204 crate::types::IpAddressType::from(
205 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
206 )
207 )
208 ?
209 )
210 ;
211 builder = builder.set_ip_address_type(var_16);
212 }
213 ,
214 s if s.matches("publicDnsNames") => {
215 let var_17 =
216 Some(
217 crate::protocol_serde::shape_instance_connect_endpoint_public_dns_names::de_instance_connect_endpoint_public_dns_names(&mut tag)
218 ?
219 )
220 ;
221 builder = builder.set_public_dns_names(var_17);
222 }
223 ,
224 _ => {}
225 }
226 }
227 Ok(builder.build())
228}