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 - | output = output.set_header(
|
45 - | crate::protocol_serde::shape_complex_error::de_header_header(_response_headers).map_err(|_| {
|
46 - | crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse Header from header `X-Header")
|
47 - | })?,
|
48 - | );
|
49 - | let output = output.meta(generic);
|
50 - | output.build()
|
51 - | };
|
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:267 */output = output.set_header(
|
60 + | /* ProtocolParserGenerator.kt:302 */crate::protocol_serde::shape_complex_error::de_header_header(_response_headers)
|
61 + | .map_err(|_|crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse Header from header `X-Header"))?
|
62 + | /* ProtocolParserGenerator.kt:267 */);
|
63 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
64 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
65 + | /* ProtocolParserGenerator.kt:146 */}
|
66 + | /* ProtocolParserGenerator.kt:145 */;
|
67 + | /* ProtocolParserGenerator.kt:179 */
|
52 68 | tmp
|
69 + | /* ProtocolParserGenerator.kt:139 */
|
53 70 | }),
|
54 - | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
|
71 + | /* ProtocolParserGenerator.kt:182 */
|
72 + | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
55 73 | })
|
74 + | /* ProtocolParserGenerator.kt:99 */
|
56 75 | }
|
57 76 |
|
77 + | /* RustType.kt:516 */
|
58 78 | #[allow(clippy::unnecessary_wraps)]
|
79 + | /* ProtocolParserGenerator.kt:71 */
|
59 80 | pub fn de_greeting_with_errors_http_response(
|
60 81 | _response_status: u16,
|
61 82 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
62 83 | _response_body: &[u8],
|
63 84 | ) -> std::result::Result<
|
64 85 | crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
|
65 86 | crate::operation::greeting_with_errors::GreetingWithErrorsError,
|
66 87 | > {
|
88 + | /* ProtocolParserGenerator.kt:77 */
|
67 89 | Ok({
|
90 + | /* RustType.kt:516 */
|
68 91 | #[allow(unused_mut)]
|
92 + | /* ProtocolParserGenerator.kt:240 */
|
69 93 | let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
|
94 + | /* ProtocolParserGenerator.kt:267 */
|
70 95 | output = output.set_greeting(
|
96 + | /* ProtocolParserGenerator.kt:302 */
|
71 97 | crate::protocol_serde::shape_greeting_with_errors_output::de_greeting_header(_response_headers).map_err(|_| {
|
72 98 | crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse greeting from header `X-Greeting")
|
73 - | })?,
|
99 + | })?, /* ProtocolParserGenerator.kt:267 */
|
74 100 | );
|
101 + | /* ClientBuilderInstantiator.kt:56 */
|
75 102 | output.build()
|
103 + | /* ProtocolParserGenerator.kt:77 */
|
76 104 | })
|
105 + | /* ProtocolParserGenerator.kt:71 */
|
77 106 | }
|