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_escaped_string_values_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::escaped_string_values::EscapedStringValuesOutput,
|
9 11 | crate::operation::escaped_string_values::EscapedStringValuesError,
|
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::escaped_string_values::EscapedStringValuesError::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::escaped_string_values::EscapedStringValuesError::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::escaped_string_values::EscapedStringValuesError::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::escaped_string_values::EscapedStringValuesError::unhandled)?;
|
29 - | let output = output.meta(generic);
|
30 - | crate::serde_util::validation_exception_correct_errors(output)
|
31 - | .build()
|
32 - | .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::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::escaped_string_values::EscapedStringValuesError::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::escaped_string_values::EscapedStringValuesError::unhandled)?
|
40 + | /* ProtocolParserGenerator.kt:146 */}
|
41 + | /* ProtocolParserGenerator.kt:145 */;
|
42 + | /* ProtocolParserGenerator.kt:179 */
|
34 43 | tmp
|
44 + | /* ProtocolParserGenerator.kt:139 */
|
35 45 | }),
|
46 + | /* ProtocolParserGenerator.kt:139 */
|
36 47 | "ExtraError" => crate::operation::escaped_string_values::EscapedStringValuesError::ExtraError({
|
48 + | /* RustType.kt:516 */
|
37 49 | #[allow(unused_mut)]
|
38 - | let mut tmp = {
|
39 - | #[allow(unused_mut)]
|
40 - | let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
|
41 - | output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
|
42 - | .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
|
43 - | let output = output.meta(generic);
|
44 - | output.build()
|
45 - | };
|
50 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
51 + | /* ProtocolParserGenerator.kt:146 */ {
|
52 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
53 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
|
54 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
|
55 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
56 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
57 + | /* ProtocolParserGenerator.kt:146 */}
|
58 + | /* ProtocolParserGenerator.kt:145 */;
|
59 + | /* ProtocolParserGenerator.kt:170 */
|
46 60 | if tmp.message.is_none() {
|
47 61 | tmp.message = _error_message;
|
48 62 | }
|
63 + | /* ProtocolParserGenerator.kt:179 */
|
49 64 | tmp
|
65 + | /* ProtocolParserGenerator.kt:139 */
|
50 66 | }),
|
51 - | _ => crate::operation::escaped_string_values::EscapedStringValuesError::generic(generic),
|
67 + | /* ProtocolParserGenerator.kt:182 */
|
68 + | _ => crate::operation::escaped_string_values::EscapedStringValuesError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
52 69 | })
|
70 + | /* ProtocolParserGenerator.kt:99 */
|
53 71 | }
|
54 72 |
|
73 + | /* RustType.kt:516 */
|
55 74 | #[allow(clippy::unnecessary_wraps)]
|
75 + | /* ProtocolParserGenerator.kt:71 */
|
56 76 | pub fn de_escaped_string_values_http_response(
|
57 77 | _response_status: u16,
|
58 78 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
59 79 | _response_body: &[u8],
|
60 80 | ) -> std::result::Result<
|
61 81 | crate::operation::escaped_string_values::EscapedStringValuesOutput,
|
62 82 | crate::operation::escaped_string_values::EscapedStringValuesError,
|
63 83 | > {
|
84 + | /* ProtocolParserGenerator.kt:77 */
|
64 85 | Ok({
|
86 + | /* RustType.kt:516 */
|
65 87 | #[allow(unused_mut)]
|
88 + | /* ProtocolParserGenerator.kt:240 */
|
66 89 | let mut output = crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder::default();
|
90 + | /* ProtocolParserGenerator.kt:247 */
|
67 91 | output = crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values(_response_body, output)
|
68 92 | .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
|
93 + | /* ClientBuilderInstantiator.kt:56 */
|
69 94 | output.build()
|
95 + | /* ProtocolParserGenerator.kt:77 */
|
70 96 | })
|
97 + | /* ProtocolParserGenerator.kt:71 */
|
71 98 | }
|
72 99 |
|
100 + | /* JsonSerializerGenerator.kt:287 */
|
73 101 | pub fn ser_escaped_string_values_input(
|
74 102 | input: &crate::operation::escaped_string_values::EscapedStringValuesInput,
|
75 103 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
104 + | /* JsonSerializerGenerator.kt:291 */
|
76 105 | let mut out = String::new();
|
106 + | /* JsonSerializerGenerator.kt:292 */
|
77 107 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
108 + | /* JsonSerializerGenerator.kt:375 */
|
78 109 | crate::protocol_serde::shape_escaped_string_values_input::ser_escaped_string_values_input_input(&mut object, input)?;
|
110 + | /* JsonSerializerGenerator.kt:295 */
|
79 111 | object.finish();
|
112 + | /* JsonSerializerGenerator.kt:296 */
|
80 113 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
114 + | /* JsonSerializerGenerator.kt:287 */
|
81 115 | }
|
82 116 |
|
117 + | /* JsonParserGenerator.kt:148 */
|
83 118 | pub(crate) fn de_escaped_string_values(
|
84 119 | value: &[u8],
|
85 120 | mut builder: crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
|
86 121 | ) -> ::std::result::Result<
|
87 122 | crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
|
88 123 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
89 124 | > {
|
125 + | /* JsonParserGenerator.kt:153 */
|
90 126 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
91 127 | let tokens = &mut tokens_owned;
|
92 128 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
129 + | /* JsonParserGenerator.kt:684 */
|
93 130 | loop {
|
131 + | /* JsonParserGenerator.kt:685 */
|
94 132 | match tokens.next().transpose()? {
|
95 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
96 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
97 - | "enum" => {
|
98 - | builder = builder.set_enum(
|
99 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
100 - | .map(|s| s.to_unescaped().map(|u| crate::types::EnumWithEscapedChars::from(u.as_ref())))
|
101 - | .transpose()?,
|
102 - | );
|
133 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
134 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
135 + | /* JsonParserGenerator.kt:260 */
|
136 + | match key.to_unescaped()?.as_ref() {
|
137 + | /* JsonParserGenerator.kt:262 */
|
138 + | "enum" => {
|
139 + | /* JsonParserGenerator.kt:265 */
|
140 + | builder = builder.set_enum(
|
141 + | /* JsonParserGenerator.kt:354 */
|
142 + | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
143 + | .map(|s|
|
144 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
145 + | /* JsonParserGenerator.kt:345 */crate::types::EnumWithEscapedChars::from(u.as_ref())
|
146 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
147 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
148 + | );
|
149 + | /* JsonParserGenerator.kt:262 */
|
150 + | }
|
151 + | /* JsonParserGenerator.kt:262 */
|
152 + | "also\"has\"quotes" => {
|
153 + | /* JsonParserGenerator.kt:265 */
|
154 + | builder = builder.set_some_string(
|
155 + | /* JsonParserGenerator.kt:354 */
|
156 + | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
157 + | .map(|s|
|
158 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
159 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
160 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
161 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
162 + | );
|
163 + | /* JsonParserGenerator.kt:262 */
|
164 + | }
|
165 + | /* JsonParserGenerator.kt:290 */
|
166 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
103 167 | }
|
104 - | "also\"has\"quotes" => {
|
105 - | builder = builder.set_some_string(
|
106 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
107 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
108 - | .transpose()?,
|
109 - | );
|
110 - | }
|
111 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
112 - | },
|
168 + | /* JsonParserGenerator.kt:686 */
|
169 + | }
|
170 + | /* JsonParserGenerator.kt:695 */
|
113 171 | other => {
|
114 172 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
115 173 | "expected object key or end object, found: {:?}",
|
116 174 | other
|
117 175 | )))
|
118 - | }
|
176 + | } /* JsonParserGenerator.kt:685 */
|
119 177 | }
|
178 + | /* JsonParserGenerator.kt:684 */
|
120 179 | }
|
180 + | /* JsonParserGenerator.kt:250 */
|
121 181 | if tokens.next().is_some() {
|
182 + | /* JsonParserGenerator.kt:251 */
|
122 183 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
123 184 | "found more JSON tokens after completing parsing",
|
124 185 | ));
|
186 + | /* JsonParserGenerator.kt:250 */
|
125 187 | }
|
188 + | /* JsonParserGenerator.kt:163 */
|
126 189 | Ok(builder)
|
190 + | /* JsonParserGenerator.kt:148 */
|
127 191 | }
|