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_list_objects_v2_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::ListObjectsV2Input,
|
7 9 | ::aws_smithy_http_server::protocol::rest_xml::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_xml::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::list_objects_v2_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:794 */
|
22 30 | if let Some(value) =
|
23 31 | crate::protocol_serde::shape_list_objects_v2_input::de_expected_bucket_owner_header(
|
24 32 | &headers,
|
25 33 | )?
|
26 34 | {
|
27 35 | input = input.set_expected_bucket_owner(Some(value))
|
28 36 | }
|
37 + | /* ServerHttpBoundProtocolGenerator.kt:794 */
|
29 38 | if let Some(value) =
|
30 39 | crate::protocol_serde::shape_list_objects_v2_input::de_request_payer_header(&headers)?
|
31 40 | {
|
32 41 | input = input.set_request_payer(Some(value))
|
33 42 | }
|
43 + | /* ServerHttpBoundProtocolGenerator.kt:986 */
|
34 44 | let input_string = uri.path();
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:998 */
|
35 46 | let (input_string, m0) = ::nom::sequence::preceded(
|
36 47 | ::nom::bytes::complete::tag("/"),
|
37 48 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
38 49 | ::nom::bytes::complete::take_until("/"),
|
39 50 | ::nom::combinator::rest,
|
40 51 | )),
|
41 52 | )(input_string)?;
|
42 53 | debug_assert_eq!("", input_string);
|
54 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
43 55 | input =
|
44 56 | input.set_bucket(crate::protocol_serde::shape_list_objects_v2_input::de_bucket(m0)?);
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:1073 */
|
45 58 | let query_string = uri.query().unwrap_or("");
|
46 59 | let pairs = ::form_urlencoded::parse(query_string.as_bytes());
|
60 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
47 61 | let mut continuation_token_seen = false;
|
62 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
48 63 | let mut delimiter_seen = false;
|
64 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
49 65 | let mut encoding_type_seen = false;
|
66 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
50 67 | let mut fetch_owner_seen = false;
|
68 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
51 69 | let mut max_keys_seen = false;
|
70 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
52 71 | let mut prefix_seen = false;
|
72 + | /* ServerHttpBoundProtocolGenerator.kt:1099 */
|
53 73 | let mut start_after_seen = false;
|
74 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
54 75 | for (k, v) in pairs {
|
76 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
55 77 | if !continuation_token_seen && k == "continuation-token" {
|
56 78 | input = input.set_continuation_token(
|
57 79 | crate::protocol_serde::shape_list_objects_v2_input::de_continuation_token(&v)?,
|
58 80 | );
|
59 81 | continuation_token_seen = true;
|
60 82 | }
|
83 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
61 84 | if !delimiter_seen && k == "delimiter" {
|
62 85 | input = input.set_delimiter(
|
63 86 | crate::protocol_serde::shape_list_objects_v2_input::de_delimiter(&v)?,
|
64 87 | );
|
65 88 | delimiter_seen = true;
|
66 89 | }
|
90 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
67 91 | if !encoding_type_seen && k == "encoding-type" {
|
68 92 | input = input.set_encoding_type(
|
69 93 | crate::protocol_serde::shape_list_objects_v2_input::de_encoding_type(&v)?,
|
70 94 | );
|
71 95 | encoding_type_seen = true;
|
72 96 | }
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
73 98 | if !fetch_owner_seen && k == "fetch-owner" {
|
74 99 | input = input.set_fetch_owner(
|
75 100 | crate::protocol_serde::shape_list_objects_v2_input::de_fetch_owner(&v)?,
|
76 101 | );
|
77 102 | fetch_owner_seen = true;
|
78 103 | }
|
104 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
79 105 | if !max_keys_seen && k == "max-keys" {
|
80 106 | input = input.set_max_keys(
|
81 107 | crate::protocol_serde::shape_list_objects_v2_input::de_max_keys(&v)?,
|
82 108 | );
|
83 109 | max_keys_seen = true;
|
84 110 | }
|
111 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
85 112 | if !prefix_seen && k == "prefix" {
|
86 113 | input = input
|
87 114 | .set_prefix(crate::protocol_serde::shape_list_objects_v2_input::de_prefix(&v)?);
|
88 115 | prefix_seen = true;
|
89 116 | }
|
117 + | /* ServerHttpBoundProtocolGenerator.kt:1109 */
|
90 118 | if !start_after_seen && k == "start-after" {
|
91 119 | input = input.set_start_after(
|
92 120 | crate::protocol_serde::shape_list_objects_v2_input::de_start_after(&v)?,
|
93 121 | );
|
94 122 | start_after_seen = true;
|
95 123 | }
|
124 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
96 125 | }
|
126 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
97 127 | input.build()?
|
128 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
98 129 | })
|
130 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
99 131 | }
|
100 132 |
|
133 + | /* RustType.kt:516 */
|
101 134 | #[allow(clippy::unnecessary_wraps)]
|
135 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
102 136 | pub fn ser_list_objects_v2_http_response(
|
103 137 | #[allow(unused_variables)] output: crate::output::ListObjectsV2Output,
|
104 138 | ) -> std::result::Result<
|
105 139 | ::aws_smithy_http_server::response::Response,
|
106 140 | ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
|
107 141 | > {
|
142 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
108 143 | Ok({
|
144 + | /* RustType.kt:516 */
|
109 145 | #[allow(unused_mut)]
|
146 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
110 147 | let mut builder = ::http::Response::builder();
|
148 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
111 149 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
112 150 | builder,
|
113 151 | ::http::header::CONTENT_TYPE,
|
114 152 | "application/xml",
|
115 153 | );
|
154 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
116 155 | let http_status: u16 = 200;
|
117 156 | builder = builder.status(http_status);
|
157 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
118 158 | let payload =
|
119 - | crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?;
|
159 + | /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?
|
160 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
161 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
120 162 | let content_length = payload.len();
|
121 163 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
122 164 | builder,
|
123 165 | ::http::header::CONTENT_LENGTH,
|
124 166 | content_length,
|
125 167 | );
|
168 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
126 169 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
170 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
127 171 | builder.body(body)?
|
172 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
128 173 | })
|
174 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
129 175 | }
|
130 176 |
|
177 + | /* RustType.kt:516 */
|
131 178 | #[allow(clippy::unnecessary_wraps)]
|
179 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
132 180 | pub fn ser_list_objects_v2_http_error(
|
133 181 | error: &crate::error::ListObjectsV2Error,
|
134 182 | ) -> std::result::Result<
|
135 183 | ::aws_smithy_http_server::response::Response,
|
136 184 | ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
|
137 185 | > {
|
186 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
138 187 | Ok({
|
188 + | /* ServerHttpBoundProtocolGenerator.kt:468 */
|
139 189 | match error {
|
190 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
140 191 | crate::error::ListObjectsV2Error::NoSuchBucket(output) => {
|
192 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
141 193 | let payload =
|
142 194 | crate::protocol_serde::shape_no_such_bucket::ser_no_such_bucket_error(output)?;
|
195 + | /* RustType.kt:516 */
|
143 196 | #[allow(unused_mut)]
|
197 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
144 198 | let mut builder = ::http::Response::builder();
|
199 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
145 200 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
146 201 | builder,
|
147 202 | ::http::header::CONTENT_TYPE,
|
148 203 | "application/xml",
|
149 204 | );
|
205 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
150 206 | let content_length = payload.len();
|
151 207 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
152 208 | builder,
|
153 209 | ::http::header::CONTENT_LENGTH,
|
154 210 | content_length,
|
155 211 | );
|
212 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
156 213 | builder
|
157 214 | .status(400)
|
158 215 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
216 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
159 217 | }
|
218 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
160 219 | crate::error::ListObjectsV2Error::ValidationException(output) => {
|
220 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
161 221 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
222 + | /* RustType.kt:516 */
|
162 223 | #[allow(unused_mut)]
|
224 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
163 225 | let mut builder = ::http::Response::builder();
|
226 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
164 227 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
165 228 | builder,
|
166 229 | ::http::header::CONTENT_TYPE,
|
167 230 | "application/xml",
|
168 231 | );
|
232 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
169 233 | let content_length = payload.len();
|
170 234 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
171 235 | builder,
|
172 236 | ::http::header::CONTENT_LENGTH,
|
173 237 | content_length,
|
174 238 | );
|
239 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
175 240 | builder
|
176 241 | .status(400)
|
177 242 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
243 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
244 + | } /* ServerHttpBoundProtocolGenerator.kt:468 */
|
178 245 | }
|
179 - | }
|
246 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
180 247 | })
|
248 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
181 249 | }
|
182 250 |
|
251 + | /* XmlBindingTraitSerializerGenerator.kt:217 */
|
183 252 | pub fn ser_list_objects_v2_output(
|
184 253 | output: &crate::output::ListObjectsV2Output,
|
185 254 | ) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
|
255 + | /* XmlBindingTraitSerializerGenerator.kt:221 */
|
186 256 | let mut out = String::new();
|
257 + | /* XmlBindingTraitSerializerGenerator.kt:225 */
|
187 258 | {
|
259 + | /* XmlBindingTraitSerializerGenerator.kt:226 */
|
188 260 | let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
|
189 261 | #[allow(unused_mut)]
|
190 262 | let mut root = writer
|
191 263 | .start_el("ListObjectsV2Output")
|
192 264 | .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
|
265 + | /* XmlBindingTraitSerializerGenerator.kt:440 */
|
193 266 | crate::protocol_serde::shape_list_objects_v2_output::ser_list_objects_v2_output_output(
|
194 267 | output, root,
|
195 268 | )?
|
269 + | /* XmlBindingTraitSerializerGenerator.kt:225 */
|
196 270 | }
|
271 + | /* XmlBindingTraitSerializerGenerator.kt:238 */
|
197 272 | Ok(out)
|
273 + | /* XmlBindingTraitSerializerGenerator.kt:217 */
|
198 274 | }
|