14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | Err(crate::operation::list_regional_buckets::ListRegionalBucketsError::generic(generic))
|
17 17 | }
|
18 18 |
|
19 19 | #[allow(clippy::unnecessary_wraps)]
|
20 20 | pub fn de_list_regional_buckets_http_response(
|
21 21 | _response_status: u16,
|
22 22 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
23 23 | _response_body: &[u8],
|
24 24 | ) -> std::result::Result<
|
25 25 | crate::operation::list_regional_buckets::ListRegionalBucketsOutput,
|
26 26 | crate::operation::list_regional_buckets::ListRegionalBucketsError,
|
27 27 | > {
|
28 28 | Ok({
|
29 29 | #[allow(unused_mut)]
|
30 30 | let mut output = crate::operation::list_regional_buckets::builders::ListRegionalBucketsOutputBuilder::default();
|
31 31 | output = crate::protocol_serde::shape_list_regional_buckets::de_list_regional_buckets(_response_body, output)
|
32 32 | .map_err(crate::operation::list_regional_buckets::ListRegionalBucketsError::unhandled)?;
|
33 33 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
34 34 | output.build()
|
35 35 | })
|
36 36 | }
|
37 37 |
|
38 38 | pub fn ser_list_regional_buckets_headers(
|
39 39 | input: &crate::operation::list_regional_buckets::ListRegionalBucketsInput,
|
40 40 | mut builder: ::http::request::Builder,
|
41 41 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
42 42 | if let ::std::option::Option::Some(inner_1) = &input.account_id {
|
43 43 | let formatted_2 = inner_1.as_str();
|
44 - | let header_value = formatted_2;
|
45 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
46 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
47 - | "account_id",
|
48 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
49 - | )
|
50 - | })?;
|
51 - | builder = builder.header("x-amz-account-id", header_value);
|
44 + | if !formatted_2.is_empty() {
|
45 + | let header_value = formatted_2;
|
46 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
47 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
48 + | "account_id",
|
49 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
50 + | )
|
51 + | })?;
|
52 + | builder = builder.header("x-amz-account-id", header_value);
|
53 + | }
|
52 54 | }
|
53 55 | if let ::std::option::Option::Some(inner_3) = &input.outpost_id {
|
54 56 | let formatted_4 = inner_3.as_str();
|
55 - | let header_value = formatted_4;
|
56 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
57 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
58 - | "outpost_id",
|
59 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
60 - | )
|
61 - | })?;
|
62 - | builder = builder.header("x-amz-outpost-id", header_value);
|
57 + | if !formatted_4.is_empty() {
|
58 + | let header_value = formatted_4;
|
59 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
60 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
61 + | "outpost_id",
|
62 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
63 + | )
|
64 + | })?;
|
65 + | builder = builder.header("x-amz-outpost-id", header_value);
|
66 + | }
|
63 67 | }
|
64 68 | Ok(builder)
|
65 69 | }
|
66 70 |
|
67 71 | #[allow(unused_mut)]
|
68 72 | pub fn de_list_regional_buckets(
|
69 73 | inp: &[u8],
|
70 74 | mut builder: crate::operation::list_regional_buckets::builders::ListRegionalBucketsOutputBuilder,
|
71 75 | ) -> Result<crate::operation::list_regional_buckets::builders::ListRegionalBucketsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
72 76 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
73 77 |
|
74 78 | #[allow(unused_mut)]
|
75 79 | let mut decoder = doc.root_element()?;
|
76 80 | #[allow(unused_variables)]
|
77 81 | let start_el = decoder.start_el();
|
78 82 | if !start_el.matches("ListRegionalBucketsResult") {
|
79 83 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
80 84 | "encountered invalid XML root: expected ListRegionalBucketsResult but got {:?}. This is likely a bug in the SDK.",
|
81 85 | start_el
|
82 86 | )));
|
83 87 | }
|
84 88 | while let Some(mut tag) = decoder.next_tag() {
|
85 89 | match tag.start_el() {
|
86 90 | s if s.matches("RegionalBucketList") /* RegionalBucketList com.amazonaws.s3control.synthetic#ListRegionalBucketsOutput$RegionalBucketList */ => {
|
87 91 | let var_5 =
|
88 92 | Some(
|
89 93 | crate::protocol_serde::shape_regional_bucket_list::de_regional_bucket_list(&mut tag)
|
90 94 | ?
|
91 95 | )
|
92 96 | ;
|