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 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
3 5 | pub async fn de_put_with_content_encoding_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::PutWithContentEncodingInput,
|
7 9 | ::aws_smithy_http_server::protocol::aws_json::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::aws_json::rejection::RequestRejection:
|
13 15 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
14 16 | {
|
17 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
15 18 | Ok({
|
19 + | /* RustType.kt:516 */
|
16 20 | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:723 */
|
17 22 | let mut input = crate::input::put_with_content_encoding_input::Builder::default();
|
23 + | /* RustType.kt:516 */
|
18 24 | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:728 */
|
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();
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:745 */
|
22 30 | let bytes = ::hyper::body::to_bytes(body).await?;
|
31 + | /* ServerHttpBoundProtocolGenerator.kt:768 */
|
23 32 | if !bytes.is_empty() {
|
33 + | /* ServerHttpBoundProtocolGenerator.kt:769 */
|
24 34 | ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
|
25 35 | &headers,
|
26 36 | Some("application/x-amz-json-1.1"),
|
27 37 | )?;
|
28 38 | input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
|
39 + | /* ServerHttpBoundProtocolGenerator.kt:768 */
|
29 40 | }
|
41 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
30 42 | input.build()
|
43 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
31 44 | })
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
32 46 | }
|
33 47 |
|
48 + | /* RustType.kt:516 */
|
34 49 | #[allow(clippy::unnecessary_wraps)]
|
50 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
35 51 | pub fn ser_put_with_content_encoding_http_response(
|
36 52 | #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
|
37 53 | ) -> std::result::Result<
|
38 54 | ::aws_smithy_http_server::response::Response,
|
39 55 | ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
|
40 56 | > {
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
41 58 | Ok({
|
59 + | /* RustType.kt:516 */
|
42 60 | #[allow(unused_mut)]
|
61 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
43 62 | let mut builder = ::http::Response::builder();
|
63 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
44 64 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
45 65 | builder,
|
46 66 | ::http::header::CONTENT_TYPE,
|
47 67 | "application/x-amz-json-1.1",
|
48 68 | );
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
49 70 | let http_status: u16 = 200;
|
50 71 | builder = builder.status(http_status);
|
51 - | let payload = "";
|
72 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
73 + | let payload =
|
74 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */""
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
76 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
52 77 | let content_length = payload.len();
|
53 78 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
54 79 | builder,
|
55 80 | ::http::header::CONTENT_LENGTH,
|
56 81 | content_length,
|
57 82 | );
|
83 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
58 84 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
85 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
59 86 | builder.body(body)?
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
60 88 | })
|
89 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
61 90 | }
|
62 91 |
|
92 + | /* JsonParserGenerator.kt:148 */
|
63 93 | pub(crate) fn de_put_with_content_encoding(
|
64 94 | value: &[u8],
|
65 95 | mut builder: crate::input::put_with_content_encoding_input::Builder,
|
66 96 | ) -> ::std::result::Result<
|
67 97 | crate::input::put_with_content_encoding_input::Builder,
|
68 98 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
69 99 | > {
|
100 + | /* JsonParserGenerator.kt:153 */
|
70 101 | let mut tokens_owned =
|
71 102 | ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
|
72 103 | .peekable();
|
73 104 | let tokens = &mut tokens_owned;
|
74 105 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
106 + | /* JsonParserGenerator.kt:684 */
|
75 107 | loop {
|
108 + | /* JsonParserGenerator.kt:685 */
|
76 109 | match tokens.next().transpose()? {
|
110 + | /* JsonParserGenerator.kt:686 */
|
77 111 | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
78 112 | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
113 + | /* JsonParserGenerator.kt:260 */
|
79 114 | match key.to_unescaped()?.as_ref() {
|
115 + | /* JsonParserGenerator.kt:262 */
|
80 116 | "encoding" => {
|
117 + | /* JsonParserGenerator.kt:272 */
|
81 118 | builder = builder.set_encoding(
|
119 + | /* JsonParserGenerator.kt:354 */
|
82 120 | ::aws_smithy_json::deserialize::token::expect_string_or_null(
|
83 121 | tokens.next(),
|
84 122 | )?
|
85 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
86 - | .transpose()?,
|
123 + | .map(|s|
|
124 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
125 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
126 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
127 + | .transpose()?, /* JsonParserGenerator.kt:272 */
|
87 128 | );
|
129 + | /* JsonParserGenerator.kt:262 */
|
88 130 | }
|
131 + | /* JsonParserGenerator.kt:262 */
|
89 132 | "data" => {
|
133 + | /* JsonParserGenerator.kt:272 */
|
90 134 | builder = builder.set_data(
|
135 + | /* JsonParserGenerator.kt:354 */
|
91 136 | ::aws_smithy_json::deserialize::token::expect_string_or_null(
|
92 137 | tokens.next(),
|
93 138 | )?
|
94 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
95 - | .transpose()?,
|
139 + | .map(|s|
|
140 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
141 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
142 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
143 + | .transpose()?, /* JsonParserGenerator.kt:272 */
|
96 144 | );
|
145 + | /* JsonParserGenerator.kt:262 */
|
97 146 | }
|
98 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
147 + | /* JsonParserGenerator.kt:290 */
|
148 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
99 149 | }
|
150 + | /* JsonParserGenerator.kt:686 */
|
100 151 | }
|
152 + | /* JsonParserGenerator.kt:695 */
|
101 153 | other => {
|
102 154 | return Err(
|
103 155 | ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
104 156 | "expected object key or end object, found: {:?}",
|
105 157 | other
|
106 158 | )),
|
107 159 | )
|
160 + | } /* JsonParserGenerator.kt:685 */
|
108 161 | }
|
162 + | /* JsonParserGenerator.kt:684 */
|
109 163 | }
|
110 - | }
|
164 + | /* JsonParserGenerator.kt:250 */
|
111 165 | if tokens.next().is_some() {
|
166 + | /* JsonParserGenerator.kt:251 */
|
112 167 | return Err(
|
113 168 | ::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
114 169 | "found more JSON tokens after completing parsing",
|
115 170 | ),
|
116 171 | );
|
172 + | /* JsonParserGenerator.kt:250 */
|
117 173 | }
|
174 + | /* JsonParserGenerator.kt:163 */
|
118 175 | Ok(builder)
|
176 + | /* JsonParserGenerator.kt:148 */
|
119 177 | }
|