23 23 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
24 24 | _response_body: &[u8],
|
25 25 | ) -> std::result::Result<
|
26 26 | crate::operation::get_bucket_accelerate_configuration::GetBucketAccelerateConfigurationOutput,
|
27 27 | crate::operation::get_bucket_accelerate_configuration::GetBucketAccelerateConfigurationError,
|
28 28 | > {
|
29 29 | Ok({
|
30 30 | #[allow(unused_mut)]
|
31 31 | let mut output = crate::operation::get_bucket_accelerate_configuration::builders::GetBucketAccelerateConfigurationOutputBuilder::default();
|
32 32 | output = crate::protocol_serde::shape_get_bucket_accelerate_configuration::de_get_bucket_accelerate_configuration(_response_body, output)
|
33 33 | .map_err(crate::operation::get_bucket_accelerate_configuration::GetBucketAccelerateConfigurationError::unhandled)?;
|
34 34 | output = output.set_request_charged(
|
35 35 | crate::protocol_serde::shape_get_bucket_accelerate_configuration_output::de_request_charged_header(_response_headers).map_err(|_| {
|
36 36 | crate::operation::get_bucket_accelerate_configuration::GetBucketAccelerateConfigurationError::unhandled(
|
37 37 | "Failed to parse RequestCharged from header `x-amz-request-charged",
|
38 38 | )
|
39 39 | })?,
|
40 40 | );
|
41 41 | output._set_extended_request_id(crate::s3_request_id::RequestIdExt::extended_request_id(_response_headers).map(str::to_string));
|
42 42 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
43 43 | output.build()
|
44 44 | })
|
45 45 | }
|
46 46 |
|
47 47 | pub fn ser_get_bucket_accelerate_configuration_headers(
|
48 48 | input: &crate::operation::get_bucket_accelerate_configuration::GetBucketAccelerateConfigurationInput,
|
49 49 | mut builder: ::http::request::Builder,
|
50 50 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
51 51 | if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
|
52 52 | let formatted_2 = inner_1.as_str();
|
53 + | if !formatted_2.is_empty() {
|
53 54 | let header_value = formatted_2;
|
54 55 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
55 56 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
56 57 | "expected_bucket_owner",
|
57 58 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
58 59 | )
|
59 60 | })?;
|
60 61 | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
61 62 | }
|
63 + | }
|
62 64 | if let ::std::option::Option::Some(inner_3) = &input.request_payer {
|
63 65 | let formatted_4 = inner_3.as_str();
|
66 + | if !formatted_4.is_empty() {
|
64 67 | let header_value = formatted_4;
|
65 68 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
66 69 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
67 70 | "request_payer",
|
68 71 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
69 72 | )
|
70 73 | })?;
|
71 74 | builder = builder.header("x-amz-request-payer", header_value);
|
72 75 | }
|
76 + | }
|
73 77 | Ok(builder)
|
74 78 | }
|
75 79 |
|
76 80 | #[allow(unused_mut)]
|
77 81 | pub fn de_get_bucket_accelerate_configuration(
|
78 82 | inp: &[u8],
|
79 83 | mut builder: crate::operation::get_bucket_accelerate_configuration::builders::GetBucketAccelerateConfigurationOutputBuilder,
|
80 84 | ) -> Result<
|
81 85 | crate::operation::get_bucket_accelerate_configuration::builders::GetBucketAccelerateConfigurationOutputBuilder,
|
82 86 | ::aws_smithy_xml::decode::XmlDecodeError,
|
83 87 | > {
|
84 88 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
85 89 |
|
86 90 | #[allow(unused_mut)]
|
87 91 | let mut decoder = doc.root_element()?;
|
88 92 | #[allow(unused_variables)]
|
89 93 | let start_el = decoder.start_el();
|
90 94 | if !start_el.matches("AccelerateConfiguration") {
|
91 95 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
92 96 | "encountered invalid XML root: expected AccelerateConfiguration but got {:?}. This is likely a bug in the SDK.",
|
93 97 | start_el
|
94 98 | )));
|
95 99 | }
|
96 100 | while let Some(mut tag) = decoder.next_tag() {
|
97 101 | match tag.start_el() {
|
98 102 | s if s.matches("Status") /* Status com.amazonaws.s3.synthetic#GetBucketAccelerateConfigurationOutput$Status */ => {
|
99 103 | let var_5 =
|
100 104 | Some(
|
101 105 | Result::<crate::types::BucketAccelerateStatus, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
|
102 106 | crate::types::BucketAccelerateStatus::from(
|