1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_malformed_accept_with_body_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<
|
8 - | crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput,
|
9 - | crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 - | .map_err(crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError::unhandled)?;
|
14 - | let generic = generic_builder.build();
|
15 - | Err(crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError::generic(
|
16 - | generic,
|
17 - | ))
|
18 - | }
|
19 - |
|
20 - | #[allow(clippy::unnecessary_wraps)]
|
21 - | pub fn de_malformed_accept_with_body_http_response(
|
22 - | _response_status: u16,
|
23 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
24 - | _response_body: &[u8],
|
25 - | ) -> std::result::Result<
|
26 - | crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput,
|
27 - | crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
|
28 - | > {
|
29 - | Ok({
|
30 - | #[allow(unused_mut)]
|
31 - | let mut output = crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder::default();
|
32 - | output = crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body(_response_body, output)
|
33 - | .map_err(crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError::unhandled)?;
|
34 - | output.build()
|
35 - | })
|
36 - | }
|
37 - |
|
38 - | pub(crate) fn de_malformed_accept_with_body(
|
39 - | _value: &[u8],
|
40 - | mut builder: crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder,
|
41 - | ) -> ::std::result::Result<
|
42 - | crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder,
|
43 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
44 - | > {
|
45 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
46 - | let tokens = &mut tokens_owned;
|
47 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
48 - | loop {
|
49 - | match tokens.next().transpose()? {
|
50 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
51 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
52 - | "hi" => {
|
53 - | builder = builder.set_hi(
|
54 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
55 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
56 - | .transpose()?,
|
57 - | );
|
58 - | }
|
59 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
60 - | },
|
61 - | other => {
|
62 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
63 - | "expected object key or end object, found: {other:?}"
|
64 - | )))
|
65 - | }
|
66 - | }
|
67 - | }
|
68 - | if tokens.next().is_some() {
|
69 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
70 - | "found more JSON tokens after completing parsing",
|
71 - | ));
|
72 - | }
|
73 - | Ok(builder)
|
74 - | }
|