aws_sdk_s3/operation/
list_object_versions.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `ListObjectVersions`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ListObjectVersions;
6impl ListObjectVersions {
7    /// Creates a new `ListObjectVersions`
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_object_versions::ListObjectVersionsInput,
14    ) -> ::std::result::Result<
15        crate::operation::list_object_versions::ListObjectVersionsOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::list_object_versions::ListObjectVersionsError,
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_object_versions::ListObjectVersionsError>()
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_object_versions::ListObjectVersionsOutput>()
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_object_versions::ListObjectVersionsInput,
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", "ListObjectVersions", 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 ListObjectVersions {
85    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
86        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListObjectVersions");
87
88        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
89            ListObjectVersionsRequestSerializer,
90        ));
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
92            ListObjectVersionsResponseDeserializer,
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("ListObjectVersions", "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("ListObjectVersions")
120                            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
121.with_interceptor(ListObjectVersionsEndpointParamsInterceptor)
122                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::list_object_versions::ListObjectVersionsError>::new())
123.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::list_object_versions::ListObjectVersionsError>::new())
124.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::list_object_versions::ListObjectVersionsError>::builder().transient_errors({
125                                            let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
126                                            transient_errors.push("InternalError");
127                                            ::std::borrow::Cow::Owned(transient_errors)
128                                            }).build());
129
130        ::std::borrow::Cow::Owned(rcb)
131    }
132}
133
134#[derive(Debug)]
135struct ListObjectVersionsResponseDeserializer;
136impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListObjectVersionsResponseDeserializer {
137    fn deserialize_nonstreaming(
138        &self,
139        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
140    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
141        let (success, status) = (response.status().is_success(), response.status().as_u16());
142        let headers = response.headers();
143        let body = response.body().bytes().expect("body loaded");
144        #[allow(unused_mut)]
145        let mut force_error = false;
146        ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
147        if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
148            force_error = true;
149        }
150        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
151        let parse_result = if !success && status != 200 || force_error {
152            crate::protocol_serde::shape_list_object_versions::de_list_object_versions_http_error(status, headers, body)
153        } else {
154            crate::protocol_serde::shape_list_object_versions::de_list_object_versions_http_response(status, headers, body)
155        };
156        crate::protocol_serde::type_erase_result(parse_result)
157    }
158}
159#[derive(Debug)]
160struct ListObjectVersionsRequestSerializer;
161impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListObjectVersionsRequestSerializer {
162    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
163    fn serialize_input(
164        &self,
165        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
166        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
167    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
168        let input = input
169            .downcast::<crate::operation::list_object_versions::ListObjectVersionsInput>()
170            .expect("correct type");
171        let _header_serialization_settings = _cfg
172            .load::<crate::serialization_settings::HeaderSerializationSettings>()
173            .cloned()
174            .unwrap_or_default();
175        let mut request_builder = {
176            fn uri_base(
177                _input: &crate::operation::list_object_versions::ListObjectVersionsInput,
178                output: &mut ::std::string::String,
179            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
180                use ::std::fmt::Write as _;
181                ::std::write!(output, "/").expect("formatting should succeed");
182                ::std::result::Result::Ok(())
183            }
184            fn uri_query(
185                _input: &crate::operation::list_object_versions::ListObjectVersionsInput,
186                mut output: &mut ::std::string::String,
187            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
188                let mut query = ::aws_smithy_http::query::Writer::new(output);
189                query.push_v("versions");
190                if let ::std::option::Option::Some(inner_1) = &_input.delimiter {
191                    {
192                        query.push_kv("delimiter", &::aws_smithy_http::query::fmt_string(inner_1));
193                    }
194                }
195                if let ::std::option::Option::Some(inner_2) = &_input.encoding_type {
196                    {
197                        query.push_kv("encoding-type", &::aws_smithy_http::query::fmt_string(inner_2));
198                    }
199                }
200                if let ::std::option::Option::Some(inner_3) = &_input.key_marker {
201                    {
202                        query.push_kv("key-marker", &::aws_smithy_http::query::fmt_string(inner_3));
203                    }
204                }
205                if let ::std::option::Option::Some(inner_4) = &_input.max_keys {
206                    {
207                        query.push_kv("max-keys", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
208                    }
209                }
210                if let ::std::option::Option::Some(inner_5) = &_input.prefix {
211                    {
212                        query.push_kv("prefix", &::aws_smithy_http::query::fmt_string(inner_5));
213                    }
214                }
215                if let ::std::option::Option::Some(inner_6) = &_input.version_id_marker {
216                    {
217                        query.push_kv("version-id-marker", &::aws_smithy_http::query::fmt_string(inner_6));
218                    }
219                }
220                ::std::result::Result::Ok(())
221            }
222            #[allow(clippy::unnecessary_wraps)]
223            fn update_http_builder(
224                input: &crate::operation::list_object_versions::ListObjectVersionsInput,
225                builder: ::http::request::Builder,
226            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
227                let mut uri = ::std::string::String::new();
228                uri_base(input, &mut uri)?;
229                uri_query(input, &mut uri)?;
230                let builder = crate::protocol_serde::shape_list_object_versions::ser_list_object_versions_headers(input, builder)?;
231                ::std::result::Result::Ok(builder.method("GET").uri(uri))
232            }
233            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
234            builder
235        };
236        let body = ::aws_smithy_types::body::SdkBody::from("");
237
238        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
239    }
240}
241#[derive(Debug)]
242struct ListObjectVersionsEndpointParamsInterceptor;
243
244impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListObjectVersionsEndpointParamsInterceptor {
245    fn name(&self) -> &'static str {
246        "ListObjectVersionsEndpointParamsInterceptor"
247    }
248
249    fn read_before_execution(
250        &self,
251        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
252            '_,
253            ::aws_smithy_runtime_api::client::interceptors::context::Input,
254            ::aws_smithy_runtime_api::client::interceptors::context::Output,
255            ::aws_smithy_runtime_api::client::interceptors::context::Error,
256        >,
257        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
258    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
259        let _input = context
260            .input()
261            .downcast_ref::<ListObjectVersionsInput>()
262            .ok_or("failed to downcast to ListObjectVersionsInput")?;
263
264        let params = crate::config::endpoint::Params::builder()
265            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
266            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
267            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
268            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
269            .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
270            .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
271            .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
272            .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
273            .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
274            .set_bucket(Some(
275                _input
276                    .bucket
277                    .clone()
278                    .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
279                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
280            ))
281            .set_prefix(_input.prefix.clone())
282            .build()
283            .map_err(|err| {
284                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
285            })?;
286        cfg.interceptor_state()
287            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
288        ::std::result::Result::Ok(())
289    }
290}
291
292// The get_* functions below are generated from JMESPath expressions in the
293// operationContextParams trait. They target the operation's input shape.
294
295#[allow(unreachable_code, unused_variables)]
296#[cfg(test)]
297mod list_object_versions_test {
298
299    /// Verify that interleaving list elements (DeleteMarker and Version) from different lists works
300    /// Test ID: OutOfOrderVersions
301    #[::tokio::test]
302    #[::tracing_test::traced_test]
303    async fn out_of_order_versions_response() {
304        let expected_output = crate::operation::list_object_versions::ListObjectVersionsOutput::builder()
305            .set_name(::std::option::Option::Some("sdk-obj-versions-test".to_owned()))
306            .set_prefix(::std::option::Option::Some("".to_owned()))
307            .set_key_marker(::std::option::Option::Some("".to_owned()))
308            .set_version_id_marker(::std::option::Option::Some("".to_owned()))
309            .set_max_keys(::std::option::Option::Some(1000))
310            .set_is_truncated(::std::option::Option::Some(false))
311            .set_delete_markers(::std::option::Option::Some(vec![
312                crate::types::DeleteMarkerEntry::builder()
313                    .set_key(::std::option::Option::Some("build.gradle.kts".to_owned()))
314                    .set_version_id(::std::option::Option::Some("null".to_owned()))
315                    .set_is_latest(::std::option::Option::Some(true))
316                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
317                        1234567890, 0_f64,
318                    )))
319                    .set_owner(::std::option::Option::Some(
320                        crate::types::Owner::builder()
321                            .set_id(::std::option::Option::Some(
322                                "c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34".to_owned(),
323                            ))
324                            .set_display_name(::std::option::Option::Some("test-name".to_owned()))
325                            .build(),
326                    ))
327                    .build(),
328                crate::types::DeleteMarkerEntry::builder()
329                    .set_key(::std::option::Option::Some("file-2".to_owned()))
330                    .set_version_id(::std::option::Option::Some("o98RL6vmlOYiymftbX7wgy_4XWQG4AmY".to_owned()))
331                    .set_is_latest(::std::option::Option::Some(true))
332                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
333                        1234567890, 0_f64,
334                    )))
335                    .set_owner(::std::option::Option::Some(
336                        crate::types::Owner::builder()
337                            .set_id(::std::option::Option::Some(
338                                "c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34".to_owned(),
339                            ))
340                            .set_display_name(::std::option::Option::Some("test-name".to_owned()))
341                            .build(),
342                    ))
343                    .build(),
344            ]))
345            .set_versions(::std::option::Option::Some(vec![
346                crate::types::ObjectVersion::builder()
347                    .set_key(::std::option::Option::Some("build.gradle.kts".to_owned()))
348                    .set_version_id(::std::option::Option::Some("IfK9Z4.H5TLAtMxFrxN_C7rFEZbufF3V".to_owned()))
349                    .set_is_latest(::std::option::Option::Some(false))
350                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
351                        1234567890, 0_f64,
352                    )))
353                    .set_e_tag(::std::option::Option::Some("\"99613b85e3f38b222c4ee548cde1e59d\"".to_owned()))
354                    .set_size(::std::option::Option::Some(6903))
355                    .set_owner(::std::option::Option::Some(
356                        crate::types::Owner::builder()
357                            .set_id(::std::option::Option::Some(
358                                "c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34".to_owned(),
359                            ))
360                            .set_display_name(::std::option::Option::Some("test-name".to_owned()))
361                            .build(),
362                    ))
363                    .set_storage_class(::std::option::Option::Some(
364                        "STANDARD"
365                            .parse::<crate::types::ObjectVersionStorageClass>()
366                            .expect("static value validated to member"),
367                    ))
368                    .build(),
369                crate::types::ObjectVersion::builder()
370                    .set_key(::std::option::Option::Some("file-2".to_owned()))
371                    .set_version_id(::std::option::Option::Some("PSVAbvQihRdsNiktGothjGng7q.5ou9Q".to_owned()))
372                    .set_is_latest(::std::option::Option::Some(false))
373                    .set_last_modified(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
374                        1234567890, 0_f64,
375                    )))
376                    .set_e_tag(::std::option::Option::Some("\"1727d9cb38dd325d9c12c973ef3675fc\"".to_owned()))
377                    .set_size(::std::option::Option::Some(14))
378                    .set_owner(::std::option::Option::Some(
379                        crate::types::Owner::builder()
380                            .set_id(::std::option::Option::Some(
381                                "c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34".to_owned(),
382                            ))
383                            .set_display_name(::std::option::Option::Some("test-name".to_owned()))
384                            .build(),
385                    ))
386                    .set_storage_class(::std::option::Option::Some(
387                        "STANDARD"
388                            .parse::<crate::types::ObjectVersionStorageClass>()
389                            .expect("static value validated to member"),
390                    ))
391                    .build(),
392            ]))
393            .build();
394        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
395        .status(200)
396                    .body(::aws_smithy_types::body::SdkBody::from("<?xml version=\"1.0\"?>\n<ListVersionsResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\n  <Name>sdk-obj-versions-test</Name>\n  <Prefix/>\n  <KeyMarker/>\n  <VersionIdMarker/>\n  <MaxKeys>1000</MaxKeys>\n  <IsTruncated>false</IsTruncated>\n  <DeleteMarker>\n    <Key>build.gradle.kts</Key>\n    <VersionId>null</VersionId>\n    <IsLatest>true</IsLatest>\n    <LastModified>2009-02-13T23:31:30Z</LastModified>\n    <Owner>\n      <ID>c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34</ID>\n      <DisplayName>test-name</DisplayName>\n    </Owner>\n  </DeleteMarker>\n  <Version>\n    <Key>build.gradle.kts</Key>\n    <VersionId>IfK9Z4.H5TLAtMxFrxN_C7rFEZbufF3V</VersionId>\n    <IsLatest>false</IsLatest>\n    <LastModified>2009-02-13T23:31:30Z</LastModified>\n    <ETag>\"99613b85e3f38b222c4ee548cde1e59d\"</ETag>\n    <Size>6903</Size>\n    <Owner>\n      <ID>c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34</ID>\n      <DisplayName>test-name</DisplayName>\n    </Owner>\n    <StorageClass>STANDARD</StorageClass>\n  </Version>\n  <DeleteMarker>\n    <Key>file-2</Key>\n    <VersionId>o98RL6vmlOYiymftbX7wgy_4XWQG4AmY</VersionId>\n    <IsLatest>true</IsLatest>\n    <LastModified>2009-02-13T23:31:30Z</LastModified>\n    <Owner>\n      <ID>c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34</ID>\n      <DisplayName>test-name</DisplayName>\n    </Owner>\n  </DeleteMarker>\n  <Version>\n    <Key>file-2</Key>\n    <VersionId>PSVAbvQihRdsNiktGothjGng7q.5ou9Q</VersionId>\n    <IsLatest>false</IsLatest>\n    <LastModified>2009-02-13T23:31:30Z</LastModified>\n    <ETag>\"1727d9cb38dd325d9c12c973ef3675fc\"</ETag>\n    <Size>14</Size>\n    <Owner>\n      <ID>c1665459250c459f1849ddce9b291fc3a72bcf5220dc8f6391a0a1045c683b34</ID>\n      <DisplayName>test-name</DisplayName>\n    </Owner>\n    <StorageClass>STANDARD</StorageClass>\n  </Version>\n</ListVersionsResult>\n"))
397                    .unwrap()
398                    ).unwrap();
399        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
400        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
401
402        let op = crate::operation::list_object_versions::ListObjectVersions::new();
403        let config = op.config().expect("the operation has config");
404        let de = config
405            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
406            .expect("the config must have a deserializer");
407
408        let parsed = de.deserialize_streaming(&mut http_response);
409        let parsed = parsed.unwrap_or_else(|| {
410            let http_response = http_response.map(|body| {
411                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
412                    body.bytes().unwrap(),
413                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
414                )))
415            });
416            de.deserialize_nonstreaming(&http_response)
417        });
418        let parsed = parsed
419            .expect("should be successful response")
420            .downcast::<crate::operation::list_object_versions::ListObjectVersionsOutput>()
421            .unwrap();
422        ::pretty_assertions::assert_eq!(parsed.is_truncated, expected_output.is_truncated, "Unexpected value for `is_truncated`");
423        ::pretty_assertions::assert_eq!(parsed.key_marker, expected_output.key_marker, "Unexpected value for `key_marker`");
424        ::pretty_assertions::assert_eq!(
425            parsed.version_id_marker,
426            expected_output.version_id_marker,
427            "Unexpected value for `version_id_marker`"
428        );
429        ::pretty_assertions::assert_eq!(
430            parsed.next_key_marker,
431            expected_output.next_key_marker,
432            "Unexpected value for `next_key_marker`"
433        );
434        ::pretty_assertions::assert_eq!(
435            parsed.next_version_id_marker,
436            expected_output.next_version_id_marker,
437            "Unexpected value for `next_version_id_marker`"
438        );
439        ::pretty_assertions::assert_eq!(parsed.versions, expected_output.versions, "Unexpected value for `versions`");
440        ::pretty_assertions::assert_eq!(
441            parsed.delete_markers,
442            expected_output.delete_markers,
443            "Unexpected value for `delete_markers`"
444        );
445        ::pretty_assertions::assert_eq!(parsed.name, expected_output.name, "Unexpected value for `name`");
446        ::pretty_assertions::assert_eq!(parsed.prefix, expected_output.prefix, "Unexpected value for `prefix`");
447        ::pretty_assertions::assert_eq!(parsed.delimiter, expected_output.delimiter, "Unexpected value for `delimiter`");
448        ::pretty_assertions::assert_eq!(parsed.max_keys, expected_output.max_keys, "Unexpected value for `max_keys`");
449        ::pretty_assertions::assert_eq!(
450            parsed.common_prefixes,
451            expected_output.common_prefixes,
452            "Unexpected value for `common_prefixes`"
453        );
454        ::pretty_assertions::assert_eq!(
455            parsed.encoding_type,
456            expected_output.encoding_type,
457            "Unexpected value for `encoding_type`"
458        );
459        ::pretty_assertions::assert_eq!(
460            parsed.request_charged,
461            expected_output.request_charged,
462            "Unexpected value for `request_charged`"
463        );
464    }
465}
466
467/// Error type for the `ListObjectVersionsError` operation.
468#[non_exhaustive]
469#[derive(::std::fmt::Debug)]
470pub enum ListObjectVersionsError {
471    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
472    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
473    variable wildcard pattern and check `.code()`:
474     \
475    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
476     \
477    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListObjectVersionsError) for what information is available for the error.")]
478    Unhandled(crate::error::sealed_unhandled::Unhandled),
479}
480impl ListObjectVersionsError {
481    /// Creates the `ListObjectVersionsError::Unhandled` variant from any error type.
482    pub fn unhandled(
483        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
484    ) -> Self {
485        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
486            source: err.into(),
487            meta: ::std::default::Default::default(),
488        })
489    }
490
491    /// Creates the `ListObjectVersionsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
492    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
493        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
494            source: err.clone().into(),
495            meta: err,
496        })
497    }
498    ///
499    /// Returns error metadata, which includes the error code, message,
500    /// request ID, and potentially additional information.
501    ///
502    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
503        match self {
504            Self::Unhandled(e) => &e.meta,
505        }
506    }
507}
508impl ::std::error::Error for ListObjectVersionsError {
509    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
510        match self {
511            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
512        }
513    }
514}
515impl ::std::fmt::Display for ListObjectVersionsError {
516    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
517        match self {
518            Self::Unhandled(_inner) => {
519                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
520                    write!(f, "unhandled error ({code})")
521                } else {
522                    f.write_str("unhandled error")
523                }
524            }
525        }
526    }
527}
528impl ::aws_smithy_types::retry::ProvideErrorKind for ListObjectVersionsError {
529    fn code(&self) -> ::std::option::Option<&str> {
530        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
531    }
532    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
533        ::std::option::Option::None
534    }
535}
536impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListObjectVersionsError {
537    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
538        match self {
539            Self::Unhandled(_inner) => &_inner.meta,
540        }
541    }
542}
543impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListObjectVersionsError {
544    fn create_unhandled_error(
545        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
546        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
547    ) -> Self {
548        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
549            source,
550            meta: meta.unwrap_or_default(),
551        })
552    }
553}
554impl crate::s3_request_id::RequestIdExt for crate::operation::list_object_versions::ListObjectVersionsError {
555    fn extended_request_id(&self) -> Option<&str> {
556        self.meta().extended_request_id()
557    }
558}
559impl ::aws_types::request_id::RequestId for crate::operation::list_object_versions::ListObjectVersionsError {
560    fn request_id(&self) -> Option<&str> {
561        self.meta().request_id()
562    }
563}
564
565pub use crate::operation::list_object_versions::_list_object_versions_output::ListObjectVersionsOutput;
566
567pub use crate::operation::list_object_versions::_list_object_versions_input::ListObjectVersionsInput;
568
569mod _list_object_versions_input;
570
571mod _list_object_versions_output;
572
573/// Builders
574pub mod builders;