133 139 | ::std::borrow::Cow::Owned(rcb)
|
134 140 | }
|
135 141 | }
|
136 142 |
|
137 143 | #[derive(Debug)]
|
138 144 | struct RestoreTableToPointInTimeResponseDeserializer;
|
139 145 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RestoreTableToPointInTimeResponseDeserializer {
|
140 146 | fn deserialize_nonstreaming(
|
141 147 | &self,
|
142 148 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
149 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
143 150 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
144 151 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
152 + | #[allow(unused_mut)]
|
153 + | let mut force_error = false;
|
154 + |
|
155 + | if !success && status != 200 || force_error {
|
145 156 | let headers = response.headers();
|
146 157 | let body = response.body().bytes().expect("body loaded");
|
147 158 | #[allow(unused_mut)]
|
148 - | let mut force_error = false;
|
159 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
160 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
161 + | })?;
|
149 162 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_restore_table_to_point_in_time::de_restore_table_to_point_in_time_http_error(status, headers, body)
|
152 - | } else {
|
153 - | crate::protocol_serde::shape_restore_table_to_point_in_time::de_restore_table_to_point_in_time_http_response(status, headers, body)
|
163 + | let generic = generic_builder.build();
|
164 + | let error_code = match generic.code() {
|
165 + | ::std::option::Option::Some(code) => code,
|
166 + | ::std::option::Option::None => {
|
167 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
168 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
169 + | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled(generic),
|
170 + | ),
|
171 + | ))
|
172 + | }
|
154 173 | };
|
155 - | crate::protocol_serde::type_erase_result(parse_result)
|
174 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
175 + | let protocol = _cfg
|
176 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
177 + | .expect("a SharedClientProtocol is required");
|
178 + | let err = match error_code {
|
179 + | "InternalServerError" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InternalServerError({
|
180 + | let mut tmp = match protocol
|
181 + | .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
|
182 + | .and_then(|mut deser| {
|
183 + | crate::types::error::InternalServerError::deserialize_with_response(
|
184 + | &mut *deser,
|
185 + | response.headers(),
|
186 + | response.status().into(),
|
187 + | body,
|
188 + | )
|
189 + | }) {
|
190 + | ::std::result::Result::Ok(val) => val,
|
191 + | ::std::result::Result::Err(e) => {
|
192 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
193 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
194 + | ))
|
195 + | }
|
196 + | };
|
197 + | tmp.meta = generic;
|
198 + | if tmp.message.is_none() {
|
199 + | tmp.message = _error_message;
|
200 + | }
|
201 + | tmp
|
202 + | }),
|
203 + | "InvalidEndpointException" => {
|
204 + | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidEndpointError({
|
205 + | let mut tmp = match protocol
|
206 + | .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
|
207 + | .and_then(|mut deser| {
|
208 + | crate::types::error::InvalidEndpointError::deserialize_with_response(
|
209 + | &mut *deser,
|
210 + | response.headers(),
|
211 + | response.status().into(),
|
212 + | body,
|
213 + | )
|
214 + | }) {
|
215 + | ::std::result::Result::Ok(val) => val,
|
216 + | ::std::result::Result::Err(e) => {
|
217 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
218 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
219 + | ))
|
220 + | }
|
221 + | };
|
222 + | tmp.meta = generic;
|
223 + | if tmp.message.is_none() {
|
224 + | tmp.message = _error_message;
|
225 + | }
|
226 + | tmp
|
227 + | })
|
228 + | }
|
229 + | "InvalidRestoreTimeException" => {
|
230 + | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidRestoreTimeError({
|
231 + | let mut tmp = match protocol
|
232 + | .deserialize_response(response, crate::types::error::InvalidRestoreTimeError::SCHEMA, _cfg)
|
233 + | .and_then(|mut deser| {
|
234 + | crate::types::error::InvalidRestoreTimeError::deserialize_with_response(
|
235 + | &mut *deser,
|
236 + | response.headers(),
|
237 + | response.status().into(),
|
238 + | body,
|
239 + | )
|
240 + | }) {
|
241 + | ::std::result::Result::Ok(val) => val,
|
242 + | ::std::result::Result::Err(e) => {
|
243 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
244 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
245 + | ))
|
246 + | }
|
247 + | };
|
248 + | tmp.meta = generic;
|
249 + | if tmp.message.is_none() {
|
250 + | tmp.message = _error_message;
|
251 + | }
|
252 + | tmp
|
253 + | })
|
254 + | }
|
255 + | "LimitExceededException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::LimitExceededError({
|
256 + | let mut tmp = match protocol
|
257 + | .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
|
258 + | .and_then(|mut deser| {
|
259 + | crate::types::error::LimitExceededError::deserialize_with_response(
|
260 + | &mut *deser,
|
261 + | response.headers(),
|
262 + | response.status().into(),
|
263 + | body,
|
264 + | )
|
265 + | }) {
|
266 + | ::std::result::Result::Ok(val) => val,
|
267 + | ::std::result::Result::Err(e) => {
|
268 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
269 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
270 + | ))
|
271 + | }
|
272 + | };
|
273 + | tmp.meta = generic;
|
274 + | if tmp.message.is_none() {
|
275 + | tmp.message = _error_message;
|
276 + | }
|
277 + | tmp
|
278 + | }),
|
279 + | "PointInTimeRecoveryUnavailableException" => {
|
280 + | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::PointInTimeRecoveryUnavailableError({
|
281 + | let mut tmp = match protocol
|
282 + | .deserialize_response(response, crate::types::error::PointInTimeRecoveryUnavailableError::SCHEMA, _cfg)
|
283 + | .and_then(|mut deser| {
|
284 + | crate::types::error::PointInTimeRecoveryUnavailableError::deserialize_with_response(
|
285 + | &mut *deser,
|
286 + | response.headers(),
|
287 + | response.status().into(),
|
288 + | body,
|
289 + | )
|
290 + | }) {
|
291 + | ::std::result::Result::Ok(val) => val,
|
292 + | ::std::result::Result::Err(e) => {
|
293 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
294 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
295 + | ))
|
296 + | }
|
297 + | };
|
298 + | tmp.meta = generic;
|
299 + | if tmp.message.is_none() {
|
300 + | tmp.message = _error_message;
|
301 + | }
|
302 + | tmp
|
303 + | })
|
304 + | }
|
305 + | "TableAlreadyExistsException" => {
|
306 + | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableAlreadyExistsError({
|
307 + | let mut tmp = match protocol
|
308 + | .deserialize_response(response, crate::types::error::TableAlreadyExistsError::SCHEMA, _cfg)
|
309 + | .and_then(|mut deser| {
|
310 + | crate::types::error::TableAlreadyExistsError::deserialize_with_response(
|
311 + | &mut *deser,
|
312 + | response.headers(),
|
313 + | response.status().into(),
|
314 + | body,
|
315 + | )
|
316 + | }) {
|
317 + | ::std::result::Result::Ok(val) => val,
|
318 + | ::std::result::Result::Err(e) => {
|
319 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
320 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
321 + | ))
|
322 + | }
|
323 + | };
|
324 + | tmp.meta = generic;
|
325 + | if tmp.message.is_none() {
|
326 + | tmp.message = _error_message;
|
327 + | }
|
328 + | tmp
|
329 + | })
|
330 + | }
|
331 + | "TableInUseException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableInUseError({
|
332 + | let mut tmp = match protocol
|
333 + | .deserialize_response(response, crate::types::error::TableInUseError::SCHEMA, _cfg)
|
334 + | .and_then(|mut deser| {
|
335 + | crate::types::error::TableInUseError::deserialize_with_response(
|
336 + | &mut *deser,
|
337 + | response.headers(),
|
338 + | response.status().into(),
|
339 + | body,
|
340 + | )
|
341 + | }) {
|
342 + | ::std::result::Result::Ok(val) => val,
|
343 + | ::std::result::Result::Err(e) => {
|
344 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
345 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
346 + | ))
|
347 + | }
|
348 + | };
|
349 + | tmp.meta = generic;
|
350 + | if tmp.message.is_none() {
|
351 + | tmp.message = _error_message;
|
352 + | }
|
353 + | tmp
|
354 + | }),
|
355 + | "TableNotFoundException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableNotFoundError({
|
356 + | let mut tmp = match protocol
|
357 + | .deserialize_response(response, crate::types::error::TableNotFoundError::SCHEMA, _cfg)
|
358 + | .and_then(|mut deser| {
|
359 + | crate::types::error::TableNotFoundError::deserialize_with_response(
|
360 + | &mut *deser,
|
361 + | response.headers(),
|
362 + | response.status().into(),
|
363 + | body,
|
364 + | )
|
365 + | }) {
|
366 + | ::std::result::Result::Ok(val) => val,
|
367 + | ::std::result::Result::Err(e) => {
|
368 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
369 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
370 + | ))
|
371 + | }
|
372 + | };
|
373 + | tmp.meta = generic;
|
374 + | if tmp.message.is_none() {
|
375 + | tmp.message = _error_message;
|
376 + | }
|
377 + | tmp
|
378 + | }),
|
379 + | _ => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::generic(generic),
|
380 + | };
|
381 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
382 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
383 + | ))
|
384 + | } else {
|
385 + | let protocol = _cfg
|
386 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
387 + | .expect("a SharedClientProtocol is required");
|
388 + | let mut deser = protocol
|
389 + | .deserialize_response(response, RestoreTableToPointInTime::OUTPUT_SCHEMA, _cfg)
|
390 + | .map_err(|e| {
|
391 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
392 + | })?;
|
393 + | let body = response.body().bytes().expect("body loaded");
|
394 + | let output = crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput::deserialize_with_response(
|
395 + | &mut *deser,
|
396 + | response.headers(),
|
397 + | response.status().into(),
|
398 + | body,
|
399 + | )
|
400 + | .map_err(|e| {
|
401 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
402 + | })?;
|
403 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
404 + | }
|
156 405 | }
|
157 406 | }
|
158 407 | #[derive(Debug)]
|
159 408 | struct RestoreTableToPointInTimeRequestSerializer;
|
160 409 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RestoreTableToPointInTimeRequestSerializer {
|
161 410 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
162 411 | fn serialize_input(
|
163 412 | &self,
|
164 413 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
165 414 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
166 415 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
167 416 | let input = input
|
168 417 | .downcast::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput>()
|
169 418 | .expect("correct type");
|
170 - | let _header_serialization_settings = _cfg
|
171 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
172 - | .cloned()
|
173 - | .unwrap_or_default();
|
174 - | let mut request_builder = {
|
175 - | #[allow(clippy::uninlined_format_args)]
|
176 - | fn uri_base(
|
177 - | _input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | ::std::write!(output, "/").expect("formatting should succeed");
|
182 - | ::std::result::Result::Ok(())
|
183 - | }
|
184 - | #[allow(clippy::unnecessary_wraps)]
|
185 - | fn update_http_builder(
|
186 - | input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
|
187 - | builder: ::http_1x::request::Builder,
|
188 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
189 - | let mut uri = ::std::string::String::new();
|
190 - | uri_base(input, &mut uri)?;
|
191 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
192 - | }
|
193 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
194 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
195 - | builder = _header_serialization_settings.set_default_header(
|
196 - | builder,
|
197 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
198 - | "DynamoDB_20120810.RestoreTableToPointInTime",
|
199 - | );
|
200 - | builder
|
201 - | };
|
202 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
203 - | crate::protocol_serde::shape_restore_table_to_point_in_time::ser_restore_table_to_point_in_time_input(&input)?,
|
204 - | );
|
205 - | if let Some(content_length) = body.content_length() {
|
206 - | let content_length = content_length.to_string();
|
207 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
208 - | }
|
209 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
419 + | let protocol = _cfg
|
420 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
421 + | .expect("a SharedClientProtocol is required");
|
422 + | let mut request = protocol
|
423 + | .serialize_request(&input, RestoreTableToPointInTime::INPUT_SCHEMA, "", _cfg)
|
424 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
425 + |
|
426 + | return ::std::result::Result::Ok(request);
|
210 427 | }
|
211 428 | }
|
212 429 | #[derive(Debug)]
|
213 430 | struct RestoreTableToPointInTimeEndpointParamsInterceptor;
|
214 431 |
|
215 432 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RestoreTableToPointInTimeEndpointParamsInterceptor {
|
216 433 | fn name(&self) -> &'static str {
|
217 434 | "RestoreTableToPointInTimeEndpointParamsInterceptor"
|
218 435 | }
|
219 436 |
|