28 28 | output.build()
|
29 29 | })
|
30 30 | }
|
31 31 |
|
32 32 | pub fn ser_put_bucket_acl_headers(
|
33 33 | input: &crate::operation::put_bucket_acl::PutBucketAclInput,
|
34 34 | mut builder: ::http::request::Builder,
|
35 35 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
36 36 | if let ::std::option::Option::Some(inner_1) = &input.acl {
|
37 37 | let formatted_2 = inner_1.as_str();
|
38 + | if !formatted_2.is_empty() {
|
38 39 | let header_value = formatted_2;
|
39 40 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
40 41 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
41 42 | "acl",
|
42 43 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
43 44 | )
|
44 45 | })?;
|
45 46 | builder = builder.header("x-amz-acl", header_value);
|
46 47 | }
|
48 + | }
|
47 49 | if let ::std::option::Option::Some(inner_3) = &input.content_md5 {
|
48 50 | let formatted_4 = inner_3.as_str();
|
51 + | if !formatted_4.is_empty() {
|
49 52 | let header_value = formatted_4;
|
50 53 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
51 54 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
52 55 | "content_md5",
|
53 56 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
54 57 | )
|
55 58 | })?;
|
56 59 | builder = builder.header("Content-MD5", header_value);
|
57 60 | }
|
61 + | }
|
58 62 | if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
|
59 63 | let formatted_6 = inner_5.as_str();
|
64 + | if !formatted_6.is_empty() {
|
60 65 | let header_value = formatted_6;
|
61 66 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
62 67 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
63 68 | "checksum_algorithm",
|
64 69 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
65 70 | )
|
66 71 | })?;
|
67 72 | builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
|
68 73 | }
|
74 + | }
|
69 75 | if let ::std::option::Option::Some(inner_7) = &input.grant_full_control {
|
70 76 | let formatted_8 = inner_7.as_str();
|
77 + | if !formatted_8.is_empty() {
|
71 78 | let header_value = formatted_8;
|
72 79 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
73 80 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
74 81 | "grant_full_control",
|
75 82 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
76 83 | )
|
77 84 | })?;
|
78 85 | builder = builder.header("x-amz-grant-full-control", header_value);
|
79 86 | }
|
87 + | }
|
80 88 | if let ::std::option::Option::Some(inner_9) = &input.grant_read {
|
81 89 | let formatted_10 = inner_9.as_str();
|
90 + | if !formatted_10.is_empty() {
|
82 91 | let header_value = formatted_10;
|
83 92 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
84 93 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
85 94 | "grant_read",
|
86 95 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
87 96 | )
|
88 97 | })?;
|
89 98 | builder = builder.header("x-amz-grant-read", header_value);
|
90 99 | }
|
100 + | }
|
91 101 | if let ::std::option::Option::Some(inner_11) = &input.grant_read_acp {
|
92 102 | let formatted_12 = inner_11.as_str();
|
103 + | if !formatted_12.is_empty() {
|
93 104 | let header_value = formatted_12;
|
94 105 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
95 106 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
96 107 | "grant_read_acp",
|
97 108 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
98 109 | )
|
99 110 | })?;
|
100 111 | builder = builder.header("x-amz-grant-read-acp", header_value);
|
101 112 | }
|
113 + | }
|
102 114 | if let ::std::option::Option::Some(inner_13) = &input.grant_write {
|
103 115 | let formatted_14 = inner_13.as_str();
|
116 + | if !formatted_14.is_empty() {
|
104 117 | let header_value = formatted_14;
|
105 118 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
106 119 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
107 120 | "grant_write",
|
108 121 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
109 122 | )
|
110 123 | })?;
|
111 124 | builder = builder.header("x-amz-grant-write", header_value);
|
112 125 | }
|
126 + | }
|
113 127 | if let ::std::option::Option::Some(inner_15) = &input.grant_write_acp {
|
114 128 | let formatted_16 = inner_15.as_str();
|
129 + | if !formatted_16.is_empty() {
|
115 130 | let header_value = formatted_16;
|
116 131 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
117 132 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
118 133 | "grant_write_acp",
|
119 134 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
120 135 | )
|
121 136 | })?;
|
122 137 | builder = builder.header("x-amz-grant-write-acp", header_value);
|
123 138 | }
|
139 + | }
|
124 140 | if let ::std::option::Option::Some(inner_17) = &input.expected_bucket_owner {
|
125 141 | let formatted_18 = inner_17.as_str();
|
142 + | if !formatted_18.is_empty() {
|
126 143 | let header_value = formatted_18;
|
127 144 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
128 145 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
129 146 | "expected_bucket_owner",
|
130 147 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
131 148 | )
|
132 149 | })?;
|
133 150 | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
134 151 | }
|
152 + | }
|
135 153 | Ok(builder)
|
136 154 | }
|