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_json_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_json_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_json_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_json_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:170 */
|
52 68 | if tmp.message.is_none() {
|
53 69 | tmp.message = _error_message;
|
54 70 | }
|
71 + | /* ProtocolParserGenerator.kt:179 */
|
55 72 | tmp
|
73 + | /* ProtocolParserGenerator.kt:139 */
|
56 74 | }),
|
75 + | /* ProtocolParserGenerator.kt:139 */
|
57 76 | "FooError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError({
|
77 + | /* RustType.kt:516 */
|
58 78 | #[allow(unused_mut)]
|
59 - | let mut tmp = {
|
60 - | #[allow(unused_mut)]
|
61 - | let mut output = crate::types::error::builders::FooErrorBuilder::default();
|
62 - | output = crate::protocol_serde::shape_foo_error::de_foo_error_json_err(_response_body, output)
|
63 - | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
64 - | let output = output.meta(generic);
|
65 - | output.build()
|
66 - | };
|
79 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
80 + | /* ProtocolParserGenerator.kt:146 */ {
|
81 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
82 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::FooErrorBuilder::default();
|
83 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_foo_error::de_foo_error_json_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
84 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
85 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
86 + | /* ProtocolParserGenerator.kt:146 */}
|
87 + | /* ProtocolParserGenerator.kt:145 */;
|
88 + | /* ProtocolParserGenerator.kt:170 */
|
67 89 | if tmp.message.is_none() {
|
68 90 | tmp.message = _error_message;
|
69 91 | }
|
92 + | /* ProtocolParserGenerator.kt:179 */
|
70 93 | tmp
|
94 + | /* ProtocolParserGenerator.kt:139 */
|
71 95 | }),
|
72 - | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
|
96 + | /* ProtocolParserGenerator.kt:182 */
|
97 + | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
73 98 | })
|
99 + | /* ProtocolParserGenerator.kt:99 */
|
74 100 | }
|
75 101 |
|
102 + | /* RustType.kt:516 */
|
76 103 | #[allow(clippy::unnecessary_wraps)]
|
104 + | /* ProtocolParserGenerator.kt:71 */
|
77 105 | pub fn de_greeting_with_errors_http_response(
|
78 106 | _response_status: u16,
|
79 107 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
80 108 | _response_body: &[u8],
|
81 109 | ) -> std::result::Result<
|
82 110 | crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
|
83 111 | crate::operation::greeting_with_errors::GreetingWithErrorsError,
|
84 112 | > {
|
113 + | /* ProtocolParserGenerator.kt:77 */
|
85 114 | Ok({
|
115 + | /* RustType.kt:516 */
|
86 116 | #[allow(unused_mut)]
|
117 + | /* ProtocolParserGenerator.kt:240 */
|
87 118 | let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
|
119 + | /* ProtocolParserGenerator.kt:267 */
|
88 120 | output = output.set_greeting(
|
121 + | /* ProtocolParserGenerator.kt:302 */
|
89 122 | crate::protocol_serde::shape_greeting_with_errors_output::de_greeting_header(_response_headers).map_err(|_| {
|
90 123 | crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse greeting from header `X-Greeting")
|
91 - | })?,
|
124 + | })?, /* ProtocolParserGenerator.kt:267 */
|
92 125 | );
|
126 + | /* ClientBuilderInstantiator.kt:56 */
|
93 127 | output.build()
|
128 + | /* ProtocolParserGenerator.kt:77 */
|
94 129 | })
|
130 + | /* ProtocolParserGenerator.kt:71 */
|
95 131 | }
|