24 24 | }
|
25 25 |
|
26 26 | impl<B>
|
27 27 | ::aws_smithy_http_server::request::FromRequest<
|
28 28 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
29 29 | B,
|
30 30 | > for crate::input::GetPokemonSpeciesInput
|
31 31 | where
|
32 32 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
33 33 | B: 'static,
|
34 34 |
|
35 35 | B::Data: Send,
|
36 36 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
37 37 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
38 38 | {
|
39 39 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
40 40 | type Future = GetPokemonSpeciesInputFuture;
|
41 41 |
|
42 42 | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
43 43 | let fut = async move {
|
44 44 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
45 45 | request.headers(),
|
46 46 | &CONTENT_TYPE_GETPOKEMONSPECIES,
|
47 47 | ) {
|
48 48 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
49 49 | }
|
50 50 | crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_request(
|
51 51 | request,
|
52 52 | )
|
53 53 | .await
|
54 - | .map_err(Into::into)
|
55 54 | };
|
56 55 | use ::futures_util::future::TryFutureExt;
|
57 56 | let fut = fut.map_err(
|
58 57 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
59 58 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
60 59 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
61 60 | e,
|
62 61 | )
|
63 62 | },
|
64 63 | );
|
65 64 | GetPokemonSpeciesInputFuture {
|
66 65 | inner: Box::pin(fut),
|
67 66 | }
|
68 67 | }
|
69 68 | }
|
70 69 | impl
|
71 70 | ::aws_smithy_http_server::response::IntoResponse<
|
72 71 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
73 72 | > for crate::output::GetPokemonSpeciesOutput
|
74 73 | {
|
75 74 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
76 75 | match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_response(self) {
|
77 76 | Ok(response) => response,
|
78 77 | Err(e) => {
|
79 78 | ::tracing::error!(error = %e, "failed to serialize response");
|
80 79 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
81 80 | }
|
82 81 | }
|
83 82 | }
|
84 83 | }
|
126 125 | ) -> std::task::Poll<Self::Output> {
|
127 126 | let this = self.project();
|
128 127 | this.inner.as_mut().poll(cx)
|
129 128 | }
|
130 129 | }
|
131 130 |
|
132 131 | impl<B>
|
133 132 | ::aws_smithy_http_server::request::FromRequest<
|
134 133 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
135 134 | B,
|
136 135 | > for crate::input::CheckHealthInput
|
137 136 | where
|
138 137 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
139 138 | B: 'static,
|
140 139 |
|
141 140 | B::Data: Send,
|
142 141 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
143 142 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
144 143 | {
|
145 144 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
146 145 | type Future = CheckHealthInputFuture;
|
147 146 |
|
148 147 | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
149 148 | let fut = async move {
|
150 149 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
151 150 | request.headers(),
|
152 151 | &CONTENT_TYPE_CHECKHEALTH,
|
153 152 | ) {
|
154 153 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
155 154 | }
|
156 - | crate::protocol_serde::shape_check_health::de_check_health_http_request(request)
|
157 - | .await
|
158 - | .map_err(Into::into)
|
155 + | crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
|
159 156 | };
|
160 157 | use ::futures_util::future::TryFutureExt;
|
161 158 | let fut = fut.map_err(
|
162 159 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
163 160 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
164 161 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
165 162 | e,
|
166 163 | )
|
167 164 | },
|
168 165 | );
|
169 166 | CheckHealthInputFuture {
|
170 167 | inner: Box::pin(fut),
|
171 168 | }
|
172 169 | }
|
173 170 | }
|
174 171 | impl
|
175 172 | ::aws_smithy_http_server::response::IntoResponse<
|
176 173 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
177 174 | > for crate::output::CheckHealthOutput
|
178 175 | {
|
179 176 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
180 177 | match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
|
181 178 | Ok(response) => response,
|
182 179 | Err(e) => {
|
183 180 | ::tracing::error!(error = %e, "failed to serialize response");
|
184 181 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
185 182 | }
|
186 183 | }
|
187 184 | }
|
188 185 | }
|
228 225 | ) -> std::task::Poll<Self::Output> {
|
229 226 | let this = self.project();
|
230 227 | this.inner.as_mut().poll(cx)
|
231 228 | }
|
232 229 | }
|
233 230 |
|
234 231 | impl<B>
|
235 232 | ::aws_smithy_http_server::request::FromRequest<
|
236 233 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
237 234 | B,
|
238 235 | > for crate::input::DoNothingInput
|
239 236 | where
|
240 237 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
241 238 | B: 'static,
|
242 239 |
|
243 240 | B::Data: Send,
|
244 241 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
245 242 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
246 243 | {
|
247 244 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
248 245 | type Future = DoNothingInputFuture;
|
249 246 |
|
250 247 | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
251 248 | let fut = async move {
|
252 249 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
253 250 | request.headers(),
|
254 251 | &CONTENT_TYPE_DONOTHING,
|
255 252 | ) {
|
256 253 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
257 254 | }
|
258 - | crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request)
|
259 - | .await
|
260 - | .map_err(Into::into)
|
255 + | crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
|
261 256 | };
|
262 257 | use ::futures_util::future::TryFutureExt;
|
263 258 | let fut = fut.map_err(
|
264 259 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
265 260 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
266 261 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
267 262 | e,
|
268 263 | )
|
269 264 | },
|
270 265 | );
|
271 266 | DoNothingInputFuture {
|
272 267 | inner: Box::pin(fut),
|
273 268 | }
|
274 269 | }
|
275 270 | }
|
276 271 | impl
|
277 272 | ::aws_smithy_http_server::response::IntoResponse<
|
278 273 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
279 274 | > for crate::output::DoNothingOutput
|
280 275 | {
|
281 276 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
282 277 | match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
|
283 278 | Ok(response) => response,
|
284 279 | Err(e) => {
|
285 280 | ::tracing::error!(error = %e, "failed to serialize response");
|
286 281 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
287 282 | }
|
288 283 | }
|
289 284 | }
|
290 285 | }
|
332 327 | this.inner.as_mut().poll(cx)
|
333 328 | }
|
334 329 | }
|
335 330 |
|
336 331 | impl<B>
|
337 332 | ::aws_smithy_http_server::request::FromRequest<
|
338 333 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
339 334 | B,
|
340 335 | > for crate::input::GetServerStatisticsInput
|
341 336 | where
|
342 337 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
343 338 | B: 'static,
|
344 339 |
|
345 340 | B::Data: Send,
|
346 341 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
347 342 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
348 343 | {
|
349 344 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
350 345 | type Future = GetServerStatisticsInputFuture;
|
351 346 |
|
352 347 | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
353 348 | let fut = async move {
|
354 349 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
355 350 | request.headers(),
|
356 351 | &CONTENT_TYPE_GETSERVERSTATISTICS,
|
357 352 | ) {
|
358 353 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
359 354 | }
|
360 355 | crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
|
361 356 | .await
|
362 - | .map_err(Into::into)
|
363 357 | };
|
364 358 | use ::futures_util::future::TryFutureExt;
|
365 359 | let fut = fut.map_err(
|
366 360 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
367 361 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
368 362 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
369 363 | e,
|
370 364 | )
|
371 365 | },
|
372 366 | );
|
373 367 | GetServerStatisticsInputFuture {
|
374 368 | inner: Box::pin(fut),
|
375 369 | }
|
376 370 | }
|
377 371 | }
|
378 372 | impl
|
379 373 | ::aws_smithy_http_server::response::IntoResponse<
|
380 374 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
381 375 | > for crate::output::GetServerStatisticsOutput
|
382 376 | {
|
383 377 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
384 378 | match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
|
385 379 | Ok(response) => response,
|
386 380 | Err(e) => {
|
387 381 | ::tracing::error!(error = %e, "failed to serialize response");
|
388 382 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
389 383 | }
|
390 384 | }
|
391 385 | }
|
392 386 | }
|