1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(clippy::unnecessary_wraps)]
|
3 3 | pub async fn de_greeting_with_errors_http_request<B>(
|
4 - | #[allow(unused_variables)] request: ::http::Request<B>,
|
4 + | #[allow(unused_variables)] request: ::http_1x::Request<B>,
|
5 5 | ) -> std::result::Result<
|
6 6 | crate::input::GreetingWithErrorsInput,
|
7 7 | ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
|
8 8 | >
|
9 9 | where
|
10 10 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
11 11 | B::Data: Send,
|
12 12 | ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
|
13 13 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
14 14 | {
|
15 15 | Ok({
|
16 16 | #[allow(unused_mut)]
|
17 17 | let mut input = crate::input::greeting_with_errors_input::Builder::default();
|
18 18 | #[allow(unused_variables)]
|
19 19 | let ::aws_smithy_runtime_api::http::RequestParts {
|
20 20 | uri, headers, body, ..
|
21 21 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
22 22 | input.build()
|
23 23 | })
|
24 24 | }
|
25 25 |
|
26 26 | #[allow(clippy::unnecessary_wraps)]
|
27 27 | pub fn ser_greeting_with_errors_http_response(
|
28 28 | #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
|
29 29 | ) -> std::result::Result<
|
30 30 | ::aws_smithy_http_server::response::Response,
|
31 31 | ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
|
32 32 | > {
|
33 33 | Ok({
|
34 34 | #[allow(unused_mut)]
|
35 - | let mut builder = ::http::Response::builder();
|
35 + | let mut builder = ::http_1x::Response::builder();
|
36 36 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
37 37 | builder,
|
38 - | ::http::header::CONTENT_TYPE,
|
38 + | ::http_1x::header::CONTENT_TYPE,
|
39 39 | "application/x-amz-json-1.1",
|
40 40 | );
|
41 41 | let http_status: u16 = 200;
|
42 42 | builder = builder.status(http_status);
|
43 43 | let payload =
|
44 44 | crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
|
45 45 | ;
|
46 46 | let content_length = payload.len();
|
47 47 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
48 48 | builder,
|
49 - | ::http::header::CONTENT_LENGTH,
|
49 + | ::http_1x::header::CONTENT_LENGTH,
|
50 50 | content_length,
|
51 51 | );
|
52 52 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
53 53 | builder.body(body)?
|
54 54 | })
|
55 55 | }
|
56 56 |
|
57 57 | #[allow(clippy::unnecessary_wraps)]
|
58 58 | pub fn ser_greeting_with_errors_http_error(
|
59 59 | error: &crate::error::GreetingWithErrorsError,
|
60 60 | ) -> std::result::Result<
|
61 61 | ::aws_smithy_http_server::response::Response,
|
62 62 | ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
|
63 63 | > {
|
64 64 | Ok({
|
65 65 | match error {
|
66 66 | crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
|
67 67 | let payload =
|
68 68 | crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
|
69 69 | output,
|
70 70 | )?;
|
71 71 | #[allow(unused_mut)]
|
72 - | let mut builder = ::http::Response::builder();
|
72 + | let mut builder = ::http_1x::Response::builder();
|
73 73 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
74 74 | builder,
|
75 - | ::http::header::CONTENT_TYPE,
|
75 + | ::http_1x::header::CONTENT_TYPE,
|
76 76 | "application/x-amz-json-1.1",
|
77 77 | );
|
78 78 | let content_length = payload.len();
|
79 79 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
80 80 | builder,
|
81 - | ::http::header::CONTENT_LENGTH,
|
81 + | ::http_1x::header::CONTENT_LENGTH,
|
82 82 | content_length,
|
83 83 | );
|
84 84 | builder
|
85 85 | .status(400)
|
86 86 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
87 87 | }
|
88 88 | crate::error::GreetingWithErrorsError::ComplexError(output) => {
|
89 89 | let payload =
|
90 90 | crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
|
91 91 | #[allow(unused_mut)]
|
92 - | let mut builder = ::http::Response::builder();
|
92 + | let mut builder = ::http_1x::Response::builder();
|
93 93 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
94 94 | builder,
|
95 - | ::http::header::CONTENT_TYPE,
|
95 + | ::http_1x::header::CONTENT_TYPE,
|
96 96 | "application/x-amz-json-1.1",
|
97 97 | );
|
98 98 | let content_length = payload.len();
|
99 99 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
100 100 | builder,
|
101 - | ::http::header::CONTENT_LENGTH,
|
101 + | ::http_1x::header::CONTENT_LENGTH,
|
102 102 | content_length,
|
103 103 | );
|
104 104 | builder
|
105 105 | .status(400)
|
106 106 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
107 107 | }
|
108 108 | crate::error::GreetingWithErrorsError::FooError(output) => {
|
109 109 | let payload = crate::protocol_serde::shape_foo_error::ser_foo_error_error(output)?;
|
110 110 | #[allow(unused_mut)]
|
111 - | let mut builder = ::http::Response::builder();
|
111 + | let mut builder = ::http_1x::Response::builder();
|
112 112 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
113 113 | builder,
|
114 - | ::http::header::CONTENT_TYPE,
|
114 + | ::http_1x::header::CONTENT_TYPE,
|
115 115 | "application/x-amz-json-1.1",
|
116 116 | );
|
117 117 | let content_length = payload.len();
|
118 118 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
119 119 | builder,
|
120 - | ::http::header::CONTENT_LENGTH,
|
120 + | ::http_1x::header::CONTENT_LENGTH,
|
121 121 | content_length,
|
122 122 | );
|
123 123 | builder
|
124 124 | .status(500)
|
125 125 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
126 126 | }
|
127 127 | }
|
128 128 | })
|
129 129 | }
|