aws_sdk_dynamodb/operation/
list_exports.rs1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ListExports;
6impl ListExports {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_exports::ListExportsInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_exports::ListExportsOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::list_exports::ListExportsInput,
18 ) -> ::std::result::Result<crate::operation::list_exports::ListExportsOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_exports::ListExportsError, ::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::list_exports::ListExportsError>().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::list_exports::ListExportsOutput>().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::list_exports::ListExportsInput,
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 "ListExports",
41 input,
42 runtime_plugins,
43 stop_point
44 )
45 .instrument(::tracing::debug_span!(
48 "DynamoDB.ListExports",
49 "rpc.service" = "DynamoDB",
50 "rpc.method" = "ListExports",
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 ListExports {
76 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListExports");
78
79 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListExportsRequestSerializer));
80 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListExportsResponseDeserializer));
81
82 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83 crate::config::auth::Params::builder()
84 .operation_name("ListExports")
85 .build()
86 .expect("required fields set")
87 ));
88
89 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
90 "ListExports",
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("ListExports")
110 .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
111.with_interceptor(ListExportsEndpointParamsInterceptor)
112 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::list_exports::ListExportsError>::new())
113.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::list_exports::ListExportsError>::new())
114.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::list_exports::ListExportsError>::new());
115
116 ::std::borrow::Cow::Owned(rcb)
117 }
118 }
119
120
121#[derive(Debug)]
122 struct ListExportsResponseDeserializer;
123 impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListExportsResponseDeserializer {
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::list_exports::ListExportsError::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::list_exports::ListExportsError::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"LimitExceededException" => crate::operation::list_exports::ListExportsError::LimitExceededException({
161let mut tmp = match protocol.deserialize_response(response, crate::types::error::LimitExceededException::SCHEMA, _cfg)
162 .and_then(|mut deser| crate::types::error::LimitExceededException::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_ => crate::operation::list_exports::ListExportsError::generic(generic)
174};
175 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
176} else {
177 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
178 .expect("a SharedClientProtocol is required");
179 let mut deser = protocol.deserialize_response(response, ListExports::OUTPUT_SCHEMA, _cfg)
180 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
181 let body = response.body().bytes().expect("body loaded");
182 let output = crate::operation::list_exports::ListExportsOutput::deserialize_with_response(
183 &mut *deser,
184 response.headers(),
185 response.status().into(),
186 body,
187 ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
188 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
189 }
190 }
191 }
192#[derive(Debug)]
193 struct ListExportsRequestSerializer;
194 impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListExportsRequestSerializer {
195 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
196 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> {
197 let input = input.downcast::<crate::operation::list_exports::ListExportsInput>().expect("correct type");
198 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
199 .expect("a SharedClientProtocol is required");
200 let mut request = protocol.serialize_request(
201 &input, ListExports::INPUT_SCHEMA, "", _cfg,
202 ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
203
204 return ::std::result::Result::Ok(request);
205 }
206 }
207#[derive(Debug)]
208 struct ListExportsEndpointParamsInterceptor;
209
210 impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListExportsEndpointParamsInterceptor {
211 fn name(&self) -> &'static str {
212 "ListExportsEndpointParamsInterceptor"
213 }
214
215 fn read_before_execution(
216 &self,
217 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>,
218 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
219 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
220 let _input = context.input()
221 .downcast_ref::<ListExportsInput>()
222 .ok_or("failed to downcast to ListExportsInput")?;
223
224
225
226 let params = crate::config::endpoint::Params::builder()
227 .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
228.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
229.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
230.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
231.set_account_id_endpoint_mode(::std::option::Option::Some(cfg.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned().unwrap_or_default().to_string()))
232.set_resource_arn(_input.table_arn.clone())
233 .build()
234 .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
235 cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
236 ::std::result::Result::Ok(())
237 }
238 }
239
240 #[non_exhaustive]
247#[derive(::std::fmt::Debug)]
248pub enum ListExportsError {
249 InternalServerError(crate::types::error::InternalServerError),
251 LimitExceededException(crate::types::error::LimitExceededException),
259 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
261 variable wildcard pattern and check `.code()`:
262 \
263 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
264 \
265 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListExportsError) for what information is available for the error.")]
266 Unhandled(crate::error::sealed_unhandled::Unhandled),
267}
268impl ListExportsError {
269 pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
271 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
272 }
273
274 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
276 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
277 }
278 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
283 match self {
284 Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
285 Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
286 Self::Unhandled(e) => &e.meta,
287 }
288 }
289 pub fn is_internal_server_error(&self) -> bool {
291 matches!(self, Self::InternalServerError(_))
292 }
293 pub fn is_limit_exceeded_exception(&self) -> bool {
295 matches!(self, Self::LimitExceededException(_))
296 }
297}
298impl ::std::error::Error for ListExportsError {
299 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
300 match self {
301 Self::InternalServerError(_inner) =>
302 ::std::option::Option::Some(_inner)
303 ,
304 Self::LimitExceededException(_inner) =>
305 ::std::option::Option::Some(_inner)
306 ,
307 Self::Unhandled(_inner) => {
308 ::std::option::Option::Some(&*_inner.source)
309 }
310 }
311 }
312}
313impl ::std::fmt::Display for ListExportsError {
314 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
315 match self {
316 Self::InternalServerError(_inner) =>
317 _inner.fmt(f)
318 ,
319 Self::LimitExceededException(_inner) =>
320 _inner.fmt(f)
321 ,
322 Self::Unhandled(_inner) => {
323 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
324 write!(f, "unhandled error ({code})")
325 } else {
326 f.write_str("unhandled error")
327 }
328 }
329 }
330 }
331}
332impl ::aws_smithy_types::retry::ProvideErrorKind for ListExportsError {
333 fn code(&self) -> ::std::option::Option<&str> {
334 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
335 }
336 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
337 ::std::option::Option::None
338 }
339}
340impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListExportsError {
341 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
342 match self {
343 Self::InternalServerError(_inner) =>
344 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
345 ,
346 Self::LimitExceededException(_inner) =>
347 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
348 ,
349 Self::Unhandled(_inner) => {
350 &_inner.meta
351 }
352 }
353 }
354}
355impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListExportsError {
356 fn create_unhandled_error(
357 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
358 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
359 ) -> Self {
360 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
361 }
362}
363impl ::aws_types::request_id::RequestId for crate::operation::list_exports::ListExportsError {
364 fn request_id(&self) -> Option<&str> {
365 self.meta().request_id()
366 }
367 }
368
369pub use crate::operation::list_exports::_list_exports_input::ListExportsInput;
370
371pub use crate::operation::list_exports::_list_exports_output::ListExportsOutput;
372
373mod _list_exports_input;
374
375mod _list_exports_output;
376
377pub mod builders;
379
380pub mod paginator;
382