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