1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct RestoreTableToPointInTime;
6impl RestoreTableToPointInTime {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
18 ) -> ::std::result::Result<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
19 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>| {
20 err.map_service_error(|err| {
21 err.downcast::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError>().expect("correct error type")
22 })
23 };
24 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
25 .await
26 .map_err(map_err)?;
27 let output = context.finalize().map_err(map_err)?;
28 ::std::result::Result::Ok(output.downcast::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput>().expect("correct output type"))
29 }
30
31 pub(crate) async fn orchestrate_with_stop_point(
32 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
33 input: crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
34 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
35 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
36 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
37 use ::tracing::Instrument;
38 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
39 "DynamoDB",
40 "RestoreTableToPointInTime",
41 input,
42 runtime_plugins,
43 stop_point
44 )
45 .instrument(::tracing::debug_span!(
48 "DynamoDB.RestoreTableToPointInTime",
49 "rpc.service" = "DynamoDB",
50 "rpc.method" = "RestoreTableToPointInTime",
51 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
52 "rpc.system" = "aws-api",
53 ))
54 .await
55 }
56
57 pub(crate) fn operation_runtime_plugins(
58 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
59 client_config: &crate::config::Config,
60 config_override: ::std::option::Option<crate::config::Builder>,
61 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
62 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
63
64 if let ::std::option::Option::Some(config_override) = config_override {
65 for plugin in config_override.runtime_plugins.iter().cloned() {
66 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
67 }
68 runtime_plugins = runtime_plugins.with_operation_plugin(
69 crate::config::ConfigOverrideRuntimePlugin::new(config_override, client_config.config.clone(), &client_config.runtime_components)
70 );
71 }
72 runtime_plugins
73 }
74}
75impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RestoreTableToPointInTime {
76 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RestoreTableToPointInTime");
78
79 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(RestoreTableToPointInTimeRequestSerializer));
80 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(RestoreTableToPointInTimeResponseDeserializer));
81
82 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83 crate::config::auth::Params::builder()
84 .operation_name("RestoreTableToPointInTime")
85 .build()
86 .expect("required fields set")
87 ));
88
89 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
90 "RestoreTableToPointInTime",
91 "DynamoDB",
92 ));
93let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
94 signing_options.double_uri_encode = true;
95 signing_options.content_sha256_header = false;
96 signing_options.normalize_uri_path = true;
97 signing_options.payload_override = None;
98
99 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
100 signing_options,
101 ..::std::default::Default::default()
102 });
103
104 ::std::option::Option::Some(cfg.freeze())
105 }
106
107 fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
108 #[allow(unused_mut)]
109 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RestoreTableToPointInTime")
110 .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
111.with_interceptor(RestoreTableToPointInTimeEndpointParamsInterceptor)
112 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError>::new())
113.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError>::new())
114.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError>::new());
115
116 ::std::borrow::Cow::Owned(rcb)
117 }
118 }
119
120
121#[derive(Debug)]
122 struct RestoreTableToPointInTimeResponseDeserializer;
123 impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RestoreTableToPointInTimeResponseDeserializer {
124
125
126 fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
127 let (success, status) = (response.status().is_success(), response.status().as_u16());
128 #[allow(unused_mut)]
129 let mut force_error = false;
130 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
131 if !success && status != 200 || force_error {
132 let headers = response.headers();
133 let body = response.body().bytes().expect("body loaded");
134#[allow(unused_mut)]
135 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body)
136 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
137 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
138 let generic = generic_builder.build();
139let error_code = match generic.code() {
140 ::std::option::Option::Some(code) => code,
141 ::std::option::Option::None => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled(generic)))),
142 };
143 let _error_message = generic.message().map(|msg| msg.to_owned());
144 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
145 .expect("a SharedClientProtocol is required");
146let err = match error_code {
147"InternalServerError" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InternalServerError({
148let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
149 .and_then(|mut deser| crate::types::error::InternalServerError::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
150 {
151 ::std::result::Result::Ok(val) => val,
152 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
153 };
154 tmp.meta = generic;
155if tmp.message.is_none() {
156 tmp.message = _error_message;
157 }
158tmp
159}),
160"InvalidEndpointException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidEndpointException({
161let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidEndpointException::SCHEMA, _cfg)
162 .and_then(|mut deser| crate::types::error::InvalidEndpointException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
163 {
164 ::std::result::Result::Ok(val) => val,
165 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
166 };
167 tmp.meta = generic;
168if tmp.message.is_none() {
169 tmp.message = _error_message;
170 }
171tmp
172}),
173"InvalidRestoreTimeException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidRestoreTimeException({
174let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidRestoreTimeException::SCHEMA, _cfg)
175 .and_then(|mut deser| crate::types::error::InvalidRestoreTimeException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
176 {
177 ::std::result::Result::Ok(val) => val,
178 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
179 };
180 tmp.meta = generic;
181if tmp.message.is_none() {
182 tmp.message = _error_message;
183 }
184tmp
185}),
186"LimitExceededException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::LimitExceededException({
187let mut tmp = match protocol.deserialize_response(response, crate::types::error::LimitExceededException::SCHEMA, _cfg)
188 .and_then(|mut deser| crate::types::error::LimitExceededException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
189 {
190 ::std::result::Result::Ok(val) => val,
191 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
192 };
193 tmp.meta = generic;
194if tmp.message.is_none() {
195 tmp.message = _error_message;
196 }
197tmp
198}),
199"PointInTimeRecoveryUnavailableException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::PointInTimeRecoveryUnavailableException({
200let mut tmp = match protocol.deserialize_response(response, crate::types::error::PointInTimeRecoveryUnavailableException::SCHEMA, _cfg)
201 .and_then(|mut deser| crate::types::error::PointInTimeRecoveryUnavailableException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
202 {
203 ::std::result::Result::Ok(val) => val,
204 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
205 };
206 tmp.meta = generic;
207if tmp.message.is_none() {
208 tmp.message = _error_message;
209 }
210tmp
211}),
212"TableAlreadyExistsException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableAlreadyExistsException({
213let mut tmp = match protocol.deserialize_response(response, crate::types::error::TableAlreadyExistsException::SCHEMA, _cfg)
214 .and_then(|mut deser| crate::types::error::TableAlreadyExistsException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
215 {
216 ::std::result::Result::Ok(val) => val,
217 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
218 };
219 tmp.meta = generic;
220if tmp.message.is_none() {
221 tmp.message = _error_message;
222 }
223tmp
224}),
225"TableInUseException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableInUseException({
226let mut tmp = match protocol.deserialize_response(response, crate::types::error::TableInUseException::SCHEMA, _cfg)
227 .and_then(|mut deser| crate::types::error::TableInUseException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
228 {
229 ::std::result::Result::Ok(val) => val,
230 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
231 };
232 tmp.meta = generic;
233if tmp.message.is_none() {
234 tmp.message = _error_message;
235 }
236tmp
237}),
238"TableNotFoundException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableNotFoundException({
239let mut tmp = match protocol.deserialize_response(response, crate::types::error::TableNotFoundException::SCHEMA, _cfg)
240 .and_then(|mut deser| crate::types::error::TableNotFoundException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
241 {
242 ::std::result::Result::Ok(val) => val,
243 ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
244 };
245 tmp.meta = generic;
246if tmp.message.is_none() {
247 tmp.message = _error_message;
248 }
249tmp
250}),
251_ => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::generic(generic)
252};
253 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
254} else {
255 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
256 .expect("a SharedClientProtocol is required");
257 let mut deser = protocol.deserialize_response(response, RestoreTableToPointInTime::OUTPUT_SCHEMA, _cfg)
258 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
259 let body = response.body().bytes().expect("body loaded");
260 let output = crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput::deserialize_with_response(
261 &mut *deser,
262 response.headers(),
263 response.status().into(),
264 body,
265 ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
266 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
267 }
268 }
269 }
270#[derive(Debug)]
271 struct RestoreTableToPointInTimeRequestSerializer;
272 impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RestoreTableToPointInTimeRequestSerializer {
273 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
274 fn serialize_input(&self, input: ::aws_smithy_runtime_api::client::interceptors::context::Input, _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
275 let input = input.downcast::<crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput>().expect("correct type");
276 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
277 .expect("a SharedClientProtocol is required");
278 let mut request = protocol.serialize_request(
279 &input, RestoreTableToPointInTime::INPUT_SCHEMA, "", _cfg,
280 ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
281
282 return ::std::result::Result::Ok(request);
283 }
284 }
285#[derive(Debug)]
286 struct RestoreTableToPointInTimeEndpointParamsInterceptor;
287
288 impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RestoreTableToPointInTimeEndpointParamsInterceptor {
289 fn name(&self) -> &'static str {
290 "RestoreTableToPointInTimeEndpointParamsInterceptor"
291 }
292
293 fn read_before_execution(
294 &self,
295 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<'_, ::aws_smithy_runtime_api::client::interceptors::context::Input, ::aws_smithy_runtime_api::client::interceptors::context::Output, ::aws_smithy_runtime_api::client::interceptors::context::Error>,
296 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
297 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
298 let _input = context.input()
299 .downcast_ref::<RestoreTableToPointInTimeInput>()
300 .ok_or("failed to downcast to RestoreTableToPointInTimeInput")?;
301
302
303
304 let params = crate::config::endpoint::Params::builder()
305 .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
306.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
307.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
308.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
309.set_account_id_endpoint_mode(::std::option::Option::Some(cfg.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned().unwrap_or_default().to_string()))
310.set_resource_arn(Some(_input.target_table_name.clone().filter(|f|!AsRef::<str>::as_ref(f).trim().is_empty()).ok_or_else(||::aws_smithy_types::error::operation::BuildError::missing_field("target_table_name", "A required field was not set"))?))
311 .build()
312 .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
313 cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
314 ::std::result::Result::Ok(())
315 }
316 }
317
318 #[non_exhaustive]
325#[derive(::std::fmt::Debug)]
326pub enum RestoreTableToPointInTimeError {
327 InternalServerError(crate::types::error::InternalServerError),
329 #[allow(missing_docs)] InvalidEndpointException(crate::types::error::InvalidEndpointException),
331 InvalidRestoreTimeException(crate::types::error::InvalidRestoreTimeException),
333 LimitExceededException(crate::types::error::LimitExceededException),
341 PointInTimeRecoveryUnavailableException(crate::types::error::PointInTimeRecoveryUnavailableException),
343 TableAlreadyExistsException(crate::types::error::TableAlreadyExistsException),
345 TableInUseException(crate::types::error::TableInUseException),
347 TableNotFoundException(crate::types::error::TableNotFoundException),
349 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
351 variable wildcard pattern and check `.code()`:
352 \
353 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
354 \
355 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RestoreTableToPointInTimeError) for what information is available for the error.")]
356 Unhandled(crate::error::sealed_unhandled::Unhandled),
357}
358impl RestoreTableToPointInTimeError {
359 pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
361 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
362 }
363
364 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
366 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
367 }
368 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
373 match self {
374 Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
375 Self::InvalidEndpointException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
376 Self::InvalidRestoreTimeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
377 Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
378 Self::PointInTimeRecoveryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
379 Self::TableAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
380 Self::TableInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
381 Self::TableNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
382 Self::Unhandled(e) => &e.meta,
383 }
384 }
385 pub fn is_internal_server_error(&self) -> bool {
387 matches!(self, Self::InternalServerError(_))
388 }
389 pub fn is_invalid_endpoint_exception(&self) -> bool {
391 matches!(self, Self::InvalidEndpointException(_))
392 }
393 pub fn is_invalid_restore_time_exception(&self) -> bool {
395 matches!(self, Self::InvalidRestoreTimeException(_))
396 }
397 pub fn is_limit_exceeded_exception(&self) -> bool {
399 matches!(self, Self::LimitExceededException(_))
400 }
401 pub fn is_point_in_time_recovery_unavailable_exception(&self) -> bool {
403 matches!(self, Self::PointInTimeRecoveryUnavailableException(_))
404 }
405 pub fn is_table_already_exists_exception(&self) -> bool {
407 matches!(self, Self::TableAlreadyExistsException(_))
408 }
409 pub fn is_table_in_use_exception(&self) -> bool {
411 matches!(self, Self::TableInUseException(_))
412 }
413 pub fn is_table_not_found_exception(&self) -> bool {
415 matches!(self, Self::TableNotFoundException(_))
416 }
417}
418impl ::std::error::Error for RestoreTableToPointInTimeError {
419 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
420 match self {
421 Self::InternalServerError(_inner) =>
422 ::std::option::Option::Some(_inner)
423 ,
424 Self::InvalidEndpointException(_inner) =>
425 ::std::option::Option::Some(_inner)
426 ,
427 Self::InvalidRestoreTimeException(_inner) =>
428 ::std::option::Option::Some(_inner)
429 ,
430 Self::LimitExceededException(_inner) =>
431 ::std::option::Option::Some(_inner)
432 ,
433 Self::PointInTimeRecoveryUnavailableException(_inner) =>
434 ::std::option::Option::Some(_inner)
435 ,
436 Self::TableAlreadyExistsException(_inner) =>
437 ::std::option::Option::Some(_inner)
438 ,
439 Self::TableInUseException(_inner) =>
440 ::std::option::Option::Some(_inner)
441 ,
442 Self::TableNotFoundException(_inner) =>
443 ::std::option::Option::Some(_inner)
444 ,
445 Self::Unhandled(_inner) => {
446 ::std::option::Option::Some(&*_inner.source)
447 }
448 }
449 }
450}
451impl ::std::fmt::Display for RestoreTableToPointInTimeError {
452 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
453 match self {
454 Self::InternalServerError(_inner) =>
455 _inner.fmt(f)
456 ,
457 Self::InvalidEndpointException(_inner) =>
458 _inner.fmt(f)
459 ,
460 Self::InvalidRestoreTimeException(_inner) =>
461 _inner.fmt(f)
462 ,
463 Self::LimitExceededException(_inner) =>
464 _inner.fmt(f)
465 ,
466 Self::PointInTimeRecoveryUnavailableException(_inner) =>
467 _inner.fmt(f)
468 ,
469 Self::TableAlreadyExistsException(_inner) =>
470 _inner.fmt(f)
471 ,
472 Self::TableInUseException(_inner) =>
473 _inner.fmt(f)
474 ,
475 Self::TableNotFoundException(_inner) =>
476 _inner.fmt(f)
477 ,
478 Self::Unhandled(_inner) => {
479 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
480 write!(f, "unhandled error ({code})")
481 } else {
482 f.write_str("unhandled error")
483 }
484 }
485 }
486 }
487}
488impl ::aws_smithy_types::retry::ProvideErrorKind for RestoreTableToPointInTimeError {
489 fn code(&self) -> ::std::option::Option<&str> {
490 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
491 }
492 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
493 ::std::option::Option::None
494 }
495}
496impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RestoreTableToPointInTimeError {
497 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
498 match self {
499 Self::InternalServerError(_inner) =>
500 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
501 ,
502 Self::InvalidEndpointException(_inner) =>
503 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
504 ,
505 Self::InvalidRestoreTimeException(_inner) =>
506 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
507 ,
508 Self::LimitExceededException(_inner) =>
509 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
510 ,
511 Self::PointInTimeRecoveryUnavailableException(_inner) =>
512 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
513 ,
514 Self::TableAlreadyExistsException(_inner) =>
515 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
516 ,
517 Self::TableInUseException(_inner) =>
518 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
519 ,
520 Self::TableNotFoundException(_inner) =>
521 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
522 ,
523 Self::Unhandled(_inner) => {
524 &_inner.meta
525 }
526 }
527 }
528}
529impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RestoreTableToPointInTimeError {
530 fn create_unhandled_error(
531 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
532 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
533 ) -> Self {
534 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
535 }
536}
537impl ::aws_types::request_id::RequestId for crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError {
538 fn request_id(&self) -> Option<&str> {
539 self.meta().request_id()
540 }
541 }
542
543pub use crate::operation::restore_table_to_point_in_time::_restore_table_to_point_in_time_input::RestoreTableToPointInTimeInput;
544
545pub use crate::operation::restore_table_to_point_in_time::_restore_table_to_point_in_time_output::RestoreTableToPointInTimeOutput;
546
547mod _restore_table_to_point_in_time_input;
548
549mod _restore_table_to_point_in_time_output;
550
551pub mod builders;
553