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_greeting_with_errors_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::greeting_with_errors::GreetingWithErrorsOutput,
|
9 11 | crate::operation::greeting_with_errors::GreetingWithErrorsError,
|
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::greeting_with_errors::GreetingWithErrorsError::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::greeting_with_errors::GreetingWithErrorsError::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 | "InvalidGreeting" => crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting({
|
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::InvalidGreetingBuilder::default();
|
27 - | output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_xml_err(_response_body, output)
|
28 - | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
29 - | let output = output.meta(generic);
|
30 - | output.build()
|
31 - | };
|
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::InvalidGreetingBuilder::default();
|
37 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_xml_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
38 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
39 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
40 + | /* ProtocolParserGenerator.kt:146 */}
|
41 + | /* ProtocolParserGenerator.kt:145 */;
|
42 + | /* ProtocolParserGenerator.kt:170 */
|
32 43 | if tmp.message.is_none() {
|
33 44 | tmp.message = _error_message;
|
34 45 | }
|
46 + | /* ProtocolParserGenerator.kt:179 */
|
35 47 | tmp
|
48 + | /* ProtocolParserGenerator.kt:139 */
|
36 49 | }),
|
50 + | /* ProtocolParserGenerator.kt:139 */
|
37 51 | "ComplexError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError({
|
52 + | /* RustType.kt:516 */
|
38 53 | #[allow(unused_mut)]
|
39 - | let mut tmp = {
|
40 - | #[allow(unused_mut)]
|
41 - | let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
|
42 - | output = crate::protocol_serde::shape_complex_error::de_complex_error_xml_err(_response_body, output)
|
43 - | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
44 - | let output = output.meta(generic);
|
45 - | output.build()
|
46 - | };
|
54 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
55 + | /* ProtocolParserGenerator.kt:146 */ {
|
56 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
57 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
|
58 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_complex_error::de_complex_error_xml_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
59 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
60 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
61 + | /* ProtocolParserGenerator.kt:146 */}
|
62 + | /* ProtocolParserGenerator.kt:145 */;
|
63 + | /* ProtocolParserGenerator.kt:179 */
|
47 64 | tmp
|
65 + | /* ProtocolParserGenerator.kt:139 */
|
48 66 | }),
|
67 + | /* ProtocolParserGenerator.kt:139 */
|
49 68 | "Customized" => crate::operation::greeting_with_errors::GreetingWithErrorsError::CustomCodeError({
|
69 + | /* RustType.kt:516 */
|
50 70 | #[allow(unused_mut)]
|
51 - | let mut tmp = {
|
52 - | #[allow(unused_mut)]
|
53 - | let mut output = crate::types::error::builders::CustomCodeErrorBuilder::default();
|
54 - | output = crate::protocol_serde::shape_custom_code_error::de_custom_code_error_xml_err(_response_body, output)
|
55 - | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
56 - | let output = output.meta(generic);
|
57 - | output.build()
|
58 - | };
|
71 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
72 + | /* ProtocolParserGenerator.kt:146 */ {
|
73 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
74 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::CustomCodeErrorBuilder::default();
|
75 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_custom_code_error::de_custom_code_error_xml_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
76 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
77 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
78 + | /* ProtocolParserGenerator.kt:146 */}
|
79 + | /* ProtocolParserGenerator.kt:145 */;
|
80 + | /* ProtocolParserGenerator.kt:170 */
|
59 81 | if tmp.message.is_none() {
|
60 82 | tmp.message = _error_message;
|
61 83 | }
|
84 + | /* ProtocolParserGenerator.kt:179 */
|
62 85 | tmp
|
86 + | /* ProtocolParserGenerator.kt:139 */
|
63 87 | }),
|
64 - | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
|
88 + | /* ProtocolParserGenerator.kt:182 */
|
89 + | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
65 90 | })
|
91 + | /* ProtocolParserGenerator.kt:99 */
|
66 92 | }
|
67 93 |
|
94 + | /* RustType.kt:516 */
|
68 95 | #[allow(clippy::unnecessary_wraps)]
|
96 + | /* ProtocolParserGenerator.kt:71 */
|
69 97 | pub fn de_greeting_with_errors_http_response(
|
70 98 | _response_status: u16,
|
71 99 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
72 100 | _response_body: &[u8],
|
73 101 | ) -> std::result::Result<
|
74 102 | crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
|
75 103 | crate::operation::greeting_with_errors::GreetingWithErrorsError,
|
76 104 | > {
|
105 + | /* ProtocolParserGenerator.kt:77 */
|
77 106 | Ok({
|
107 + | /* RustType.kt:516 */
|
78 108 | #[allow(unused_mut)]
|
109 + | /* ProtocolParserGenerator.kt:240 */
|
79 110 | let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
|
111 + | /* ProtocolParserGenerator.kt:247 */
|
80 112 | output = crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors(_response_body, output)
|
81 113 | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
114 + | /* ClientBuilderInstantiator.kt:56 */
|
82 115 | output.build()
|
116 + | /* ProtocolParserGenerator.kt:77 */
|
83 117 | })
|
118 + | /* ProtocolParserGenerator.kt:71 */
|
84 119 | }
|
85 120 |
|
121 + | /* RustType.kt:516 */
|
86 122 | #[allow(unused_mut)]
|
123 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
87 124 | pub fn de_greeting_with_errors(
|
88 125 | inp: &[u8],
|
89 126 | mut builder: crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
|
90 127 | ) -> std::result::Result<crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError>
|
91 128 | {
|
129 + | /* XmlBindingTraitParserGenerator.kt:194 */
|
92 130 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
93 131 |
|
94 132 | #[allow(unused_mut)]
|
95 133 | let mut decoder = doc.root_element()?;
|
96 134 | #[allow(unused_variables)]
|
97 135 | let start_el = decoder.start_el();
|
136 + | /* AwsQueryParserGenerator.kt:38 */
|
98 137 | if !(start_el.matches("GreetingWithErrorsResponse")) {
|
99 138 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
100 139 | "invalid root, expected GreetingWithErrorsResponse got {:?}",
|
101 140 | start_el
|
102 141 | )));
|
103 142 | }
|
104 143 | if let Some(mut result_tag) = decoder.next_tag() {
|
105 144 | let start_el = result_tag.start_el();
|
106 145 | if !(start_el.matches("GreetingWithErrorsResult")) {
|
107 146 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
108 147 | "invalid result, expected GreetingWithErrorsResult got {:?}",
|
109 148 | start_el
|
110 149 | )));
|
111 150 | }
|
151 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
112 152 | while let Some(mut tag) = result_tag.next_tag() {
|
153 + | /* XmlBindingTraitParserGenerator.kt:353 */
|
113 154 | match tag.start_el() {
|
114 - | s if s.matches("greeting") /* greeting aws.protocoltests.query.synthetic#GreetingWithErrorsOutput$greeting */ => {
|
115 - | let var_1 =
|
116 - | Some(
|
117 - | Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
|
118 - | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
119 - | .into()
|
120 - | )
|
121 - | ?
|
122 - | )
|
123 - | ;
|
124 - | builder = builder.set_greeting(var_1);
|
125 - | }
|
155 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("greeting") /* greeting aws.protocoltests.query.synthetic#GreetingWithErrorsOutput$greeting */ => {
|
156 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
|
157 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
158 + | /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
|
159 + | /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
160 + | /* XmlBindingTraitParserGenerator.kt:748 */.into()
|
161 + | /* XmlBindingTraitParserGenerator.kt:729 */)
|
162 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
163 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
164 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
165 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_greeting(var_1);
|
166 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
126 167 | ,
|
127 - | _ => {}
|
128 - | }
|
168 + | /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
|
169 + | /* XmlBindingTraitParserGenerator.kt:353 */}
|
170 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
129 171 | }
|
172 + | /* AwsQueryParserGenerator.kt:52 */
|
130 173 | } else {
|
131 174 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("expected GreetingWithErrorsResult tag"));
|
132 175 | };
|
176 + | /* XmlBindingTraitParserGenerator.kt:213 */
|
133 177 | Ok(builder)
|
178 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
134 179 | }
|