aws_sdk_s3/protocol_serde/
shape_get_bucket_intelligent_tiering_configuration.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_get_bucket_intelligent_tiering_configuration_http_error(
4 _response_status: u16,
5 _response_headers: &::aws_smithy_runtime_api::http::Headers,
6 _response_body: &[u8],
7) -> std::result::Result<
8 crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationOutput,
9 crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationError,
10> {
11 #[allow(unused_mut)]
12 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
13 .map_err(crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationError::unhandled)?;
14 generic_builder = crate::s3_request_id::apply_extended_request_id(generic_builder, _response_headers);
15 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
16 let generic = generic_builder.build();
17 Err(crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationError::generic(generic))
18}
19
20#[allow(clippy::unnecessary_wraps)]
21pub fn de_get_bucket_intelligent_tiering_configuration_http_response(
22 _response_status: u16,
23 _response_headers: &::aws_smithy_runtime_api::http::Headers,
24 _response_body: &[u8],
25) -> std::result::Result<
26 crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationOutput,
27 crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationError,
28> {
29 Ok({
30 #[allow(unused_mut)]
31 let mut output =
32 crate::operation::get_bucket_intelligent_tiering_configuration::builders::GetBucketIntelligentTieringConfigurationOutputBuilder::default(
33 );
34 output = output.set_intelligent_tiering_configuration(
35 crate::protocol_serde::shape_get_bucket_intelligent_tiering_configuration_output::de_intelligent_tiering_configuration_payload(
36 _response_body,
37 )?,
38 );
39 output._set_extended_request_id(crate::s3_request_id::RequestIdExt::extended_request_id(_response_headers).map(str::to_string));
40 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
41 output.build()
42 })
43}
44
45pub fn ser_get_bucket_intelligent_tiering_configuration_headers(
46 input: &crate::operation::get_bucket_intelligent_tiering_configuration::GetBucketIntelligentTieringConfigurationInput,
47 mut builder: ::http::request::Builder,
48) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
49 if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
50 let formatted_2 = inner_1.as_str();
51 let header_value = formatted_2;
52 let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
53 ::aws_smithy_types::error::operation::BuildError::invalid_field(
54 "expected_bucket_owner",
55 format!("`{}` cannot be used as a header value: {}", &header_value, err),
56 )
57 })?;
58 builder = builder.header("x-amz-expected-bucket-owner", header_value);
59 }
60 Ok(builder)
61}