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 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_sparse_json_maps_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<crate::operation::sparse_json_maps::SparseJsonMapsOutput, crate::operation::sparse_json_maps::SparseJsonMapsError> {
|
10 + | /* RustType.kt:516 */
|
8 11 | #[allow(unused_mut)]
|
12 + | /* ProtocolParserGenerator.kt:106 */
|
9 13 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 14 | .map_err(crate::operation::sparse_json_maps::SparseJsonMapsError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:185 */
|
12 18 | Err(crate::operation::sparse_json_maps::SparseJsonMapsError::generic(generic))
|
19 + | /* ProtocolParserGenerator.kt:99 */
|
13 20 | }
|
14 21 |
|
22 + | /* RustType.kt:516 */
|
15 23 | #[allow(clippy::unnecessary_wraps)]
|
24 + | /* ProtocolParserGenerator.kt:71 */
|
16 25 | pub fn de_sparse_json_maps_http_response(
|
17 26 | _response_status: u16,
|
18 27 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
19 28 | _response_body: &[u8],
|
20 29 | ) -> std::result::Result<crate::operation::sparse_json_maps::SparseJsonMapsOutput, crate::operation::sparse_json_maps::SparseJsonMapsError> {
|
30 + | /* ProtocolParserGenerator.kt:77 */
|
21 31 | Ok({
|
32 + | /* RustType.kt:516 */
|
22 33 | #[allow(unused_mut)]
|
34 + | /* ProtocolParserGenerator.kt:240 */
|
23 35 | let mut output = crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder::default();
|
36 + | /* ProtocolParserGenerator.kt:247 */
|
24 37 | output = crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps(_response_body, output)
|
25 38 | .map_err(crate::operation::sparse_json_maps::SparseJsonMapsError::unhandled)?;
|
39 + | /* ClientBuilderInstantiator.kt:56 */
|
26 40 | output.build()
|
41 + | /* ProtocolParserGenerator.kt:77 */
|
27 42 | })
|
43 + | /* ProtocolParserGenerator.kt:71 */
|
28 44 | }
|
29 45 |
|
46 + | /* JsonSerializerGenerator.kt:287 */
|
30 47 | pub fn ser_sparse_json_maps_input(
|
31 48 | input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
|
32 49 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
50 + | /* JsonSerializerGenerator.kt:291 */
|
33 51 | let mut out = String::new();
|
52 + | /* JsonSerializerGenerator.kt:292 */
|
34 53 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
54 + | /* JsonSerializerGenerator.kt:375 */
|
35 55 | crate::protocol_serde::shape_sparse_json_maps_input::ser_sparse_json_maps_input_input(&mut object, input)?;
|
56 + | /* JsonSerializerGenerator.kt:295 */
|
36 57 | object.finish();
|
58 + | /* JsonSerializerGenerator.kt:296 */
|
37 59 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
60 + | /* JsonSerializerGenerator.kt:287 */
|
38 61 | }
|
39 62 |
|
63 + | /* JsonParserGenerator.kt:148 */
|
40 64 | pub(crate) fn de_sparse_json_maps(
|
41 65 | value: &[u8],
|
42 66 | mut builder: crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder,
|
43 67 | ) -> ::std::result::Result<
|
44 68 | crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder,
|
45 69 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
46 70 | > {
|
71 + | /* JsonParserGenerator.kt:153 */
|
47 72 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
48 73 | let tokens = &mut tokens_owned;
|
49 74 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
75 + | /* JsonParserGenerator.kt:684 */
|
50 76 | loop {
|
77 + | /* JsonParserGenerator.kt:685 */
|
51 78 | match tokens.next().transpose()? {
|
52 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
53 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
54 - | "sparseBooleanMap" => {
|
55 - | builder = builder.set_sparse_boolean_map(crate::protocol_serde::shape_sparse_boolean_map::de_sparse_boolean_map(tokens)?);
|
79 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
80 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
81 + | /* JsonParserGenerator.kt:260 */
|
82 + | match key.to_unescaped()?.as_ref() {
|
83 + | /* JsonParserGenerator.kt:262 */
|
84 + | "sparseBooleanMap" => {
|
85 + | /* JsonParserGenerator.kt:265 */
|
86 + | builder = builder.set_sparse_boolean_map(
|
87 + | /* JsonParserGenerator.kt:509 */
|
88 + | crate::protocol_serde::shape_sparse_boolean_map::de_sparse_boolean_map(tokens)?, /* JsonParserGenerator.kt:265 */
|
89 + | );
|
90 + | /* JsonParserGenerator.kt:262 */
|
91 + | }
|
92 + | /* JsonParserGenerator.kt:262 */
|
93 + | "sparseNumberMap" => {
|
94 + | /* JsonParserGenerator.kt:265 */
|
95 + | builder = builder.set_sparse_number_map(
|
96 + | /* JsonParserGenerator.kt:509 */
|
97 + | crate::protocol_serde::shape_sparse_number_map::de_sparse_number_map(tokens)?, /* JsonParserGenerator.kt:265 */
|
98 + | );
|
99 + | /* JsonParserGenerator.kt:262 */
|
100 + | }
|
101 + | /* JsonParserGenerator.kt:262 */
|
102 + | "sparseSetMap" => {
|
103 + | /* JsonParserGenerator.kt:265 */
|
104 + | builder = builder.set_sparse_set_map(
|
105 + | /* JsonParserGenerator.kt:509 */
|
106 + | crate::protocol_serde::shape_sparse_set_map::de_sparse_set_map(tokens)?, /* JsonParserGenerator.kt:265 */
|
107 + | );
|
108 + | /* JsonParserGenerator.kt:262 */
|
109 + | }
|
110 + | /* JsonParserGenerator.kt:262 */
|
111 + | "sparseStringMap" => {
|
112 + | /* JsonParserGenerator.kt:265 */
|
113 + | builder = builder.set_sparse_string_map(
|
114 + | /* JsonParserGenerator.kt:509 */
|
115 + | crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?, /* JsonParserGenerator.kt:265 */
|
116 + | );
|
117 + | /* JsonParserGenerator.kt:262 */
|
118 + | }
|
119 + | /* JsonParserGenerator.kt:262 */
|
120 + | "sparseStructMap" => {
|
121 + | /* JsonParserGenerator.kt:265 */
|
122 + | builder = builder.set_sparse_struct_map(
|
123 + | /* JsonParserGenerator.kt:509 */
|
124 + | crate::protocol_serde::shape_sparse_struct_map::de_sparse_struct_map(tokens)?, /* JsonParserGenerator.kt:265 */
|
125 + | );
|
126 + | /* JsonParserGenerator.kt:262 */
|
127 + | }
|
128 + | /* JsonParserGenerator.kt:290 */
|
129 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
56 130 | }
|
57 - | "sparseNumberMap" => {
|
58 - | builder = builder.set_sparse_number_map(crate::protocol_serde::shape_sparse_number_map::de_sparse_number_map(tokens)?);
|
59 - | }
|
60 - | "sparseSetMap" => {
|
61 - | builder = builder.set_sparse_set_map(crate::protocol_serde::shape_sparse_set_map::de_sparse_set_map(tokens)?);
|
62 - | }
|
63 - | "sparseStringMap" => {
|
64 - | builder = builder.set_sparse_string_map(crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?);
|
65 - | }
|
66 - | "sparseStructMap" => {
|
67 - | builder = builder.set_sparse_struct_map(crate::protocol_serde::shape_sparse_struct_map::de_sparse_struct_map(tokens)?);
|
68 - | }
|
69 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
70 - | },
|
131 + | /* JsonParserGenerator.kt:686 */
|
132 + | }
|
133 + | /* JsonParserGenerator.kt:695 */
|
71 134 | other => {
|
72 135 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
73 136 | "expected object key or end object, found: {:?}",
|
74 137 | other
|
75 138 | )))
|
76 - | }
|
139 + | } /* JsonParserGenerator.kt:685 */
|
77 140 | }
|
141 + | /* JsonParserGenerator.kt:684 */
|
78 142 | }
|
143 + | /* JsonParserGenerator.kt:250 */
|
79 144 | if tokens.next().is_some() {
|
145 + | /* JsonParserGenerator.kt:251 */
|
80 146 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
81 147 | "found more JSON tokens after completing parsing",
|
82 148 | ));
|
149 + | /* JsonParserGenerator.kt:250 */
|
83 150 | }
|
151 + | /* JsonParserGenerator.kt:163 */
|
84 152 | Ok(builder)
|
153 + | /* JsonParserGenerator.kt:148 */
|
85 154 | }
|