34 34 | output.build()
|
35 35 | })
|
36 36 | }
|
37 37 |
|
38 38 | pub fn ser_write_get_object_response_headers(
|
39 39 | input: &crate::operation::write_get_object_response::WriteGetObjectResponseInput,
|
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.request_route {
|
43 43 | let formatted_2 = inner_1.as_str();
|
44 + | if !formatted_2.is_empty() {
|
44 45 | let header_value = formatted_2;
|
45 46 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
46 47 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
47 48 | "request_route",
|
48 49 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
49 50 | )
|
50 51 | })?;
|
51 52 | builder = builder.header("x-amz-request-route", header_value);
|
52 53 | }
|
54 + | }
|
53 55 | if let ::std::option::Option::Some(inner_3) = &input.request_token {
|
54 56 | let formatted_4 = inner_3.as_str();
|
57 + | if !formatted_4.is_empty() {
|
55 58 | let header_value = formatted_4;
|
56 59 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
57 60 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
58 61 | "request_token",
|
59 62 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
60 63 | )
|
61 64 | })?;
|
62 65 | builder = builder.header("x-amz-request-token", header_value);
|
63 66 | }
|
67 + | }
|
64 68 | if let ::std::option::Option::Some(inner_5) = &input.status_code {
|
65 69 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
|
66 70 | let formatted_6 = encoder.encode();
|
71 + | if !formatted_6.is_empty() {
|
67 72 | let header_value = formatted_6;
|
68 73 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
69 74 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
70 75 | "status_code",
|
71 76 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
72 77 | )
|
73 78 | })?;
|
74 79 | builder = builder.header("x-amz-fwd-status", header_value);
|
75 80 | }
|
81 + | }
|
76 82 | if let ::std::option::Option::Some(inner_7) = &input.error_code {
|
77 83 | let formatted_8 = inner_7.as_str();
|
84 + | if !formatted_8.is_empty() {
|
78 85 | let header_value = formatted_8;
|
79 86 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
80 87 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
81 88 | "error_code",
|
82 89 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
83 90 | )
|
84 91 | })?;
|
85 92 | builder = builder.header("x-amz-fwd-error-code", header_value);
|
86 93 | }
|
94 + | }
|
87 95 | if let ::std::option::Option::Some(inner_9) = &input.error_message {
|
88 96 | let formatted_10 = inner_9.as_str();
|
97 + | if !formatted_10.is_empty() {
|
89 98 | let header_value = formatted_10;
|
90 99 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
91 100 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
92 101 | "error_message",
|
93 102 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
94 103 | )
|
95 104 | })?;
|
96 105 | builder = builder.header("x-amz-fwd-error-message", header_value);
|
97 106 | }
|
107 + | }
|
98 108 | if let ::std::option::Option::Some(inner_11) = &input.accept_ranges {
|
99 109 | let formatted_12 = inner_11.as_str();
|
110 + | if !formatted_12.is_empty() {
|
100 111 | let header_value = formatted_12;
|
101 112 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
102 113 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
103 114 | "accept_ranges",
|
104 115 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
105 116 | )
|
106 117 | })?;
|
107 118 | builder = builder.header("x-amz-fwd-header-accept-ranges", header_value);
|
108 119 | }
|
120 + | }
|
109 121 | if let ::std::option::Option::Some(inner_13) = &input.cache_control {
|
110 122 | let formatted_14 = inner_13.as_str();
|
123 + | if !formatted_14.is_empty() {
|
111 124 | let header_value = formatted_14;
|
112 125 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
113 126 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
114 127 | "cache_control",
|
115 128 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
116 129 | )
|
117 130 | })?;
|
118 131 | builder = builder.header("x-amz-fwd-header-Cache-Control", header_value);
|
119 132 | }
|
133 + | }
|
120 134 | if let ::std::option::Option::Some(inner_15) = &input.content_disposition {
|
121 135 | let formatted_16 = inner_15.as_str();
|
136 + | if !formatted_16.is_empty() {
|
122 137 | let header_value = formatted_16;
|
123 138 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
124 139 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
125 140 | "content_disposition",
|
126 141 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
127 142 | )
|
128 143 | })?;
|
129 144 | builder = builder.header("x-amz-fwd-header-Content-Disposition", header_value);
|
130 145 | }
|
146 + | }
|
131 147 | if let ::std::option::Option::Some(inner_17) = &input.content_encoding {
|
132 148 | let formatted_18 = inner_17.as_str();
|
149 + | if !formatted_18.is_empty() {
|
133 150 | let header_value = formatted_18;
|
134 151 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
135 152 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
136 153 | "content_encoding",
|
137 154 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
138 155 | )
|
139 156 | })?;
|
140 157 | builder = builder.header("x-amz-fwd-header-Content-Encoding", header_value);
|
141 158 | }
|
159 + | }
|
142 160 | if let ::std::option::Option::Some(inner_19) = &input.content_language {
|
143 161 | let formatted_20 = inner_19.as_str();
|
162 + | if !formatted_20.is_empty() {
|
144 163 | let header_value = formatted_20;
|
145 164 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
146 165 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
147 166 | "content_language",
|
148 167 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
149 168 | )
|
150 169 | })?;
|
151 170 | builder = builder.header("x-amz-fwd-header-Content-Language", header_value);
|
152 171 | }
|
172 + | }
|
153 173 | if let ::std::option::Option::Some(inner_21) = &input.content_length {
|
154 174 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_21);
|
155 175 | let formatted_22 = encoder.encode();
|
176 + | if !formatted_22.is_empty() {
|
156 177 | let header_value = formatted_22;
|
157 178 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
158 179 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
159 180 | "content_length",
|
160 181 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
161 182 | )
|
162 183 | })?;
|
163 184 | builder = builder.header("Content-Length", header_value);
|
164 185 | }
|
186 + | }
|
165 187 | if let ::std::option::Option::Some(inner_23) = &input.content_range {
|
166 188 | let formatted_24 = inner_23.as_str();
|
189 + | if !formatted_24.is_empty() {
|
167 190 | let header_value = formatted_24;
|
168 191 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
169 192 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
170 193 | "content_range",
|
171 194 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
172 195 | )
|
173 196 | })?;
|
174 197 | builder = builder.header("x-amz-fwd-header-Content-Range", header_value);
|
175 198 | }
|
199 + | }
|
176 200 | if let ::std::option::Option::Some(inner_25) = &input.content_type {
|
177 201 | let formatted_26 = inner_25.as_str();
|
202 + | if !formatted_26.is_empty() {
|
178 203 | let header_value = formatted_26;
|
179 204 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
180 205 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
181 206 | "content_type",
|
182 207 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
183 208 | )
|
184 209 | })?;
|
185 210 | builder = builder.header("x-amz-fwd-header-Content-Type", header_value);
|
186 211 | }
|
212 + | }
|
187 213 | if let ::std::option::Option::Some(inner_27) = &input.checksum_crc32 {
|
188 214 | let formatted_28 = inner_27.as_str();
|
215 + | if !formatted_28.is_empty() {
|
189 216 | let header_value = formatted_28;
|
190 217 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
191 218 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
192 219 | "checksum_crc32",
|
193 220 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
194 221 | )
|
195 222 | })?;
|
196 223 | builder = builder.header("x-amz-fwd-header-x-amz-checksum-crc32", header_value);
|
197 224 | }
|
225 + | }
|
198 226 | if let ::std::option::Option::Some(inner_29) = &input.checksum_crc32_c {
|
199 227 | let formatted_30 = inner_29.as_str();
|
228 + | if !formatted_30.is_empty() {
|
200 229 | let header_value = formatted_30;
|
201 230 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
202 231 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
203 232 | "checksum_crc32_c",
|
204 233 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
205 234 | )
|
206 235 | })?;
|
207 236 | builder = builder.header("x-amz-fwd-header-x-amz-checksum-crc32c", header_value);
|
208 237 | }
|
238 + | }
|
209 239 | if let ::std::option::Option::Some(inner_31) = &input.checksum_sha1 {
|
210 240 | let formatted_32 = inner_31.as_str();
|
241 + | if !formatted_32.is_empty() {
|
211 242 | let header_value = formatted_32;
|
212 243 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
213 244 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
214 245 | "checksum_sha1",
|
215 246 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
216 247 | )
|
217 248 | })?;
|
218 249 | builder = builder.header("x-amz-fwd-header-x-amz-checksum-sha1", header_value);
|
219 250 | }
|
251 + | }
|
220 252 | if let ::std::option::Option::Some(inner_33) = &input.checksum_sha256 {
|
221 253 | let formatted_34 = inner_33.as_str();
|
254 + | if !formatted_34.is_empty() {
|
222 255 | let header_value = formatted_34;
|
223 256 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
224 257 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
225 258 | "checksum_sha256",
|
226 259 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
227 260 | )
|
228 261 | })?;
|
229 262 | builder = builder.header("x-amz-fwd-header-x-amz-checksum-sha256", header_value);
|
230 263 | }
|
264 + | }
|
231 265 | if let ::std::option::Option::Some(inner_35) = &input.delete_marker {
|
232 266 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_35);
|
233 267 | let formatted_36 = encoder.encode();
|
268 + | if !formatted_36.is_empty() {
|
234 269 | let header_value = formatted_36;
|
235 270 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
236 271 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
237 272 | "delete_marker",
|
238 273 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
239 274 | )
|
240 275 | })?;
|
241 276 | builder = builder.header("x-amz-fwd-header-x-amz-delete-marker", header_value);
|
242 277 | }
|
278 + | }
|
243 279 | if let ::std::option::Option::Some(inner_37) = &input.e_tag {
|
244 280 | let formatted_38 = inner_37.as_str();
|
281 + | if !formatted_38.is_empty() {
|
245 282 | let header_value = formatted_38;
|
246 283 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
247 284 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
248 285 | "e_tag",
|
249 286 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
250 287 | )
|
251 288 | })?;
|
252 289 | builder = builder.header("x-amz-fwd-header-ETag", header_value);
|
253 290 | }
|
291 + | }
|
254 292 | if let ::std::option::Option::Some(inner_39) = &input.expires {
|
255 293 | let formatted_40 = inner_39.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
294 + | if !formatted_40.is_empty() {
|
256 295 | let header_value = formatted_40;
|
257 296 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
258 297 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
259 298 | "expires",
|
260 299 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
261 300 | )
|
262 301 | })?;
|
263 302 | builder = builder.header("x-amz-fwd-header-Expires", header_value);
|
264 303 | }
|
304 + | }
|
265 305 | if let ::std::option::Option::Some(inner_41) = &input.expiration {
|
266 306 | let formatted_42 = inner_41.as_str();
|
307 + | if !formatted_42.is_empty() {
|
267 308 | let header_value = formatted_42;
|
268 309 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
269 310 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
270 311 | "expiration",
|
271 312 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
272 313 | )
|
273 314 | })?;
|
274 315 | builder = builder.header("x-amz-fwd-header-x-amz-expiration", header_value);
|
275 316 | }
|
317 + | }
|
276 318 | if let ::std::option::Option::Some(inner_43) = &input.last_modified {
|
277 319 | let formatted_44 = inner_43.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
320 + | if !formatted_44.is_empty() {
|
278 321 | let header_value = formatted_44;
|
279 322 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
280 323 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
281 324 | "last_modified",
|
282 325 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
283 326 | )
|
284 327 | })?;
|
285 328 | builder = builder.header("x-amz-fwd-header-Last-Modified", header_value);
|
286 329 | }
|
330 + | }
|
287 331 | if let ::std::option::Option::Some(inner_45) = &input.missing_meta {
|
288 332 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_45);
|
289 333 | let formatted_46 = encoder.encode();
|
334 + | if !formatted_46.is_empty() {
|
290 335 | let header_value = formatted_46;
|
291 336 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
292 337 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
293 338 | "missing_meta",
|
294 339 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
295 340 | )
|
296 341 | })?;
|
297 342 | builder = builder.header("x-amz-fwd-header-x-amz-missing-meta", header_value);
|
298 343 | }
|
344 + | }
|
299 345 | if let ::std::option::Option::Some(inner_47) = &input.object_lock_mode {
|
300 346 | let formatted_48 = inner_47.as_str();
|
347 + | if !formatted_48.is_empty() {
|
301 348 | let header_value = formatted_48;
|
302 349 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
303 350 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
304 351 | "object_lock_mode",
|
305 352 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
306 353 | )
|
307 354 | })?;
|
308 355 | builder = builder.header("x-amz-fwd-header-x-amz-object-lock-mode", header_value);
|
309 356 | }
|
357 + | }
|
310 358 | if let ::std::option::Option::Some(inner_49) = &input.object_lock_legal_hold_status {
|
311 359 | let formatted_50 = inner_49.as_str();
|
360 + | if !formatted_50.is_empty() {
|
312 361 | let header_value = formatted_50;
|
313 362 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
314 363 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
315 364 | "object_lock_legal_hold_status",
|
316 365 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
317 366 | )
|
318 367 | })?;
|
319 368 | builder = builder.header("x-amz-fwd-header-x-amz-object-lock-legal-hold", header_value);
|
320 369 | }
|
370 + | }
|
321 371 | if let ::std::option::Option::Some(inner_51) = &input.object_lock_retain_until_date {
|
322 372 | let formatted_52 = inner_51.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
373 + | if !formatted_52.is_empty() {
|
323 374 | let header_value = formatted_52;
|
324 375 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
325 376 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
326 377 | "object_lock_retain_until_date",
|
327 378 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
328 379 | )
|
329 380 | })?;
|
330 381 | builder = builder.header("x-amz-fwd-header-x-amz-object-lock-retain-until-date", header_value);
|
331 382 | }
|
383 + | }
|
332 384 | if let ::std::option::Option::Some(inner_53) = &input.parts_count {
|
333 385 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_53);
|
334 386 | let formatted_54 = encoder.encode();
|
387 + | if !formatted_54.is_empty() {
|
335 388 | let header_value = formatted_54;
|
336 389 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
337 390 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
338 391 | "parts_count",
|
339 392 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
340 393 | )
|
341 394 | })?;
|
342 395 | builder = builder.header("x-amz-fwd-header-x-amz-mp-parts-count", header_value);
|
343 396 | }
|
397 + | }
|
344 398 | if let ::std::option::Option::Some(inner_55) = &input.replication_status {
|
345 399 | let formatted_56 = inner_55.as_str();
|
400 + | if !formatted_56.is_empty() {
|
346 401 | let header_value = formatted_56;
|
347 402 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
348 403 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
349 404 | "replication_status",
|
350 405 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
351 406 | )
|
352 407 | })?;
|
353 408 | builder = builder.header("x-amz-fwd-header-x-amz-replication-status", header_value);
|
354 409 | }
|
410 + | }
|
355 411 | if let ::std::option::Option::Some(inner_57) = &input.request_charged {
|
356 412 | let formatted_58 = inner_57.as_str();
|
413 + | if !formatted_58.is_empty() {
|
357 414 | let header_value = formatted_58;
|
358 415 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
359 416 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
360 417 | "request_charged",
|
361 418 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
362 419 | )
|
363 420 | })?;
|
364 421 | builder = builder.header("x-amz-fwd-header-x-amz-request-charged", header_value);
|
365 422 | }
|
423 + | }
|
366 424 | if let ::std::option::Option::Some(inner_59) = &input.restore {
|
367 425 | let formatted_60 = inner_59.as_str();
|
426 + | if !formatted_60.is_empty() {
|
368 427 | let header_value = formatted_60;
|
369 428 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
370 429 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
371 430 | "restore",
|
372 431 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
373 432 | )
|
374 433 | })?;
|
375 434 | builder = builder.header("x-amz-fwd-header-x-amz-restore", header_value);
|
376 435 | }
|
436 + | }
|
377 437 | if let ::std::option::Option::Some(inner_61) = &input.server_side_encryption {
|
378 438 | let formatted_62 = inner_61.as_str();
|
439 + | if !formatted_62.is_empty() {
|
379 440 | let header_value = formatted_62;
|
380 441 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
381 442 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
382 443 | "server_side_encryption",
|
383 444 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
384 445 | )
|
385 446 | })?;
|
386 447 | builder = builder.header("x-amz-fwd-header-x-amz-server-side-encryption", header_value);
|
387 448 | }
|
449 + | }
|
388 450 | if let ::std::option::Option::Some(inner_63) = &input.sse_customer_algorithm {
|
389 451 | let formatted_64 = inner_63.as_str();
|
452 + | if !formatted_64.is_empty() {
|
390 453 | let header_value = formatted_64;
|
391 454 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
392 455 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
393 456 | "sse_customer_algorithm",
|
394 457 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
395 458 | )
|
396 459 | })?;
|
397 460 | builder = builder.header("x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm", header_value);
|
398 461 | }
|
462 + | }
|
399 463 | if let ::std::option::Option::Some(inner_65) = &input.ssekms_key_id {
|
400 464 | let formatted_66 = inner_65.as_str();
|
465 + | if !formatted_66.is_empty() {
|
401 466 | let header_value = formatted_66;
|
402 467 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
403 468 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
404 469 | "ssekms_key_id",
|
405 470 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
406 471 | )
|
407 472 | })?;
|
408 473 | builder = builder.header("x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id", header_value);
|
409 474 | }
|
475 + | }
|
410 476 | if let ::std::option::Option::Some(inner_67) = &input.sse_customer_key_md5 {
|
411 477 | let formatted_68 = inner_67.as_str();
|
478 + | if !formatted_68.is_empty() {
|
412 479 | let header_value = formatted_68;
|
413 480 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
414 481 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
415 482 | "sse_customer_key_md5",
|
416 483 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
417 484 | )
|
418 485 | })?;
|
419 486 | builder = builder.header("x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5", header_value);
|
420 487 | }
|
488 + | }
|
421 489 | if let ::std::option::Option::Some(inner_69) = &input.storage_class {
|
422 490 | let formatted_70 = inner_69.as_str();
|
491 + | if !formatted_70.is_empty() {
|
423 492 | let header_value = formatted_70;
|
424 493 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
425 494 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
426 495 | "storage_class",
|
427 496 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
428 497 | )
|
429 498 | })?;
|
430 499 | builder = builder.header("x-amz-fwd-header-x-amz-storage-class", header_value);
|
431 500 | }
|
501 + | }
|
432 502 | if let ::std::option::Option::Some(inner_71) = &input.tag_count {
|
433 503 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_71);
|
434 504 | let formatted_72 = encoder.encode();
|
505 + | if !formatted_72.is_empty() {
|
435 506 | let header_value = formatted_72;
|
436 507 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
437 508 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
438 509 | "tag_count",
|
439 510 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
440 511 | )
|
441 512 | })?;
|
442 513 | builder = builder.header("x-amz-fwd-header-x-amz-tagging-count", header_value);
|
443 514 | }
|
515 + | }
|
444 516 | if let ::std::option::Option::Some(inner_73) = &input.version_id {
|
445 517 | let formatted_74 = inner_73.as_str();
|
518 + | if !formatted_74.is_empty() {
|
446 519 | let header_value = formatted_74;
|
447 520 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
448 521 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
449 522 | "version_id",
|
450 523 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
451 524 | )
|
452 525 | })?;
|
453 526 | builder = builder.header("x-amz-fwd-header-x-amz-version-id", header_value);
|
454 527 | }
|
528 + | }
|
455 529 | if let ::std::option::Option::Some(inner_75) = &input.bucket_key_enabled {
|
456 530 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_75);
|
457 531 | let formatted_76 = encoder.encode();
|
532 + | if !formatted_76.is_empty() {
|
458 533 | let header_value = formatted_76;
|
459 534 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
460 535 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
461 536 | "bucket_key_enabled",
|
462 537 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
463 538 | )
|
464 539 | })?;
|
465 540 | builder = builder.header("x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled", header_value);
|
466 541 | }
|
542 + | }
|
467 543 | if let ::std::option::Option::Some(inner_77) = &input.metadata {
|
468 544 | {
|
469 545 | for (k, v) in inner_77 {
|
470 546 | use std::str::FromStr;
|
471 547 | let header_name = http::header::HeaderName::from_str(&format!("{}{}", "x-amz-meta-", &k)).map_err(|err| {
|
472 548 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
473 549 | "metadata",
|
474 550 | format!("`{k}` cannot be used as a header name: {err}"),
|
475 551 | )
|
476 552 | })?;
|