13 13 | #[allow(unused_mut)]
|
14 14 | let mut output = crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::default();
|
15 15 | output = output.set_events(Some(crate::protocol_serde::shape_capture_pokemon_output::de_events_payload(
|
16 16 | _response_body,
|
17 17 | )?));
|
18 18 | output
|
19 19 | .build()
|
20 20 | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
|
21 21 | })
|
22 22 | }
|
23 - |
|
24 - | #[allow(clippy::unnecessary_wraps)]
|
25 - | pub fn de_capture_pokemon_http_error(
|
26 - | _response_status: u16,
|
27 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
28 - | _response_body: &[u8],
|
29 - | ) -> std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, crate::operation::capture_pokemon::CapturePokemonError> {
|
30 - | #[allow(unused_mut)]
|
31 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
32 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
33 - | let generic = generic_builder.build();
|
34 - | let error_code = match generic.code() {
|
35 - | Some(code) => code,
|
36 - | None => return Err(crate::operation::capture_pokemon::CapturePokemonError::unhandled(generic)),
|
37 - | };
|
38 - |
|
39 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
40 - | Err(match error_code {
|
41 - | "UnsupportedRegionError" => crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError({
|
42 - | #[allow(unused_mut)]
|
43 - | let mut tmp = {
|
44 - | #[allow(unused_mut)]
|
45 - | let mut output = crate::types::error::builders::UnsupportedRegionErrorBuilder::default();
|
46 - | output = crate::protocol_serde::shape_unsupported_region_error::de_unsupported_region_error_json_err(_response_body, output)
|
47 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
48 - | let output = output.meta(generic);
|
49 - | crate::serde_util::unsupported_region_error_correct_errors(output)
|
50 - | .build()
|
51 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
|
52 - | };
|
53 - | if tmp.message.is_none() {
|
54 - | tmp.message = _error_message;
|
55 - | }
|
56 - | tmp
|
57 - | }),
|
58 - | "ThrottlingError" => crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError({
|
59 - | #[allow(unused_mut)]
|
60 - | let mut tmp = {
|
61 - | #[allow(unused_mut)]
|
62 - | let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default();
|
63 - | output = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(_response_body, output)
|
64 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
65 - | let output = output.meta(generic);
|
66 - | output.build()
|
67 - | };
|
68 - | if tmp.message.is_none() {
|
69 - | tmp.message = _error_message;
|
70 - | }
|
71 - | tmp
|
72 - | }),
|
73 - | "ValidationException" => crate::operation::capture_pokemon::CapturePokemonError::ValidationError({
|
74 - | #[allow(unused_mut)]
|
75 - | let mut tmp = {
|
76 - | #[allow(unused_mut)]
|
77 - | let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
|
78 - | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
79 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
80 - | let output = output.meta(generic);
|
81 - | crate::serde_util::validation_exception_correct_errors(output)
|
82 - | .build()
|
83 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
|
84 - | };
|
85 - | tmp
|
86 - | }),
|
87 - | "MasterBallUnsuccessful" => crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful({
|
88 - | #[allow(unused_mut)]
|
89 - | let mut tmp = {
|
90 - | #[allow(unused_mut)]
|
91 - | let mut output = crate::types::error::builders::MasterBallUnsuccessfulBuilder::default();
|
92 - | output = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(_response_body, output)
|
93 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
94 - | let output = output.meta(generic);
|
95 - | output.build()
|
96 - | };
|
97 - | if tmp.message.is_none() {
|
98 - | tmp.message = _error_message;
|
99 - | }
|
100 - | tmp
|
101 - | }),
|
102 - | "InvalidPokeballError" => crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError({
|
103 - | #[allow(unused_mut)]
|
104 - | let mut tmp = {
|
105 - | #[allow(unused_mut)]
|
106 - | let mut output = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
|
107 - | output = crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(_response_body, output)
|
108 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
|
109 - | let output = output.meta(generic);
|
110 - | crate::serde_util::invalid_pokeball_error_correct_errors(output)
|
111 - | .build()
|
112 - | .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
|
113 - | };
|
114 - | if tmp.message.is_none() {
|
115 - | tmp.message = _error_message;
|
116 - | }
|
117 - | tmp
|
118 - | }),
|
119 - | _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic),
|
120 - | })
|
121 - | }
|