10 10 | .map_err(crate::operation::get_bucket_tagging::GetBucketTaggingError::unhandled)?;
|
11 11 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
12 12 | let generic = generic_builder.build();
|
13 13 | Err(crate::operation::get_bucket_tagging::GetBucketTaggingError::generic(generic))
|
14 14 | }
|
15 15 |
|
16 16 | #[allow(clippy::unnecessary_wraps)]
|
17 17 | pub fn de_get_bucket_tagging_http_response(
|
18 18 | _response_status: u16,
|
19 19 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
20 20 | _response_body: &[u8],
|
21 21 | ) -> std::result::Result<crate::operation::get_bucket_tagging::GetBucketTaggingOutput, crate::operation::get_bucket_tagging::GetBucketTaggingError> {
|
22 22 | Ok({
|
23 23 | #[allow(unused_mut)]
|
24 24 | let mut output = crate::operation::get_bucket_tagging::builders::GetBucketTaggingOutputBuilder::default();
|
25 25 | output = crate::protocol_serde::shape_get_bucket_tagging::de_get_bucket_tagging(_response_body, output)
|
26 26 | .map_err(crate::operation::get_bucket_tagging::GetBucketTaggingError::unhandled)?;
|
27 27 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
28 28 | crate::serde_util::get_bucket_tagging_output_output_correct_errors(output)
|
29 29 | .build()
|
30 30 | .map_err(crate::operation::get_bucket_tagging::GetBucketTaggingError::unhandled)?
|
31 31 | })
|
32 32 | }
|
33 33 |
|
34 34 | pub fn ser_get_bucket_tagging_headers(
|
35 35 | input: &crate::operation::get_bucket_tagging::GetBucketTaggingInput,
|
36 36 | mut builder: ::http::request::Builder,
|
37 37 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
38 38 | if let ::std::option::Option::Some(inner_1) = &input.account_id {
|
39 39 | let formatted_2 = inner_1.as_str();
|
40 - | let header_value = formatted_2;
|
41 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
42 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
43 - | "account_id",
|
44 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
45 - | )
|
46 - | })?;
|
47 - | builder = builder.header("x-amz-account-id", header_value);
|
40 + | if !formatted_2.is_empty() {
|
41 + | let header_value = formatted_2;
|
42 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
43 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
44 + | "account_id",
|
45 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
46 + | )
|
47 + | })?;
|
48 + | builder = builder.header("x-amz-account-id", header_value);
|
49 + | }
|
48 50 | }
|
49 51 | Ok(builder)
|
50 52 | }
|
51 53 |
|
52 54 | #[allow(unused_mut)]
|
53 55 | pub fn de_get_bucket_tagging(
|
54 56 | inp: &[u8],
|
55 57 | mut builder: crate::operation::get_bucket_tagging::builders::GetBucketTaggingOutputBuilder,
|
56 58 | ) -> Result<crate::operation::get_bucket_tagging::builders::GetBucketTaggingOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
57 59 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
58 60 |
|
59 61 | #[allow(unused_mut)]
|
60 62 | let mut decoder = doc.root_element()?;
|
61 63 | #[allow(unused_variables)]
|
62 64 | let start_el = decoder.start_el();
|
63 65 | if !start_el.matches("GetBucketTaggingResult") {
|
64 66 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
65 67 | "encountered invalid XML root: expected GetBucketTaggingResult but got {:?}. This is likely a bug in the SDK.",
|
66 68 | start_el
|
67 69 | )));
|
68 70 | }
|
69 71 | while let Some(mut tag) = decoder.next_tag() {
|
70 72 | match tag.start_el() {
|
71 73 | s if s.matches("TagSet") /* TagSet com.amazonaws.s3control.synthetic#GetBucketTaggingOutput$TagSet */ => {
|
72 74 | let var_3 =
|
73 75 | Some(
|
74 76 | crate::protocol_serde::shape_s3_tag_set::de_s3_tag_set(&mut tag)
|
75 77 | ?
|
76 78 | )
|
77 79 | ;
|