1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_xml_timestamps_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<crate::operation::xml_timestamps::XmlTimestampsOutput, crate::operation::xml_timestamps::XmlTimestampsError> {
|
10 + | /* RustType.kt:516 */
|
8 11 | #[allow(unused_mut)]
|
12 + | /* ProtocolParserGenerator.kt:106 */
|
9 13 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 14 | .map_err(crate::operation::xml_timestamps::XmlTimestampsError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:185 */
|
12 18 | Err(crate::operation::xml_timestamps::XmlTimestampsError::generic(generic))
|
19 + | /* ProtocolParserGenerator.kt:99 */
|
13 20 | }
|
14 21 |
|
22 + | /* RustType.kt:516 */
|
15 23 | #[allow(clippy::unnecessary_wraps)]
|
24 + | /* ProtocolParserGenerator.kt:71 */
|
16 25 | pub fn de_xml_timestamps_http_response(
|
17 26 | _response_status: u16,
|
18 27 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
19 28 | _response_body: &[u8],
|
20 29 | ) -> std::result::Result<crate::operation::xml_timestamps::XmlTimestampsOutput, crate::operation::xml_timestamps::XmlTimestampsError> {
|
30 + | /* ProtocolParserGenerator.kt:77 */
|
21 31 | Ok({
|
32 + | /* RustType.kt:516 */
|
22 33 | #[allow(unused_mut)]
|
34 + | /* ProtocolParserGenerator.kt:240 */
|
23 35 | let mut output = crate::operation::xml_timestamps::builders::XmlTimestampsOutputBuilder::default();
|
36 + | /* ProtocolParserGenerator.kt:247 */
|
24 37 | output = crate::protocol_serde::shape_xml_timestamps::de_xml_timestamps(_response_body, output)
|
25 38 | .map_err(crate::operation::xml_timestamps::XmlTimestampsError::unhandled)?;
|
39 + | /* ClientBuilderInstantiator.kt:56 */
|
26 40 | output.build()
|
41 + | /* ProtocolParserGenerator.kt:77 */
|
27 42 | })
|
43 + | /* ProtocolParserGenerator.kt:71 */
|
28 44 | }
|
29 45 |
|
46 + | /* RustType.kt:516 */
|
30 47 | #[allow(unused_mut)]
|
48 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
31 49 | pub fn de_xml_timestamps(
|
32 50 | inp: &[u8],
|
33 51 | mut builder: crate::operation::xml_timestamps::builders::XmlTimestampsOutputBuilder,
|
34 52 | ) -> std::result::Result<crate::operation::xml_timestamps::builders::XmlTimestampsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
53 + | /* XmlBindingTraitParserGenerator.kt:194 */
|
35 54 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
36 55 |
|
37 56 | #[allow(unused_mut)]
|
38 57 | let mut decoder = doc.root_element()?;
|
39 58 | #[allow(unused_variables)]
|
40 59 | let start_el = decoder.start_el();
|
60 + | /* Ec2QueryParserGenerator.kt:35 */
|
41 61 | if !(start_el.matches("XmlTimestampsResponse")) {
|
42 62 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
43 63 | "invalid root, expected XmlTimestampsResponse got {:?}",
|
44 64 | start_el
|
45 65 | )));
|
46 66 | }
|
67 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
47 68 | while let Some(mut tag) = decoder.next_tag() {
|
69 + | /* XmlBindingTraitParserGenerator.kt:353 */
|
48 70 | match tag.start_el() {
|
49 - | s if s.matches("normal") /* normal aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$normal */ => {
|
50 - | let var_1 =
|
51 - | Some(
|
52 - | ::aws_smithy_types::DateTime::from_str(
|
53 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
54 - | , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
55 - | )
|
56 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
57 - | ?
|
58 - | )
|
59 - | ;
|
60 - | builder = builder.set_normal(var_1);
|
61 - | }
|
71 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("normal") /* normal aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$normal */ => {
|
72 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
|
73 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
74 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
75 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
76 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
77 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
78 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
79 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
80 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
81 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
82 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_normal(var_1);
|
83 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
62 84 | ,
|
63 - | s if s.matches("dateTime") /* dateTime aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$dateTime */ => {
|
64 - | let var_2 =
|
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: `smithy.api#Timestamp`)"))
|
71 - | ?
|
72 - | )
|
73 - | ;
|
74 - | builder = builder.set_date_time(var_2);
|
75 - | }
|
85 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("dateTime") /* dateTime aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$dateTime */ => {
|
86 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
|
87 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
88 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
89 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
90 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
91 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
92 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
93 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
94 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
95 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
96 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_date_time(var_2);
|
97 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
76 98 | ,
|
77 - | s if s.matches("dateTimeOnTarget") /* dateTimeOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$dateTimeOnTarget */ => {
|
78 - | let var_3 =
|
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: `aws.protocoltests.shared#DateTime`)"))
|
85 - | ?
|
86 - | )
|
87 - | ;
|
88 - | builder = builder.set_date_time_on_target(var_3);
|
89 - | }
|
99 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("dateTimeOnTarget") /* dateTimeOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$dateTimeOnTarget */ => {
|
100 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_3 =
|
101 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
102 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
103 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
104 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
105 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
106 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#DateTime`)"))
|
107 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
108 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
109 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
110 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_date_time_on_target(var_3);
|
111 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
90 112 | ,
|
91 - | s if s.matches("epochSeconds") /* epochSeconds aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$epochSeconds */ => {
|
92 - | let var_4 =
|
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::EpochSeconds
|
97 - | )
|
98 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
99 - | ?
|
100 - | )
|
101 - | ;
|
102 - | builder = builder.set_epoch_seconds(var_4);
|
103 - | }
|
113 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("epochSeconds") /* epochSeconds aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$epochSeconds */ => {
|
114 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_4 =
|
115 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
116 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
117 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
118 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::EpochSeconds
|
119 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
120 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
121 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
122 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
123 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
124 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_epoch_seconds(var_4);
|
125 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
104 126 | ,
|
105 - | s if s.matches("epochSecondsOnTarget") /* epochSecondsOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$epochSecondsOnTarget */ => {
|
106 - | let var_5 =
|
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::EpochSeconds
|
111 - | )
|
112 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#EpochSeconds`)"))
|
113 - | ?
|
114 - | )
|
115 - | ;
|
116 - | builder = builder.set_epoch_seconds_on_target(var_5);
|
117 - | }
|
127 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("epochSecondsOnTarget") /* epochSecondsOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$epochSecondsOnTarget */ => {
|
128 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_5 =
|
129 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
130 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
131 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
132 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::EpochSeconds
|
133 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
134 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#EpochSeconds`)"))
|
135 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
136 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
137 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
138 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_epoch_seconds_on_target(var_5);
|
139 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
118 140 | ,
|
119 - | s if s.matches("httpDate") /* httpDate aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$httpDate */ => {
|
120 - | let var_6 =
|
121 - | Some(
|
122 - | ::aws_smithy_types::DateTime::from_str(
|
123 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
124 - | , ::aws_smithy_types::date_time::Format::HttpDate
|
125 - | )
|
126 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
127 - | ?
|
128 - | )
|
129 - | ;
|
130 - | builder = builder.set_http_date(var_6);
|
131 - | }
|
141 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("httpDate") /* httpDate aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$httpDate */ => {
|
142 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_6 =
|
143 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
144 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
145 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
146 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::HttpDate
|
147 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
148 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
149 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
150 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
151 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
152 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_http_date(var_6);
|
153 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
132 154 | ,
|
133 - | s if s.matches("httpDateOnTarget") /* httpDateOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$httpDateOnTarget */ => {
|
134 - | let var_7 =
|
135 - | Some(
|
136 - | ::aws_smithy_types::DateTime::from_str(
|
137 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
138 - | , ::aws_smithy_types::date_time::Format::HttpDate
|
139 - | )
|
140 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#HttpDate`)"))
|
141 - | ?
|
142 - | )
|
143 - | ;
|
144 - | builder = builder.set_http_date_on_target(var_7);
|
145 - | }
|
155 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("httpDateOnTarget") /* httpDateOnTarget aws.protocoltests.ec2.synthetic#XmlTimestampsOutput$httpDateOnTarget */ => {
|
156 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_7 =
|
157 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
158 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
159 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
160 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::HttpDate
|
161 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
162 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#HttpDate`)"))
|
163 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
164 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
165 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
166 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_http_date_on_target(var_7);
|
167 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
146 168 | ,
|
147 - | _ => {}
|
148 - | }
|
169 + | /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
|
170 + | /* XmlBindingTraitParserGenerator.kt:353 */}
|
171 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
149 172 | }
|
173 + | /* XmlBindingTraitParserGenerator.kt:213 */
|
150 174 | Ok(builder)
|
175 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
151 176 | }
|