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