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_operation_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::operation::OperationOutput, crate::operation::operation::OperationError> {
|
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::operation::OperationError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:185 */
|
12 18 | Err(crate::operation::operation::OperationError::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_operation_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::operation::OperationOutput, crate::operation::operation::OperationError> {
|
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::operation::builders::OperationOutputBuilder::default();
|
36 + | /* ProtocolParserGenerator.kt:247 */
|
24 37 | output = crate::protocol_serde::shape_operation::de_operation(_response_body, output)
|
25 38 | .map_err(crate::operation::operation::OperationError::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_operation_input(
|
31 48 | input: &crate::operation::operation::OperationInput,
|
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_operation_input::ser_operation_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_operation(
|
41 65 | value: &[u8],
|
42 66 | mut builder: crate::operation::operation::builders::OperationOutputBuilder,
|
43 67 | ) -> ::std::result::Result<crate::operation::operation::builders::OperationOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
|
68 + | /* JsonParserGenerator.kt:153 */
|
44 69 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
45 70 | let tokens = &mut tokens_owned;
|
46 71 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
72 + | /* JsonParserGenerator.kt:684 */
|
47 73 | loop {
|
74 + | /* JsonParserGenerator.kt:685 */
|
48 75 | match tokens.next().transpose()? {
|
49 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
50 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
76 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
77 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
78 + | /* JsonParserGenerator.kt:260 */
|
79 + | match key.to_unescaped()?.as_ref() {
|
80 + | /* JsonParserGenerator.kt:262 */
|
51 81 | "message" => {
|
82 + | /* JsonParserGenerator.kt:265 */
|
52 83 | builder = builder.set_message(
|
84 + | /* JsonParserGenerator.kt:354 */
|
53 85 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
54 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
55 - | .transpose()?,
|
86 + | .map(|s|
|
87 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
88 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
89 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
90 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
56 91 | );
|
92 + | /* JsonParserGenerator.kt:262 */
|
57 93 | }
|
58 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
59 - | },
|
94 + | /* JsonParserGenerator.kt:290 */
|
95 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
96 + | }
|
97 + | /* JsonParserGenerator.kt:686 */
|
98 + | }
|
99 + | /* JsonParserGenerator.kt:695 */
|
60 100 | other => {
|
61 101 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
62 102 | "expected object key or end object, found: {:?}",
|
63 103 | other
|
64 104 | )))
|
105 + | } /* JsonParserGenerator.kt:685 */
|
65 106 | }
|
107 + | /* JsonParserGenerator.kt:684 */
|
66 108 | }
|
67 - | }
|
109 + | /* JsonParserGenerator.kt:250 */
|
68 110 | if tokens.next().is_some() {
|
111 + | /* JsonParserGenerator.kt:251 */
|
69 112 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
70 113 | "found more JSON tokens after completing parsing",
|
71 114 | ));
|
115 + | /* JsonParserGenerator.kt:250 */
|
72 116 | }
|
117 + | /* JsonParserGenerator.kt:163 */
|
73 118 | Ok(builder)
|
119 + | /* JsonParserGenerator.kt:148 */
|
74 120 | }
|