2 2 | #[allow(clippy::unnecessary_wraps)]
|
3 3 | pub fn de_restore_table_to_point_in_time_http_error(
|
4 4 | _response_status: u16,
|
5 5 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<
|
8 8 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
|
9 9 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
14 14 | let generic = generic_builder.build();
|
15 15 | let error_code = match generic.code() {
|
16 16 | Some(code) => code,
|
17 17 | None => return Err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled(generic)),
|
18 18 | };
|
19 19 |
|
20 20 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
21 21 | Err(match error_code {
|
22 22 | "InternalServerError" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InternalServerError({
|
23 23 | #[allow(unused_mut)]
|
24 24 | let mut tmp = {
|
25 25 | #[allow(unused_mut)]
|
26 26 | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
27 27 | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
28 28 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
29 29 | let output = output.meta(generic);
|
30 30 | output.build()
|
31 31 | };
|
32 - | if tmp.message.is_none() {
|
33 - | tmp.message = _error_message;
|
34 - | }
|
35 32 | tmp
|
36 33 | }),
|
37 34 | "InvalidEndpointException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidEndpointError({
|
38 35 | #[allow(unused_mut)]
|
39 36 | let mut tmp = {
|
40 37 | #[allow(unused_mut)]
|
41 38 | let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
|
42 39 | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
43 40 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
44 41 | let output = output.meta(generic);
|
45 42 | output.build()
|
46 43 | };
|
47 - | if tmp.message.is_none() {
|
48 - | tmp.message = _error_message;
|
49 - | }
|
50 44 | tmp
|
51 45 | }),
|
52 46 | "InvalidRestoreTimeException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidRestoreTimeError({
|
53 47 | #[allow(unused_mut)]
|
54 48 | let mut tmp = {
|
55 49 | #[allow(unused_mut)]
|
56 50 | let mut output = crate::types::error::builders::InvalidRestoreTimeErrorBuilder::default();
|
57 51 | output =
|
58 52 | crate::protocol_serde::shape_invalid_restore_time_exception::de_invalid_restore_time_exception_json_err(_response_body, output)
|
59 53 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
60 54 | let output = output.meta(generic);
|
61 55 | output.build()
|
62 56 | };
|
63 - | if tmp.message.is_none() {
|
64 - | tmp.message = _error_message;
|
65 - | }
|
66 57 | tmp
|
67 58 | }),
|
68 59 | "LimitExceededException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::LimitExceededError({
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut tmp = {
|
71 62 | #[allow(unused_mut)]
|
72 63 | let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
|
73 64 | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
74 65 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
75 66 | let output = output.meta(generic);
|
76 67 | output.build()
|
77 68 | };
|
78 - | if tmp.message.is_none() {
|
79 - | tmp.message = _error_message;
|
80 - | }
|
81 69 | tmp
|
82 70 | }),
|
83 71 | "PointInTimeRecoveryUnavailableException" => {
|
84 72 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::PointInTimeRecoveryUnavailableError({
|
85 73 | #[allow(unused_mut)]
|
86 74 | let mut tmp = {
|
87 75 | #[allow(unused_mut)]
|
88 76 | let mut output = crate::types::error::builders::PointInTimeRecoveryUnavailableErrorBuilder::default();
|
89 77 | output = crate::protocol_serde::shape_point_in_time_recovery_unavailable_exception::de_point_in_time_recovery_unavailable_exception_json_err(_response_body, output).map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
90 78 | let output = output.meta(generic);
|
91 79 | output.build()
|
92 80 | };
|
93 - | if tmp.message.is_none() {
|
94 - | tmp.message = _error_message;
|
95 - | }
|
96 81 | tmp
|
97 82 | })
|
98 83 | }
|
99 84 | "TableAlreadyExistsException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableAlreadyExistsError({
|
100 85 | #[allow(unused_mut)]
|
101 86 | let mut tmp = {
|
102 87 | #[allow(unused_mut)]
|
103 88 | let mut output = crate::types::error::builders::TableAlreadyExistsErrorBuilder::default();
|
104 89 | output =
|
105 90 | crate::protocol_serde::shape_table_already_exists_exception::de_table_already_exists_exception_json_err(_response_body, output)
|
106 91 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
107 92 | let output = output.meta(generic);
|
108 93 | output.build()
|
109 94 | };
|
110 - | if tmp.message.is_none() {
|
111 - | tmp.message = _error_message;
|
112 - | }
|
113 95 | tmp
|
114 96 | }),
|
115 97 | "TableInUseException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableInUseError({
|
116 98 | #[allow(unused_mut)]
|
117 99 | let mut tmp = {
|
118 100 | #[allow(unused_mut)]
|
119 101 | let mut output = crate::types::error::builders::TableInUseErrorBuilder::default();
|
120 102 | output = crate::protocol_serde::shape_table_in_use_exception::de_table_in_use_exception_json_err(_response_body, output)
|
121 103 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
122 104 | let output = output.meta(generic);
|
123 105 | output.build()
|
124 106 | };
|
125 - | if tmp.message.is_none() {
|
126 - | tmp.message = _error_message;
|
127 - | }
|
128 107 | tmp
|
129 108 | }),
|
130 109 | "TableNotFoundException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableNotFoundError({
|
131 110 | #[allow(unused_mut)]
|
132 111 | let mut tmp = {
|
133 112 | #[allow(unused_mut)]
|
134 113 | let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
|
135 114 | output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
|
136 115 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
137 116 | let output = output.meta(generic);
|
138 117 | output.build()
|
139 118 | };
|
140 - | if tmp.message.is_none() {
|
141 - | tmp.message = _error_message;
|
142 - | }
|
143 119 | tmp
|
144 120 | }),
|
145 121 | _ => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::generic(generic),
|
146 122 | })
|
147 123 | }
|
148 124 |
|
149 125 | #[allow(clippy::unnecessary_wraps)]
|
150 126 | pub fn de_restore_table_to_point_in_time_http_response(
|
151 127 | _response_status: u16,
|
152 128 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
153 129 | _response_body: &[u8],
|
154 130 | ) -> std::result::Result<
|
155 131 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
|
156 132 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
|
157 133 | > {
|
158 134 | Ok({
|
159 135 | #[allow(unused_mut)]
|
160 136 | let mut output = crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeOutputBuilder::default();
|
161 137 | output = crate::protocol_serde::shape_restore_table_to_point_in_time::de_restore_table_to_point_in_time(_response_body, output)
|
162 138 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
163 139 | output.build()
|
164 140 | })
|
165 141 | }
|
166 142 |
|
167 143 | pub fn ser_restore_table_to_point_in_time_input(
|
168 144 | input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
|
169 145 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
170 146 | let mut out = String::new();
|
171 147 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
172 148 | crate::protocol_serde::shape_restore_table_to_point_in_time_input::ser_restore_table_to_point_in_time_input_input(&mut object, input)?;
|