Skip to main content

aws_sdk_s3/operation/
write_get_object_response.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `WriteGetObjectResponse`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct WriteGetObjectResponse;
6impl WriteGetObjectResponse {
7    /// Creates a new `WriteGetObjectResponse`
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::write_get_object_response::WriteGetObjectResponseInput,
14    ) -> ::std::result::Result<
15        crate::operation::write_get_object_response::WriteGetObjectResponseOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::write_get_object_response::WriteGetObjectResponseError,
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::write_get_object_response::WriteGetObjectResponseError>()
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::write_get_object_response::WriteGetObjectResponseOutput>()
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::write_get_object_response::WriteGetObjectResponseInput,
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("S3", "WriteGetObjectResponse", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "S3.WriteGetObjectResponse",
59                "rpc.service" = "S3",
60                "rpc.method" = "WriteGetObjectResponse",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WriteGetObjectResponse {
88    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("WriteGetObjectResponse");
90
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92            WriteGetObjectResponseRequestSerializer,
93        ));
94        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95            WriteGetObjectResponseResponseDeserializer,
96        ));
97
98        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99            crate::config::auth::Params::builder()
100                .operation_name("WriteGetObjectResponse")
101                .build()
102                .expect("required fields set"),
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
106            "WriteGetObjectResponse",
107            "S3",
108        ));
109        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
110        signing_options.double_uri_encode = true;
111        signing_options.content_sha256_header = true;
112        signing_options.normalize_uri_path = false;
113        signing_options.payload_override = Some(::aws_sigv4::http_request::SignableBody::UnsignedPayload);
114
115        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
116            signing_options,
117            ..::std::default::Default::default()
118        });
119
120        ::std::option::Option::Some(cfg.freeze())
121    }
122
123    fn runtime_components(
124        &self,
125        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
126    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
127        #[allow(unused_mut)]
128        let mut rcb =
129            ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("WriteGetObjectResponse")
130                .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
131                    WriteGetObjectResponseTelemetryInputCaptureInterceptor,
132                ))
133                .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
134                    ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
135                ))
136                .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
137                    WriteGetObjectResponseEndpointParamsInterceptor,
138                ))
139                .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
140                    crate::operation::write_get_object_response::WriteGetObjectResponseError,
141                >::new())
142                .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
143                    crate::operation::write_get_object_response::WriteGetObjectResponseError,
144                >::new())
145                .with_retry_classifier(
146                    ::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
147                        crate::operation::write_get_object_response::WriteGetObjectResponseError,
148                    >::builder()
149                    .transient_errors({
150                        let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
151                        transient_errors.push("InternalError");
152                        ::std::borrow::Cow::Owned(transient_errors)
153                    })
154                    .build(),
155                )
156                .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
157                    crate::operation::write_get_object_response::WriteGetObjectResponseError,
158                >::new());
159
160        ::std::borrow::Cow::Owned(rcb)
161    }
162}
163
164#[derive(Debug)]
165struct WriteGetObjectResponseTelemetryInputCaptureInterceptor;
166
167#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
168impl ::aws_smithy_runtime_api::client::interceptors::Intercept for WriteGetObjectResponseTelemetryInputCaptureInterceptor {
169    fn name(&self) -> &'static str {
170        "WriteGetObjectResponseTelemetryInputCaptureInterceptor"
171    }
172
173    fn read_before_execution(
174        &self,
175        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
176            '_,
177            ::aws_smithy_runtime_api::client::interceptors::context::Input,
178            ::aws_smithy_runtime_api::client::interceptors::context::Output,
179            ::aws_smithy_runtime_api::client::interceptors::context::Error,
180        >,
181        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
182    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
183        // Nothing to do unless the customer opted in by naming members to record.
184        let ::std::option::Option::Some(requested) = cfg
185            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
186            .filter(|r| !r.is_empty())
187        else {
188            return ::std::result::Result::Ok(());
189        };
190
191        let ::std::option::Option::Some(input) = context.input().downcast_ref::<WriteGetObjectResponseInput>() else {
192            // A mismatched input is not this interceptor's concern; skip quietly.
193            return ::std::result::Result::Ok(());
194        };
195
196        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
197        if requested.should_capture("RequestRoute") {
198            if let ::std::option::Option::Some(value) = input.request_route.as_deref() {
199                captured.insert("RequestRoute", value);
200            }
201        }
202        if requested.should_capture("RequestToken") {
203            if let ::std::option::Option::Some(value) = input.request_token.as_deref() {
204                captured.insert("RequestToken", value);
205            }
206        }
207        if requested.should_capture("ErrorCode") {
208            if let ::std::option::Option::Some(value) = input.error_code.as_deref() {
209                captured.insert("ErrorCode", value);
210            }
211        }
212        if requested.should_capture("ErrorMessage") {
213            if let ::std::option::Option::Some(value) = input.error_message.as_deref() {
214                captured.insert("ErrorMessage", value);
215            }
216        }
217        if requested.should_capture("AcceptRanges") {
218            if let ::std::option::Option::Some(value) = input.accept_ranges.as_deref() {
219                captured.insert("AcceptRanges", value);
220            }
221        }
222        if requested.should_capture("CacheControl") {
223            if let ::std::option::Option::Some(value) = input.cache_control.as_deref() {
224                captured.insert("CacheControl", value);
225            }
226        }
227        if requested.should_capture("ContentDisposition") {
228            if let ::std::option::Option::Some(value) = input.content_disposition.as_deref() {
229                captured.insert("ContentDisposition", value);
230            }
231        }
232        if requested.should_capture("ContentEncoding") {
233            if let ::std::option::Option::Some(value) = input.content_encoding.as_deref() {
234                captured.insert("ContentEncoding", value);
235            }
236        }
237        if requested.should_capture("ContentLanguage") {
238            if let ::std::option::Option::Some(value) = input.content_language.as_deref() {
239                captured.insert("ContentLanguage", value);
240            }
241        }
242        if requested.should_capture("ContentRange") {
243            if let ::std::option::Option::Some(value) = input.content_range.as_deref() {
244                captured.insert("ContentRange", value);
245            }
246        }
247        if requested.should_capture("ContentType") {
248            if let ::std::option::Option::Some(value) = input.content_type.as_deref() {
249                captured.insert("ContentType", value);
250            }
251        }
252        if requested.should_capture("ChecksumCRC32") {
253            if let ::std::option::Option::Some(value) = input.checksum_crc32.as_deref() {
254                captured.insert("ChecksumCRC32", value);
255            }
256        }
257        if requested.should_capture("ChecksumCRC32C") {
258            if let ::std::option::Option::Some(value) = input.checksum_crc32_c.as_deref() {
259                captured.insert("ChecksumCRC32C", value);
260            }
261        }
262        if requested.should_capture("ChecksumCRC64NVME") {
263            if let ::std::option::Option::Some(value) = input.checksum_crc64_nvme.as_deref() {
264                captured.insert("ChecksumCRC64NVME", value);
265            }
266        }
267        if requested.should_capture("ChecksumSHA1") {
268            if let ::std::option::Option::Some(value) = input.checksum_sha1.as_deref() {
269                captured.insert("ChecksumSHA1", value);
270            }
271        }
272        if requested.should_capture("ChecksumSHA256") {
273            if let ::std::option::Option::Some(value) = input.checksum_sha256.as_deref() {
274                captured.insert("ChecksumSHA256", value);
275            }
276        }
277        if requested.should_capture("ChecksumSHA512") {
278            if let ::std::option::Option::Some(value) = input.checksum_sha512.as_deref() {
279                captured.insert("ChecksumSHA512", value);
280            }
281        }
282        if requested.should_capture("ChecksumMD5") {
283            if let ::std::option::Option::Some(value) = input.checksum_md5.as_deref() {
284                captured.insert("ChecksumMD5", value);
285            }
286        }
287        if requested.should_capture("ChecksumXXHASH64") {
288            if let ::std::option::Option::Some(value) = input.checksum_xxhash64.as_deref() {
289                captured.insert("ChecksumXXHASH64", value);
290            }
291        }
292        if requested.should_capture("ChecksumXXHASH3") {
293            if let ::std::option::Option::Some(value) = input.checksum_xxhash3.as_deref() {
294                captured.insert("ChecksumXXHASH3", value);
295            }
296        }
297        if requested.should_capture("ChecksumXXHASH128") {
298            if let ::std::option::Option::Some(value) = input.checksum_xxhash128.as_deref() {
299                captured.insert("ChecksumXXHASH128", value);
300            }
301        }
302        if requested.should_capture("ETag") {
303            if let ::std::option::Option::Some(value) = input.e_tag.as_deref() {
304                captured.insert("ETag", value);
305            }
306        }
307        if requested.should_capture("Expiration") {
308            if let ::std::option::Option::Some(value) = input.expiration.as_deref() {
309                captured.insert("Expiration", value);
310            }
311        }
312        if requested.should_capture("Restore") {
313            if let ::std::option::Option::Some(value) = input.restore.as_deref() {
314                captured.insert("Restore", value);
315            }
316        }
317        if requested.should_capture("SSECustomerAlgorithm") {
318            if let ::std::option::Option::Some(value) = input.sse_customer_algorithm.as_deref() {
319                captured.insert("SSECustomerAlgorithm", value);
320            }
321        }
322        if requested.should_capture("SSECustomerKeyMD5") {
323            if let ::std::option::Option::Some(value) = input.sse_customer_key_md5.as_deref() {
324                captured.insert("SSECustomerKeyMD5", value);
325            }
326        }
327        if requested.should_capture("VersionId") {
328            if let ::std::option::Option::Some(value) = input.version_id.as_deref() {
329                captured.insert("VersionId", value);
330            }
331        }
332
333        cfg.interceptor_state().store_put(captured);
334        ::std::result::Result::Ok(())
335    }
336}
337#[derive(Debug)]
338struct WriteGetObjectResponseResponseDeserializer;
339impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for WriteGetObjectResponseResponseDeserializer {
340    fn deserialize_nonstreaming_with_config(
341        &self,
342        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
343        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
344    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
345        let (success, status) = (response.status().is_success(), response.status().as_u16());
346        let headers = response.headers();
347        let body = response.body().bytes().expect("body loaded");
348        #[allow(unused_mut)]
349        let mut force_error = false;
350        ::tracing::debug!(extended_request_id = ?crate::s3_request_id::RequestIdExt::extended_request_id(response));
351        if matches!(crate::rest_xml_unwrapped_errors::body_is_error(body), Ok(true)) {
352            force_error = true;
353        }
354        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
355        let parse_result = if !success && status != 200 || force_error {
356            crate::protocol_serde::shape_write_get_object_response::de_write_get_object_response_http_error(status, headers, body)
357        } else {
358            crate::protocol_serde::shape_write_get_object_response::de_write_get_object_response_http_response(status, headers, body)
359        };
360        crate::protocol_serde::type_erase_result(parse_result)
361    }
362}
363#[derive(Debug)]
364struct WriteGetObjectResponseRequestSerializer;
365impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for WriteGetObjectResponseRequestSerializer {
366    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
367    fn serialize_input(
368        &self,
369        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
370        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
371    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
372        let input = input
373            .downcast::<crate::operation::write_get_object_response::WriteGetObjectResponseInput>()
374            .expect("correct type");
375        let _header_serialization_settings = _cfg
376            .load::<crate::serialization_settings::HeaderSerializationSettings>()
377            .cloned()
378            .unwrap_or_default();
379        let mut request_builder = {
380            #[allow(clippy::uninlined_format_args)]
381            fn uri_base(
382                _input: &crate::operation::write_get_object_response::WriteGetObjectResponseInput,
383                output: &mut ::std::string::String,
384            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
385                use ::std::fmt::Write as _;
386                ::std::write!(output, "/WriteGetObjectResponse").expect("formatting should succeed");
387                ::std::result::Result::Ok(())
388            }
389            #[allow(clippy::unnecessary_wraps)]
390            fn update_http_builder(
391                input: &crate::operation::write_get_object_response::WriteGetObjectResponseInput,
392                builder: ::http_1x::request::Builder,
393            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
394                let mut uri = ::std::string::String::new();
395                uri_base(input, &mut uri)?;
396                let builder = crate::protocol_serde::shape_write_get_object_response::ser_write_get_object_response_headers(input, builder)?;
397                ::std::result::Result::Ok(builder.method("POST").uri(uri))
398            }
399            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
400            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
401            builder
402        };
403        let body = crate::protocol_serde::shape_write_get_object_response_input::ser_body_http_payload(input.body)?.into_inner();
404        if let Some(content_length) = body.content_length() {
405            let content_length = content_length.to_string();
406            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
407        }
408        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
409    }
410}
411#[derive(Debug)]
412struct WriteGetObjectResponseEndpointParamsInterceptor;
413
414#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
415impl ::aws_smithy_runtime_api::client::interceptors::Intercept for WriteGetObjectResponseEndpointParamsInterceptor {
416    fn name(&self) -> &'static str {
417        "WriteGetObjectResponseEndpointParamsInterceptor"
418    }
419
420    fn read_before_execution(
421        &self,
422        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
423            '_,
424            ::aws_smithy_runtime_api::client::interceptors::context::Input,
425            ::aws_smithy_runtime_api::client::interceptors::context::Output,
426            ::aws_smithy_runtime_api::client::interceptors::context::Error,
427        >,
428        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
429    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
430        let _input = context
431            .input()
432            .downcast_ref::<WriteGetObjectResponseInput>()
433            .ok_or("failed to downcast to WriteGetObjectResponseInput")?;
434
435        let endpoint_prefix = {
436            let request_route = _input.request_route.as_deref().unwrap_or_default();
437            if request_route.is_empty() {
438                return Err(
439                    ::aws_smithy_runtime_api::client::endpoint::error::InvalidEndpointError::failed_to_construct_uri(
440                        "request_route was unset or empty but must be set as part of the endpoint prefix",
441                    )
442                    .into(),
443                );
444            }
445            #[allow(clippy::uninlined_format_args)]
446            ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new(format!("{RequestRoute}.", RequestRoute = request_route))
447        }
448        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err))?;
449        cfg.interceptor_state().store_put(endpoint_prefix);
450
451        let params = crate::config::endpoint::Params::builder()
452            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
453            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
454            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
455            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
456            .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
457            .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
458            .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
459            .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
460            .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
461            .set_use_object_lambda_endpoint(Some(true))
462            .build()
463            .map_err(|err| {
464                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
465            })?;
466        cfg.interceptor_state()
467            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
468        ::std::result::Result::Ok(())
469    }
470}
471
472// The get_* functions below are generated from JMESPath expressions in the
473// operationContextParams trait. They target the operation's input shape.
474
475/// Error type for the `WriteGetObjectResponseError` operation.
476#[non_exhaustive]
477#[derive(::std::fmt::Debug)]
478pub enum WriteGetObjectResponseError {
479    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
480    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
481    variable wildcard pattern and check `.code()`:
482     \
483    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
484     \
485    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-WriteGetObjectResponseError) for what information is available for the error.")]
486    Unhandled(crate::error::sealed_unhandled::Unhandled),
487}
488impl WriteGetObjectResponseError {
489    /// Creates the `WriteGetObjectResponseError::Unhandled` variant from any error type.
490    pub fn unhandled(
491        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
492    ) -> Self {
493        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
494            source: err.into(),
495            meta: ::std::default::Default::default(),
496        })
497    }
498
499    /// Creates the `WriteGetObjectResponseError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
500    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
501        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
502            source: err.clone().into(),
503            meta: err,
504        })
505    }
506    ///
507    /// Returns error metadata, which includes the error code, message,
508    /// request ID, and potentially additional information.
509    ///
510    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
511        match self {
512            Self::Unhandled(e) => &e.meta,
513        }
514    }
515}
516impl ::std::error::Error for WriteGetObjectResponseError {
517    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
518        match self {
519            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
520        }
521    }
522}
523impl ::std::fmt::Display for WriteGetObjectResponseError {
524    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
525        match self {
526            Self::Unhandled(_inner) => {
527                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
528                    write!(f, "unhandled error ({code})")
529                } else {
530                    f.write_str("unhandled error")
531                }
532            }
533        }
534    }
535}
536impl ::aws_smithy_types::retry::ProvideErrorKind for WriteGetObjectResponseError {
537    fn code(&self) -> ::std::option::Option<&str> {
538        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
539    }
540    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
541        ::std::option::Option::None
542    }
543}
544impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for WriteGetObjectResponseError {
545    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
546        match self {
547            Self::Unhandled(_inner) => &_inner.meta,
548        }
549    }
550}
551impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for WriteGetObjectResponseError {
552    fn create_unhandled_error(
553        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
554        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
555    ) -> Self {
556        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
557            source,
558            meta: meta.unwrap_or_default(),
559        })
560    }
561}
562impl crate::s3_request_id::RequestIdExt for crate::operation::write_get_object_response::WriteGetObjectResponseError {
563    fn extended_request_id(&self) -> Option<&str> {
564        self.meta().extended_request_id()
565    }
566}
567impl ::aws_types::request_id::RequestId for crate::operation::write_get_object_response::WriteGetObjectResponseError {
568    fn request_id(&self) -> Option<&str> {
569        self.meta().request_id()
570    }
571}
572
573pub use crate::operation::write_get_object_response::_write_get_object_response_input::WriteGetObjectResponseInput;
574
575pub use crate::operation::write_get_object_response::_write_get_object_response_output::WriteGetObjectResponseOutput;
576
577mod _write_get_object_response_input;
578
579mod _write_get_object_response_output;
580
581/// Builders
582pub mod builders;