6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<crate::operation::put_bucket_policy::PutBucketPolicyOutput, crate::operation::put_bucket_policy::PutBucketPolicyError> {
|
8 8 | #[allow(unused_mut)]
|
9 9 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 10 | .map_err(crate::operation::put_bucket_policy::PutBucketPolicyError::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::put_bucket_policy::PutBucketPolicyError::generic(generic))
|
14 14 | }
|
15 15 |
|
16 16 | #[allow(clippy::unnecessary_wraps)]
|
17 17 | pub fn de_put_bucket_policy_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::put_bucket_policy::PutBucketPolicyOutput, crate::operation::put_bucket_policy::PutBucketPolicyError> {
|
22 22 | Ok({
|
23 23 | #[allow(unused_mut)]
|
24 24 | let mut output = crate::operation::put_bucket_policy::builders::PutBucketPolicyOutputBuilder::default();
|
25 25 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
26 26 | output.build()
|
27 27 | })
|
28 28 | }
|
29 29 |
|
30 30 | pub fn ser_put_bucket_policy_headers(
|
31 31 | input: &crate::operation::put_bucket_policy::PutBucketPolicyInput,
|
32 32 | mut builder: ::http::request::Builder,
|
33 33 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
34 34 | if let ::std::option::Option::Some(inner_1) = &input.account_id {
|
35 35 | let formatted_2 = inner_1.as_str();
|
36 - | let header_value = formatted_2;
|
37 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
38 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
39 - | "account_id",
|
40 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
41 - | )
|
42 - | })?;
|
43 - | builder = builder.header("x-amz-account-id", header_value);
|
36 + | if !formatted_2.is_empty() {
|
37 + | let header_value = formatted_2;
|
38 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
39 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
40 + | "account_id",
|
41 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
42 + | )
|
43 + | })?;
|
44 + | builder = builder.header("x-amz-account-id", header_value);
|
45 + | }
|
44 46 | }
|
45 47 | if let ::std::option::Option::Some(inner_3) = &input.confirm_remove_self_bucket_access {
|
46 48 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
|
47 49 | let formatted_4 = encoder.encode();
|
48 - | let header_value = formatted_4;
|
49 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
50 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
51 - | "confirm_remove_self_bucket_access",
|
52 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
53 - | )
|
54 - | })?;
|
55 - | builder = builder.header("x-amz-confirm-remove-self-bucket-access", header_value);
|
50 + | if !formatted_4.is_empty() {
|
51 + | let header_value = formatted_4;
|
52 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
53 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
54 + | "confirm_remove_self_bucket_access",
|
55 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
56 + | )
|
57 + | })?;
|
58 + | builder = builder.header("x-amz-confirm-remove-self-bucket-access", header_value);
|
59 + | }
|
56 60 | }
|
57 61 | Ok(builder)
|
58 62 | }
|
59 63 |
|
60 64 | pub fn ser_put_bucket_policy_op_input(
|
61 65 | input: &crate::operation::put_bucket_policy::PutBucketPolicyInput,
|
62 66 | ) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
63 67 | let mut out = String::new();
|
64 68 | {
|
65 69 | let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
|