1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:534 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
3 5 | pub async fn de_http_checksum_required_http_request<B>(
|
4 - | #[allow(unused_variables)] request: ::http::Request<B>,
|
6 + | #[allow(unused_variables)] request: ::http_1x::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::HttpChecksumRequiredInput,
|
7 9 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
8 10 | >
|
9 11 | where
|
10 12 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
11 13 | B::Data: Send,
|
12 14 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
13 15 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
14 16 | {
|
17 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
15 18 | Ok({
|
19 + | /* RustType.kt:534 */
|
16 20 | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:759 */
|
17 22 | let mut input = crate::input::http_checksum_required_input::Builder::default();
|
23 + | /* RustType.kt:534 */
|
18 24 | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:764 */
|
19 26 | let ::aws_smithy_runtime_api::http::RequestParts {
|
20 27 | uri, headers, body, ..
|
21 28 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
22 - | let bytes = ::hyper::body::to_bytes(body).await?;
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:789 */
|
30 + | let bytes = {
|
31 + | use ::http_body_util::BodyExt;
|
32 + | body.collect().await?.to_bytes()
|
33 + | };
|
34 + | /* ServerHttpBoundProtocolGenerator.kt:825 */
|
23 35 | if !bytes.is_empty() {
|
36 + | /* ServerHttpBoundProtocolGenerator.kt:826 */
|
24 37 | ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
|
25 38 | &headers,
|
26 39 | Some("application/json"),
|
27 40 | )?;
|
28 41 | input = crate::protocol_serde::shape_http_checksum_required::de_http_checksum_required(
|
29 42 | bytes.as_ref(),
|
30 43 | input,
|
31 44 | )?;
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:825 */
|
32 46 | }
|
47 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
33 48 | input.build()
|
49 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
34 50 | })
|
51 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
35 52 | }
|
36 53 |
|
54 + | /* RustType.kt:534 */
|
37 55 | #[allow(clippy::unnecessary_wraps)]
|
56 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
38 57 | pub fn ser_http_checksum_required_http_response(
|
39 58 | #[allow(unused_variables)] output: crate::output::HttpChecksumRequiredOutput,
|
40 59 | ) -> std::result::Result<
|
41 60 | ::aws_smithy_http_server::response::Response,
|
42 61 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
43 62 | > {
|
63 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
44 64 | Ok({
|
65 + | /* RustType.kt:534 */
|
45 66 | #[allow(unused_mut)]
|
46 - | let mut builder = ::http::Response::builder();
|
67 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
68 + | let mut builder = ::http_1x::Response::builder();
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
47 70 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
48 71 | builder,
|
49 - | ::http::header::CONTENT_TYPE,
|
72 + | ::http_1x::header::CONTENT_TYPE,
|
50 73 | "application/json",
|
51 74 | );
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
52 76 | let http_status: u16 = 200;
|
53 77 | builder = builder.status(http_status);
|
78 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
54 79 | let payload =
|
55 - | crate::protocol_serde::shape_http_checksum_required_output::ser_http_checksum_required_output_output_output(&output)?
|
56 - | ;
|
80 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_http_checksum_required_output::ser_http_checksum_required_output_output_output(&output)?
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
82 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
57 83 | let content_length = payload.len();
|
58 84 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
59 85 | builder,
|
60 - | ::http::header::CONTENT_LENGTH,
|
86 + | ::http_1x::header::CONTENT_LENGTH,
|
61 87 | content_length,
|
62 88 | );
|
89 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
63 90 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
91 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
64 92 | builder.body(body)?
|
93 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
65 94 | })
|
95 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
66 96 | }
|
67 97 |
|
98 + | /* JsonParserGenerator.kt:148 */
|
68 99 | pub(crate) fn de_http_checksum_required(
|
69 100 | value: &[u8],
|
70 101 | mut builder: crate::input::http_checksum_required_input::Builder,
|
71 102 | ) -> ::std::result::Result<
|
72 103 | crate::input::http_checksum_required_input::Builder,
|
73 104 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
74 105 | > {
|
106 + | /* JsonParserGenerator.kt:153 */
|
75 107 | let mut tokens_owned =
|
76 108 | ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
|
77 109 | .peekable();
|
78 110 | let tokens = &mut tokens_owned;
|
79 111 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
112 + | /* JsonParserGenerator.kt:684 */
|
80 113 | loop {
|
114 + | /* JsonParserGenerator.kt:685 */
|
81 115 | match tokens.next().transpose()? {
|
116 + | /* JsonParserGenerator.kt:686 */
|
82 117 | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
83 118 | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
119 + | /* JsonParserGenerator.kt:260 */
|
84 120 | match key.to_unescaped()?.as_ref() {
|
121 + | /* JsonParserGenerator.kt:262 */
|
85 122 | "foo" => {
|
123 + | /* JsonParserGenerator.kt:272 */
|
86 124 | builder = builder.set_foo(
|
125 + | /* JsonParserGenerator.kt:354 */
|
87 126 | ::aws_smithy_json::deserialize::token::expect_string_or_null(
|
88 127 | tokens.next(),
|
89 128 | )?
|
90 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
91 - | .transpose()?,
|
129 + | .map(|s|
|
130 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
131 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
132 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
133 + | .transpose()?, /* JsonParserGenerator.kt:272 */
|
92 134 | );
|
135 + | /* JsonParserGenerator.kt:262 */
|
93 136 | }
|
94 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
137 + | /* JsonParserGenerator.kt:290 */
|
138 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
95 139 | }
|
140 + | /* JsonParserGenerator.kt:686 */
|
96 141 | }
|
142 + | /* JsonParserGenerator.kt:695 */
|
97 143 | other => {
|
98 144 | return Err(
|
99 145 | ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
100 146 | "expected object key or end object, found: {other:?}"
|
101 147 | )),
|
102 148 | )
|
103 - | }
|
149 + | } /* JsonParserGenerator.kt:685 */
|
104 150 | }
|
151 + | /* JsonParserGenerator.kt:684 */
|
105 152 | }
|
153 + | /* JsonParserGenerator.kt:250 */
|
106 154 | if tokens.next().is_some() {
|
155 + | /* JsonParserGenerator.kt:251 */
|
107 156 | return Err(
|
108 157 | ::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
109 158 | "found more JSON tokens after completing parsing",
|
110 159 | ),
|
111 160 | );
|
161 + | /* JsonParserGenerator.kt:250 */
|
112 162 | }
|
163 + | /* JsonParserGenerator.kt:163 */
|
113 164 | Ok(builder)
|
165 + | /* JsonParserGenerator.kt:148 */
|
114 166 | }
|