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 + | /* AwsQueryParserGenerator.kt:38 */
|
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 | }
|
47 67 | if let Some(mut result_tag) = decoder.next_tag() {
|
48 68 | let start_el = result_tag.start_el();
|
49 69 | if !(start_el.matches("XmlTimestampsResult")) {
|
50 70 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
51 71 | "invalid result, expected XmlTimestampsResult got {:?}",
|
52 72 | start_el
|
53 73 | )));
|
54 74 | }
|
75 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
55 76 | while let Some(mut tag) = result_tag.next_tag() {
|
77 + | /* XmlBindingTraitParserGenerator.kt:353 */
|
56 78 | match tag.start_el() {
|
57 - | s if s.matches("normal") /* normal aws.protocoltests.query.synthetic#XmlTimestampsOutput$normal */ => {
|
58 - | let var_1 =
|
59 - | Some(
|
60 - | ::aws_smithy_types::DateTime::from_str(
|
61 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
62 - | , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
63 - | )
|
64 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
65 - | ?
|
66 - | )
|
67 - | ;
|
68 - | builder = builder.set_normal(var_1);
|
69 - | }
|
79 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("normal") /* normal aws.protocoltests.query.synthetic#XmlTimestampsOutput$normal */ => {
|
80 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
|
81 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
82 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
83 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
84 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
85 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
86 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
87 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
88 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
89 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
90 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_normal(var_1);
|
91 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
70 92 | ,
|
71 - | s if s.matches("dateTime") /* dateTime aws.protocoltests.query.synthetic#XmlTimestampsOutput$dateTime */ => {
|
72 - | let var_2 =
|
73 - | Some(
|
74 - | ::aws_smithy_types::DateTime::from_str(
|
75 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
76 - | , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
77 - | )
|
78 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
79 - | ?
|
80 - | )
|
81 - | ;
|
82 - | builder = builder.set_date_time(var_2);
|
83 - | }
|
93 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("dateTime") /* dateTime aws.protocoltests.query.synthetic#XmlTimestampsOutput$dateTime */ => {
|
94 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
|
95 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
96 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
97 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
98 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
99 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
100 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
101 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
102 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
103 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
104 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_date_time(var_2);
|
105 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
84 106 | ,
|
85 - | s if s.matches("dateTimeOnTarget") /* dateTimeOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$dateTimeOnTarget */ => {
|
86 - | let var_3 =
|
87 - | Some(
|
88 - | ::aws_smithy_types::DateTime::from_str(
|
89 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
90 - | , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
91 - | )
|
92 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#DateTime`)"))
|
93 - | ?
|
94 - | )
|
95 - | ;
|
96 - | builder = builder.set_date_time_on_target(var_3);
|
97 - | }
|
107 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("dateTimeOnTarget") /* dateTimeOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$dateTimeOnTarget */ => {
|
108 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_3 =
|
109 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
110 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
111 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
112 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
|
113 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
114 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#DateTime`)"))
|
115 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
116 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
117 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
118 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_date_time_on_target(var_3);
|
119 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
98 120 | ,
|
99 - | s if s.matches("epochSeconds") /* epochSeconds aws.protocoltests.query.synthetic#XmlTimestampsOutput$epochSeconds */ => {
|
100 - | let var_4 =
|
101 - | Some(
|
102 - | ::aws_smithy_types::DateTime::from_str(
|
103 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
104 - | , ::aws_smithy_types::date_time::Format::EpochSeconds
|
105 - | )
|
106 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
107 - | ?
|
108 - | )
|
109 - | ;
|
110 - | builder = builder.set_epoch_seconds(var_4);
|
111 - | }
|
121 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("epochSeconds") /* epochSeconds aws.protocoltests.query.synthetic#XmlTimestampsOutput$epochSeconds */ => {
|
122 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_4 =
|
123 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
124 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
125 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
126 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::EpochSeconds
|
127 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
128 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
129 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
130 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
131 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
132 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_epoch_seconds(var_4);
|
133 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
112 134 | ,
|
113 - | s if s.matches("epochSecondsOnTarget") /* epochSecondsOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$epochSecondsOnTarget */ => {
|
114 - | let var_5 =
|
115 - | Some(
|
116 - | ::aws_smithy_types::DateTime::from_str(
|
117 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
118 - | , ::aws_smithy_types::date_time::Format::EpochSeconds
|
119 - | )
|
120 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#EpochSeconds`)"))
|
121 - | ?
|
122 - | )
|
123 - | ;
|
124 - | builder = builder.set_epoch_seconds_on_target(var_5);
|
125 - | }
|
135 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("epochSecondsOnTarget") /* epochSecondsOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$epochSecondsOnTarget */ => {
|
136 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_5 =
|
137 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
138 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
139 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
140 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::EpochSeconds
|
141 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
142 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#EpochSeconds`)"))
|
143 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
144 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
145 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
146 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_epoch_seconds_on_target(var_5);
|
147 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
126 148 | ,
|
127 - | s if s.matches("httpDate") /* httpDate aws.protocoltests.query.synthetic#XmlTimestampsOutput$httpDate */ => {
|
128 - | let var_6 =
|
129 - | Some(
|
130 - | ::aws_smithy_types::DateTime::from_str(
|
131 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
132 - | , ::aws_smithy_types::date_time::Format::HttpDate
|
133 - | )
|
134 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
135 - | ?
|
136 - | )
|
137 - | ;
|
138 - | builder = builder.set_http_date(var_6);
|
139 - | }
|
149 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("httpDate") /* httpDate aws.protocoltests.query.synthetic#XmlTimestampsOutput$httpDate */ => {
|
150 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_6 =
|
151 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
152 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
153 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
154 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::HttpDate
|
155 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
156 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `smithy.api#Timestamp`)"))
|
157 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
158 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
159 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
160 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_http_date(var_6);
|
161 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
140 162 | ,
|
141 - | s if s.matches("httpDateOnTarget") /* httpDateOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$httpDateOnTarget */ => {
|
142 - | let var_7 =
|
143 - | Some(
|
144 - | ::aws_smithy_types::DateTime::from_str(
|
145 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
146 - | , ::aws_smithy_types::date_time::Format::HttpDate
|
147 - | )
|
148 - | .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#HttpDate`)"))
|
149 - | ?
|
150 - | )
|
151 - | ;
|
152 - | builder = builder.set_http_date_on_target(var_7);
|
153 - | }
|
163 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("httpDateOnTarget") /* httpDateOnTarget aws.protocoltests.query.synthetic#XmlTimestampsOutput$httpDateOnTarget */ => {
|
164 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_7 =
|
165 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
166 + | /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
|
167 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
168 + | /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::HttpDate
|
169 + | /* XmlBindingTraitParserGenerator.kt:701 */)
|
170 + | /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#HttpDate`)"))
|
171 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
172 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
173 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
174 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_http_date_on_target(var_7);
|
175 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
154 176 | ,
|
155 - | _ => {}
|
156 - | }
|
177 + | /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
|
178 + | /* XmlBindingTraitParserGenerator.kt:353 */}
|
179 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
157 180 | }
|
181 + | /* AwsQueryParserGenerator.kt:52 */
|
158 182 | } else {
|
159 183 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("expected XmlTimestampsResult tag"));
|
160 184 | };
|
185 + | /* XmlBindingTraitParserGenerator.kt:213 */
|
161 186 | Ok(builder)
|
187 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
162 188 | }
|