297 297 | _ => crate::operation::start_stream_transcription::StartStreamTranscriptionError::generic(generic),
|
298 298 | })
|
299 299 | }
|
300 300 |
|
301 301 | pub fn ser_start_stream_transcription_headers(
|
302 302 | input: &crate::operation::start_stream_transcription::StartStreamTranscriptionInput,
|
303 303 | mut builder: ::http::request::Builder,
|
304 304 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
305 305 | if let ::std::option::Option::Some(inner_1) = &input.language_code {
|
306 306 | let formatted_2 = inner_1.as_str();
|
307 - | let header_value = formatted_2;
|
308 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
309 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
310 - | "language_code",
|
311 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
312 - | )
|
313 - | })?;
|
314 - | builder = builder.header("x-amzn-transcribe-language-code", header_value);
|
307 + | if !formatted_2.is_empty() {
|
308 + | let header_value = formatted_2;
|
309 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
310 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
311 + | "language_code",
|
312 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
313 + | )
|
314 + | })?;
|
315 + | builder = builder.header("x-amzn-transcribe-language-code", header_value);
|
316 + | }
|
315 317 | }
|
316 318 | if let ::std::option::Option::Some(inner_3) = &input.media_sample_rate_hertz {
|
317 319 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
|
318 320 | let formatted_4 = encoder.encode();
|
319 - | let header_value = formatted_4;
|
320 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
321 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
322 - | "media_sample_rate_hertz",
|
323 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
324 - | )
|
325 - | })?;
|
326 - | builder = builder.header("x-amzn-transcribe-sample-rate", header_value);
|
321 + | if !formatted_4.is_empty() {
|
322 + | let header_value = formatted_4;
|
323 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
324 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
325 + | "media_sample_rate_hertz",
|
326 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
327 + | )
|
328 + | })?;
|
329 + | builder = builder.header("x-amzn-transcribe-sample-rate", header_value);
|
330 + | }
|
327 331 | }
|
328 332 | if let ::std::option::Option::Some(inner_5) = &input.media_encoding {
|
329 333 | let formatted_6 = inner_5.as_str();
|
330 - | let header_value = formatted_6;
|
331 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
332 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
333 - | "media_encoding",
|
334 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
335 - | )
|
336 - | })?;
|
337 - | builder = builder.header("x-amzn-transcribe-media-encoding", header_value);
|
334 + | if !formatted_6.is_empty() {
|
335 + | let header_value = formatted_6;
|
336 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
337 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
338 + | "media_encoding",
|
339 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
340 + | )
|
341 + | })?;
|
342 + | builder = builder.header("x-amzn-transcribe-media-encoding", header_value);
|
343 + | }
|
338 344 | }
|
339 345 | if let ::std::option::Option::Some(inner_7) = &input.vocabulary_name {
|
340 346 | let formatted_8 = inner_7.as_str();
|
341 - | let header_value = formatted_8;
|
342 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
343 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
344 - | "vocabulary_name",
|
345 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
346 - | )
|
347 - | })?;
|
348 - | builder = builder.header("x-amzn-transcribe-vocabulary-name", header_value);
|
347 + | if !formatted_8.is_empty() {
|
348 + | let header_value = formatted_8;
|
349 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
350 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
351 + | "vocabulary_name",
|
352 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
353 + | )
|
354 + | })?;
|
355 + | builder = builder.header("x-amzn-transcribe-vocabulary-name", header_value);
|
356 + | }
|
349 357 | }
|
350 358 | if let ::std::option::Option::Some(inner_9) = &input.session_id {
|
351 359 | let formatted_10 = inner_9.as_str();
|
352 - | let header_value = formatted_10;
|
353 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
354 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
355 - | "session_id",
|
356 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
357 - | )
|
358 - | })?;
|
359 - | builder = builder.header("x-amzn-transcribe-session-id", header_value);
|
360 + | if !formatted_10.is_empty() {
|
361 + | let header_value = formatted_10;
|
362 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
363 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
364 + | "session_id",
|
365 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
366 + | )
|
367 + | })?;
|
368 + | builder = builder.header("x-amzn-transcribe-session-id", header_value);
|
369 + | }
|
360 370 | }
|
361 371 | if let ::std::option::Option::Some(inner_11) = &input.vocabulary_filter_name {
|
362 372 | let formatted_12 = inner_11.as_str();
|
363 - | let header_value = formatted_12;
|
364 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
365 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
366 - | "vocabulary_filter_name",
|
367 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
368 - | )
|
369 - | })?;
|
370 - | builder = builder.header("x-amzn-transcribe-vocabulary-filter-name", header_value);
|
373 + | if !formatted_12.is_empty() {
|
374 + | let header_value = formatted_12;
|
375 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
376 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
377 + | "vocabulary_filter_name",
|
378 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
379 + | )
|
380 + | })?;
|
381 + | builder = builder.header("x-amzn-transcribe-vocabulary-filter-name", header_value);
|
382 + | }
|
371 383 | }
|
372 384 | if let ::std::option::Option::Some(inner_13) = &input.vocabulary_filter_method {
|
373 385 | let formatted_14 = inner_13.as_str();
|
374 - | let header_value = formatted_14;
|
375 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
376 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
377 - | "vocabulary_filter_method",
|
378 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
379 - | )
|
380 - | })?;
|
381 - | builder = builder.header("x-amzn-transcribe-vocabulary-filter-method", header_value);
|
386 + | if !formatted_14.is_empty() {
|
387 + | let header_value = formatted_14;
|
388 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
389 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
390 + | "vocabulary_filter_method",
|
391 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
392 + | )
|
393 + | })?;
|
394 + | builder = builder.header("x-amzn-transcribe-vocabulary-filter-method", header_value);
|
395 + | }
|
382 396 | }
|
383 397 | if let ::std::option::Option::Some(inner_15) = &input.show_speaker_label {
|
384 398 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_15);
|
385 399 | let formatted_16 = encoder.encode();
|
386 - | let header_value = formatted_16;
|
387 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
388 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
389 - | "show_speaker_label",
|
390 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
391 - | )
|
392 - | })?;
|
393 - | builder = builder.header("x-amzn-transcribe-show-speaker-label", header_value);
|
400 + | if !formatted_16.is_empty() {
|
401 + | let header_value = formatted_16;
|
402 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
403 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
404 + | "show_speaker_label",
|
405 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
406 + | )
|
407 + | })?;
|
408 + | builder = builder.header("x-amzn-transcribe-show-speaker-label", header_value);
|
409 + | }
|
394 410 | }
|
395 411 | if let ::std::option::Option::Some(inner_17) = &input.enable_channel_identification {
|
396 412 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
|
397 413 | let formatted_18 = encoder.encode();
|
398 - | let header_value = formatted_18;
|
399 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
400 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
401 - | "enable_channel_identification",
|
402 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
403 - | )
|
404 - | })?;
|
405 - | builder = builder.header("x-amzn-transcribe-enable-channel-identification", header_value);
|
414 + | if !formatted_18.is_empty() {
|
415 + | let header_value = formatted_18;
|
416 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
417 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
418 + | "enable_channel_identification",
|
419 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
420 + | )
|
421 + | })?;
|
422 + | builder = builder.header("x-amzn-transcribe-enable-channel-identification", header_value);
|
423 + | }
|
406 424 | }
|
407 425 | if let ::std::option::Option::Some(inner_19) = &input.number_of_channels {
|
408 426 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_19);
|
409 427 | let formatted_20 = encoder.encode();
|
410 - | let header_value = formatted_20;
|
411 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
412 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
413 - | "number_of_channels",
|
414 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
415 - | )
|
416 - | })?;
|
417 - | builder = builder.header("x-amzn-transcribe-number-of-channels", header_value);
|
428 + | if !formatted_20.is_empty() {
|
429 + | let header_value = formatted_20;
|
430 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
431 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
432 + | "number_of_channels",
|
433 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
434 + | )
|
435 + | })?;
|
436 + | builder = builder.header("x-amzn-transcribe-number-of-channels", header_value);
|
437 + | }
|
418 438 | }
|
419 439 | if let ::std::option::Option::Some(inner_21) = &input.enable_partial_results_stabilization {
|
420 440 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_21);
|
421 441 | let formatted_22 = encoder.encode();
|
422 - | let header_value = formatted_22;
|
423 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
424 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
425 - | "enable_partial_results_stabilization",
|
426 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
427 - | )
|
428 - | })?;
|
429 - | builder = builder.header("x-amzn-transcribe-enable-partial-results-stabilization", header_value);
|
442 + | if !formatted_22.is_empty() {
|
443 + | let header_value = formatted_22;
|
444 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
445 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
446 + | "enable_partial_results_stabilization",
|
447 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
448 + | )
|
449 + | })?;
|
450 + | builder = builder.header("x-amzn-transcribe-enable-partial-results-stabilization", header_value);
|
451 + | }
|
430 452 | }
|
431 453 | if let ::std::option::Option::Some(inner_23) = &input.partial_results_stability {
|
432 454 | let formatted_24 = inner_23.as_str();
|
433 - | let header_value = formatted_24;
|
434 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
435 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
436 - | "partial_results_stability",
|
437 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
438 - | )
|
439 - | })?;
|
440 - | builder = builder.header("x-amzn-transcribe-partial-results-stability", header_value);
|
455 + | if !formatted_24.is_empty() {
|
456 + | let header_value = formatted_24;
|
457 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
458 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
459 + | "partial_results_stability",
|
460 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
461 + | )
|
462 + | })?;
|
463 + | builder = builder.header("x-amzn-transcribe-partial-results-stability", header_value);
|
464 + | }
|
441 465 | }
|
442 466 | if let ::std::option::Option::Some(inner_25) = &input.content_identification_type {
|
443 467 | let formatted_26 = inner_25.as_str();
|
444 - | let header_value = formatted_26;
|
445 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
446 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
447 - | "content_identification_type",
|
448 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
449 - | )
|
450 - | })?;
|
451 - | builder = builder.header("x-amzn-transcribe-content-identification-type", header_value);
|
468 + | if !formatted_26.is_empty() {
|
469 + | let header_value = formatted_26;
|
470 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
471 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
472 + | "content_identification_type",
|
473 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
474 + | )
|
475 + | })?;
|
476 + | builder = builder.header("x-amzn-transcribe-content-identification-type", header_value);
|
477 + | }
|
452 478 | }
|
453 479 | if let ::std::option::Option::Some(inner_27) = &input.content_redaction_type {
|
454 480 | let formatted_28 = inner_27.as_str();
|
455 - | let header_value = formatted_28;
|
456 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
457 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
458 - | "content_redaction_type",
|
459 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
460 - | )
|
461 - | })?;
|
462 - | builder = builder.header("x-amzn-transcribe-content-redaction-type", header_value);
|
481 + | if !formatted_28.is_empty() {
|
482 + | let header_value = formatted_28;
|
483 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
484 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
485 + | "content_redaction_type",
|
486 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
487 + | )
|
488 + | })?;
|
489 + | builder = builder.header("x-amzn-transcribe-content-redaction-type", header_value);
|
490 + | }
|
463 491 | }
|
464 492 | if let ::std::option::Option::Some(inner_29) = &input.pii_entity_types {
|
465 493 | let formatted_30 = inner_29.as_str();
|
466 - | let header_value = formatted_30;
|
467 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
468 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
469 - | "pii_entity_types",
|
470 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
471 - | )
|
472 - | })?;
|
473 - | builder = builder.header("x-amzn-transcribe-pii-entity-types", header_value);
|
494 + | if !formatted_30.is_empty() {
|
495 + | let header_value = formatted_30;
|
496 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
497 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
498 + | "pii_entity_types",
|
499 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
500 + | )
|
501 + | })?;
|
502 + | builder = builder.header("x-amzn-transcribe-pii-entity-types", header_value);
|
503 + | }
|
474 504 | }
|
475 505 | if let ::std::option::Option::Some(inner_31) = &input.language_model_name {
|
476 506 | let formatted_32 = inner_31.as_str();
|
477 - | let header_value = formatted_32;
|
478 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
479 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
480 - | "language_model_name",
|
481 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
482 - | )
|
483 - | })?;
|
484 - | builder = builder.header("x-amzn-transcribe-language-model-name", header_value);
|
507 + | if !formatted_32.is_empty() {
|
508 + | let header_value = formatted_32;
|
509 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
510 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
511 + | "language_model_name",
|
512 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
513 + | )
|
514 + | })?;
|
515 + | builder = builder.header("x-amzn-transcribe-language-model-name", header_value);
|
516 + | }
|
485 517 | }
|
486 518 | if let ::std::option::Option::Some(inner_33) = &input.identify_language {
|
487 519 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_33);
|
488 520 | let formatted_34 = encoder.encode();
|
489 - | let header_value = formatted_34;
|
490 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
491 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
492 - | "identify_language",
|
493 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
494 - | )
|
495 - | })?;
|
496 - | builder = builder.header("x-amzn-transcribe-identify-language", header_value);
|
521 + | if !formatted_34.is_empty() {
|
522 + | let header_value = formatted_34;
|
523 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
524 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
525 + | "identify_language",
|
526 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
527 + | )
|
528 + | })?;
|
529 + | builder = builder.header("x-amzn-transcribe-identify-language", header_value);
|
530 + | }
|
497 531 | }
|
498 532 | if let ::std::option::Option::Some(inner_35) = &input.language_options {
|
499 533 | let formatted_36 = inner_35.as_str();
|
500 - | let header_value = formatted_36;
|
501 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
502 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
503 - | "language_options",
|
504 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
505 - | )
|
506 - | })?;
|
507 - | builder = builder.header("x-amzn-transcribe-language-options", header_value);
|
534 + | if !formatted_36.is_empty() {
|
535 + | let header_value = formatted_36;
|
536 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
537 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
538 + | "language_options",
|
539 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
540 + | )
|
541 + | })?;
|
542 + | builder = builder.header("x-amzn-transcribe-language-options", header_value);
|
543 + | }
|
508 544 | }
|
509 545 | if let ::std::option::Option::Some(inner_37) = &input.preferred_language {
|
510 546 | let formatted_38 = inner_37.as_str();
|
511 - | let header_value = formatted_38;
|
512 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
513 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
514 - | "preferred_language",
|
515 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
516 - | )
|
517 - | })?;
|
518 - | builder = builder.header("x-amzn-transcribe-preferred-language", header_value);
|
547 + | if !formatted_38.is_empty() {
|
548 + | let header_value = formatted_38;
|
549 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
550 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
551 + | "preferred_language",
|
552 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
553 + | )
|
554 + | })?;
|
555 + | builder = builder.header("x-amzn-transcribe-preferred-language", header_value);
|
556 + | }
|
519 557 | }
|
520 558 | if let ::std::option::Option::Some(inner_39) = &input.identify_multiple_languages {
|
521 559 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_39);
|
522 560 | let formatted_40 = encoder.encode();
|
523 - | let header_value = formatted_40;
|
524 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
525 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
526 - | "identify_multiple_languages",
|
527 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
528 - | )
|
529 - | })?;
|
530 - | builder = builder.header("x-amzn-transcribe-identify-multiple-languages", header_value);
|
561 + | if !formatted_40.is_empty() {
|
562 + | let header_value = formatted_40;
|
563 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
564 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
565 + | "identify_multiple_languages",
|
566 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
567 + | )
|
568 + | })?;
|
569 + | builder = builder.header("x-amzn-transcribe-identify-multiple-languages", header_value);
|
570 + | }
|
531 571 | }
|
532 572 | if let ::std::option::Option::Some(inner_41) = &input.vocabulary_names {
|
533 573 | let formatted_42 = inner_41.as_str();
|
534 - | let header_value = formatted_42;
|
535 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
536 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
537 - | "vocabulary_names",
|
538 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
539 - | )
|
540 - | })?;
|
541 - | builder = builder.header("x-amzn-transcribe-vocabulary-names", header_value);
|
574 + | if !formatted_42.is_empty() {
|
575 + | let header_value = formatted_42;
|
576 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
577 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
578 + | "vocabulary_names",
|
579 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
580 + | )
|
581 + | })?;
|
582 + | builder = builder.header("x-amzn-transcribe-vocabulary-names", header_value);
|
583 + | }
|
542 584 | }
|
543 585 | if let ::std::option::Option::Some(inner_43) = &input.vocabulary_filter_names {
|
544 586 | let formatted_44 = inner_43.as_str();
|
545 - | let header_value = formatted_44;
|
546 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
547 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
548 - | "vocabulary_filter_names",
|
549 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
550 - | )
|
551 - | })?;
|
552 - | builder = builder.header("x-amzn-transcribe-vocabulary-filter-names", header_value);
|
587 + | if !formatted_44.is_empty() {
|
588 + | let header_value = formatted_44;
|
589 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
590 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
591 + | "vocabulary_filter_names",
|
592 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
593 + | )
|
594 + | })?;
|
595 + | builder = builder.header("x-amzn-transcribe-vocabulary-filter-names", header_value);
|
596 + | }
|
553 597 | }
|
554 598 | Ok(builder)
|
555 599 | }
|