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::cbor_errors::parse_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_cbor_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_cbor_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_cbor_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_cbor_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:170 */
|
47 64 | if tmp.message.is_none() {
|
48 65 | tmp.message = _error_message;
|
49 66 | }
|
67 + | /* ProtocolParserGenerator.kt:179 */
|
50 68 | tmp
|
69 + | /* ProtocolParserGenerator.kt:139 */
|
51 70 | }),
|
52 - | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
|
71 + | /* ProtocolParserGenerator.kt:182 */
|
72 + | _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
53 73 | })
|
74 + | /* ProtocolParserGenerator.kt:99 */
|
54 75 | }
|
55 76 |
|
77 + | /* RustType.kt:516 */
|
56 78 | #[allow(clippy::unnecessary_wraps)]
|
79 + | /* ProtocolParserGenerator.kt:71 */
|
57 80 | pub fn de_greeting_with_errors_http_response(
|
58 81 | _response_status: u16,
|
59 82 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
60 83 | _response_body: &[u8],
|
61 84 | ) -> std::result::Result<
|
62 85 | crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
|
63 86 | crate::operation::greeting_with_errors::GreetingWithErrorsError,
|
64 87 | > {
|
88 + | /* ProtocolParserGenerator.kt:77 */
|
65 89 | Ok({
|
90 + | /* RustType.kt:516 */
|
66 91 | #[allow(unused_mut)]
|
92 + | /* ProtocolParserGenerator.kt:240 */
|
67 93 | let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
|
94 + | /* ProtocolParserGenerator.kt:247 */
|
68 95 | output = crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors(_response_body, output)
|
69 96 | .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
|
97 + | /* ClientBuilderInstantiator.kt:56 */
|
70 98 | output.build()
|
99 + | /* ProtocolParserGenerator.kt:77 */
|
71 100 | })
|
101 + | /* ProtocolParserGenerator.kt:71 */
|
72 102 | }
|
73 103 |
|
104 + | /* CborParserGenerator.kt:482 */
|
74 105 | pub(crate) fn de_greeting_with_errors(
|
75 106 | value: &[u8],
|
76 107 | mut builder: crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
|
77 108 | ) -> ::std::result::Result<
|
78 109 | crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
|
79 110 | ::aws_smithy_cbor::decode::DeserializeError,
|
80 111 | > {
|
81 112 | #[allow(clippy::match_single_binding)]
|
82 113 | fn pair(
|
83 114 | mut builder: crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
|