aws_sdk_ec2/protocol_serde/
shape_vpc_endpoint_connection.rs1#[allow(clippy::needless_question_mark)]
3pub fn de_vpc_endpoint_connection(
4 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
5) -> ::std::result::Result<crate::types::VpcEndpointConnection, ::aws_smithy_xml::decode::XmlDecodeError> {
6 #[allow(unused_mut)]
7 let mut builder = crate::types::VpcEndpointConnection::builder();
8 while let Some(mut tag) = decoder.next_tag() {
9 match tag.start_el() {
10 s if s.matches("serviceId") => {
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_service_id(var_1);
21 }
22 ,
23 s if s.matches("vpcEndpointId") => {
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_endpoint_id(var_2);
34 }
35 ,
36 s if s.matches("vpcEndpointOwner") => {
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_vpc_endpoint_owner(var_3);
47 }
48 ,
49 s if s.matches("vpcEndpointState") => {
50 let var_4 =
51 Some(
52 Result::<crate::types::State, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
53 crate::types::State::from(
54 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
55 )
56 )
57 ?
58 )
59 ;
60 builder = builder.set_vpc_endpoint_state(var_4);
61 }
62 ,
63 s if s.matches("creationTimestamp") => {
64 let var_5 =
65 Some(
66 ::aws_smithy_types::DateTime::from_str(
67 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
68 , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
69 )
70 .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#MillisecondDateTime`)"))
71 ?
72 )
73 ;
74 builder = builder.set_creation_timestamp(var_5);
75 }
76 ,
77 s if s.matches("dnsEntrySet") => {
78 let var_6 =
79 Some(
80 crate::protocol_serde::shape_dns_entry_set::de_dns_entry_set(&mut tag)
81 ?
82 )
83 ;
84 builder = builder.set_dns_entries(var_6);
85 }
86 ,
87 s if s.matches("networkLoadBalancerArnSet") => {
88 let var_7 =
89 Some(
90 crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
91 ?
92 )
93 ;
94 builder = builder.set_network_load_balancer_arns(var_7);
95 }
96 ,
97 s if s.matches("gatewayLoadBalancerArnSet") => {
98 let var_8 =
99 Some(
100 crate::protocol_serde::shape_value_string_list::de_value_string_list(&mut tag)
101 ?
102 )
103 ;
104 builder = builder.set_gateway_load_balancer_arns(var_8);
105 }
106 ,
107 s if s.matches("ipAddressType") => {
108 let var_9 =
109 Some(
110 Result::<crate::types::IpAddressType, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
111 crate::types::IpAddressType::from(
112 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
113 )
114 )
115 ?
116 )
117 ;
118 builder = builder.set_ip_address_type(var_9);
119 }
120 ,
121 s if s.matches("vpcEndpointConnectionId") => {
122 let var_10 =
123 Some(
124 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
125 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
126 .into()
127 )
128 ?
129 )
130 ;
131 builder = builder.set_vpc_endpoint_connection_id(var_10);
132 }
133 ,
134 s if s.matches("tagSet") => {
135 let var_11 =
136 Some(
137 crate::protocol_serde::shape_tag_list::de_tag_list(&mut tag)
138 ?
139 )
140 ;
141 builder = builder.set_tags(var_11);
142 }
143 ,
144 s if s.matches("vpcEndpointRegion") => {
145 let var_12 =
146 Some(
147 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
148 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
149 .into()
150 )
151 ?
152 )
153 ;
154 builder = builder.set_vpc_endpoint_region(var_12);
155 }
156 ,
157 _ => {}
158 }
159 }
160 Ok(builder.build())
161}