1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | pub(crate) fn de_length_list_pattern_string_header_header(header_map: &::aws_smithy_runtime_api::http::Headers) -> ::std::result::Result<::std::option::Option<crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained>, ::aws_smithy_legacy_http::header::ParseError>{
|
3 + | let headers = header_map.get_all("X-Length-List-Pattern-String");
|
4 + | let var_1: Vec<::std::string::String> =
|
5 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
6 + | Ok(if !var_1.is_empty() {
|
7 + | Some(crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained(var_1))
|
8 + | } else {
|
9 + | None
|
10 + | })
|
11 + | }
|
12 + |
|
13 + | pub(crate) fn de_length_set_pattern_string_header_header(header_map: &::aws_smithy_runtime_api::http::Headers) -> ::std::result::Result<::std::option::Option<crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained>, ::aws_smithy_legacy_http::header::ParseError>{
|
14 + | let headers = header_map.get_all("X-Length-Set-Pattern-String");
|
15 + | let var_2: Vec<::std::string::String> =
|
16 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
17 + | Ok(if !var_2.is_empty() {
|
18 + | Some(crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained(var_2))
|
19 + | } else {
|
20 + | None
|
21 + | })
|
22 + | }
|
23 + |
|
24 + | pub(crate) fn de_length_string_header_header(
|
25 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
26 + | ) -> ::std::result::Result<
|
27 + | ::std::option::Option<::std::string::String>,
|
28 + | ::aws_smithy_legacy_http::header::ParseError,
|
29 + | > {
|
30 + | let headers = header_map.get_all("X-Length");
|
31 + | ::aws_smithy_legacy_http::header::one_or_none(headers)
|
32 + | }
|
33 + |
|
34 + | pub(crate) fn de_length_string_header_map_prefix_header(
|
35 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
36 + | ) -> std::result::Result<
|
37 + | ::std::option::Option<
|
38 + | crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained,
|
39 + | >,
|
40 + | ::aws_smithy_legacy_http::header::ParseError,
|
41 + | > {
|
42 + | let headers = ::aws_smithy_legacy_http::header::headers_for_prefix(
|
43 + | header_map.iter().map(|(k, _)| k),
|
44 + | "X-Length-String-Prefix-Headers-",
|
45 + | );
|
46 + | let out: std::result::Result<_, _> = headers.map(|(key, header_name)| {
|
47 + | let values = header_map.get_all(header_name);
|
48 + | crate::protocol_serde::shape_constrained_http_bound_shapes_operation_input::de_length_string_header_map_inner(values).map(|v| (key.to_string(), v.expect(
|
49 + | "we have checked there is at least one value for this header name; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"
|
50 + | )))
|
51 + | }).collect();
|
52 + | let out = out.map(
|
53 + | crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained,
|
54 + | );
|
55 + | out.map(Some)
|
56 + | }
|
57 + |
|
58 + | pub(crate) fn de_length_string_set_header_header(
|
59 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
60 + | ) -> ::std::result::Result<
|
61 + | ::std::option::Option<
|
62 + | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained,
|
63 + | >,
|
64 + | ::aws_smithy_legacy_http::header::ParseError,
|
65 + | > {
|
66 + | let headers = header_map.get_all("X-Length-Set");
|
67 + | let var_3: Vec<::std::string::String> =
|
68 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
69 + | Ok(if !var_3.is_empty() {
|
70 + | Some(crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained(var_3))
|
71 + | } else {
|
72 + | None
|
73 + | })
|
74 + | }
|
75 + |
|
76 + | pub(crate) fn de_list_length_string_header_header(
|
77 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
78 + | ) -> ::std::result::Result<
|
79 + | ::std::option::Option<
|
80 + | crate::unconstrained::list_of_length_string_unconstrained::ListOfLengthStringUnconstrained,
|
81 + | >,
|
82 + | ::aws_smithy_legacy_http::header::ParseError,
|
83 + | > {
|
84 + | let headers = header_map.get_all("X-List-Length-String");
|
85 + | let var_4: Vec<::std::string::String> =
|
86 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
87 + | Ok(if !var_4.is_empty() {
|
88 + | Some(crate::unconstrained::list_of_length_string_unconstrained::ListOfLengthStringUnconstrained(var_4))
|
89 + | } else {
|
90 + | None
|
91 + | })
|
92 + | }
|
93 + |
|
94 + | pub(crate) fn de_range_byte_header_header(
|
95 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
96 + | ) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_legacy_http::header::ParseError>
|
97 + | {
|
98 + | let headers = header_map.get_all("X-Range-Byte");
|
99 + | let var_5 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(headers)?;
|
100 + | if var_5.len() > 1 {
|
101 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
102 + | "expected one item but found {}",
|
103 + | var_5.len()
|
104 + | )))
|
105 + | } else {
|
106 + | let mut var_5 = var_5;
|
107 + | Ok(var_5.pop())
|
108 + | }
|
109 + | }
|
110 + |
|
111 + | pub(crate) fn de_range_byte_list_header_header(
|
112 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
113 + | ) -> ::std::result::Result<
|
114 + | ::std::option::Option<
|
115 + | crate::unconstrained::list_of_range_byte_unconstrained::ListOfRangeByteUnconstrained,
|
116 + | >,
|
117 + | ::aws_smithy_legacy_http::header::ParseError,
|
118 + | > {
|
119 + | let headers = header_map.get_all("X-Range-Byte-List");
|
120 + | let var_6 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(headers)?;
|
121 + | Ok(if !var_6.is_empty() {
|
122 + | Some(
|
123 + | crate::unconstrained::list_of_range_byte_unconstrained::ListOfRangeByteUnconstrained(
|
124 + | var_6,
|
125 + | ),
|
126 + | )
|
127 + | } else {
|
128 + | None
|
129 + | })
|
130 + | }
|
131 + |
|
132 + | pub(crate) fn de_range_byte_set_header_header(
|
133 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
134 + | ) -> ::std::result::Result<
|
135 + | ::std::option::Option<
|
136 + | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained,
|
137 + | >,
|
138 + | ::aws_smithy_legacy_http::header::ParseError,
|
139 + | > {
|
140 + | let headers = header_map.get_all("X-Range-Byte-Set");
|
141 + | let var_7 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(headers)?;
|
142 + | Ok(if !var_7.is_empty() {
|
143 + | Some(
|
144 + | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained(
|
145 + | var_7,
|
146 + | ),
|
147 + | )
|
148 + | } else {
|
149 + | None
|
150 + | })
|
151 + | }
|
152 + |
|
153 + | pub(crate) fn de_range_integer_header_header(
|
154 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
155 + | ) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
|
156 + | {
|
157 + | let headers = header_map.get_all("X-Range-Integer");
|
158 + | let var_8 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
159 + | if var_8.len() > 1 {
|
160 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
161 + | "expected one item but found {}",
|
162 + | var_8.len()
|
163 + | )))
|
164 + | } else {
|
165 + | let mut var_8 = var_8;
|
166 + | Ok(var_8.pop())
|
167 + | }
|
168 + | }
|
169 + |
|
170 + | pub(crate) fn de_range_integer_list_header_header(
|
171 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
172 + | ) -> ::std::result::Result<
|
173 + | ::std::option::Option<
|
174 + | crate::unconstrained::list_of_range_integer_unconstrained::ListOfRangeIntegerUnconstrained,
|
175 + | >,
|
176 + | ::aws_smithy_legacy_http::header::ParseError,
|
177 + | > {
|
178 + | let headers = header_map.get_all("X-Range-Integer-List");
|
179 + | let var_9 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
180 + | Ok(if !var_9.is_empty() {
|
181 + | Some(crate::unconstrained::list_of_range_integer_unconstrained::ListOfRangeIntegerUnconstrained(var_9))
|
182 + | } else {
|
183 + | None
|
184 + | })
|
185 + | }
|
186 + |
|
187 + | pub(crate) fn de_range_integer_set_header_header(
|
188 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
189 + | ) -> ::std::result::Result<
|
190 + | ::std::option::Option<
|
191 + | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained,
|
192 + | >,
|
193 + | ::aws_smithy_legacy_http::header::ParseError,
|
194 + | > {
|
195 + | let headers = header_map.get_all("X-Range-Integer-Set");
|
196 + | let var_10 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
197 + | Ok(if !var_10.is_empty() {
|
198 + | Some(crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained(var_10))
|
199 + | } else {
|
200 + | None
|
201 + | })
|
202 + | }
|
203 + |
|
204 + | pub(crate) fn de_range_long_header_header(
|
205 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
206 + | ) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_legacy_http::header::ParseError>
|
207 + | {
|
208 + | let headers = header_map.get_all("X-Range-Long");
|
209 + | let var_11 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
|
210 + | if var_11.len() > 1 {
|
211 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
212 + | "expected one item but found {}",
|
213 + | var_11.len()
|
214 + | )))
|
215 + | } else {
|
216 + | let mut var_11 = var_11;
|
217 + | Ok(var_11.pop())
|
218 + | }
|
219 + | }
|
220 + |
|
221 + | pub(crate) fn de_range_long_list_header_header(
|
222 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
223 + | ) -> ::std::result::Result<
|
224 + | ::std::option::Option<
|
225 + | crate::unconstrained::list_of_range_long_unconstrained::ListOfRangeLongUnconstrained,
|
226 + | >,
|
227 + | ::aws_smithy_legacy_http::header::ParseError,
|
228 + | > {
|
229 + | let headers = header_map.get_all("X-Range-Long-List");
|
230 + | let var_12 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
|
231 + | Ok(if !var_12.is_empty() {
|
232 + | Some(
|
233 + | crate::unconstrained::list_of_range_long_unconstrained::ListOfRangeLongUnconstrained(
|
234 + | var_12,
|
235 + | ),
|
236 + | )
|
237 + | } else {
|
238 + | None
|
239 + | })
|
240 + | }
|
241 + |
|
242 + | pub(crate) fn de_range_long_set_header_header(
|
243 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
244 + | ) -> ::std::result::Result<
|
245 + | ::std::option::Option<
|
246 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained,
|
247 + | >,
|
248 + | ::aws_smithy_legacy_http::header::ParseError,
|
249 + | > {
|
250 + | let headers = header_map.get_all("X-Range-Long-Set");
|
251 + | let var_13 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
|
252 + | Ok(if !var_13.is_empty() {
|
253 + | Some(
|
254 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained(
|
255 + | var_13,
|
256 + | ),
|
257 + | )
|
258 + | } else {
|
259 + | None
|
260 + | })
|
261 + | }
|
262 + |
|
263 + | pub(crate) fn de_range_short_header_header(
|
264 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
265 + | ) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_legacy_http::header::ParseError>
|
266 + | {
|
267 + | let headers = header_map.get_all("X-Range-Short");
|
268 + | let var_14 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
|
269 + | if var_14.len() > 1 {
|
270 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
271 + | "expected one item but found {}",
|
272 + | var_14.len()
|
273 + | )))
|
274 + | } else {
|
275 + | let mut var_14 = var_14;
|
276 + | Ok(var_14.pop())
|
277 + | }
|
278 + | }
|
279 + |
|
280 + | pub(crate) fn de_range_short_list_header_header(
|
281 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
282 + | ) -> ::std::result::Result<
|
283 + | ::std::option::Option<
|
284 + | crate::unconstrained::list_of_range_short_unconstrained::ListOfRangeShortUnconstrained,
|
285 + | >,
|
286 + | ::aws_smithy_legacy_http::header::ParseError,
|
287 + | > {
|
288 + | let headers = header_map.get_all("X-Range-Short-List");
|
289 + | let var_15 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
|
290 + | Ok(if !var_15.is_empty() {
|
291 + | Some(
|
292 + | crate::unconstrained::list_of_range_short_unconstrained::ListOfRangeShortUnconstrained(
|
293 + | var_15,
|
294 + | ),
|
295 + | )
|
296 + | } else {
|
297 + | None
|
298 + | })
|
299 + | }
|
300 + |
|
301 + | pub(crate) fn de_range_short_set_header_header(
|
302 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
303 + | ) -> ::std::result::Result<
|
304 + | ::std::option::Option<
|
305 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained,
|
306 + | >,
|
307 + | ::aws_smithy_legacy_http::header::ParseError,
|
308 + | > {
|
309 + | let headers = header_map.get_all("X-Range-Short-Set");
|
310 + | let var_16 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
|
311 + | Ok(if !var_16.is_empty() {
|
312 + | Some(
|
313 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained(
|
314 + | var_16,
|
315 + | ),
|
316 + | )
|
317 + | } else {
|
318 + | None
|
319 + | })
|
320 + | }
|
321 + |
|
322 + | pub fn de_range_integer_label(
|
323 + | value: &str,
|
324 + | ) -> std::result::Result<
|
325 + | i32,
|
326 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
327 + | > {
|
328 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
329 + | Ok(value)
|
330 + | }
|
331 + |
|
332 + | pub fn de_range_short_label(
|
333 + | value: &str,
|
334 + | ) -> std::result::Result<
|
335 + | i16,
|
336 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
337 + | > {
|
338 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
339 + | Ok(value)
|
340 + | }
|
341 + |
|
342 + | pub fn de_range_long_label(
|
343 + | value: &str,
|
344 + | ) -> std::result::Result<
|
345 + | i64,
|
346 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
347 + | > {
|
348 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
349 + | Ok(value)
|
350 + | }
|
351 + |
|
352 + | pub fn de_range_byte_label(
|
353 + | value: &str,
|
354 + | ) -> std::result::Result<
|
355 + | i8,
|
356 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
357 + | > {
|
358 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
359 + | Ok(value)
|
360 + | }
|
361 + |
|
362 + | pub fn de_length_string_label(
|
363 + | value: &str,
|
364 + | ) -> std::result::Result<
|
365 + | ::std::string::String,
|
366 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
367 + | > {
|
368 + | let value = ::percent_encoding::percent_decode_str(value)
|
369 + | .decode_utf8()?
|
370 + | .into_owned();
|
371 + | Ok(value)
|
372 + | }
|
373 + |
|
374 + | pub fn de_enum_string_label(
|
375 + | value: &str,
|
376 + | ) -> std::result::Result<
|
377 + | ::std::string::String,
|
378 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
379 + | > {
|
380 + | let value = ::percent_encoding::percent_decode_str(value)
|
381 + | .decode_utf8()?
|
382 + | .into_owned();
|
383 + | Ok(value)
|
384 + | }
|
385 + |
|
386 + | pub fn de_enum_string_query(
|
387 + | value: &str,
|
388 + | ) -> std::result::Result<
|
389 + | ::std::option::Option<::std::string::String>,
|
390 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
391 + | > {
|
392 + | let value = value.to_owned();
|
393 + | Ok(Some(value))
|
394 + | }
|
395 + |
|
396 + | pub fn de_length_string_query(
|
397 + | value: &str,
|
398 + | ) -> std::result::Result<
|
399 + | ::std::option::Option<::std::string::String>,
|
400 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
401 + | > {
|
402 + | let value = value.to_owned();
|
403 + | Ok(Some(value))
|
404 + | }
|
405 + |
|
406 + | pub fn de_range_byte_query(
|
407 + | value: &str,
|
408 + | ) -> std::result::Result<
|
409 + | i8,
|
410 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
411 + | > {
|
412 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
413 + | Ok(value)
|
414 + | }
|
415 + |
|
416 + | pub fn de_range_integer_query(
|
417 + | value: &str,
|
418 + | ) -> std::result::Result<
|
419 + | i32,
|
420 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
421 + | > {
|
422 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
423 + | Ok(value)
|
424 + | }
|
425 + |
|
426 + | pub fn de_range_long_query(
|
427 + | value: &str,
|
428 + | ) -> std::result::Result<
|
429 + | i64,
|
430 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
431 + | > {
|
432 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
433 + | Ok(value)
|
434 + | }
|
435 + |
|
436 + | pub fn de_range_short_query(
|
437 + | value: &str,
|
438 + | ) -> std::result::Result<
|
439 + | i16,
|
440 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
441 + | > {
|
442 + | let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
|
443 + | Ok(value)
|
444 + | }
|
445 + |
|
446 + | pub fn de_length_string_header_map_inner<'a>(
|
447 + | headers: impl ::std::iter::Iterator<Item = &'a str>,
|
448 + | ) -> std::result::Result<Option<::std::string::String>, ::aws_smithy_legacy_http::header::ParseError>
|
449 + | {
|
450 + | ::aws_smithy_legacy_http::header::one_or_none(headers)
|
451 + | }
|