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_result_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::result::ResultOutput, crate::operation::result::ResultError> {
|
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::result::ResultError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:185 */
|
12 18 | Err(crate::operation::result::ResultError::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_result_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::result::ResultOutput, crate::operation::result::ResultError> {
|
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::result::builders::ResultOutputBuilder::default();
|
36 + | /* ProtocolParserGenerator.kt:247 */
|
24 37 | output = crate::protocol_serde::shape_result::de_result(_response_body, output).map_err(crate::operation::result::ResultError::unhandled)?;
|
38 + | /* ClientBuilderInstantiator.kt:56 */
|
25 39 | output.build()
|
40 + | /* ProtocolParserGenerator.kt:77 */
|
26 41 | })
|
42 + | /* ProtocolParserGenerator.kt:71 */
|
27 43 | }
|
28 44 |
|
45 + | /* JsonSerializerGenerator.kt:287 */
|
29 46 | pub fn ser_result_input(
|
30 47 | input: &crate::operation::result::ResultInput,
|
31 48 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
49 + | /* JsonSerializerGenerator.kt:291 */
|
32 50 | let mut out = String::new();
|
51 + | /* JsonSerializerGenerator.kt:292 */
|
33 52 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
53 + | /* JsonSerializerGenerator.kt:375 */
|
34 54 | crate::protocol_serde::shape_result_input::ser_result_input_input(&mut object, input)?;
|
55 + | /* JsonSerializerGenerator.kt:295 */
|
35 56 | object.finish();
|
57 + | /* JsonSerializerGenerator.kt:296 */
|
36 58 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
59 + | /* JsonSerializerGenerator.kt:287 */
|
37 60 | }
|
38 61 |
|
62 + | /* JsonParserGenerator.kt:148 */
|
39 63 | pub(crate) fn de_result(
|
40 64 | value: &[u8],
|
41 65 | mut builder: crate::operation::result::builders::ResultOutputBuilder,
|
42 66 | ) -> ::std::result::Result<crate::operation::result::builders::ResultOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
|
67 + | /* JsonParserGenerator.kt:153 */
|
43 68 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
44 69 | let tokens = &mut tokens_owned;
|
45 70 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
71 + | /* JsonParserGenerator.kt:684 */
|
46 72 | loop {
|
73 + | /* JsonParserGenerator.kt:685 */
|
47 74 | match tokens.next().transpose()? {
|
48 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
49 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
50 - | "pv_member" => {
|
51 - | builder = builder.set_pv_member(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
75 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
76 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
77 + | /* JsonParserGenerator.kt:260 */
|
78 + | match key.to_unescaped()?.as_ref() {
|
79 + | /* JsonParserGenerator.kt:262 */
|
80 + | "pv_member" => {
|
81 + | /* JsonParserGenerator.kt:265 */
|
82 + | builder = builder.set_pv_member(
|
83 + | /* JsonParserGenerator.kt:298 */
|
84 + | ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?, /* JsonParserGenerator.kt:265 */
|
85 + | );
|
86 + | /* JsonParserGenerator.kt:262 */
|
87 + | }
|
88 + | /* JsonParserGenerator.kt:290 */
|
89 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
52 90 | }
|
53 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
54 - | },
|
91 + | /* JsonParserGenerator.kt:686 */
|
92 + | }
|
93 + | /* JsonParserGenerator.kt:695 */
|
55 94 | other => {
|
56 95 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
57 96 | "expected object key or end object, found: {:?}",
|
58 97 | other
|
59 98 | )))
|
60 - | }
|
99 + | } /* JsonParserGenerator.kt:685 */
|
61 100 | }
|
101 + | /* JsonParserGenerator.kt:684 */
|
62 102 | }
|
103 + | /* JsonParserGenerator.kt:250 */
|
63 104 | if tokens.next().is_some() {
|
105 + | /* JsonParserGenerator.kt:251 */
|
64 106 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
65 107 | "found more JSON tokens after completing parsing",
|
66 108 | ));
|
109 + | /* JsonParserGenerator.kt:250 */
|
67 110 | }
|
111 + | /* JsonParserGenerator.kt:163 */
|
68 112 | Ok(builder)
|
113 + | /* JsonParserGenerator.kt:148 */
|
69 114 | }
|