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_primitive_int_op_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::primitive_int_op::PrimitiveIntOpOutput, crate::operation::primitive_int_op::PrimitiveIntOpError> {
|
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::primitive_int_op::PrimitiveIntOpError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:122 */
|
12 18 | let error_code = match generic.code() {
|
13 19 | Some(code) => code,
|
14 20 | None => return Err(crate::operation::primitive_int_op::PrimitiveIntOpError::unhandled(generic)),
|
15 21 | };
|
16 22 |
|
17 23 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
24 + | /* ProtocolParserGenerator.kt:133 */
|
18 25 | Err(match error_code {
|
26 + | /* ProtocolParserGenerator.kt:139 */
|
19 27 | "ExtraError" => crate::operation::primitive_int_op::PrimitiveIntOpError::ExtraError({
|
28 + | /* RustType.kt:516 */
|
20 29 | #[allow(unused_mut)]
|
21 - | let mut tmp = {
|
22 - | #[allow(unused_mut)]
|
23 - | let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
|
24 - | output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
|
25 - | .map_err(crate::operation::primitive_int_op::PrimitiveIntOpError::unhandled)?;
|
26 - | let output = output.meta(generic);
|
27 - | output.build()
|
28 - | };
|
30 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
31 + | /* ProtocolParserGenerator.kt:146 */ {
|
32 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
33 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
|
34 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::primitive_int_op::PrimitiveIntOpError::unhandled)?;
|
35 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
36 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
37 + | /* ProtocolParserGenerator.kt:146 */}
|
38 + | /* ProtocolParserGenerator.kt:145 */;
|
39 + | /* ProtocolParserGenerator.kt:170 */
|
29 40 | if tmp.message.is_none() {
|
30 41 | tmp.message = _error_message;
|
31 42 | }
|
43 + | /* ProtocolParserGenerator.kt:179 */
|
32 44 | tmp
|
45 + | /* ProtocolParserGenerator.kt:139 */
|
33 46 | }),
|
34 - | _ => crate::operation::primitive_int_op::PrimitiveIntOpError::generic(generic),
|
47 + | /* ProtocolParserGenerator.kt:182 */
|
48 + | _ => crate::operation::primitive_int_op::PrimitiveIntOpError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
35 49 | })
|
50 + | /* ProtocolParserGenerator.kt:99 */
|
36 51 | }
|
37 52 |
|
53 + | /* RustType.kt:516 */
|
38 54 | #[allow(clippy::unnecessary_wraps)]
|
55 + | /* ProtocolParserGenerator.kt:71 */
|
39 56 | pub fn de_primitive_int_op_http_response(
|
40 57 | _response_status: u16,
|
41 58 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
42 59 | _response_body: &[u8],
|
43 60 | ) -> std::result::Result<crate::operation::primitive_int_op::PrimitiveIntOpOutput, crate::operation::primitive_int_op::PrimitiveIntOpError> {
|
61 + | /* ProtocolParserGenerator.kt:77 */
|
44 62 | Ok({
|
63 + | /* RustType.kt:516 */
|
45 64 | #[allow(unused_mut)]
|
65 + | /* ProtocolParserGenerator.kt:240 */
|
46 66 | let mut output = crate::operation::primitive_int_op::builders::PrimitiveIntOpOutputBuilder::default();
|
67 + | /* ProtocolParserGenerator.kt:247 */
|
47 68 | output = crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op(_response_body, output)
|
48 69 | .map_err(crate::operation::primitive_int_op::PrimitiveIntOpError::unhandled)?;
|
70 + | /* ClientBuilderInstantiator.kt:56 */
|
49 71 | output.build()
|
72 + | /* ProtocolParserGenerator.kt:77 */
|
50 73 | })
|
74 + | /* ProtocolParserGenerator.kt:71 */
|
51 75 | }
|
52 76 |
|
77 + | /* JsonSerializerGenerator.kt:287 */
|
53 78 | pub fn ser_primitive_int_op_input(
|
54 79 | input: &crate::operation::primitive_int_op::PrimitiveIntOpInput,
|
55 80 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
81 + | /* JsonSerializerGenerator.kt:291 */
|
56 82 | let mut out = String::new();
|
83 + | /* JsonSerializerGenerator.kt:292 */
|
57 84 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
85 + | /* JsonSerializerGenerator.kt:375 */
|
58 86 | crate::protocol_serde::shape_primitive_int_op_input::ser_primitive_int_op_input_input(&mut object, input)?;
|
87 + | /* JsonSerializerGenerator.kt:295 */
|
59 88 | object.finish();
|
89 + | /* JsonSerializerGenerator.kt:296 */
|
60 90 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
91 + | /* JsonSerializerGenerator.kt:287 */
|
61 92 | }
|
62 93 |
|
94 + | /* JsonParserGenerator.kt:148 */
|
63 95 | pub(crate) fn de_primitive_int_op(
|
64 96 | value: &[u8],
|
65 97 | mut builder: crate::operation::primitive_int_op::builders::PrimitiveIntOpOutputBuilder,
|
66 98 | ) -> ::std::result::Result<
|
67 99 | crate::operation::primitive_int_op::builders::PrimitiveIntOpOutputBuilder,
|
68 100 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
69 101 | > {
|
102 + | /* JsonParserGenerator.kt:153 */
|
70 103 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
71 104 | let tokens = &mut tokens_owned;
|
72 105 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
106 + | /* JsonParserGenerator.kt:684 */
|
73 107 | loop {
|
108 + | /* JsonParserGenerator.kt:685 */
|
74 109 | match tokens.next().transpose()? {
|
75 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
76 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
77 - | "value" => {
|
78 - | builder = builder.set_value(
|
79 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
80 - | .map(i32::try_from)
|
81 - | .transpose()?,
|
82 - | );
|
110 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
111 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
112 + | /* JsonParserGenerator.kt:260 */
|
113 + | match key.to_unescaped()?.as_ref() {
|
114 + | /* JsonParserGenerator.kt:262 */
|
115 + | "value" => {
|
116 + | /* JsonParserGenerator.kt:265 */
|
117 + | builder = builder.set_value(
|
118 + | /* JsonParserGenerator.kt:365 */
|
119 + | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
120 + | .map(i32::try_from)
|
121 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
122 + | );
|
123 + | /* JsonParserGenerator.kt:262 */
|
124 + | }
|
125 + | /* JsonParserGenerator.kt:290 */
|
126 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
83 127 | }
|
84 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
85 - | },
|
128 + | /* JsonParserGenerator.kt:686 */
|
129 + | }
|
130 + | /* JsonParserGenerator.kt:695 */
|
86 131 | other => {
|
87 132 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
88 133 | "expected object key or end object, found: {:?}",
|
89 134 | other
|
90 135 | )))
|
91 - | }
|
136 + | } /* JsonParserGenerator.kt:685 */
|
92 137 | }
|
138 + | /* JsonParserGenerator.kt:684 */
|
93 139 | }
|
140 + | /* JsonParserGenerator.kt:250 */
|
94 141 | if tokens.next().is_some() {
|
142 + | /* JsonParserGenerator.kt:251 */
|
95 143 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
96 144 | "found more JSON tokens after completing parsing",
|
97 145 | ));
|
146 + | /* JsonParserGenerator.kt:250 */
|
98 147 | }
|
148 + | /* JsonParserGenerator.kt:163 */
|
99 149 | Ok(builder)
|
150 + | /* JsonParserGenerator.kt:148 */
|
100 151 | }
|