1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_document_type_as_map_value_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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
|
9 - | crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
|
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::document_type_as_map_value::DocumentTypeAsMapValueError::unhandled)?;
|
14 - | let generic = generic_builder.build();
|
15 - | Err(crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError::generic(
|
16 - | generic,
|
17 - | ))
|
18 - | }
|
19 - |
|
20 - | #[allow(clippy::unnecessary_wraps)]
|
21 - | pub fn de_document_type_as_map_value_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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
|
27 - | crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
|
28 - | > {
|
29 - | Ok({
|
30 - | #[allow(unused_mut)]
|
31 - | let mut output = crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder::default();
|
32 - | output = crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value(_response_body, output)
|
33 - | .map_err(crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError::unhandled)?;
|
34 - | output.build()
|
35 - | })
|
36 - | }
|
37 - |
|
38 - | pub fn ser_document_type_as_map_value_input(
|
39 - | input: &crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput,
|
40 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
41 - | let mut out = String::new();
|
42 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
43 - | crate::protocol_serde::shape_document_type_as_map_value_input::ser_document_type_as_map_value_input_input(&mut object, input)?;
|
44 - | object.finish();
|
45 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
46 - | }
|
47 - |
|
48 - | pub(crate) fn de_document_type_as_map_value(
|
49 - | _value: &[u8],
|
50 - | mut builder: crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder,
|
51 - | ) -> ::std::result::Result<
|
52 - | crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder,
|
53 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
54 - | > {
|
55 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
56 - | let tokens = &mut tokens_owned;
|
57 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
58 - | loop {
|
59 - | match tokens.next().transpose()? {
|
60 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
61 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
62 - | "docValuedMap" => {
|
63 - | builder = builder.set_doc_valued_map(crate::protocol_serde::shape_document_valued_map::de_document_valued_map(tokens, _value)?);
|
64 - | }
|
65 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
66 - | },
|
67 - | other => {
|
68 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
69 - | "expected object key or end object, found: {other:?}"
|
70 - | )))
|
71 - | }
|
72 - | }
|
73 - | }
|
74 - | if tokens.next().is_some() {
|
75 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
76 - | "found more JSON tokens after completing parsing",
|
77 - | ));
|
78 - | }
|
79 - | Ok(builder)
|
80 - | }
|