Skip to main content

aws_sdk_s3/operation/
update_bucket_metadata_inventory_table_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `UpdateBucketMetadataInventoryTableConfiguration`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateBucketMetadataInventoryTableConfiguration;
6impl UpdateBucketMetadataInventoryTableConfiguration {
7    /// Creates a new `UpdateBucketMetadataInventoryTableConfiguration`
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::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput,
14    ) -> ::std::result::Result<
15        crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError,
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::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError>().expect("correct error type")
27                            })
28        };
29        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
30            .await
31            .map_err(map_err)?;
32        let output = context.finalize().map_err(map_err)?;
33        ::std::result::Result::Ok(output.downcast::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationOutput>().expect("correct output type"))
34    }
35
36    pub(crate) async fn orchestrate_with_stop_point(
37        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
38        input: crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput,
39        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
40    ) -> ::std::result::Result<
41        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
42        ::aws_smithy_runtime_api::client::result::SdkError<
43            ::aws_smithy_runtime_api::client::interceptors::context::Error,
44            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
45        >,
46    > {
47        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
48        use ::tracing::Instrument;
49        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
50            "S3",
51            "UpdateBucketMetadataInventoryTableConfiguration",
52            input,
53            runtime_plugins,
54            stop_point,
55        )
56        // Create a parent span for the entire operation. Includes a random, internal-only,
57        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
58        .instrument(::tracing::debug_span!(
59            "S3.UpdateBucketMetadataInventoryTableConfiguration",
60            "rpc.service" = "S3",
61            "rpc.method" = "UpdateBucketMetadataInventoryTableConfiguration",
62            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
63            "rpc.system" = "aws-api",
64        ))
65        .await
66    }
67
68    pub(crate) fn operation_runtime_plugins(
69        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
70        client_config: &crate::config::Config,
71        config_override: ::std::option::Option<crate::config::Builder>,
72    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
73        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
74
75        if let ::std::option::Option::Some(config_override) = config_override {
76            for plugin in config_override.runtime_plugins.iter().cloned() {
77                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
78            }
79            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
80                config_override,
81                client_config.config.clone(),
82                &client_config.runtime_components,
83            ));
84        }
85        runtime_plugins
86    }
87}
88impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateBucketMetadataInventoryTableConfiguration {
89    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
90        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateBucketMetadataInventoryTableConfiguration");
91
92        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
93            UpdateBucketMetadataInventoryTableConfigurationRequestSerializer,
94        ));
95        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
96            UpdateBucketMetadataInventoryTableConfigurationResponseDeserializer,
97        ));
98
99        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
100            crate::config::auth::Params::builder()
101                .operation_name("UpdateBucketMetadataInventoryTableConfiguration")
102                .build()
103                .expect("required fields set"),
104        ));
105
106        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
107            "UpdateBucketMetadataInventoryTableConfiguration",
108            "S3",
109        ));
110        cfg.store_put(crate::s3_express::checksum::provide_default_checksum_algorithm());
111        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
112        signing_options.double_uri_encode = false;
113        signing_options.content_sha256_header = true;
114        signing_options.normalize_uri_path = false;
115        signing_options.payload_override = None;
116
117        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
118            signing_options,
119            ..::std::default::Default::default()
120        });
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("UpdateBucketMetadataInventoryTableConfiguration")
131                            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateBucketMetadataInventoryTableConfigurationTelemetryInputCaptureInterceptor))
132.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()))
133.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateBucketMetadataInventoryTableConfigurationEndpointParamsInterceptor))
134.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(crate::http_request_checksum::RequestChecksumInterceptor::new(
135                                |input: &::aws_smithy_runtime_api::client::interceptors::context::Input| {
136                                    let input: &crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput = 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 = request.headers().iter().filter_map(|(name, _val)| {
145                                        if name.starts_with("x-amz-checksum-") {
146                                            Some(name)
147                                        } else {
148                                            None
149                                        }
150                                    });
151                                    for algo_header in headers_to_check {
152                                        if request.headers().get(algo_header).is_some() {
153                                            user_set_checksum_value = true;
154                                        }
155                                    }
156
157                                    // We check if the user set the checksum algo manually
158                                    let user_set_checksum_algo = request.headers()
159                                        .get("x-amz-sdk-checksum-algorithm")
160                                        .is_some();
161
162                                    // This value is set by the user on the SdkConfig to indicate their preference
163                                    let request_checksum_calculation = cfg
164                                        .load::<::aws_smithy_types::checksum_config::RequestChecksumCalculation>()
165                                        .unwrap_or(&::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenSupported);
166
167                                    // From the httpChecksum trait
168                                    let http_checksum_required = true;
169
170                                    let is_presigned_req = cfg.load::<crate::presigning::PresigningMarker>().is_some();
171
172                                    // If the request is presigned we do not set a default.
173                                    // If the RequestChecksumCalculation is WhenSupported and the user has not set a checksum value or algo
174                                    // we set the default. If it is WhenRequired and a checksum is required by the trait and the user has not
175                                    // set a checksum value or algo we also set the default. In all other cases we do nothing.
176                                    match (
177                                        request_checksum_calculation,
178                                        http_checksum_required,
179                                        user_set_checksum_value,
180                                        user_set_checksum_algo,
181                                        is_presigned_req,
182                                    ) {
183                                        (_, _, _, _, true) => {}
184                                        (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenSupported, _, false, false, _)
185                                        | (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenRequired, true, false, false, _) => {
186                                            request.headers_mut().insert("x-amz-sdk-checksum-algorithm", "CRC32");
187                                        }
188                                        _ => {},
189                                    }
190
191                                    // We return a bool indicating if the user did set the checksum value, if they did
192                                    // we can short circuit and exit the interceptor early.
193                                    Ok(user_set_checksum_value)
194                                }
195                                )))
196                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError>::new())
197.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError>::new())
198.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError>::builder().transient_errors({
199                                            let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
200                                            transient_errors.push("InternalError");
201                                            ::std::borrow::Cow::Owned(transient_errors)
202                                            }).build())
203.with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError>::new());
204
205        ::std::borrow::Cow::Owned(rcb)
206    }
207}
208
209#[derive(Debug)]
210struct UpdateBucketMetadataInventoryTableConfigurationTelemetryInputCaptureInterceptor;
211
212#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
213impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateBucketMetadataInventoryTableConfigurationTelemetryInputCaptureInterceptor {
214    fn name(&self) -> &'static str {
215        "UpdateBucketMetadataInventoryTableConfigurationTelemetryInputCaptureInterceptor"
216    }
217
218    fn read_before_execution(
219        &self,
220        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
221            '_,
222            ::aws_smithy_runtime_api::client::interceptors::context::Input,
223            ::aws_smithy_runtime_api::client::interceptors::context::Output,
224            ::aws_smithy_runtime_api::client::interceptors::context::Error,
225        >,
226        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
227    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
228        // Nothing to do unless the customer opted in by naming members to record.
229        let ::std::option::Option::Some(requested) = cfg
230            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
231            .filter(|r| !r.is_empty())
232        else {
233            return ::std::result::Result::Ok(());
234        };
235
236        let ::std::option::Option::Some(input) = context.input().downcast_ref::<UpdateBucketMetadataInventoryTableConfigurationInput>() else {
237            // A mismatched input is not this interceptor's concern; skip quietly.
238            return ::std::result::Result::Ok(());
239        };
240
241        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
242        if requested.should_capture("Bucket") {
243            if let ::std::option::Option::Some(value) = input.bucket.as_deref() {
244                captured.insert("Bucket", value);
245            }
246        }
247        if requested.should_capture("ContentMD5") {
248            if let ::std::option::Option::Some(value) = input.content_md5.as_deref() {
249                captured.insert("ContentMD5", value);
250            }
251        }
252        if requested.should_capture("ExpectedBucketOwner") {
253            if let ::std::option::Option::Some(value) = input.expected_bucket_owner.as_deref() {
254                captured.insert("ExpectedBucketOwner", value);
255            }
256        }
257
258        cfg.interceptor_state().store_put(captured);
259        ::std::result::Result::Ok(())
260    }
261}
262#[derive(Debug)]
263struct UpdateBucketMetadataInventoryTableConfigurationResponseDeserializer;
264impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateBucketMetadataInventoryTableConfigurationResponseDeserializer {
265    fn deserialize_nonstreaming_with_config(
266        &self,
267        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
268        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
269    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
270        let (success, status) = (response.status().is_success(), response.status().as_u16());
271        let headers = response.headers();
272        let body = response.body().bytes().expect("body loaded");
273        #[allow(unused_mut)]
274        let mut force_error = false;
275        ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
276        if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
277            force_error = true;
278        }
279        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
280        let parse_result = if !success && status != 200 || force_error {
281            crate::protocol_serde::shape_update_bucket_metadata_inventory_table_configuration::de_update_bucket_metadata_inventory_table_configuration_http_error(status, headers, body, _cfg)
282        } else {
283            crate::protocol_serde::shape_update_bucket_metadata_inventory_table_configuration::de_update_bucket_metadata_inventory_table_configuration_http_response(status, headers, body, _cfg)
284        };
285        crate::protocol_serde::type_erase_result(parse_result)
286    }
287}
288#[derive(Debug)]
289struct UpdateBucketMetadataInventoryTableConfigurationRequestSerializer;
290impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateBucketMetadataInventoryTableConfigurationRequestSerializer {
291    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
292    fn serialize_input(
293        &self,
294        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
295        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
296    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
297        let input = input
298            .downcast::<crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput>(
299            )
300            .expect("correct type");
301        let _header_serialization_settings = _cfg
302            .load::<crate::serialization_settings::HeaderSerializationSettings>()
303            .cloned()
304            .unwrap_or_default();
305        let mut request_builder = {
306            #[allow(clippy::uninlined_format_args)]
307            fn uri_base(
308                _input: &crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput,
309                output: &mut ::std::string::String,
310            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
311                use ::std::fmt::Write as _;
312                ::std::write!(output, "/").expect("formatting should succeed");
313                ::std::result::Result::Ok(())
314            }
315            fn uri_query(
316                _input: &crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput,
317                mut output: &mut ::std::string::String,
318            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
319                let mut query = ::aws_smithy_http::query::Writer::new(output);
320                query.push_v("metadataInventoryTable");
321                ::std::result::Result::Ok(())
322            }
323            #[allow(clippy::unnecessary_wraps)]
324            fn update_http_builder(
325                input: &crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationInput,
326                builder: ::http_1x::request::Builder,
327            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
328                let mut uri = ::std::string::String::new();
329                uri_base(input, &mut uri)?;
330                uri_query(input, &mut uri)?;
331                let builder = crate::protocol_serde::shape_update_bucket_metadata_inventory_table_configuration::ser_update_bucket_metadata_inventory_table_configuration_headers(input, builder)?;
332                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
333            }
334            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
335            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
336            builder
337        };
338        let body = ::aws_smithy_types::body::SdkBody::from(
339            crate::protocol_serde::shape_update_bucket_metadata_inventory_table_configuration_input::ser_inventory_table_configuration_http_payload(
340                &input.inventory_table_configuration,
341            )?,
342        );
343        if let Some(content_length) = body.content_length() {
344            let content_length = content_length.to_string();
345            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
346        }
347        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
348    }
349}
350#[derive(Debug)]
351struct UpdateBucketMetadataInventoryTableConfigurationEndpointParamsInterceptor;
352
353#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
354impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateBucketMetadataInventoryTableConfigurationEndpointParamsInterceptor {
355    fn name(&self) -> &'static str {
356        "UpdateBucketMetadataInventoryTableConfigurationEndpointParamsInterceptor"
357    }
358
359    fn read_before_execution(
360        &self,
361        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
362            '_,
363            ::aws_smithy_runtime_api::client::interceptors::context::Input,
364            ::aws_smithy_runtime_api::client::interceptors::context::Output,
365            ::aws_smithy_runtime_api::client::interceptors::context::Error,
366        >,
367        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
368    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
369        let _input = context
370            .input()
371            .downcast_ref::<UpdateBucketMetadataInventoryTableConfigurationInput>()
372            .ok_or("failed to downcast to UpdateBucketMetadataInventoryTableConfigurationInput")?;
373
374        let params = crate::config::endpoint::Params::builder()
375            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
376            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
377            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
378            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
379            .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
380            .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
381            .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
382            .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
383            .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
384            .set_use_s3_express_control_endpoint(Some(true))
385            .set_bucket(Some(
386                _input
387                    .bucket
388                    .clone()
389                    .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
390                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
391            ))
392            .build()
393            .map_err(|err| {
394                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
395            })?;
396        cfg.interceptor_state()
397            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
398        ::std::result::Result::Ok(())
399    }
400}
401
402// The get_* functions below are generated from JMESPath expressions in the
403// operationContextParams trait. They target the operation's input shape.
404
405/// Error type for the `UpdateBucketMetadataInventoryTableConfigurationError` operation.
406#[non_exhaustive]
407#[derive(::std::fmt::Debug)]
408pub enum UpdateBucketMetadataInventoryTableConfigurationError {
409    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
410    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
411    variable wildcard pattern and check `.code()`:
412     \
413    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
414     \
415    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateBucketMetadataInventoryTableConfigurationError) for what information is available for the error.")]
416    Unhandled(crate::error::sealed_unhandled::Unhandled),
417}
418impl UpdateBucketMetadataInventoryTableConfigurationError {
419    /// Creates the `UpdateBucketMetadataInventoryTableConfigurationError::Unhandled` variant from any error type.
420    pub fn unhandled(
421        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
422    ) -> Self {
423        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
424            source: err.into(),
425            meta: ::std::default::Default::default(),
426        })
427    }
428
429    /// Creates the `UpdateBucketMetadataInventoryTableConfigurationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
430    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
431        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
432            source: err.clone().into(),
433            meta: err,
434        })
435    }
436    ///
437    /// Returns error metadata, which includes the error code, message,
438    /// request ID, and potentially additional information.
439    ///
440    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
441        match self {
442            Self::Unhandled(e) => &e.meta,
443        }
444    }
445}
446impl ::std::error::Error for UpdateBucketMetadataInventoryTableConfigurationError {
447    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
448        match self {
449            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
450        }
451    }
452}
453impl ::std::fmt::Display for UpdateBucketMetadataInventoryTableConfigurationError {
454    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
455        match self {
456            Self::Unhandled(_inner) => {
457                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
458                    write!(f, "unhandled error ({code})")
459                } else {
460                    f.write_str("unhandled error")
461                }
462            }
463        }
464    }
465}
466impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateBucketMetadataInventoryTableConfigurationError {
467    fn code(&self) -> ::std::option::Option<&str> {
468        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
469    }
470    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
471        ::std::option::Option::None
472    }
473}
474impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateBucketMetadataInventoryTableConfigurationError {
475    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
476        match self {
477            Self::Unhandled(_inner) => &_inner.meta,
478        }
479    }
480}
481impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateBucketMetadataInventoryTableConfigurationError {
482    fn create_unhandled_error(
483        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
484        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
485    ) -> Self {
486        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
487            source,
488            meta: meta.unwrap_or_default(),
489        })
490    }
491}
492impl crate::s3_request_id::RequestIdExt
493    for crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError
494{
495    fn extended_request_id(&self) -> Option<&str> {
496        self.meta().extended_request_id()
497    }
498}
499impl ::aws_types::request_id::RequestId
500    for crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError
501{
502    fn request_id(&self) -> Option<&str> {
503        self.meta().request_id()
504    }
505}
506
507pub use crate::operation::update_bucket_metadata_inventory_table_configuration::_update_bucket_metadata_inventory_table_configuration_input::UpdateBucketMetadataInventoryTableConfigurationInput;
508
509pub use crate::operation::update_bucket_metadata_inventory_table_configuration::_update_bucket_metadata_inventory_table_configuration_output::UpdateBucketMetadataInventoryTableConfigurationOutput;
510
511mod _update_bucket_metadata_inventory_table_configuration_input;
512
513mod _update_bucket_metadata_inventory_table_configuration_output;
514
515/// Builders
516pub mod builders;