117 117 | output.build()
|
118 118 | })
|
119 119 | }
|
120 120 |
|
121 121 | pub fn ser_copy_object_headers(
|
122 122 | input: &crate::operation::copy_object::CopyObjectInput,
|
123 123 | mut builder: ::http::request::Builder,
|
124 124 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
125 125 | if let ::std::option::Option::Some(inner_1) = &input.acl {
|
126 126 | let formatted_2 = inner_1.as_str();
|
127 + | if !formatted_2.is_empty() {
|
127 128 | let header_value = formatted_2;
|
128 129 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
129 130 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
130 131 | "acl",
|
131 132 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
132 133 | )
|
133 134 | })?;
|
134 135 | builder = builder.header("x-amz-acl", header_value);
|
135 136 | }
|
137 + | }
|
136 138 | if let ::std::option::Option::Some(inner_3) = &input.cache_control {
|
137 139 | let formatted_4 = inner_3.as_str();
|
140 + | if !formatted_4.is_empty() {
|
138 141 | let header_value = formatted_4;
|
139 142 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
140 143 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
141 144 | "cache_control",
|
142 145 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
143 146 | )
|
144 147 | })?;
|
145 148 | builder = builder.header("Cache-Control", header_value);
|
146 149 | }
|
150 + | }
|
147 151 | if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
|
148 152 | let formatted_6 = inner_5.as_str();
|
153 + | if !formatted_6.is_empty() {
|
149 154 | let header_value = formatted_6;
|
150 155 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
151 156 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
152 157 | "checksum_algorithm",
|
153 158 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
154 159 | )
|
155 160 | })?;
|
156 161 | builder = builder.header("x-amz-checksum-algorithm", header_value);
|
157 162 | }
|
163 + | }
|
158 164 | if let ::std::option::Option::Some(inner_7) = &input.content_disposition {
|
159 165 | let formatted_8 = inner_7.as_str();
|
166 + | if !formatted_8.is_empty() {
|
160 167 | let header_value = formatted_8;
|
161 168 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
162 169 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
163 170 | "content_disposition",
|
164 171 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
165 172 | )
|
166 173 | })?;
|
167 174 | builder = builder.header("Content-Disposition", header_value);
|
168 175 | }
|
176 + | }
|
169 177 | if let ::std::option::Option::Some(inner_9) = &input.content_encoding {
|
170 178 | let formatted_10 = inner_9.as_str();
|
179 + | if !formatted_10.is_empty() {
|
171 180 | let header_value = formatted_10;
|
172 181 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
173 182 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
174 183 | "content_encoding",
|
175 184 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
176 185 | )
|
177 186 | })?;
|
178 187 | builder = builder.header("Content-Encoding", header_value);
|
179 188 | }
|
189 + | }
|
180 190 | if let ::std::option::Option::Some(inner_11) = &input.content_language {
|
181 191 | let formatted_12 = inner_11.as_str();
|
192 + | if !formatted_12.is_empty() {
|
182 193 | let header_value = formatted_12;
|
183 194 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
184 195 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
185 196 | "content_language",
|
186 197 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
187 198 | )
|
188 199 | })?;
|
189 200 | builder = builder.header("Content-Language", header_value);
|
190 201 | }
|
202 + | }
|
191 203 | if let ::std::option::Option::Some(inner_13) = &input.content_type {
|
192 204 | let formatted_14 = inner_13.as_str();
|
205 + | if !formatted_14.is_empty() {
|
193 206 | let header_value = formatted_14;
|
194 207 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
195 208 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
196 209 | "content_type",
|
197 210 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
198 211 | )
|
199 212 | })?;
|
200 213 | builder = builder.header("Content-Type", header_value);
|
201 214 | }
|
215 + | }
|
202 216 | if let ::std::option::Option::Some(inner_15) = &input.copy_source {
|
203 217 | let formatted_16 = inner_15.as_str();
|
218 + | if !formatted_16.is_empty() {
|
204 219 | let header_value = formatted_16;
|
205 220 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
206 221 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
207 222 | "copy_source",
|
208 223 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
209 224 | )
|
210 225 | })?;
|
211 226 | builder = builder.header("x-amz-copy-source", header_value);
|
212 227 | }
|
228 + | }
|
213 229 | if let ::std::option::Option::Some(inner_17) = &input.copy_source_if_match {
|
214 230 | let formatted_18 = inner_17.as_str();
|
231 + | if !formatted_18.is_empty() {
|
215 232 | let header_value = formatted_18;
|
216 233 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
217 234 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
218 235 | "copy_source_if_match",
|
219 236 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
220 237 | )
|
221 238 | })?;
|
222 239 | builder = builder.header("x-amz-copy-source-if-match", header_value);
|
223 240 | }
|
241 + | }
|
224 242 | if let ::std::option::Option::Some(inner_19) = &input.copy_source_if_modified_since {
|
225 243 | let formatted_20 = inner_19.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
244 + | if !formatted_20.is_empty() {
|
226 245 | let header_value = formatted_20;
|
227 246 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
228 247 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
229 248 | "copy_source_if_modified_since",
|
230 249 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
231 250 | )
|
232 251 | })?;
|
233 252 | builder = builder.header("x-amz-copy-source-if-modified-since", header_value);
|
234 253 | }
|
254 + | }
|
235 255 | if let ::std::option::Option::Some(inner_21) = &input.copy_source_if_none_match {
|
236 256 | let formatted_22 = inner_21.as_str();
|
257 + | if !formatted_22.is_empty() {
|
237 258 | let header_value = formatted_22;
|
238 259 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
239 260 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
240 261 | "copy_source_if_none_match",
|
241 262 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
242 263 | )
|
243 264 | })?;
|
244 265 | builder = builder.header("x-amz-copy-source-if-none-match", header_value);
|
245 266 | }
|
267 + | }
|
246 268 | if let ::std::option::Option::Some(inner_23) = &input.copy_source_if_unmodified_since {
|
247 269 | let formatted_24 = inner_23.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
270 + | if !formatted_24.is_empty() {
|
248 271 | let header_value = formatted_24;
|
249 272 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
250 273 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
251 274 | "copy_source_if_unmodified_since",
|
252 275 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
253 276 | )
|
254 277 | })?;
|
255 278 | builder = builder.header("x-amz-copy-source-if-unmodified-since", header_value);
|
256 279 | }
|
280 + | }
|
257 281 | if let ::std::option::Option::Some(inner_25) = &input.expires {
|
258 282 | let formatted_26 = inner_25.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
283 + | if !formatted_26.is_empty() {
|
259 284 | let header_value = formatted_26;
|
260 285 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
261 286 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
262 287 | "expires",
|
263 288 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
264 289 | )
|
265 290 | })?;
|
266 291 | builder = builder.header("Expires", header_value);
|
267 292 | }
|
293 + | }
|
268 294 | if let ::std::option::Option::Some(inner_27) = &input.grant_full_control {
|
269 295 | let formatted_28 = inner_27.as_str();
|
296 + | if !formatted_28.is_empty() {
|
270 297 | let header_value = formatted_28;
|
271 298 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
272 299 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
273 300 | "grant_full_control",
|
274 301 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
275 302 | )
|
276 303 | })?;
|
277 304 | builder = builder.header("x-amz-grant-full-control", header_value);
|
278 305 | }
|
306 + | }
|
279 307 | if let ::std::option::Option::Some(inner_29) = &input.grant_read {
|
280 308 | let formatted_30 = inner_29.as_str();
|
309 + | if !formatted_30.is_empty() {
|
281 310 | let header_value = formatted_30;
|
282 311 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
283 312 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
284 313 | "grant_read",
|
285 314 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
286 315 | )
|
287 316 | })?;
|
288 317 | builder = builder.header("x-amz-grant-read", header_value);
|
289 318 | }
|
319 + | }
|
290 320 | if let ::std::option::Option::Some(inner_31) = &input.grant_read_acp {
|
291 321 | let formatted_32 = inner_31.as_str();
|
322 + | if !formatted_32.is_empty() {
|
292 323 | let header_value = formatted_32;
|
293 324 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
294 325 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
295 326 | "grant_read_acp",
|
296 327 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
297 328 | )
|
298 329 | })?;
|
299 330 | builder = builder.header("x-amz-grant-read-acp", header_value);
|
300 331 | }
|
332 + | }
|
301 333 | if let ::std::option::Option::Some(inner_33) = &input.grant_write_acp {
|
302 334 | let formatted_34 = inner_33.as_str();
|
335 + | if !formatted_34.is_empty() {
|
303 336 | let header_value = formatted_34;
|
304 337 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
305 338 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
306 339 | "grant_write_acp",
|
307 340 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
308 341 | )
|
309 342 | })?;
|
310 343 | builder = builder.header("x-amz-grant-write-acp", header_value);
|
311 344 | }
|
345 + | }
|
312 346 | if let ::std::option::Option::Some(inner_35) = &input.metadata_directive {
|
313 347 | let formatted_36 = inner_35.as_str();
|
348 + | if !formatted_36.is_empty() {
|
314 349 | let header_value = formatted_36;
|
315 350 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
316 351 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
317 352 | "metadata_directive",
|
318 353 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
319 354 | )
|
320 355 | })?;
|
321 356 | builder = builder.header("x-amz-metadata-directive", header_value);
|
322 357 | }
|
358 + | }
|
323 359 | if let ::std::option::Option::Some(inner_37) = &input.tagging_directive {
|
324 360 | let formatted_38 = inner_37.as_str();
|
361 + | if !formatted_38.is_empty() {
|
325 362 | let header_value = formatted_38;
|
326 363 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
327 364 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
328 365 | "tagging_directive",
|
329 366 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
330 367 | )
|
331 368 | })?;
|
332 369 | builder = builder.header("x-amz-tagging-directive", header_value);
|
333 370 | }
|
371 + | }
|
334 372 | if let ::std::option::Option::Some(inner_39) = &input.server_side_encryption {
|
335 373 | let formatted_40 = inner_39.as_str();
|
374 + | if !formatted_40.is_empty() {
|
336 375 | let header_value = formatted_40;
|
337 376 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
338 377 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
339 378 | "server_side_encryption",
|
340 379 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
341 380 | )
|
342 381 | })?;
|
343 382 | builder = builder.header("x-amz-server-side-encryption", header_value);
|
344 383 | }
|
384 + | }
|
345 385 | if let ::std::option::Option::Some(inner_41) = &input.storage_class {
|
346 386 | let formatted_42 = inner_41.as_str();
|
387 + | if !formatted_42.is_empty() {
|
347 388 | let header_value = formatted_42;
|
348 389 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
349 390 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
350 391 | "storage_class",
|
351 392 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
352 393 | )
|
353 394 | })?;
|
354 395 | builder = builder.header("x-amz-storage-class", header_value);
|
355 396 | }
|
397 + | }
|
356 398 | if let ::std::option::Option::Some(inner_43) = &input.website_redirect_location {
|
357 399 | let formatted_44 = inner_43.as_str();
|
400 + | if !formatted_44.is_empty() {
|
358 401 | let header_value = formatted_44;
|
359 402 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
360 403 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
361 404 | "website_redirect_location",
|
362 405 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
363 406 | )
|
364 407 | })?;
|
365 408 | builder = builder.header("x-amz-website-redirect-location", header_value);
|
366 409 | }
|
410 + | }
|
367 411 | if let ::std::option::Option::Some(inner_45) = &input.sse_customer_algorithm {
|
368 412 | let formatted_46 = inner_45.as_str();
|
413 + | if !formatted_46.is_empty() {
|
369 414 | let header_value = formatted_46;
|
370 415 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
371 416 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
372 417 | "sse_customer_algorithm",
|
373 418 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
374 419 | )
|
375 420 | })?;
|
376 421 | builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
|
377 422 | }
|
423 + | }
|
378 424 | if let ::std::option::Option::Some(inner_47) = &input.sse_customer_key {
|
379 425 | let formatted_48 = inner_47.as_str();
|
426 + | if !formatted_48.is_empty() {
|
380 427 | let header_value = formatted_48;
|
381 428 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
382 429 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
383 430 | "sse_customer_key",
|
384 431 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
385 432 | )
|
386 433 | })?;
|
387 434 | builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
|
388 435 | }
|
436 + | }
|
389 437 | if let ::std::option::Option::Some(inner_49) = &input.sse_customer_key_md5 {
|
390 438 | let formatted_50 = inner_49.as_str();
|
439 + | if !formatted_50.is_empty() {
|
391 440 | let header_value = formatted_50;
|
392 441 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
393 442 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
394 443 | "sse_customer_key_md5",
|
395 444 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
396 445 | )
|
397 446 | })?;
|
398 447 | builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
|
399 448 | }
|
449 + | }
|
400 450 | if let ::std::option::Option::Some(inner_51) = &input.ssekms_key_id {
|
401 451 | let formatted_52 = inner_51.as_str();
|
452 + | if !formatted_52.is_empty() {
|
402 453 | let header_value = formatted_52;
|
403 454 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
404 455 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
405 456 | "ssekms_key_id",
|
406 457 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
407 458 | )
|
408 459 | })?;
|
409 460 | builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value);
|
410 461 | }
|
462 + | }
|
411 463 | if let ::std::option::Option::Some(inner_53) = &input.ssekms_encryption_context {
|
412 464 | let formatted_54 = inner_53.as_str();
|
465 + | if !formatted_54.is_empty() {
|
413 466 | let header_value = formatted_54;
|
414 467 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
415 468 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
416 469 | "ssekms_encryption_context",
|
417 470 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
418 471 | )
|
419 472 | })?;
|
420 473 | builder = builder.header("x-amz-server-side-encryption-context", header_value);
|
421 474 | }
|
475 + | }
|
422 476 | if let ::std::option::Option::Some(inner_55) = &input.bucket_key_enabled {
|
423 477 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_55);
|
424 478 | let formatted_56 = encoder.encode();
|
479 + | if !formatted_56.is_empty() {
|
425 480 | let header_value = formatted_56;
|
426 481 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
427 482 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
428 483 | "bucket_key_enabled",
|
429 484 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
430 485 | )
|
431 486 | })?;
|
432 487 | builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value);
|
433 488 | }
|
489 + | }
|
434 490 | if let ::std::option::Option::Some(inner_57) = &input.copy_source_sse_customer_algorithm {
|
435 491 | let formatted_58 = inner_57.as_str();
|
492 + | if !formatted_58.is_empty() {
|
436 493 | let header_value = formatted_58;
|
437 494 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
438 495 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
439 496 | "copy_source_sse_customer_algorithm",
|
440 497 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
441 498 | )
|
442 499 | })?;
|
443 500 | builder = builder.header("x-amz-copy-source-server-side-encryption-customer-algorithm", header_value);
|
444 501 | }
|
502 + | }
|
445 503 | if let ::std::option::Option::Some(inner_59) = &input.copy_source_sse_customer_key {
|
446 504 | let formatted_60 = inner_59.as_str();
|
505 + | if !formatted_60.is_empty() {
|
447 506 | let header_value = formatted_60;
|
448 507 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
449 508 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
450 509 | "copy_source_sse_customer_key",
|
451 510 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
452 511 | )
|
453 512 | })?;
|
454 513 | builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key", header_value);
|
455 514 | }
|
515 + | }
|
456 516 | if let ::std::option::Option::Some(inner_61) = &input.copy_source_sse_customer_key_md5 {
|
457 517 | let formatted_62 = inner_61.as_str();
|
518 + | if !formatted_62.is_empty() {
|
458 519 | let header_value = formatted_62;
|
459 520 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
460 521 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
461 522 | "copy_source_sse_customer_key_md5",
|
462 523 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
463 524 | )
|
464 525 | })?;
|
465 526 | builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key-MD5", header_value);
|
466 527 | }
|
528 + | }
|
467 529 | if let ::std::option::Option::Some(inner_63) = &input.request_payer {
|
468 530 | let formatted_64 = inner_63.as_str();
|
531 + | if !formatted_64.is_empty() {
|
469 532 | let header_value = formatted_64;
|
470 533 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
471 534 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
472 535 | "request_payer",
|
473 536 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
474 537 | )
|
475 538 | })?;
|
476 539 | builder = builder.header("x-amz-request-payer", header_value);
|
477 540 | }
|
541 + | }
|
478 542 | if let ::std::option::Option::Some(inner_65) = &input.tagging {
|
479 543 | let formatted_66 = inner_65.as_str();
|
544 + | if !formatted_66.is_empty() {
|
480 545 | let header_value = formatted_66;
|
481 546 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
482 547 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
483 548 | "tagging",
|
484 549 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
485 550 | )
|
486 551 | })?;
|
487 552 | builder = builder.header("x-amz-tagging", header_value);
|
488 553 | }
|
554 + | }
|
489 555 | if let ::std::option::Option::Some(inner_67) = &input.object_lock_mode {
|
490 556 | let formatted_68 = inner_67.as_str();
|
557 + | if !formatted_68.is_empty() {
|
491 558 | let header_value = formatted_68;
|
492 559 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
493 560 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
494 561 | "object_lock_mode",
|
495 562 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
496 563 | )
|
497 564 | })?;
|
498 565 | builder = builder.header("x-amz-object-lock-mode", header_value);
|
499 566 | }
|
567 + | }
|
500 568 | if let ::std::option::Option::Some(inner_69) = &input.object_lock_retain_until_date {
|
501 569 | let formatted_70 = inner_69.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
570 + | if !formatted_70.is_empty() {
|
502 571 | let header_value = formatted_70;
|
503 572 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
504 573 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
505 574 | "object_lock_retain_until_date",
|
506 575 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
507 576 | )
|
508 577 | })?;
|
509 578 | builder = builder.header("x-amz-object-lock-retain-until-date", header_value);
|
510 579 | }
|
580 + | }
|
511 581 | if let ::std::option::Option::Some(inner_71) = &input.object_lock_legal_hold_status {
|
512 582 | let formatted_72 = inner_71.as_str();
|
583 + | if !formatted_72.is_empty() {
|
513 584 | let header_value = formatted_72;
|
514 585 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
515 586 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
516 587 | "object_lock_legal_hold_status",
|
517 588 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
518 589 | )
|
519 590 | })?;
|
520 591 | builder = builder.header("x-amz-object-lock-legal-hold", header_value);
|
521 592 | }
|
593 + | }
|
522 594 | if let ::std::option::Option::Some(inner_73) = &input.expected_bucket_owner {
|
523 595 | let formatted_74 = inner_73.as_str();
|
596 + | if !formatted_74.is_empty() {
|
524 597 | let header_value = formatted_74;
|
525 598 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
526 599 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
527 600 | "expected_bucket_owner",
|
528 601 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
529 602 | )
|
530 603 | })?;
|
531 604 | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
532 605 | }
|
606 + | }
|
533 607 | if let ::std::option::Option::Some(inner_75) = &input.expected_source_bucket_owner {
|
534 608 | let formatted_76 = inner_75.as_str();
|
609 + | if !formatted_76.is_empty() {
|
535 610 | let header_value = formatted_76;
|
536 611 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
537 612 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
538 613 | "expected_source_bucket_owner",
|
539 614 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
540 615 | )
|
541 616 | })?;
|
542 617 | builder = builder.header("x-amz-source-expected-bucket-owner", header_value);
|
543 618 | }
|
619 + | }
|
544 620 | if let ::std::option::Option::Some(inner_77) = &input.metadata {
|
545 621 | {
|
546 622 | for (k, v) in inner_77 {
|
547 623 | use std::str::FromStr;
|
548 624 | let header_name = http::header::HeaderName::from_str(&format!("{}{}", "x-amz-meta-", &k)).map_err(|err| {
|
549 625 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
550 626 | "metadata",
|
551 627 | format!("`{k}` cannot be used as a header name: {err}"),
|
552 628 | )
|
553 629 | })?;
|