aws_sdk_s3/operation/
put_bucket_lifecycle_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `PutBucketLifecycleConfiguration`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct PutBucketLifecycleConfiguration;
6impl PutBucketLifecycleConfiguration {
7    /// Creates a new `PutBucketLifecycleConfiguration`
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::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
14    ) -> ::std::result::Result<
15        crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError,
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::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError>()
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::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationOutput>()
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::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
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(
54            "s3",
55            "PutBucketLifecycleConfiguration",
56            input,
57            runtime_plugins,
58            stop_point,
59        )
60        .await
61    }
62
63    pub(crate) fn operation_runtime_plugins(
64        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
65        client_config: &crate::config::Config,
66        config_override: ::std::option::Option<crate::config::Builder>,
67    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
68        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
69        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
70            ::aws_runtime::auth::sigv4::SCHEME_ID,
71            #[cfg(feature = "sigv4a")]
72            {
73                ::aws_runtime::auth::sigv4a::SCHEME_ID
74            },
75            crate::s3_express::auth::SCHEME_ID,
76            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
77        ]));
78        if let ::std::option::Option::Some(config_override) = config_override {
79            for plugin in config_override.runtime_plugins.iter().cloned() {
80                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
81            }
82            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
83                config_override,
84                client_config.config.clone(),
85                &client_config.runtime_components,
86            ));
87        }
88        runtime_plugins
89    }
90}
91impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PutBucketLifecycleConfiguration {
92    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
93        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("PutBucketLifecycleConfiguration");
94
95        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
96            PutBucketLifecycleConfigurationRequestSerializer,
97        ));
98        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
99            PutBucketLifecycleConfigurationResponseDeserializer,
100        ));
101
102        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
103            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
104        ));
105
106        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
107            "PutBucketLifecycleConfiguration",
108            "s3",
109        ));
110        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
111        signing_options.double_uri_encode = false;
112        signing_options.content_sha256_header = true;
113        signing_options.normalize_uri_path = false;
114        signing_options.payload_override = None;
115
116        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
117            signing_options,
118            ..::std::default::Default::default()
119        });
120        cfg.store_put(crate::s3_express::checksum::provide_default_checksum_algorithm());
121
122        ::std::option::Option::Some(cfg.freeze())
123    }
124
125    fn runtime_components(
126        &self,
127        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
128    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
129        #[allow(unused_mut)]
130        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("PutBucketLifecycleConfiguration")
131            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
132            .with_interceptor(PutBucketLifecycleConfigurationEndpointParamsInterceptor)
133            .with_interceptor(crate::http_request_checksum::RequestChecksumInterceptor::new(
134                |input: &::aws_smithy_runtime_api::client::interceptors::context::Input| {
135                    let input: &crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput =
136                        input.downcast_ref().expect("correct type");
137                    let checksum_algorithm = input.checksum_algorithm();
138                    let checksum_algorithm = checksum_algorithm.map(|algorithm| algorithm.as_str());
139                    (checksum_algorithm.map(|s| s.to_string()), true)
140                },
141                |request: &mut ::aws_smithy_runtime_api::http::Request, cfg: &::aws_smithy_types::config_bag::ConfigBag| {
142                    // We check if the user has set any of the checksum values manually
143                    let mut user_set_checksum_value = false;
144                    let headers_to_check =
145                        request
146                            .headers()
147                            .iter()
148                            .filter_map(|(name, _val)| if name.starts_with("x-amz-checksum-") { Some(name) } else { None });
149                    for algo_header in headers_to_check {
150                        if request.headers().get(algo_header).is_some() {
151                            user_set_checksum_value = true;
152                        }
153                    }
154
155                    // We check if the user set the checksum algo manually
156                    let user_set_checksum_algo = request.headers().get("x-amz-sdk-checksum-algorithm").is_some();
157
158                    // This value is set by the user on the SdkConfig to indicate their preference
159                    let request_checksum_calculation = cfg
160                        .load::<::aws_smithy_types::checksum_config::RequestChecksumCalculation>()
161                        .unwrap_or(&::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenSupported);
162
163                    // From the httpChecksum trait
164                    let http_checksum_required = true;
165
166                    let is_presigned_req = cfg.load::<crate::presigning::PresigningMarker>().is_some();
167
168                    // If the request is presigned we do not set a default.
169                    // If the RequestChecksumCalculation is WhenSupported and the user has not set a checksum value or algo
170                    // we default to Crc32. If it is WhenRequired and a checksum is required by the trait and the user has not
171                    // set a checksum value or algo we also set the default. In all other cases we do nothing.
172                    match (
173                        request_checksum_calculation,
174                        http_checksum_required,
175                        user_set_checksum_value,
176                        user_set_checksum_algo,
177                        is_presigned_req,
178                    ) {
179                        (_, _, _, _, true) => {}
180                        (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenSupported, _, false, false, _)
181                        | (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenRequired, true, false, false, _) => {
182                            request.headers_mut().insert("x-amz-sdk-checksum-algorithm", "CRC32");
183                        }
184                        _ => {}
185                    }
186
187                    // We return a bool indicating if the user did set the checksum value, if they did
188                    // we can short circuit and exit the interceptor early.
189                    Ok(user_set_checksum_value)
190                },
191            ))
192            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
193                crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError,
194            >::new())
195            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
196                crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError,
197            >::new())
198            .with_retry_classifier(
199                ::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
200                    crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError,
201                >::builder()
202                .transient_errors({
203                    let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
204                    transient_errors.push("InternalError");
205                    ::std::borrow::Cow::Owned(transient_errors)
206                })
207                .build(),
208            );
209
210        ::std::borrow::Cow::Owned(rcb)
211    }
212}
213
214#[derive(Debug)]
215struct PutBucketLifecycleConfigurationResponseDeserializer;
216impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutBucketLifecycleConfigurationResponseDeserializer {
217    fn deserialize_nonstreaming(
218        &self,
219        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
220    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
221        let (success, status) = (response.status().is_success(), response.status().as_u16());
222        let headers = response.headers();
223        let body = response.body().bytes().expect("body loaded");
224        #[allow(unused_mut)]
225        let mut force_error = false;
226        ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
227        if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
228            force_error = true;
229        }
230        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
231        let parse_result = if !success && status != 200 || force_error {
232            crate::protocol_serde::shape_put_bucket_lifecycle_configuration::de_put_bucket_lifecycle_configuration_http_error(status, headers, body)
233        } else {
234            crate::protocol_serde::shape_put_bucket_lifecycle_configuration::de_put_bucket_lifecycle_configuration_http_response(
235                status, headers, body,
236            )
237        };
238        crate::protocol_serde::type_erase_result(parse_result)
239    }
240}
241#[derive(Debug)]
242struct PutBucketLifecycleConfigurationRequestSerializer;
243impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PutBucketLifecycleConfigurationRequestSerializer {
244    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
245    fn serialize_input(
246        &self,
247        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
248        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
249    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
250        let input = input
251            .downcast::<crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput>()
252            .expect("correct type");
253        let _header_serialization_settings = _cfg
254            .load::<crate::serialization_settings::HeaderSerializationSettings>()
255            .cloned()
256            .unwrap_or_default();
257        let mut request_builder = {
258            fn uri_base(
259                _input: &crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
260                output: &mut ::std::string::String,
261            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
262                use ::std::fmt::Write as _;
263                ::std::write!(output, "/").expect("formatting should succeed");
264                ::std::result::Result::Ok(())
265            }
266            fn uri_query(
267                _input: &crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
268                mut output: &mut ::std::string::String,
269            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
270                let mut query = ::aws_smithy_http::query::Writer::new(output);
271                query.push_v("lifecycle");
272                ::std::result::Result::Ok(())
273            }
274            #[allow(clippy::unnecessary_wraps)]
275            fn update_http_builder(
276                input: &crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
277                builder: ::http::request::Builder,
278            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
279                let mut uri = ::std::string::String::new();
280                uri_base(input, &mut uri)?;
281                uri_query(input, &mut uri)?;
282                let builder =
283                    crate::protocol_serde::shape_put_bucket_lifecycle_configuration::ser_put_bucket_lifecycle_configuration_headers(input, builder)?;
284                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
285            }
286            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
287            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
288            builder
289        };
290        let body = ::aws_smithy_types::body::SdkBody::from(
291            crate::protocol_serde::shape_put_bucket_lifecycle_configuration_input::ser_lifecycle_configuration_http_payload(
292                &input.lifecycle_configuration,
293            )?,
294        );
295        if let Some(content_length) = body.content_length() {
296            let content_length = content_length.to_string();
297            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
298        }
299        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
300    }
301}
302#[derive(Debug)]
303struct PutBucketLifecycleConfigurationEndpointParamsInterceptor;
304
305impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutBucketLifecycleConfigurationEndpointParamsInterceptor {
306    fn name(&self) -> &'static str {
307        "PutBucketLifecycleConfigurationEndpointParamsInterceptor"
308    }
309
310    fn read_before_execution(
311        &self,
312        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
313            '_,
314            ::aws_smithy_runtime_api::client::interceptors::context::Input,
315            ::aws_smithy_runtime_api::client::interceptors::context::Output,
316            ::aws_smithy_runtime_api::client::interceptors::context::Error,
317        >,
318        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
319    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
320        let _input = context
321            .input()
322            .downcast_ref::<PutBucketLifecycleConfigurationInput>()
323            .ok_or("failed to downcast to PutBucketLifecycleConfigurationInput")?;
324
325        let params = crate::config::endpoint::Params::builder()
326            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
327            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
328            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
329            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
330            .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
331            .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
332            .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
333            .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
334            .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
335            .set_use_s3_express_control_endpoint(Some(true))
336            .set_bucket(Some(
337                _input
338                    .bucket
339                    .clone()
340                    .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
341                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
342            ))
343            .build()
344            .map_err(|err| {
345                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
346            })?;
347        cfg.interceptor_state()
348            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
349        ::std::result::Result::Ok(())
350    }
351}
352
353// The get_* functions below are generated from JMESPath expressions in the
354// operationContextParams trait. They target the operation's input shape.
355
356#[allow(unreachable_code, unused_variables)]
357#[cfg(test)]
358mod put_bucket_lifecycle_configuration_test {
359
360    /// This test validates that the content md5 header is set correctly
361    /// Test ID: PutBucketLifecycleConfiguration
362    #[::tokio::test]
363    #[::tracing_test::traced_test]
364    async fn put_bucket_lifecycle_configuration_request() {
365        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
366        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
367        let config_builder = config_builder.region(::aws_types::region::Region::new("us-east-1"));
368        let mut config_builder = config_builder;
369        config_builder.set_region(Some(crate::config::Region::new("us-east-1")));
370
371        let config = config_builder.http_client(http_client).build();
372        let client = crate::Client::from_conf(config);
373        let result = client
374            .put_bucket_lifecycle_configuration()
375            .set_bucket(::std::option::Option::Some("test-bucket".to_owned()))
376            .set_lifecycle_configuration(::std::option::Option::Some(
377                crate::types::BucketLifecycleConfiguration::builder()
378                    .set_rules(::std::option::Option::Some(vec![crate::types::LifecycleRule::builder()
379                        .set_expiration(::std::option::Option::Some(
380                            crate::types::LifecycleExpiration::builder()
381                                .set_days(::std::option::Option::Some(1))
382                                .build(),
383                        ))
384                        .set_status(::std::option::Option::Some(
385                            "Enabled"
386                                .parse::<crate::types::ExpirationStatus>()
387                                .expect("static value validated to member"),
388                        ))
389                        .set_id(::std::option::Option::Some("Expire".to_owned()))
390                        .build()
391                        .unwrap()]))
392                    .build()
393                    .unwrap(),
394            ))
395            .send()
396            .await;
397        let _ = dbg!(result);
398        let http_request = request_receiver.expect_request();
399        let expected_headers = [("x-amz-checksum-crc32", "11+f3g==")];
400        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
401        let body = http_request.body().bytes().expect("body should be strict");
402        ::aws_smithy_protocol_test::assert_ok(
403        ::aws_smithy_protocol_test::validate_body(body, "<LifecycleConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\n    <Rule>\n        <Expiration>\n            <Days>1</Days>\n        </Expiration>\n        <ID>Expire</ID>\n        <Status>Enabled</Status>\n    </Rule>\n</LifecycleConfiguration>\n", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
404        );
405        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
406        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
407        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
408    }
409}
410
411/// Error type for the `PutBucketLifecycleConfigurationError` operation.
412#[non_exhaustive]
413#[derive(::std::fmt::Debug)]
414pub enum PutBucketLifecycleConfigurationError {
415    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
416    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
417    variable wildcard pattern and check `.code()`:
418     \
419    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
420     \
421    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PutBucketLifecycleConfigurationError) for what information is available for the error.")]
422    Unhandled(crate::error::sealed_unhandled::Unhandled),
423}
424impl PutBucketLifecycleConfigurationError {
425    /// Creates the `PutBucketLifecycleConfigurationError::Unhandled` variant from any error type.
426    pub fn unhandled(
427        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
428    ) -> Self {
429        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
430            source: err.into(),
431            meta: ::std::default::Default::default(),
432        })
433    }
434
435    /// Creates the `PutBucketLifecycleConfigurationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
436    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
437        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
438            source: err.clone().into(),
439            meta: err,
440        })
441    }
442    ///
443    /// Returns error metadata, which includes the error code, message,
444    /// request ID, and potentially additional information.
445    ///
446    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
447        match self {
448            Self::Unhandled(e) => &e.meta,
449        }
450    }
451}
452impl ::std::error::Error for PutBucketLifecycleConfigurationError {
453    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
454        match self {
455            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
456        }
457    }
458}
459impl ::std::fmt::Display for PutBucketLifecycleConfigurationError {
460    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
461        match self {
462            Self::Unhandled(_inner) => {
463                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
464                    write!(f, "unhandled error ({code})")
465                } else {
466                    f.write_str("unhandled error")
467                }
468            }
469        }
470    }
471}
472impl ::aws_smithy_types::retry::ProvideErrorKind for PutBucketLifecycleConfigurationError {
473    fn code(&self) -> ::std::option::Option<&str> {
474        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
475    }
476    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
477        ::std::option::Option::None
478    }
479}
480impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PutBucketLifecycleConfigurationError {
481    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
482        match self {
483            Self::Unhandled(_inner) => &_inner.meta,
484        }
485    }
486}
487impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PutBucketLifecycleConfigurationError {
488    fn create_unhandled_error(
489        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
490        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
491    ) -> Self {
492        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
493            source,
494            meta: meta.unwrap_or_default(),
495        })
496    }
497}
498impl crate::s3_request_id::RequestIdExt for crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError {
499    fn extended_request_id(&self) -> Option<&str> {
500        self.meta().extended_request_id()
501    }
502}
503impl ::aws_types::request_id::RequestId for crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationError {
504    fn request_id(&self) -> Option<&str> {
505        self.meta().request_id()
506    }
507}
508
509pub use crate::operation::put_bucket_lifecycle_configuration::_put_bucket_lifecycle_configuration_output::PutBucketLifecycleConfigurationOutput;
510
511pub use crate::operation::put_bucket_lifecycle_configuration::_put_bucket_lifecycle_configuration_input::PutBucketLifecycleConfigurationInput;
512
513mod _put_bucket_lifecycle_configuration_input;
514
515mod _put_bucket_lifecycle_configuration_output;
516
517/// Builders
518pub mod builders;