1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* HttpBindingGenerator.kt:159 */
|
3 + | pub(crate) fn de_header_boolean_list_header(
|
4 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
5 + | ) -> ::std::result::Result<
|
6 + | ::std::option::Option<::std::vec::Vec<bool>>,
|
7 + | ::aws_smithy_legacy_http::header::ParseError,
|
8 + | > {
|
9 + | /* HttpBindingGenerator.kt:166 */
|
10 + | let headers = header_map.get_all("X-BooleanList");
|
11 + | /* HttpBindingGenerator.kt:427 */
|
12 + | let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
|
13 + | /* HttpBindingGenerator.kt:453 */
|
14 + | Ok(if !var_1.is_empty() { Some(var_1) } else { None })
|
15 + | /* HttpBindingGenerator.kt:159 */
|
16 + | }
|
17 + |
|
18 + | /* HttpBindingGenerator.kt:159 */
|
19 + | pub(crate) fn de_header_byte_header(
|
20 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
21 + | ) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_legacy_http::header::ParseError>
|
22 + | {
|
23 + | /* HttpBindingGenerator.kt:166 */
|
24 + | let headers = header_map.get_all("X-Byte");
|
25 + | /* HttpBindingGenerator.kt:427 */
|
26 + | let var_2 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(headers)?;
|
27 + | /* HttpBindingGenerator.kt:491 */
|
28 + | if var_2.len() > 1 {
|
29 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
30 + | "expected one item but found {}",
|
31 + | var_2.len()
|
32 + | )))
|
33 + | } else {
|
34 + | let mut var_2 = var_2;
|
35 + | Ok(var_2.pop())
|
36 + | }
|
37 + | /* HttpBindingGenerator.kt:159 */
|
38 + | }
|
39 + |
|
40 + | /* HttpBindingGenerator.kt:159 */
|
41 + | pub(crate) fn de_header_double_header(
|
42 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
43 + | ) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_legacy_http::header::ParseError>
|
44 + | {
|
45 + | /* HttpBindingGenerator.kt:166 */
|
46 + | let headers = header_map.get_all("X-Double");
|
47 + | /* HttpBindingGenerator.kt:427 */
|
48 + | let var_3 = ::aws_smithy_legacy_http::header::read_many_primitive::<f64>(headers)?;
|
49 + | /* HttpBindingGenerator.kt:491 */
|
50 + | if var_3.len() > 1 {
|
51 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
52 + | "expected one item but found {}",
|
53 + | var_3.len()
|
54 + | )))
|
55 + | } else {
|
56 + | let mut var_3 = var_3;
|
57 + | Ok(var_3.pop())
|
58 + | }
|
59 + | /* HttpBindingGenerator.kt:159 */
|
60 + | }
|
61 + |
|
62 + | /* HttpBindingGenerator.kt:159 */
|
63 + | pub(crate) fn de_header_enum_header(
|
64 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
65 + | ) -> ::std::result::Result<
|
66 + | ::std::option::Option<::std::string::String>,
|
67 + | ::aws_smithy_legacy_http::header::ParseError,
|
68 + | > {
|
69 + | /* HttpBindingGenerator.kt:166 */
|
70 + | let headers = header_map.get_all("X-Enum");
|
71 + | /* HttpBindingGenerator.kt:398 */
|
72 + | ::aws_smithy_legacy_http::header::one_or_none(headers)
|
73 + | /* HttpBindingGenerator.kt:159 */
|
74 + | }
|
75 + |
|
76 + | /* HttpBindingGenerator.kt:159 */
|
77 + | pub(crate) fn de_header_enum_list_header(
|
78 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
79 + | ) -> ::std::result::Result<
|
80 + | ::std::option::Option<
|
81 + | crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained,
|
82 + | >,
|
83 + | ::aws_smithy_legacy_http::header::ParseError,
|
84 + | > {
|
85 + | /* HttpBindingGenerator.kt:166 */
|
86 + | let headers = header_map.get_all("X-EnumList");
|
87 + | /* HttpBindingGenerator.kt:432 */
|
88 + | let var_4: Vec<::std::string::String> =
|
89 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
90 + | /* HttpBindingGenerator.kt:479 */
|
91 + | Ok(if !var_4.is_empty() {
|
92 + | Some(crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(var_4))
|
93 + | } else {
|
94 + | None
|
95 + | })
|
96 + | /* HttpBindingGenerator.kt:159 */
|
97 + | }
|
98 + |
|
99 + | /* HttpBindingGenerator.kt:159 */
|
100 + | pub(crate) fn de_header_false_bool_header(
|
101 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
102 + | ) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_legacy_http::header::ParseError>
|
103 + | {
|
104 + | /* HttpBindingGenerator.kt:166 */
|
105 + | let headers = header_map.get_all("X-Boolean2");
|
106 + | /* HttpBindingGenerator.kt:427 */
|
107 + | let var_5 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
|
108 + | /* HttpBindingGenerator.kt:491 */
|
109 + | if var_5.len() > 1 {
|
110 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
111 + | "expected one item but found {}",
|
112 + | var_5.len()
|
113 + | )))
|
114 + | } else {
|
115 + | let mut var_5 = var_5;
|
116 + | Ok(var_5.pop())
|
117 + | }
|
118 + | /* HttpBindingGenerator.kt:159 */
|
119 + | }
|
120 + |
|
121 + | /* HttpBindingGenerator.kt:159 */
|
122 + | pub(crate) fn de_header_float_header(
|
123 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
124 + | ) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_legacy_http::header::ParseError>
|
125 + | {
|
126 + | /* HttpBindingGenerator.kt:166 */
|
127 + | let headers = header_map.get_all("X-Float");
|
128 + | /* HttpBindingGenerator.kt:427 */
|
129 + | let var_6 = ::aws_smithy_legacy_http::header::read_many_primitive::<f32>(headers)?;
|
130 + | /* HttpBindingGenerator.kt:491 */
|
131 + | if var_6.len() > 1 {
|
132 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
133 + | "expected one item but found {}",
|
134 + | var_6.len()
|
135 + | )))
|
136 + | } else {
|
137 + | let mut var_6 = var_6;
|
138 + | Ok(var_6.pop())
|
139 + | }
|
140 + | /* HttpBindingGenerator.kt:159 */
|
141 + | }
|
142 + |
|
143 + | /* HttpBindingGenerator.kt:159 */
|
144 + | pub(crate) fn de_header_integer_header(
|
145 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
146 + | ) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
|
147 + | {
|
148 + | /* HttpBindingGenerator.kt:166 */
|
149 + | let headers = header_map.get_all("X-Integer");
|
150 + | /* HttpBindingGenerator.kt:427 */
|
151 + | let var_7 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
152 + | /* HttpBindingGenerator.kt:491 */
|
153 + | if var_7.len() > 1 {
|
154 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
155 + | "expected one item but found {}",
|
156 + | var_7.len()
|
157 + | )))
|
158 + | } else {
|
159 + | let mut var_7 = var_7;
|
160 + | Ok(var_7.pop())
|
161 + | }
|
162 + | /* HttpBindingGenerator.kt:159 */
|
163 + | }
|
164 + |
|
165 + | /* HttpBindingGenerator.kt:159 */
|
166 + | pub(crate) fn de_header_integer_enum_header(
|
167 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
168 + | ) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
|
169 + | {
|
170 + | /* HttpBindingGenerator.kt:166 */
|
171 + | let headers = header_map.get_all("X-IntegerEnum");
|
172 + | /* HttpBindingGenerator.kt:427 */
|
173 + | let var_8 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
174 + | /* HttpBindingGenerator.kt:491 */
|
175 + | if var_8.len() > 1 {
|
176 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
177 + | "expected one item but found {}",
|
178 + | var_8.len()
|
179 + | )))
|
180 + | } else {
|
181 + | let mut var_8 = var_8;
|
182 + | Ok(var_8.pop())
|
183 + | }
|
184 + | /* HttpBindingGenerator.kt:159 */
|
185 + | }
|
186 + |
|
187 + | /* HttpBindingGenerator.kt:159 */
|
188 + | pub(crate) fn de_header_integer_enum_list_header(
|
189 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
190 + | ) -> ::std::result::Result<
|
191 + | ::std::option::Option<::std::vec::Vec<i32>>,
|
192 + | ::aws_smithy_legacy_http::header::ParseError,
|
193 + | > {
|
194 + | /* HttpBindingGenerator.kt:166 */
|
195 + | let headers = header_map.get_all("X-IntegerEnumList");
|
196 + | /* HttpBindingGenerator.kt:427 */
|
197 + | let var_9 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
198 + | /* HttpBindingGenerator.kt:453 */
|
199 + | Ok(if !var_9.is_empty() { Some(var_9) } else { None })
|
200 + | /* HttpBindingGenerator.kt:159 */
|
201 + | }
|
202 + |
|
203 + | /* HttpBindingGenerator.kt:159 */
|
204 + | pub(crate) fn de_header_integer_list_header(
|
205 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
206 + | ) -> ::std::result::Result<
|
207 + | ::std::option::Option<::std::vec::Vec<i32>>,
|
208 + | ::aws_smithy_legacy_http::header::ParseError,
|
209 + | > {
|
210 + | /* HttpBindingGenerator.kt:166 */
|
211 + | let headers = header_map.get_all("X-IntegerList");
|
212 + | /* HttpBindingGenerator.kt:427 */
|
213 + | let var_10 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
|
214 + | /* HttpBindingGenerator.kt:453 */
|
215 + | Ok(if !var_10.is_empty() {
|
216 + | Some(var_10)
|
217 + | } else {
|
218 + | None
|
219 + | })
|
220 + | /* HttpBindingGenerator.kt:159 */
|
221 + | }
|
222 + |
|
223 + | /* HttpBindingGenerator.kt:159 */
|
224 + | pub(crate) fn de_header_long_header(
|
225 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
226 + | ) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_legacy_http::header::ParseError>
|
227 + | {
|
228 + | /* HttpBindingGenerator.kt:166 */
|
229 + | let headers = header_map.get_all("X-Long");
|
230 + | /* HttpBindingGenerator.kt:427 */
|
231 + | let var_11 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
|
232 + | /* HttpBindingGenerator.kt:491 */
|
233 + | if var_11.len() > 1 {
|
234 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
235 + | "expected one item but found {}",
|
236 + | var_11.len()
|
237 + | )))
|
238 + | } else {
|
239 + | let mut var_11 = var_11;
|
240 + | Ok(var_11.pop())
|
241 + | }
|
242 + | /* HttpBindingGenerator.kt:159 */
|
243 + | }
|
244 + |
|
245 + | /* HttpBindingGenerator.kt:159 */
|
246 + | pub(crate) fn de_header_short_header(
|
247 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
248 + | ) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_legacy_http::header::ParseError>
|
249 + | {
|
250 + | /* HttpBindingGenerator.kt:166 */
|
251 + | let headers = header_map.get_all("X-Short");
|
252 + | /* HttpBindingGenerator.kt:427 */
|
253 + | let var_12 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
|
254 + | /* HttpBindingGenerator.kt:491 */
|
255 + | if var_12.len() > 1 {
|
256 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
257 + | "expected one item but found {}",
|
258 + | var_12.len()
|
259 + | )))
|
260 + | } else {
|
261 + | let mut var_12 = var_12;
|
262 + | Ok(var_12.pop())
|
263 + | }
|
264 + | /* HttpBindingGenerator.kt:159 */
|
265 + | }
|
266 + |
|
267 + | /* HttpBindingGenerator.kt:159 */
|
268 + | pub(crate) fn de_header_string_header(
|
269 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
270 + | ) -> ::std::result::Result<
|
271 + | ::std::option::Option<::std::string::String>,
|
272 + | ::aws_smithy_legacy_http::header::ParseError,
|
273 + | > {
|
274 + | /* HttpBindingGenerator.kt:166 */
|
275 + | let headers = header_map.get_all("X-String");
|
276 + | /* HttpBindingGenerator.kt:398 */
|
277 + | ::aws_smithy_legacy_http::header::one_or_none(headers)
|
278 + | /* HttpBindingGenerator.kt:159 */
|
279 + | }
|
280 + |
|
281 + | /* HttpBindingGenerator.kt:159 */
|
282 + | pub(crate) fn de_header_string_list_header(
|
283 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
284 + | ) -> ::std::result::Result<
|
285 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
286 + | ::aws_smithy_legacy_http::header::ParseError,
|
287 + | > {
|
288 + | /* HttpBindingGenerator.kt:166 */
|
289 + | let headers = header_map.get_all("X-StringList");
|
290 + | /* HttpBindingGenerator.kt:432 */
|
291 + | let var_13: Vec<::std::string::String> =
|
292 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
293 + | /* HttpBindingGenerator.kt:453 */
|
294 + | Ok(if !var_13.is_empty() {
|
295 + | Some(var_13)
|
296 + | } else {
|
297 + | None
|
298 + | })
|
299 + | /* HttpBindingGenerator.kt:159 */
|
300 + | }
|
301 + |
|
302 + | /* HttpBindingGenerator.kt:159 */
|
303 + | pub(crate) fn de_header_string_set_header(
|
304 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
305 + | ) -> ::std::result::Result<
|
306 + | ::std::option::Option<crate::unconstrained::string_set_unconstrained::StringSetUnconstrained>,
|
307 + | ::aws_smithy_legacy_http::header::ParseError,
|
308 + | > {
|
309 + | /* HttpBindingGenerator.kt:166 */
|
310 + | let headers = header_map.get_all("X-StringSet");
|
311 + | /* HttpBindingGenerator.kt:432 */
|
312 + | let var_14: Vec<::std::string::String> =
|
313 + | ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
|
314 + | /* HttpBindingGenerator.kt:479 */
|
315 + | Ok(if !var_14.is_empty() {
|
316 + | Some(crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(var_14))
|
317 + | } else {
|
318 + | None
|
319 + | })
|
320 + | /* HttpBindingGenerator.kt:159 */
|
321 + | }
|
322 + |
|
323 + | /* HttpBindingGenerator.kt:159 */
|
324 + | pub(crate) fn de_header_timestamp_list_header(
|
325 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
326 + | ) -> ::std::result::Result<
|
327 + | ::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>,
|
328 + | ::aws_smithy_legacy_http::header::ParseError,
|
329 + | > {
|
330 + | /* HttpBindingGenerator.kt:166 */
|
331 + | let headers = header_map.get_all("X-TimestampList");
|
332 + | /* HttpBindingGenerator.kt:417 */
|
333 + | let var_15: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_legacy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
|
334 + | /* HttpBindingGenerator.kt:425 */;
|
335 + | /* HttpBindingGenerator.kt:453 */
|
336 + | Ok(if !var_15.is_empty() {
|
337 + | Some(var_15)
|
338 + | } else {
|
339 + | None
|
340 + | })
|
341 + | /* HttpBindingGenerator.kt:159 */
|
342 + | }
|
343 + |
|
344 + | /* HttpBindingGenerator.kt:159 */
|
345 + | pub(crate) fn de_header_true_bool_header(
|
346 + | header_map: &::aws_smithy_runtime_api::http::Headers,
|
347 + | ) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_legacy_http::header::ParseError>
|
348 + | {
|
349 + | /* HttpBindingGenerator.kt:166 */
|
350 + | let headers = header_map.get_all("X-Boolean1");
|
351 + | /* HttpBindingGenerator.kt:427 */
|
352 + | let var_16 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
|
353 + | /* HttpBindingGenerator.kt:491 */
|
354 + | if var_16.len() > 1 {
|
355 + | Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
|
356 + | "expected one item but found {}",
|
357 + | var_16.len()
|
358 + | )))
|
359 + | } else {
|
360 + | let mut var_16 = var_16;
|
361 + | Ok(var_16.pop())
|
362 + | }
|
363 + | /* HttpBindingGenerator.kt:159 */
|
364 + | }
|