35 35 | output.build()
|
36 36 | })
|
37 37 | }
|
38 38 |
|
39 39 | pub fn ser_delete_objects_headers(
|
40 40 | input: &crate::operation::delete_objects::DeleteObjectsInput,
|
41 41 | mut builder: ::http::request::Builder,
|
42 42 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
43 43 | if let ::std::option::Option::Some(inner_1) = &input.mfa {
|
44 44 | let formatted_2 = inner_1.as_str();
|
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 - | "mfa",
|
49 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
50 - | )
|
51 - | })?;
|
52 - | builder = builder.header("x-amz-mfa", header_value);
|
45 + | if !formatted_2.is_empty() {
|
46 + | let header_value = formatted_2;
|
47 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
48 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
49 + | "mfa",
|
50 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
51 + | )
|
52 + | })?;
|
53 + | builder = builder.header("x-amz-mfa", header_value);
|
54 + | }
|
53 55 | }
|
54 56 | if let ::std::option::Option::Some(inner_3) = &input.request_payer {
|
55 57 | let formatted_4 = inner_3.as_str();
|
56 - | let header_value = formatted_4;
|
57 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
58 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
59 - | "request_payer",
|
60 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
61 - | )
|
62 - | })?;
|
63 - | builder = builder.header("x-amz-request-payer", header_value);
|
58 + | if !formatted_4.is_empty() {
|
59 + | let header_value = formatted_4;
|
60 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
61 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
62 + | "request_payer",
|
63 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
64 + | )
|
65 + | })?;
|
66 + | builder = builder.header("x-amz-request-payer", header_value);
|
67 + | }
|
64 68 | }
|
65 69 | if let ::std::option::Option::Some(inner_5) = &input.bypass_governance_retention {
|
66 70 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
|
67 71 | let formatted_6 = encoder.encode();
|
68 - | let header_value = formatted_6;
|
69 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
70 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
71 - | "bypass_governance_retention",
|
72 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
73 - | )
|
74 - | })?;
|
75 - | builder = builder.header("x-amz-bypass-governance-retention", header_value);
|
72 + | if !formatted_6.is_empty() {
|
73 + | let header_value = formatted_6;
|
74 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
75 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
76 + | "bypass_governance_retention",
|
77 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
78 + | )
|
79 + | })?;
|
80 + | builder = builder.header("x-amz-bypass-governance-retention", header_value);
|
81 + | }
|
76 82 | }
|
77 83 | if let ::std::option::Option::Some(inner_7) = &input.expected_bucket_owner {
|
78 84 | let formatted_8 = inner_7.as_str();
|
79 - | let header_value = formatted_8;
|
80 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
81 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
82 - | "expected_bucket_owner",
|
83 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
84 - | )
|
85 - | })?;
|
86 - | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
85 + | if !formatted_8.is_empty() {
|
86 + | let header_value = formatted_8;
|
87 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
88 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
89 + | "expected_bucket_owner",
|
90 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
91 + | )
|
92 + | })?;
|
93 + | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
94 + | }
|
87 95 | }
|
88 96 | if let ::std::option::Option::Some(inner_9) = &input.checksum_algorithm {
|
89 97 | let formatted_10 = inner_9.as_str();
|
90 - | let header_value = formatted_10;
|
91 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
92 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
93 - | "checksum_algorithm",
|
94 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
95 - | )
|
96 - | })?;
|
97 - | builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
|
98 + | if !formatted_10.is_empty() {
|
99 + | let header_value = formatted_10;
|
100 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
101 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
102 + | "checksum_algorithm",
|
103 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
104 + | )
|
105 + | })?;
|
106 + | builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
|
107 + | }
|
98 108 | }
|
99 109 | Ok(builder)
|
100 110 | }
|
101 111 |
|
102 112 | #[allow(unused_mut)]
|
103 113 | pub fn de_delete_objects(
|
104 114 | inp: &[u8],
|
105 115 | mut builder: crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder,
|
106 116 | ) -> Result<crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
107 117 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|