253 253 | _ => crate::operation::get_object::GetObjectError::generic(generic),
|
254 254 | })
|
255 255 | }
|
256 256 |
|
257 257 | pub fn ser_get_object_headers(
|
258 258 | input: &crate::operation::get_object::GetObjectInput,
|
259 259 | mut builder: ::http::request::Builder,
|
260 260 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
261 261 | if let ::std::option::Option::Some(inner_1) = &input.if_match {
|
262 262 | let formatted_2 = inner_1.as_str();
|
263 + | if !formatted_2.is_empty() {
|
263 264 | let header_value = formatted_2;
|
264 265 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
265 266 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
266 267 | "if_match",
|
267 268 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
268 269 | )
|
269 270 | })?;
|
270 271 | builder = builder.header("If-Match", header_value);
|
271 272 | }
|
273 + | }
|
272 274 | if let ::std::option::Option::Some(inner_3) = &input.if_modified_since {
|
273 275 | let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
276 + | if !formatted_4.is_empty() {
|
274 277 | let header_value = formatted_4;
|
275 278 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
276 279 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
277 280 | "if_modified_since",
|
278 281 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
279 282 | )
|
280 283 | })?;
|
281 284 | builder = builder.header("If-Modified-Since", header_value);
|
282 285 | }
|
286 + | }
|
283 287 | if let ::std::option::Option::Some(inner_5) = &input.if_none_match {
|
284 288 | let formatted_6 = inner_5.as_str();
|
289 + | if !formatted_6.is_empty() {
|
285 290 | let header_value = formatted_6;
|
286 291 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
287 292 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
288 293 | "if_none_match",
|
289 294 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
290 295 | )
|
291 296 | })?;
|
292 297 | builder = builder.header("If-None-Match", header_value);
|
293 298 | }
|
299 + | }
|
294 300 | if let ::std::option::Option::Some(inner_7) = &input.if_unmodified_since {
|
295 301 | let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
302 + | if !formatted_8.is_empty() {
|
296 303 | let header_value = formatted_8;
|
297 304 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
298 305 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
299 306 | "if_unmodified_since",
|
300 307 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
301 308 | )
|
302 309 | })?;
|
303 310 | builder = builder.header("If-Unmodified-Since", header_value);
|
304 311 | }
|
312 + | }
|
305 313 | if let ::std::option::Option::Some(inner_9) = &input.range {
|
306 314 | let formatted_10 = inner_9.as_str();
|
315 + | if !formatted_10.is_empty() {
|
307 316 | let header_value = formatted_10;
|
308 317 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
309 318 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
310 319 | "range",
|
311 320 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
312 321 | )
|
313 322 | })?;
|
314 323 | builder = builder.header("Range", header_value);
|
315 324 | }
|
325 + | }
|
316 326 | if let ::std::option::Option::Some(inner_11) = &input.sse_customer_algorithm {
|
317 327 | let formatted_12 = inner_11.as_str();
|
328 + | if !formatted_12.is_empty() {
|
318 329 | let header_value = formatted_12;
|
319 330 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
320 331 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
321 332 | "sse_customer_algorithm",
|
322 333 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
323 334 | )
|
324 335 | })?;
|
325 336 | builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
|
326 337 | }
|
338 + | }
|
327 339 | if let ::std::option::Option::Some(inner_13) = &input.sse_customer_key {
|
328 340 | let formatted_14 = inner_13.as_str();
|
341 + | if !formatted_14.is_empty() {
|
329 342 | let header_value = formatted_14;
|
330 343 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
331 344 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
332 345 | "sse_customer_key",
|
333 346 | format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
|
334 347 | )
|
335 348 | })?;
|
336 349 | builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
|
337 350 | }
|
351 + | }
|
338 352 | if let ::std::option::Option::Some(inner_15) = &input.sse_customer_key_md5 {
|
339 353 | let formatted_16 = inner_15.as_str();
|
354 + | if !formatted_16.is_empty() {
|
340 355 | let header_value = formatted_16;
|
341 356 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
342 357 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
343 358 | "sse_customer_key_md5",
|
344 359 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
345 360 | )
|
346 361 | })?;
|
347 362 | builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
|
348 363 | }
|
364 + | }
|
349 365 | if let ::std::option::Option::Some(inner_17) = &input.request_payer {
|
350 366 | let formatted_18 = inner_17.as_str();
|
367 + | if !formatted_18.is_empty() {
|
351 368 | let header_value = formatted_18;
|
352 369 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
353 370 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
354 371 | "request_payer",
|
355 372 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
356 373 | )
|
357 374 | })?;
|
358 375 | builder = builder.header("x-amz-request-payer", header_value);
|
359 376 | }
|
377 + | }
|
360 378 | if let ::std::option::Option::Some(inner_19) = &input.expected_bucket_owner {
|
361 379 | let formatted_20 = inner_19.as_str();
|
380 + | if !formatted_20.is_empty() {
|
362 381 | let header_value = formatted_20;
|
363 382 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
364 383 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
365 384 | "expected_bucket_owner",
|
366 385 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
367 386 | )
|
368 387 | })?;
|
369 388 | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
370 389 | }
|
390 + | }
|
371 391 | if let ::std::option::Option::Some(inner_21) = &input.checksum_mode {
|
372 392 | let formatted_22 = inner_21.as_str();
|
393 + | if !formatted_22.is_empty() {
|
373 394 | let header_value = formatted_22;
|
374 395 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
375 396 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
376 397 | "checksum_mode",
|
377 398 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
378 399 | )
|
379 400 | })?;
|
380 401 | builder = builder.header("x-amz-checksum-mode", header_value);
|
381 402 | }
|
403 + | }
|
382 404 | Ok(builder)
|
383 405 | }
|