aws_sdk_s3/operation/
list_objects.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `ListObjects`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ListObjects;
6impl ListObjects {
7    /// Creates a new `ListObjects`
8    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        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("s3", "ListObjects", input, runtime_plugins, stop_point).await
54    }
55
56    pub(crate) fn operation_runtime_plugins(
57        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
58        client_config: &crate::config::Config,
59        config_override: ::std::option::Option<crate::config::Builder>,
60    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
61        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
62        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
63            ::aws_runtime::auth::sigv4::SCHEME_ID,
64            #[cfg(feature = "sigv4a")]
65            {
66                ::aws_runtime::auth::sigv4a::SCHEME_ID
67            },
68            crate::s3_express::auth::SCHEME_ID,
69            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
70        ]));
71        if let ::std::option::Option::Some(config_override) = config_override {
72            for plugin in config_override.runtime_plugins.iter().cloned() {
73                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
74            }
75            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
76                config_override,
77                client_config.config.clone(),
78                &client_config.runtime_components,
79            ));
80        }
81        runtime_plugins
82    }
83}
84impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListObjects {
85    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
86        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListObjects");
87
88        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
89            ListObjectsRequestSerializer,
90        ));
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
92            ListObjectsResponseDeserializer,
93        ));
94
95        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
96            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
97        ));
98
99        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("ListObjects", "s3"));
100        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
101        signing_options.double_uri_encode = false;
102        signing_options.content_sha256_header = true;
103        signing_options.normalize_uri_path = false;
104        signing_options.payload_override = None;
105
106        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
107            signing_options,
108            ..::std::default::Default::default()
109        });
110
111        ::std::option::Option::Some(cfg.freeze())
112    }
113
114    fn runtime_components(
115        &self,
116        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
117    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
118        #[allow(unused_mut)]
119        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListObjects")
120            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
121            .with_interceptor(ListObjectsEndpointParamsInterceptor)
122            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
123                crate::operation::list_objects::ListObjectsError,
124            >::new())
125            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
126                crate::operation::list_objects::ListObjectsError,
127            >::new())
128            .with_retry_classifier(
129                ::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::list_objects::ListObjectsError>::builder()
130                    .transient_errors({
131                        let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
132                        transient_errors.push("InternalError");
133                        ::std::borrow::Cow::Owned(transient_errors)
134                    })
135                    .build(),
136            );
137
138        ::std::borrow::Cow::Owned(rcb)
139    }
140}
141
142#[derive(Debug)]
143struct ListObjectsResponseDeserializer;
144impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListObjectsResponseDeserializer {
145    fn deserialize_nonstreaming(
146        &self,
147        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
148    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
149        let (success, status) = (response.status().is_success(), response.status().as_u16());
150        let headers = response.headers();
151        let body = response.body().bytes().expect("body loaded");
152        #[allow(unused_mut)]
153        let mut force_error = false;
154        ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
155        if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
156            force_error = true;
157        }
158        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
159        let parse_result = if !success && status != 200 || force_error {
160            crate::protocol_serde::shape_list_objects::de_list_objects_http_error(status, headers, body)
161        } else {
162            crate::protocol_serde::shape_list_objects::de_list_objects_http_response(status, headers, body)
163        };
164        crate::protocol_serde::type_erase_result(parse_result)
165    }
166}
167#[derive(Debug)]
168struct ListObjectsRequestSerializer;
169impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListObjectsRequestSerializer {
170    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
171    fn serialize_input(
172        &self,
173        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
174        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
175    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
176        let input = input
177            .downcast::<crate::operation::list_objects::ListObjectsInput>()
178            .expect("correct type");
179        let _header_serialization_settings = _cfg
180            .load::<crate::serialization_settings::HeaderSerializationSettings>()
181            .cloned()
182            .unwrap_or_default();
183        let mut request_builder = {
184            fn uri_base(
185                _input: &crate::operation::list_objects::ListObjectsInput,
186                output: &mut ::std::string::String,
187            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
188                use ::std::fmt::Write as _;
189                ::std::write!(output, "/").expect("formatting should succeed");
190                ::std::result::Result::Ok(())
191            }
192            fn uri_query(
193                _input: &crate::operation::list_objects::ListObjectsInput,
194                mut output: &mut ::std::string::String,
195            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
196                let mut query = ::aws_smithy_http::query::Writer::new(output);
197                if let ::std::option::Option::Some(inner_1) = &_input.delimiter {
198                    {
199                        query.push_kv("delimiter", &::aws_smithy_http::query::fmt_string(inner_1));
200                    }
201                }
202                if let ::std::option::Option::Some(inner_2) = &_input.encoding_type {
203                    {
204                        query.push_kv("encoding-type", &::aws_smithy_http::query::fmt_string(inner_2));
205                    }
206                }
207                if let ::std::option::Option::Some(inner_3) = &_input.marker {
208                    {
209                        query.push_kv("marker", &::aws_smithy_http::query::fmt_string(inner_3));
210                    }
211                }
212                if let ::std::option::Option::Some(inner_4) = &_input.max_keys {
213                    {
214                        query.push_kv("max-keys", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
215                    }
216                }
217                if let ::std::option::Option::Some(inner_5) = &_input.prefix {
218                    {
219                        query.push_kv("prefix", &::aws_smithy_http::query::fmt_string(inner_5));
220                    }
221                }
222                ::std::result::Result::Ok(())
223            }
224            #[allow(clippy::unnecessary_wraps)]
225            fn update_http_builder(
226                input: &crate::operation::list_objects::ListObjectsInput,
227                builder: ::http::request::Builder,
228            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
229                let mut uri = ::std::string::String::new();
230                uri_base(input, &mut uri)?;
231                uri_query(input, &mut uri)?;
232                let builder = crate::protocol_serde::shape_list_objects::ser_list_objects_headers(input, builder)?;
233                ::std::result::Result::Ok(builder.method("GET").uri(uri))
234            }
235            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
236            builder
237        };
238        let body = ::aws_smithy_types::body::SdkBody::from("");
239
240        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
241    }
242}
243#[derive(Debug)]
244struct ListObjectsEndpointParamsInterceptor;
245
246impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListObjectsEndpointParamsInterceptor {
247    fn name(&self) -> &'static str {
248        "ListObjectsEndpointParamsInterceptor"
249    }
250
251    fn read_before_execution(
252        &self,
253        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
254            '_,
255            ::aws_smithy_runtime_api::client::interceptors::context::Input,
256            ::aws_smithy_runtime_api::client::interceptors::context::Output,
257            ::aws_smithy_runtime_api::client::interceptors::context::Error,
258        >,
259        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
260    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
261        let _input = context
262            .input()
263            .downcast_ref::<ListObjectsInput>()
264            .ok_or("failed to downcast to ListObjectsInput")?;
265
266        let params = crate::config::endpoint::Params::builder()
267            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
268            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
269            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
270            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
271            .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
272            .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
273            .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
274            .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
275            .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
276            .set_bucket(Some(
277                _input
278                    .bucket
279                    .clone()
280                    .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
281                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
282            ))
283            .set_prefix(_input.prefix.clone())
284            .build()
285            .map_err(|err| {
286                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
287            })?;
288        cfg.interceptor_state()
289            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
290        ::std::result::Result::Ok(())
291    }
292}
293
294// The get_* functions below are generated from JMESPath expressions in the
295// operationContextParams trait. They target the operation's input shape.
296
297#[allow(unreachable_code, unused_variables)]
298#[cfg(test)]
299mod list_objects_test {
300
301    /// This test validates that parsing respects whitespace
302    /// Test ID: KeysWithWhitespace
303    #[::tokio::test]
304    #[::tracing_test::traced_test]
305    async fn keys_with_whitespace_response() {
306        let expected_output = crate::operation::list_objects::ListObjectsOutput::builder()
307            .set_max_keys(::std::option::Option::Some(1000))
308            .set_is_truncated(::std::option::Option::Some(false))
309            .set_marker(::std::option::Option::Some("".to_owned()))
310            .set_name(::std::option::Option::Some("bucketname".to_owned()))
311            .set_prefix(::std::option::Option::Some("".to_owned()))
312            .set_contents(::std::option::Option::Some(vec![
313                crate::types::Object::builder()
314                    .set_key(::std::option::Option::Some("    ".to_owned()))
315                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
316                        1626452453, 0_f64,
317                    )))
318                    .set_e_tag(::std::option::Option::Some("\"etag123\"".to_owned()))
319                    .set_size(::std::option::Option::Some(0))
320                    .set_owner(::std::option::Option::Some(
321                        crate::types::Owner::builder()
322                            .set_id(::std::option::Option::Some("owner".to_owned()))
323                            .build(),
324                    ))
325                    .set_storage_class(::std::option::Option::Some(
326                        "STANDARD"
327                            .parse::<crate::types::ObjectStorageClass>()
328                            .expect("static value validated to member"),
329                    ))
330                    .build(),
331                crate::types::Object::builder()
332                    .set_key(::std::option::Option::Some(" a ".to_owned()))
333                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
334                        1626451330, 0_f64,
335                    )))
336                    .set_e_tag(::std::option::Option::Some("\"etag123\"".to_owned()))
337                    .set_size(::std::option::Option::Some(0))
338                    .set_owner(::std::option::Option::Some(
339                        crate::types::Owner::builder()
340                            .set_id(::std::option::Option::Some("owner".to_owned()))
341                            .build(),
342                    ))
343                    .set_storage_class(::std::option::Option::Some(
344                        "STANDARD"
345                            .parse::<crate::types::ObjectStorageClass>()
346                            .expect("static value validated to member"),
347                    ))
348                    .build(),
349            ]))
350            .build();
351        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
352        .status(200)
353                    .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>&quot;etag123&quot;</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>&quot;etag123&quot;</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"))
354                    .unwrap()
355                    ).unwrap();
356        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
357        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
358
359        let op = crate::operation::list_objects::ListObjects::new();
360        let config = op.config().expect("the operation has config");
361        let de = config
362            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
363            .expect("the config must have a deserializer");
364
365        let parsed = de.deserialize_streaming(&mut http_response);
366        let parsed = parsed.unwrap_or_else(|| {
367            let http_response = http_response.map(|body| {
368                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
369                    body.bytes().unwrap(),
370                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
371                )))
372            });
373            de.deserialize_nonstreaming(&http_response)
374        });
375        let parsed = parsed
376            .expect("should be successful response")
377            .downcast::<crate::operation::list_objects::ListObjectsOutput>()
378            .unwrap();
379        ::pretty_assertions::assert_eq!(parsed.is_truncated, expected_output.is_truncated, "Unexpected value for `is_truncated`");
380        ::pretty_assertions::assert_eq!(parsed.marker, expected_output.marker, "Unexpected value for `marker`");
381        ::pretty_assertions::assert_eq!(parsed.next_marker, expected_output.next_marker, "Unexpected value for `next_marker`");
382        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
383        ::pretty_assertions::assert_eq!(parsed.name, expected_output.name, "Unexpected value for `name`");
384        ::pretty_assertions::assert_eq!(parsed.prefix, expected_output.prefix, "Unexpected value for `prefix`");
385        ::pretty_assertions::assert_eq!(parsed.delimiter, expected_output.delimiter, "Unexpected value for `delimiter`");
386        ::pretty_assertions::assert_eq!(parsed.max_keys, expected_output.max_keys, "Unexpected value for `max_keys`");
387        ::pretty_assertions::assert_eq!(
388            parsed.common_prefixes,
389            expected_output.common_prefixes,
390            "Unexpected value for `common_prefixes`"
391        );
392        ::pretty_assertions::assert_eq!(
393            parsed.encoding_type,
394            expected_output.encoding_type,
395            "Unexpected value for `encoding_type`"
396        );
397        ::pretty_assertions::assert_eq!(
398            parsed.request_charged,
399            expected_output.request_charged,
400            "Unexpected value for `request_charged`"
401        );
402    }
403}
404
405/// Error type for the `ListObjectsError` operation.
406#[non_exhaustive]
407#[derive(::std::fmt::Debug)]
408pub enum ListObjectsError {
409    /// <p>The specified bucket does not exist.</p>
410    NoSuchBucket(crate::types::error::NoSuchBucket),
411    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
412    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
413    variable wildcard pattern and check `.code()`:
414     \
415    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
416     \
417    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListObjectsError) for what information is available for the error.")]
418    Unhandled(crate::error::sealed_unhandled::Unhandled),
419}
420impl ListObjectsError {
421    /// Creates the `ListObjectsError::Unhandled` variant from any error type.
422    pub fn unhandled(
423        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
424    ) -> Self {
425        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
426            source: err.into(),
427            meta: ::std::default::Default::default(),
428        })
429    }
430
431    /// Creates the `ListObjectsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
432    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
433        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
434            source: err.clone().into(),
435            meta: err,
436        })
437    }
438    ///
439    /// Returns error metadata, which includes the error code, message,
440    /// request ID, and potentially additional information.
441    ///
442    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
443        match self {
444            Self::NoSuchBucket(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445            Self::Unhandled(e) => &e.meta,
446        }
447    }
448    /// Returns `true` if the error kind is `ListObjectsError::NoSuchBucket`.
449    pub fn is_no_such_bucket(&self) -> bool {
450        matches!(self, Self::NoSuchBucket(_))
451    }
452}
453impl ::std::error::Error for ListObjectsError {
454    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
455        match self {
456            Self::NoSuchBucket(_inner) => ::std::option::Option::Some(_inner),
457            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
458        }
459    }
460}
461impl ::std::fmt::Display for ListObjectsError {
462    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
463        match self {
464            Self::NoSuchBucket(_inner) => _inner.fmt(f),
465            Self::Unhandled(_inner) => {
466                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
467                    write!(f, "unhandled error ({code})")
468                } else {
469                    f.write_str("unhandled error")
470                }
471            }
472        }
473    }
474}
475impl ::aws_smithy_types::retry::ProvideErrorKind for ListObjectsError {
476    fn code(&self) -> ::std::option::Option<&str> {
477        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
478    }
479    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
480        ::std::option::Option::None
481    }
482}
483impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListObjectsError {
484    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
485        match self {
486            Self::NoSuchBucket(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
487            Self::Unhandled(_inner) => &_inner.meta,
488        }
489    }
490}
491impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListObjectsError {
492    fn create_unhandled_error(
493        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
494        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
495    ) -> Self {
496        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
497            source,
498            meta: meta.unwrap_or_default(),
499        })
500    }
501}
502impl crate::s3_request_id::RequestIdExt for crate::operation::list_objects::ListObjectsError {
503    fn extended_request_id(&self) -> Option<&str> {
504        self.meta().extended_request_id()
505    }
506}
507impl ::aws_types::request_id::RequestId for crate::operation::list_objects::ListObjectsError {
508    fn request_id(&self) -> Option<&str> {
509        self.meta().request_id()
510    }
511}
512
513pub use crate::operation::list_objects::_list_objects_output::ListObjectsOutput;
514
515pub use crate::operation::list_objects::_list_objects_input::ListObjectsInput;
516
517mod _list_objects_input;
518
519mod _list_objects_output;
520
521/// Builders
522pub mod builders;