1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ListObjects;
6impl ListObjects {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::list_objects::ListObjectsInput,
14 ) -> ::std::result::Result<
15 crate::operation::list_objects::ListObjectsOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::list_objects::ListObjectsError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22 ::aws_smithy_runtime_api::client::interceptors::context::Error,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >| {
25 err.map_service_error(|err| {
26 err.downcast::<crate::operation::list_objects::ListObjectsError>()
27 .expect("correct error type")
28 })
29 };
30 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31 .await
32 .map_err(map_err)?;
33 let output = context.finalize().map_err(map_err)?;
34 ::std::result::Result::Ok(
35 output
36 .downcast::<crate::operation::list_objects::ListObjectsOutput>()
37 .expect("correct output type"),
38 )
39 }
40
41 pub(crate) async fn orchestrate_with_stop_point(
42 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43 input: crate::operation::list_objects::ListObjectsInput,
44 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45 ) -> ::std::result::Result<
46 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47 ::aws_smithy_runtime_api::client::result::SdkError<
48 ::aws_smithy_runtime_api::client::interceptors::context::Error,
49 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50 >,
51 > {
52 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53 use ::tracing::Instrument;
54 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("S3", "ListObjects", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "S3.ListObjects",
59 "rpc.service" = "S3",
60 "rpc.method" = "ListObjects",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListObjects {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListObjects");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 ListObjectsRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 ListObjectsResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("ListObjects")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("ListObjects", "S3"));
106 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
107 signing_options.double_uri_encode = false;
108 signing_options.content_sha256_header = true;
109 signing_options.normalize_uri_path = false;
110 signing_options.payload_override = None;
111
112 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
113 signing_options,
114 ..::std::default::Default::default()
115 });
116
117 ::std::option::Option::Some(cfg.freeze())
118 }
119
120 fn runtime_components(
121 &self,
122 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
123 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
124 #[allow(unused_mut)]
125 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListObjects")
126 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
127 ListObjectsTelemetryInputCaptureInterceptor,
128 ))
129 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
131 ))
132 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133 ListObjectsEndpointParamsInterceptor,
134 ))
135 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
136 crate::operation::list_objects::ListObjectsError,
137 >::new())
138 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
139 crate::operation::list_objects::ListObjectsError,
140 >::new())
141 .with_retry_classifier(
142 ::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::list_objects::ListObjectsError>::builder()
143 .transient_errors({
144 let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
145 transient_errors.push("InternalError");
146 ::std::borrow::Cow::Owned(transient_errors)
147 })
148 .build(),
149 );
150
151 ::std::borrow::Cow::Owned(rcb)
152 }
153}
154
155#[derive(Debug)]
156struct ListObjectsTelemetryInputCaptureInterceptor;
157
158#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
159impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListObjectsTelemetryInputCaptureInterceptor {
160 fn name(&self) -> &'static str {
161 "ListObjectsTelemetryInputCaptureInterceptor"
162 }
163
164 fn read_before_execution(
165 &self,
166 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
167 '_,
168 ::aws_smithy_runtime_api::client::interceptors::context::Input,
169 ::aws_smithy_runtime_api::client::interceptors::context::Output,
170 ::aws_smithy_runtime_api::client::interceptors::context::Error,
171 >,
172 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
173 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
174 let ::std::option::Option::Some(requested) = cfg
176 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
177 .filter(|r| !r.is_empty())
178 else {
179 return ::std::result::Result::Ok(());
180 };
181
182 let ::std::option::Option::Some(input) = context.input().downcast_ref::<ListObjectsInput>() else {
183 return ::std::result::Result::Ok(());
185 };
186
187 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
188 if requested.should_capture("Bucket") {
189 if let ::std::option::Option::Some(value) = input.bucket.as_deref() {
190 captured.insert("Bucket", value);
191 }
192 }
193 if requested.should_capture("Delimiter") {
194 if let ::std::option::Option::Some(value) = input.delimiter.as_deref() {
195 captured.insert("Delimiter", value);
196 }
197 }
198 if requested.should_capture("Marker") {
199 if let ::std::option::Option::Some(value) = input.marker.as_deref() {
200 captured.insert("Marker", value);
201 }
202 }
203 if requested.should_capture("Prefix") {
204 if let ::std::option::Option::Some(value) = input.prefix.as_deref() {
205 captured.insert("Prefix", value);
206 }
207 }
208 if requested.should_capture("ExpectedBucketOwner") {
209 if let ::std::option::Option::Some(value) = input.expected_bucket_owner.as_deref() {
210 captured.insert("ExpectedBucketOwner", value);
211 }
212 }
213
214 cfg.interceptor_state().store_put(captured);
215 ::std::result::Result::Ok(())
216 }
217}
218#[derive(Debug)]
219struct ListObjectsResponseDeserializer;
220impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListObjectsResponseDeserializer {
221 fn deserialize_nonstreaming_with_config(
222 &self,
223 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
224 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
225 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
226 let (success, status) = (response.status().is_success(), response.status().as_u16());
227 let headers = response.headers();
228 let body = response.body().bytes().expect("body loaded");
229 #[allow(unused_mut)]
230 let mut force_error = false;
231 ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
232 if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
233 force_error = true;
234 }
235 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
236 let parse_result = if !success && status != 200 || force_error {
237 crate::protocol_serde::shape_list_objects::de_list_objects_http_error(status, headers, body)
238 } else {
239 crate::protocol_serde::shape_list_objects::de_list_objects_http_response(status, headers, body)
240 };
241 crate::protocol_serde::type_erase_result(parse_result)
242 }
243}
244#[derive(Debug)]
245struct ListObjectsRequestSerializer;
246impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListObjectsRequestSerializer {
247 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
248 fn serialize_input(
249 &self,
250 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
251 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
252 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
253 let input = input
254 .downcast::<crate::operation::list_objects::ListObjectsInput>()
255 .expect("correct type");
256 let _header_serialization_settings = _cfg
257 .load::<crate::serialization_settings::HeaderSerializationSettings>()
258 .cloned()
259 .unwrap_or_default();
260 let mut request_builder = {
261 #[allow(clippy::uninlined_format_args)]
262 fn uri_base(
263 _input: &crate::operation::list_objects::ListObjectsInput,
264 output: &mut ::std::string::String,
265 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
266 use ::std::fmt::Write as _;
267 ::std::write!(output, "/").expect("formatting should succeed");
268 ::std::result::Result::Ok(())
269 }
270 fn uri_query(
271 _input: &crate::operation::list_objects::ListObjectsInput,
272 mut output: &mut ::std::string::String,
273 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
274 let mut query = ::aws_smithy_http::query::Writer::new(output);
275 if let ::std::option::Option::Some(inner_1) = &_input.delimiter {
276 {
277 query.push_kv("delimiter", &::aws_smithy_http::query::fmt_string(inner_1));
278 }
279 }
280 if let ::std::option::Option::Some(inner_2) = &_input.encoding_type {
281 {
282 query.push_kv("encoding-type", &::aws_smithy_http::query::fmt_string(inner_2.as_str()));
283 }
284 }
285 if let ::std::option::Option::Some(inner_3) = &_input.marker {
286 {
287 query.push_kv("marker", &::aws_smithy_http::query::fmt_string(inner_3));
288 }
289 }
290 if let ::std::option::Option::Some(inner_4) = &_input.max_keys {
291 {
292 query.push_kv("max-keys", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
293 }
294 }
295 if let ::std::option::Option::Some(inner_5) = &_input.prefix {
296 {
297 query.push_kv("prefix", &::aws_smithy_http::query::fmt_string(inner_5));
298 }
299 }
300 ::std::result::Result::Ok(())
301 }
302 #[allow(clippy::unnecessary_wraps)]
303 fn update_http_builder(
304 input: &crate::operation::list_objects::ListObjectsInput,
305 builder: ::http_1x::request::Builder,
306 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
307 let mut uri = ::std::string::String::new();
308 uri_base(input, &mut uri)?;
309 uri_query(input, &mut uri)?;
310 let builder = crate::protocol_serde::shape_list_objects::ser_list_objects_headers(input, builder)?;
311 ::std::result::Result::Ok(builder.method("GET").uri(uri))
312 }
313 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
314 builder
315 };
316 let body = ::aws_smithy_types::body::SdkBody::from("");
317
318 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
319 }
320}
321#[derive(Debug)]
322struct ListObjectsEndpointParamsInterceptor;
323
324#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
325impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListObjectsEndpointParamsInterceptor {
326 fn name(&self) -> &'static str {
327 "ListObjectsEndpointParamsInterceptor"
328 }
329
330 fn read_before_execution(
331 &self,
332 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
333 '_,
334 ::aws_smithy_runtime_api::client::interceptors::context::Input,
335 ::aws_smithy_runtime_api::client::interceptors::context::Output,
336 ::aws_smithy_runtime_api::client::interceptors::context::Error,
337 >,
338 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
339 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
340 let _input = context
341 .input()
342 .downcast_ref::<ListObjectsInput>()
343 .ok_or("failed to downcast to ListObjectsInput")?;
344
345 let params = crate::config::endpoint::Params::builder()
346 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
347 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
348 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
349 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
350 .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
351 .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
352 .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
353 .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
354 .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
355 .set_bucket(Some(
356 _input
357 .bucket
358 .clone()
359 .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
360 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
361 ))
362 .set_prefix(_input.prefix.clone())
363 .build()
364 .map_err(|err| {
365 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
366 })?;
367 cfg.interceptor_state()
368 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
369 ::std::result::Result::Ok(())
370 }
371}
372
373#[allow(unreachable_code, unused_variables)]
377#[cfg(test)]
378mod list_objects_test {
379
380 #[::tokio::test]
383 #[::tracing_test::traced_test]
384 async fn keys_with_whitespace_response() {
385 let expected_output = crate::operation::list_objects::ListObjectsOutput::builder()
386 .set_max_keys(::std::option::Option::Some(1000))
387 .set_is_truncated(::std::option::Option::Some(false))
388 .set_marker(::std::option::Option::Some("".to_owned()))
389 .set_name(::std::option::Option::Some("bucketname".to_owned()))
390 .set_prefix(::std::option::Option::Some("".to_owned()))
391 .set_contents(::std::option::Option::Some(vec![
392 crate::types::Object::builder()
393 .set_key(::std::option::Option::Some(" ".to_owned()))
394 .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
395 1626452453, 0_f64,
396 )))
397 .set_e_tag(::std::option::Option::Some("\"etag123\"".to_owned()))
398 .set_size(::std::option::Option::Some(0))
399 .set_owner(::std::option::Option::Some(
400 crate::types::Owner::builder()
401 .set_id(::std::option::Option::Some("owner".to_owned()))
402 .build(),
403 ))
404 .set_storage_class(::std::option::Option::Some(
405 "STANDARD"
406 .parse::<crate::types::ObjectStorageClass>()
407 .expect("static value validated to member"),
408 ))
409 .build(),
410 crate::types::Object::builder()
411 .set_key(::std::option::Option::Some(" a ".to_owned()))
412 .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
413 1626451330, 0_f64,
414 )))
415 .set_e_tag(::std::option::Option::Some("\"etag123\"".to_owned()))
416 .set_size(::std::option::Option::Some(0))
417 .set_owner(::std::option::Option::Some(
418 crate::types::Owner::builder()
419 .set_id(::std::option::Option::Some("owner".to_owned()))
420 .build(),
421 ))
422 .set_storage_class(::std::option::Option::Some(
423 "STANDARD"
424 .parse::<crate::types::ObjectStorageClass>()
425 .expect("static value validated to member"),
426 ))
427 .build(),
428 ]))
429 .build();
430 let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
431 .status(200)
432 .body(::aws_smithy_types::body::SdkBody::from("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<ListBucketResult\n\txmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\n\t<Name>bucketname</Name>\n\t<Prefix></Prefix>\n\t<Marker></Marker>\n\t<MaxKeys>1000</MaxKeys>\n\t<IsTruncated>false</IsTruncated>\n\t<Contents>\n\t\t<Key> </Key>\n\t\t<LastModified>2021-07-16T16:20:53.000Z</LastModified>\n\t\t<ETag>"etag123"</ETag>\n\t\t<Size>0</Size>\n\t\t<Owner>\n\t\t\t<ID>owner</ID>\n\t\t</Owner>\n\t\t<StorageClass>STANDARD</StorageClass>\n\t</Contents>\n\t<Contents>\n\t\t<Key> a </Key>\n\t\t<LastModified>2021-07-16T16:02:10.000Z</LastModified>\n\t\t<ETag>"etag123"</ETag>\n\t\t<Size>0</Size>\n\t\t<Owner>\n\t\t\t<ID>owner</ID>\n\t\t</Owner>\n\t\t<StorageClass>STANDARD</StorageClass>\n\t</Contents>\n</ListBucketResult>\n"))
433 .unwrap()
434 ).unwrap();
435 use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
436 use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
437
438 let op = crate::operation::list_objects::ListObjects::new();
439 let config = op.config().expect("the operation has config");
440 let de = config
441 .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
442 .expect("the config must have a deserializer");
443
444 #[allow(unused_mut)]
446 let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
447
448 let parsed = de.deserialize_streaming(&mut http_response);
449 let parsed = parsed.unwrap_or_else(|| {
450 let http_response = http_response.map(|body| {
451 ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
452 body.bytes().unwrap(),
453 ::aws_smithy_protocol_test::MediaType::from("application/xml"),
454 )))
455 });
456 de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
457 });
458 let parsed = parsed
459 .expect("should be successful response")
460 .downcast::<crate::operation::list_objects::ListObjectsOutput>()
461 .unwrap();
462 ::pretty_assertions::assert_eq!(parsed.is_truncated, expected_output.is_truncated, "Unexpected value for `is_truncated`");
463 ::pretty_assertions::assert_eq!(parsed.marker, expected_output.marker, "Unexpected value for `marker`");
464 ::pretty_assertions::assert_eq!(parsed.next_marker, expected_output.next_marker, "Unexpected value for `next_marker`");
465 ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
466 ::pretty_assertions::assert_eq!(parsed.name, expected_output.name, "Unexpected value for `name`");
467 ::pretty_assertions::assert_eq!(parsed.prefix, expected_output.prefix, "Unexpected value for `prefix`");
468 ::pretty_assertions::assert_eq!(parsed.delimiter, expected_output.delimiter, "Unexpected value for `delimiter`");
469 ::pretty_assertions::assert_eq!(parsed.max_keys, expected_output.max_keys, "Unexpected value for `max_keys`");
470 ::pretty_assertions::assert_eq!(
471 parsed.common_prefixes,
472 expected_output.common_prefixes,
473 "Unexpected value for `common_prefixes`"
474 );
475 ::pretty_assertions::assert_eq!(
476 parsed.encoding_type,
477 expected_output.encoding_type,
478 "Unexpected value for `encoding_type`"
479 );
480 ::pretty_assertions::assert_eq!(
481 parsed.request_charged,
482 expected_output.request_charged,
483 "Unexpected value for `request_charged`"
484 );
485 }
486}
487
488#[non_exhaustive]
490#[derive(::std::fmt::Debug)]
491pub enum ListObjectsError {
492 NoSuchBucket(crate::types::error::NoSuchBucket),
494 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
496 variable wildcard pattern and check `.code()`:
497 \
498 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
499 \
500 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListObjectsError) for what information is available for the error.")]
501 Unhandled(crate::error::sealed_unhandled::Unhandled),
502}
503impl ListObjectsError {
504 pub fn unhandled(
506 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
507 ) -> Self {
508 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
509 source: err.into(),
510 meta: ::std::default::Default::default(),
511 })
512 }
513
514 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
516 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
517 source: err.clone().into(),
518 meta: err,
519 })
520 }
521 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
526 match self {
527 Self::NoSuchBucket(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
528 Self::Unhandled(e) => &e.meta,
529 }
530 }
531 pub fn is_no_such_bucket(&self) -> bool {
533 matches!(self, Self::NoSuchBucket(_))
534 }
535}
536impl ::std::error::Error for ListObjectsError {
537 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
538 match self {
539 Self::NoSuchBucket(_inner) => ::std::option::Option::Some(_inner),
540 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
541 }
542 }
543}
544impl ::std::fmt::Display for ListObjectsError {
545 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
546 match self {
547 Self::NoSuchBucket(_inner) => _inner.fmt(f),
548 Self::Unhandled(_inner) => {
549 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
550 write!(f, "unhandled error ({code})")
551 } else {
552 f.write_str("unhandled error")
553 }
554 }
555 }
556 }
557}
558impl ::aws_smithy_types::retry::ProvideErrorKind for ListObjectsError {
559 fn code(&self) -> ::std::option::Option<&str> {
560 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
561 }
562 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
563 ::std::option::Option::None
564 }
565}
566impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListObjectsError {
567 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
568 match self {
569 Self::NoSuchBucket(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
570 Self::Unhandled(_inner) => &_inner.meta,
571 }
572 }
573}
574impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListObjectsError {
575 fn create_unhandled_error(
576 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
577 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
578 ) -> Self {
579 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
580 source,
581 meta: meta.unwrap_or_default(),
582 })
583 }
584}
585impl crate::s3_request_id::RequestIdExt for crate::operation::list_objects::ListObjectsError {
586 fn extended_request_id(&self) -> Option<&str> {
587 self.meta().extended_request_id()
588 }
589}
590impl ::aws_types::request_id::RequestId for crate::operation::list_objects::ListObjectsError {
591 fn request_id(&self) -> Option<&str> {
592 self.meta().request_id()
593 }
594}
595
596pub use crate::operation::list_objects::_list_objects_input::ListObjectsInput;
597
598pub use crate::operation::list_objects::_list_objects_output::ListObjectsOutput;
599
600mod _list_objects_input;
601
602mod _list_objects_output;
603
604pub mod builders;