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