AWS SDK

AWS SDK

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_medical_scribe_channel_definitions.rs

@@ -1,0 +41,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_medical_scribe_channel_definitions<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<crate::types::MedicalScribeChannelDefinition>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        let value =
   24         -
                            crate::protocol_serde::shape_medical_scribe_channel_definition::de_medical_scribe_channel_definition(tokens, _value)?;
   25         -
                        if let Some(value) = value {
   26         -
                            items.push(value);
   27         -
                        } else {
   28         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
                                "dense list cannot contain null values",
   30         -
                            ));
   31         -
                        }
   32         -
                    }
   33         -
                }
   34         -
            }
   35         -
            Ok(Some(items))
   36         -
        }
   37         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
            "expected start array or null",
   39         -
        )),
   40         -
    }
   41         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_medical_scribe_encryption_settings.rs

@@ -1,1 +69,0 @@
   11     11   
                object_2.key(key_3.as_str()).string(value_4.as_str());
   12     12   
            }
   13     13   
        }
   14     14   
        object_2.finish();
   15     15   
    }
   16     16   
    {
   17     17   
        object.key("KmsKeyId").string(input.kms_key_id.as_str());
   18     18   
    }
   19     19   
    Ok(())
   20     20   
}
   21         -
   22         -
pub(crate) fn de_medical_scribe_encryption_settings<'a, I>(
   23         -
    tokens: &mut ::std::iter::Peekable<I>,
   24         -
    _value: &'a [u8],
   25         -
) -> ::std::result::Result<Option<crate::types::MedicalScribeEncryptionSettings>, ::aws_smithy_json::deserialize::error::DeserializeError>
   26         -
where
   27         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   28         -
{
   29         -
    match tokens.next().transpose()? {
   30         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   31         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   32         -
            #[allow(unused_mut)]
   33         -
            let mut builder = crate::types::builders::MedicalScribeEncryptionSettingsBuilder::default();
   34         -
            loop {
   35         -
                match tokens.next().transpose()? {
   36         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   37         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   38         -
                        "KmsEncryptionContext" => {
   39         -
                            builder = builder.set_kms_encryption_context(
   40         -
                                crate::protocol_serde::shape_kms_encryption_context_map::de_kms_encryption_context_map(tokens, _value)?,
   41         -
                            );
   42         -
                        }
   43         -
                        "KmsKeyId" => {
   44         -
                            builder = builder.set_kms_key_id(
   45         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   46         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   47         -
                                    .transpose()?,
   48         -
                            );
   49         -
                        }
   50         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   51         -
                    },
   52         -
                    other => {
   53         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   54         -
                            "expected object key or end object, found: {other:?}"
   55         -
                        )))
   56         -
                    }
   57         -
                }
   58         -
            }
   59         -
            Ok(Some(
   60         -
                crate::serde_util::medical_scribe_encryption_settings_correct_errors(builder)
   61         -
                    .build()
   62         -
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
   63         -
            ))
   64         -
        }
   65         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   66         -
            "expected start object or null",
   67         -
        )),
   68         -
    }
   69         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_medical_scribe_post_stream_analytics_result.rs

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_medical_scribe_post_stream_analytics_result<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::MedicalScribePostStreamAnalyticsResult>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::MedicalScribePostStreamAnalyticsResultBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "ClinicalNoteGenerationResult" => {
   19         -
                            builder = builder.set_clinical_note_generation_result(
   20         -
                                crate::protocol_serde::shape_clinical_note_generation_result::de_clinical_note_generation_result(tokens, _value)?,
   21         -
                            );
   22         -
                        }
   23         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   24         -
                    },
   25         -
                    other => {
   26         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27         -
                            "expected object key or end object, found: {other:?}"
   28         -
                        )))
   29         -
                    }
   30         -
                }
   31         -
            }
   32         -
            Ok(Some(builder.build()))
   33         -
        }
   34         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35         -
            "expected start object or null",
   36         -
        )),
   37         -
    }
   38         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_medical_scribe_post_stream_analytics_settings.rs

@@ -1,1 +53,0 @@
    4      4   
    input: &crate::types::MedicalScribePostStreamAnalyticsSettings,
    5      5   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6      6   
    if let Some(var_1) = &input.clinical_note_generation_settings {
    7      7   
        #[allow(unused_mut)]
    8      8   
        let mut object_2 = object.key("ClinicalNoteGenerationSettings").start_object();
    9      9   
        crate::protocol_serde::shape_clinical_note_generation_settings::ser_clinical_note_generation_settings(&mut object_2, var_1)?;
   10     10   
        object_2.finish();
   11     11   
    }
   12     12   
    Ok(())
   13     13   
}
   14         -
   15         -
pub(crate) fn de_medical_scribe_post_stream_analytics_settings<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
    _value: &'a [u8],
   18         -
) -> ::std::result::Result<Option<crate::types::MedicalScribePostStreamAnalyticsSettings>, ::aws_smithy_json::deserialize::error::DeserializeError>
   19         -
where
   20         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   21         -
{
   22         -
    match tokens.next().transpose()? {
   23         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   25         -
            #[allow(unused_mut)]
   26         -
            let mut builder = crate::types::builders::MedicalScribePostStreamAnalyticsSettingsBuilder::default();
   27         -
            loop {
   28         -
                match tokens.next().transpose()? {
   29         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   30         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   31         -
                        "ClinicalNoteGenerationSettings" => {
   32         -
                            builder = builder.set_clinical_note_generation_settings(
   33         -
                                crate::protocol_serde::shape_clinical_note_generation_settings::de_clinical_note_generation_settings(tokens, _value)?,
   34         -
                            );
   35         -
                        }
   36         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   37         -
                    },
   38         -
                    other => {
   39         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   40         -
                            "expected object key or end object, found: {other:?}"
   41         -
                        )))
   42         -
                    }
   43         -
                }
   44         -
            }
   45         -
            Ok(Some(
   46         -
                crate::serde_util::medical_scribe_post_stream_analytics_settings_correct_errors(builder).build(),
   47         -
            ))
   48         -
        }
   49         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
            "expected start object or null",
   51         -
        )),
   52         -
    }
   53         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_medical_scribe_stream_details.rs

@@ -1,0 +139,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_medical_scribe_stream_details<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::MedicalScribeStreamDetails>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::MedicalScribeStreamDetailsBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "SessionId" => {
   19         -
                            builder = builder.set_session_id(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "StreamCreatedAt" => {
   26         -
                            builder = builder.set_stream_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   27         -
                                tokens.next(),
   28         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   29         -
                            )?);
   30         -
                        }
   31         -
                        "StreamEndedAt" => {
   32         -
                            builder = builder.set_stream_ended_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   33         -
                                tokens.next(),
   34         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   35         -
                            )?);
   36         -
                        }
   37         -
                        "LanguageCode" => {
   38         -
                            builder = builder.set_language_code(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   40         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::MedicalScribeLanguageCode::from(u.as_ref())))
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        "MediaSampleRateHertz" => {
   45         -
                            builder = builder.set_media_sample_rate_hertz(
   46         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   47         -
                                    .map(i32::try_from)
   48         -
                                    .transpose()?,
   49         -
                            );
   50         -
                        }
   51         -
                        "MediaEncoding" => {
   52         -
                            builder = builder.set_media_encoding(
   53         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   54         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::MedicalScribeMediaEncoding::from(u.as_ref())))
   55         -
                                    .transpose()?,
   56         -
                            );
   57         -
                        }
   58         -
                        "VocabularyName" => {
   59         -
                            builder = builder.set_vocabulary_name(
   60         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   61         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   62         -
                                    .transpose()?,
   63         -
                            );
   64         -
                        }
   65         -
                        "VocabularyFilterName" => {
   66         -
                            builder = builder.set_vocabulary_filter_name(
   67         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   68         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   69         -
                                    .transpose()?,
   70         -
                            );
   71         -
                        }
   72         -
                        "VocabularyFilterMethod" => {
   73         -
                            builder = builder.set_vocabulary_filter_method(
   74         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   75         -
                                    .map(|s| {
   76         -
                                        s.to_unescaped()
   77         -
                                            .map(|u| crate::types::MedicalScribeVocabularyFilterMethod::from(u.as_ref()))
   78         -
                                    })
   79         -
                                    .transpose()?,
   80         -
                            );
   81         -
                        }
   82         -
                        "ResourceAccessRoleArn" => {
   83         -
                            builder = builder.set_resource_access_role_arn(
   84         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   85         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   86         -
                                    .transpose()?,
   87         -
                            );
   88         -
                        }
   89         -
                        "ChannelDefinitions" => {
   90         -
                            builder = builder.set_channel_definitions(
   91         -
                                crate::protocol_serde::shape_medical_scribe_channel_definitions::de_medical_scribe_channel_definitions(
   92         -
                                    tokens, _value,
   93         -
                                )?,
   94         -
                            );
   95         -
                        }
   96         -
                        "EncryptionSettings" => {
   97         -
                            builder = builder.set_encryption_settings(
   98         -
                                crate::protocol_serde::shape_medical_scribe_encryption_settings::de_medical_scribe_encryption_settings(
   99         -
                                    tokens, _value,
  100         -
                                )?,
  101         -
                            );
  102         -
                        }
  103         -
                        "StreamStatus" => {
  104         -
                            builder = builder.set_stream_status(
  105         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  106         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::MedicalScribeStreamStatus::from(u.as_ref())))
  107         -
                                    .transpose()?,
  108         -
                            );
  109         -
                        }
  110         -
                        "PostStreamAnalyticsSettings" => {
  111         -
                            builder = builder.set_post_stream_analytics_settings(
  112         -
                                    crate::protocol_serde::shape_medical_scribe_post_stream_analytics_settings::de_medical_scribe_post_stream_analytics_settings(tokens, _value)?
  113         -
                                );
  114         -
                        }
  115         -
                        "PostStreamAnalyticsResult" => {
  116         -
                            builder = builder.set_post_stream_analytics_result(
  117         -
                                    crate::protocol_serde::shape_medical_scribe_post_stream_analytics_result::de_medical_scribe_post_stream_analytics_result(tokens, _value)?
  118         -
                                );
  119         -
                        }
  120         -
                        "MedicalScribeContextProvided" => {
  121         -
                            builder = builder
  122         -
                                .set_medical_scribe_context_provided(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  123         -
                        }
  124         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  125         -
                    },
  126         -
                    other => {
  127         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  128         -
                            "expected object key or end object, found: {other:?}"
  129         -
                        )))
  130         -
                    }
  131         -
                }
  132         -
            }
  133         -
            Ok(Some(builder.build()))
  134         -
        }
  135         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  136         -
            "expected start object or null",
  137         -
        )),
  138         -
    }
  139         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_resource_not_found_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_resource_not_found_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ResourceNotFoundExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ResourceNotFoundExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "Message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_start_call_analytics_stream_transcription.rs

@@ -161,161 +519,0 @@
  181    181   
                    )
  182    182   
                },
  183    183   
            )?,
  184    184   
        );
  185    185   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  186    186   
        output
  187    187   
            .build()
  188    188   
            .map_err(crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled)?
  189    189   
    })
  190    190   
}
  191         -
  192         -
#[allow(clippy::unnecessary_wraps)]
  193         -
pub fn de_start_call_analytics_stream_transcription_http_error(
  194         -
    _response_status: u16,
  195         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  196         -
    _response_body: &[u8],
  197         -
) -> std::result::Result<
  198         -
    crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionOutput,
  199         -
    crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError,
  200         -
> {
  201         -
    #[allow(unused_mut)]
  202         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
  203         -
        .map_err(crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled)?;
  204         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
  205         -
    let generic = generic_builder.build();
  206         -
    let error_code = match generic.code() {
  207         -
        Some(code) => code,
  208         -
        None => {
  209         -
            return Err(crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled(generic))
  210         -
        }
  211         -
    };
  212         -
  213         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
  214         -
    Err(match error_code {
  215         -
        "BadRequestException" => {
  216         -
            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::BadRequestException({
  217         -
                #[allow(unused_mut)]
  218         -
                let mut tmp = {
  219         -
                    #[allow(unused_mut)]
  220         -
                    let mut output = crate::types::error::builders::BadRequestExceptionBuilder::default();
  221         -
                    output = crate::protocol_serde::shape_bad_request_exception::de_bad_request_exception_json_err(_response_body, output).map_err(
  222         -
                        crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled,
  223         -
                    )?;
  224         -
                    let output = output.meta(generic);
  225         -
                    output.build()
  226         -
                };
  227         -
                if tmp.message.is_none() {
  228         -
                    tmp.message = _error_message;
  229         -
                }
  230         -
                tmp
  231         -
            })
  232         -
        }
  233         -
        "ConflictException" => {
  234         -
            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::ConflictException({
  235         -
                #[allow(unused_mut)]
  236         -
                let mut tmp = {
  237         -
                    #[allow(unused_mut)]
  238         -
                    let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
  239         -
                    output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output).map_err(
  240         -
                        crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled,
  241         -
                    )?;
  242         -
                    let output = output.meta(generic);
  243         -
                    output.build()
  244         -
                };
  245         -
                if tmp.message.is_none() {
  246         -
                    tmp.message = _error_message;
  247         -
                }
  248         -
                tmp
  249         -
            })
  250         -
        }
  251         -
        "InternalFailureException" => {
  252         -
            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::InternalFailureException({
  253         -
                #[allow(unused_mut)]
  254         -
                let mut tmp = {
  255         -
                    #[allow(unused_mut)]
  256         -
                    let mut output = crate::types::error::builders::InternalFailureExceptionBuilder::default();
  257         -
                    output = crate::protocol_serde::shape_internal_failure_exception::de_internal_failure_exception_json_err(_response_body, output)
  258         -
                        .map_err(
  259         -
                            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled,
  260         -
                        )?;
  261         -
                    let output = output.meta(generic);
  262         -
                    output.build()
  263         -
                };
  264         -
                if tmp.message.is_none() {
  265         -
                    tmp.message = _error_message;
  266         -
                }
  267         -
                tmp
  268         -
            })
  269         -
        }
  270         -
        "LimitExceededException" => {
  271         -
            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::LimitExceededException({
  272         -
                #[allow(unused_mut)]
  273         -
                let mut tmp = {
  274         -
                    #[allow(unused_mut)]
  275         -
                    let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
  276         -
                    output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
  277         -
                        .map_err(
  278         -
                            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled,
  279         -
                        )?;
  280         -
                    let output = output.meta(generic);
  281         -
                    output.build()
  282         -
                };
  283         -
                if tmp.message.is_none() {
  284         -
                    tmp.message = _error_message;
  285         -
                }
  286         -
                tmp
  287         -
            })
  288         -
        }
  289         -
        "ServiceUnavailableException" => {
  290         -
            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::ServiceUnavailableException({
  291         -
                #[allow(unused_mut)]
  292         -
                let mut tmp = {
  293         -
                    #[allow(unused_mut)]
  294         -
                    let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
  295         -
                    output =
  296         -
                        crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
  297         -
                            .map_err(
  298         -
                                crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::unhandled,
  299         -
                            )?;
  300         -
                    let output = output.meta(generic);
  301         -
                    output.build()
  302         -
                };
  303         -
                if tmp.message.is_none() {
  304         -
                    tmp.message = _error_message;
  305         -
                }
  306         -
                tmp
  307         -
            })
  308         -
        }
  309         -
        _ => crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::generic(generic),
  310         -
    })
  311         -
}
  312         -
  313         -
pub fn ser_start_call_analytics_stream_transcription_headers(
  314         -
    input: &crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionInput,
  315         -
    mut builder: ::http_1x::request::Builder,
  316         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  317         -
    if let ::std::option::Option::Some(inner_1) = &input.language_code {
  318         -
        let formatted_2 = inner_1.as_str();
  319         -
        let header_value = formatted_2;
  320         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  321         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  322         -
                "language_code",
  323         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  324         -
            )
  325         -
        })?;
  326         -
        builder = builder.header("x-amzn-transcribe-language-code", header_value);
  327         -
    }
  328         -
    if let ::std::option::Option::Some(inner_3) = &input.media_sample_rate_hertz {
  329         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
  330         -
        let formatted_4 = encoder.encode();
  331         -
        let header_value = formatted_4;
  332         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  333         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  334         -
                "media_sample_rate_hertz",
  335         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  336         -
            )
  337         -
        })?;
  338         -
        builder = builder.header("x-amzn-transcribe-sample-rate", header_value);
  339         -
    }
  340         -
    if let ::std::option::Option::Some(inner_5) = &input.media_encoding {
  341         -
        let formatted_6 = inner_5.as_str();
  342         -
        let header_value = formatted_6;
  343         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  344         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  345         -
                "media_encoding",
  346         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  347         -
            )
  348         -
        })?;
  349         -
        builder = builder.header("x-amzn-transcribe-media-encoding", header_value);
  350         -
    }
  351         -
    if let ::std::option::Option::Some(inner_7) = &input.vocabulary_name {
  352         -
        let formatted_8 = inner_7.as_str();
  353         -
        let header_value = formatted_8;
  354         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  355         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  356         -
                "vocabulary_name",
  357         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  358         -
            )
  359         -
        })?;
  360         -
        builder = builder.header("x-amzn-transcribe-vocabulary-name", header_value);
  361         -
    }
  362         -
    if let ::std::option::Option::Some(inner_9) = &input.session_id {
  363         -
        let formatted_10 = inner_9.as_str();
  364         -
        let header_value = formatted_10;
  365         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  366         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  367         -
                "session_id",
  368         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  369         -
            )
  370         -
        })?;
  371         -
        builder = builder.header("x-amzn-transcribe-session-id", header_value);
  372         -
    }
  373         -
    if let ::std::option::Option::Some(inner_11) = &input.vocabulary_filter_name {
  374         -
        let formatted_12 = inner_11.as_str();
  375         -
        let header_value = formatted_12;
  376         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  377         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  378         -
                "vocabulary_filter_name",
  379         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  380         -
            )
  381         -
        })?;
  382         -
        builder = builder.header("x-amzn-transcribe-vocabulary-filter-name", header_value);
  383         -
    }
  384         -
    if let ::std::option::Option::Some(inner_13) = &input.vocabulary_filter_method {
  385         -
        let formatted_14 = inner_13.as_str();
  386         -
        let header_value = formatted_14;
  387         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  388         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  389         -
                "vocabulary_filter_method",
  390         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  391         -
            )
  392         -
        })?;
  393         -
        builder = builder.header("x-amzn-transcribe-vocabulary-filter-method", header_value);
  394         -
    }
  395         -
    if let ::std::option::Option::Some(inner_15) = &input.language_model_name {
  396         -
        let formatted_16 = inner_15.as_str();
  397         -
        let header_value = formatted_16;
  398         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  399         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  400         -
                "language_model_name",
  401         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  402         -
            )
  403         -
        })?;
  404         -
        builder = builder.header("x-amzn-transcribe-language-model-name", header_value);
  405         -
    }
  406         -
    if let ::std::option::Option::Some(inner_17) = &input.identify_language {
  407         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
  408         -
        let formatted_18 = encoder.encode();
  409         -
        let header_value = formatted_18;
  410         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  411         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  412         -
                "identify_language",
  413         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  414         -
            )
  415         -
        })?;
  416         -
        builder = builder.header("x-amzn-transcribe-identify-language", header_value);
  417         -
    }
  418         -
    if let ::std::option::Option::Some(inner_19) = &input.language_options {
  419         -
        let formatted_20 = inner_19.as_str();
  420         -
        let header_value = formatted_20;
  421         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  422         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  423         -
                "language_options",
  424         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  425         -
            )
  426         -
        })?;
  427         -
        builder = builder.header("x-amzn-transcribe-language-options", header_value);
  428         -
    }
  429         -
    if let ::std::option::Option::Some(inner_21) = &input.preferred_language {
  430         -
        let formatted_22 = inner_21.as_str();
  431         -
        let header_value = formatted_22;
  432         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  433         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  434         -
                "preferred_language",
  435         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  436         -
            )
  437         -
        })?;
  438         -
        builder = builder.header("x-amzn-transcribe-preferred-language", header_value);
  439         -
    }
  440         -
    if let ::std::option::Option::Some(inner_23) = &input.vocabulary_names {
  441         -
        let formatted_24 = inner_23.as_str();
  442         -
        let header_value = formatted_24;
  443         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  444         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  445         -
                "vocabulary_names",
  446         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  447         -
            )
  448         -
        })?;
  449         -
        builder = builder.header("x-amzn-transcribe-vocabulary-names", header_value);
  450         -
    }
  451         -
    if let ::std::option::Option::Some(inner_25) = &input.vocabulary_filter_names {
  452         -
        let formatted_26 = inner_25.as_str();
  453         -
        let header_value = formatted_26;
  454         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  455         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  456         -
                "vocabulary_filter_names",
  457         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  458         -
            )
  459         -
        })?;
  460         -
        builder = builder.header("x-amzn-transcribe-vocabulary-filter-names", header_value);
  461         -
    }
  462         -
    if let ::std::option::Option::Some(inner_27) = &input.enable_partial_results_stabilization {
  463         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_27);
  464         -
        let formatted_28 = encoder.encode();
  465         -
        let header_value = formatted_28;
  466         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  467         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  468         -
                "enable_partial_results_stabilization",
  469         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  470         -
            )
  471         -
        })?;
  472         -
        builder = builder.header("x-amzn-transcribe-enable-partial-results-stabilization", header_value);
  473         -
    }
  474         -
    if let ::std::option::Option::Some(inner_29) = &input.partial_results_stability {
  475         -
        let formatted_30 = inner_29.as_str();
  476         -
        let header_value = formatted_30;
  477         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  478         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  479         -
                "partial_results_stability",
  480         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  481         -
            )
  482         -
        })?;
  483         -
        builder = builder.header("x-amzn-transcribe-partial-results-stability", header_value);
  484         -
    }
  485         -
    if let ::std::option::Option::Some(inner_31) = &input.content_identification_type {
  486         -
        let formatted_32 = inner_31.as_str();
  487         -
        let header_value = formatted_32;
  488         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  489         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  490         -
                "content_identification_type",
  491         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  492         -
            )
  493         -
        })?;
  494         -
        builder = builder.header("x-amzn-transcribe-content-identification-type", header_value);
  495         -
    }
  496         -
    if let ::std::option::Option::Some(inner_33) = &input.content_redaction_type {
  497         -
        let formatted_34 = inner_33.as_str();
  498         -
        let header_value = formatted_34;
  499         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  500         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  501         -
                "content_redaction_type",
  502         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  503         -
            )
  504         -
        })?;
  505         -
        builder = builder.header("x-amzn-transcribe-content-redaction-type", header_value);
  506         -
    }
  507         -
    if let ::std::option::Option::Some(inner_35) = &input.pii_entity_types {
  508         -
        let formatted_36 = inner_35.as_str();
  509         -
        let header_value = formatted_36;
  510         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  511         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  512         -
                "pii_entity_types",
  513         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  514         -
            )
  515         -
        })?;
  516         -
        builder = builder.header("x-amzn-transcribe-pii-entity-types", header_value);
  517         -
    }
  518         -
    Ok(builder)
  519         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_start_medical_scribe_stream.rs

@@ -32,32 +218,0 @@
   52     52   
                    "Failed to parse SessionId from header `x-amzn-transcribe-session-id",
   53     53   
                )
   54     54   
            })?,
   55     55   
        );
   56     56   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   57     57   
        output
   58     58   
            .build()
   59     59   
            .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?
   60     60   
    })
   61     61   
}
   62         -
   63         -
#[allow(clippy::unnecessary_wraps)]
   64         -
pub fn de_start_medical_scribe_stream_http_error(
   65         -
    _response_status: u16,
   66         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   67         -
    _response_body: &[u8],
   68         -
) -> std::result::Result<
   69         -
    crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamOutput,
   70         -
    crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError,
   71         -
> {
   72         -
    #[allow(unused_mut)]
   73         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   74         -
        .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
   75         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   76         -
    let generic = generic_builder.build();
   77         -
    let error_code = match generic.code() {
   78         -
        Some(code) => code,
   79         -
        None => {
   80         -
            return Err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled(
   81         -
                generic,
   82         -
            ))
   83         -
        }
   84         -
    };
   85         -
   86         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   87         -
    Err(match error_code {
   88         -
        "BadRequestException" => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::BadRequestException({
   89         -
            #[allow(unused_mut)]
   90         -
            let mut tmp = {
   91         -
                #[allow(unused_mut)]
   92         -
                let mut output = crate::types::error::builders::BadRequestExceptionBuilder::default();
   93         -
                output = crate::protocol_serde::shape_bad_request_exception::de_bad_request_exception_json_err(_response_body, output)
   94         -
                    .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
   95         -
                let output = output.meta(generic);
   96         -
                output.build()
   97         -
            };
   98         -
            if tmp.message.is_none() {
   99         -
                tmp.message = _error_message;
  100         -
            }
  101         -
            tmp
  102         -
        }),
  103         -
        "ConflictException" => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::ConflictException({
  104         -
            #[allow(unused_mut)]
  105         -
            let mut tmp = {
  106         -
                #[allow(unused_mut)]
  107         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
  108         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
  109         -
                    .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
  110         -
                let output = output.meta(generic);
  111         -
                output.build()
  112         -
            };
  113         -
            if tmp.message.is_none() {
  114         -
                tmp.message = _error_message;
  115         -
            }
  116         -
            tmp
  117         -
        }),
  118         -
        "InternalFailureException" => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::InternalFailureException({
  119         -
            #[allow(unused_mut)]
  120         -
            let mut tmp = {
  121         -
                #[allow(unused_mut)]
  122         -
                let mut output = crate::types::error::builders::InternalFailureExceptionBuilder::default();
  123         -
                output = crate::protocol_serde::shape_internal_failure_exception::de_internal_failure_exception_json_err(_response_body, output)
  124         -
                    .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
  125         -
                let output = output.meta(generic);
  126         -
                output.build()
  127         -
            };
  128         -
            if tmp.message.is_none() {
  129         -
                tmp.message = _error_message;
  130         -
            }
  131         -
            tmp
  132         -
        }),
  133         -
        "LimitExceededException" => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::LimitExceededException({
  134         -
            #[allow(unused_mut)]
  135         -
            let mut tmp = {
  136         -
                #[allow(unused_mut)]
  137         -
                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
  138         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
  139         -
                    .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
  140         -
                let output = output.meta(generic);
  141         -
                output.build()
  142         -
            };
  143         -
            if tmp.message.is_none() {
  144         -
                tmp.message = _error_message;
  145         -
            }
  146         -
            tmp
  147         -
        }),
  148         -
        "ServiceUnavailableException" => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::ServiceUnavailableException({
  149         -
            #[allow(unused_mut)]
  150         -
            let mut tmp = {
  151         -
                #[allow(unused_mut)]
  152         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
  153         -
                output =
  154         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
  155         -
                        .map_err(crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::unhandled)?;
  156         -
                let output = output.meta(generic);
  157         -
                output.build()
  158         -
            };
  159         -
            if tmp.message.is_none() {
  160         -
                tmp.message = _error_message;
  161         -
            }
  162         -
            tmp
  163         -
        }),
  164         -
        _ => crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::generic(generic),
  165         -
    })
  166         -
}
  167         -
  168         -
pub fn ser_start_medical_scribe_stream_headers(
  169         -
    input: &crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamInput,
  170         -
    mut builder: ::http_1x::request::Builder,
  171         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  172         -
    if let ::std::option::Option::Some(inner_1) = &input.session_id {
  173         -
        let formatted_2 = inner_1.as_str();
  174         -
        let header_value = formatted_2;
  175         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  176         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  177         -
                "session_id",
  178         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  179         -
            )
  180         -
        })?;
  181         -
        builder = builder.header("x-amzn-transcribe-session-id", header_value);
  182         -
    }
  183         -
    if let ::std::option::Option::Some(inner_3) = &input.language_code {
  184         -
        let formatted_4 = inner_3.as_str();
  185         -
        let header_value = formatted_4;
  186         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  187         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  188         -
                "language_code",
  189         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  190         -
            )
  191         -
        })?;
  192         -
        builder = builder.header("x-amzn-transcribe-language-code", header_value);
  193         -
    }
  194         -
    if let ::std::option::Option::Some(inner_5) = &input.media_sample_rate_hertz {
  195         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
  196         -
        let formatted_6 = encoder.encode();
  197         -
        let header_value = formatted_6;
  198         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  199         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  200         -
                "media_sample_rate_hertz",
  201         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  202         -
            )
  203         -
        })?;
  204         -
        builder = builder.header("x-amzn-transcribe-sample-rate", header_value);
  205         -
    }
  206         -
    if let ::std::option::Option::Some(inner_7) = &input.media_encoding {
  207         -
        let formatted_8 = inner_7.as_str();
  208         -
        let header_value = formatted_8;
  209         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  210         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  211         -
                "media_encoding",
  212         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  213         -
            )
  214         -
        })?;
  215         -
        builder = builder.header("x-amzn-transcribe-media-encoding", header_value);
  216         -
    }
  217         -
    Ok(builder)
  218         -
}

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/protocol_serde/shape_start_medical_stream_transcription.rs

@@ -89,89 +357,0 @@
  109    109   
                    "Failed to parse VocabularyName from header `x-amzn-transcribe-vocabulary-name",
  110    110   
                )
  111    111   
            })?,
  112    112   
        );
  113    113   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  114    114   
        output
  115    115   
            .build()
  116    116   
            .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?
  117    117   
    })
  118    118   
}
  119         -
  120         -
#[allow(clippy::unnecessary_wraps)]
  121         -
pub fn de_start_medical_stream_transcription_http_error(
  122         -
    _response_status: u16,
  123         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  124         -
    _response_body: &[u8],
  125         -
) -> std::result::Result<
  126         -
    crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput,
  127         -
    crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError,
  128         -
> {
  129         -
    #[allow(unused_mut)]
  130         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
  131         -
        .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  132         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
  133         -
    let generic = generic_builder.build();
  134         -
    let error_code = match generic.code() {
  135         -
        Some(code) => code,
  136         -
        None => return Err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled(generic)),
  137         -
    };
  138         -
  139         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
  140         -
    Err(match error_code {
  141         -
        "BadRequestException" => crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::BadRequestException({
  142         -
            #[allow(unused_mut)]
  143         -
            let mut tmp = {
  144         -
                #[allow(unused_mut)]
  145         -
                let mut output = crate::types::error::builders::BadRequestExceptionBuilder::default();
  146         -
                output = crate::protocol_serde::shape_bad_request_exception::de_bad_request_exception_json_err(_response_body, output)
  147         -
                    .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  148         -
                let output = output.meta(generic);
  149         -
                output.build()
  150         -
            };
  151         -
            if tmp.message.is_none() {
  152         -
                tmp.message = _error_message;
  153         -
            }
  154         -
            tmp
  155         -
        }),
  156         -
        "ConflictException" => crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::ConflictException({
  157         -
            #[allow(unused_mut)]
  158         -
            let mut tmp = {
  159         -
                #[allow(unused_mut)]
  160         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
  161         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
  162         -
                    .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  163         -
                let output = output.meta(generic);
  164         -
                output.build()
  165         -
            };
  166         -
            if tmp.message.is_none() {
  167         -
                tmp.message = _error_message;
  168         -
            }
  169         -
            tmp
  170         -
        }),
  171         -
        "InternalFailureException" => {
  172         -
            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::InternalFailureException({
  173         -
                #[allow(unused_mut)]
  174         -
                let mut tmp = {
  175         -
                    #[allow(unused_mut)]
  176         -
                    let mut output = crate::types::error::builders::InternalFailureExceptionBuilder::default();
  177         -
                    output = crate::protocol_serde::shape_internal_failure_exception::de_internal_failure_exception_json_err(_response_body, output)
  178         -
                        .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  179         -
                    let output = output.meta(generic);
  180         -
                    output.build()
  181         -
                };
  182         -
                if tmp.message.is_none() {
  183         -
                    tmp.message = _error_message;
  184         -
                }
  185         -
                tmp
  186         -
            })
  187         -
        }
  188         -
        "LimitExceededException" => {
  189         -
            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::LimitExceededException({
  190         -
                #[allow(unused_mut)]
  191         -
                let mut tmp = {
  192         -
                    #[allow(unused_mut)]
  193         -
                    let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
  194         -
                    output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
  195         -
                        .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  196         -
                    let output = output.meta(generic);
  197         -
                    output.build()
  198         -
                };
  199         -
                if tmp.message.is_none() {
  200         -
                    tmp.message = _error_message;
  201         -
                }
  202         -
                tmp
  203         -
            })
  204         -
        }
  205         -
        "ServiceUnavailableException" => {
  206         -
            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::ServiceUnavailableException({
  207         -
                #[allow(unused_mut)]
  208         -
                let mut tmp = {
  209         -
                    #[allow(unused_mut)]
  210         -
                    let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
  211         -
                    output =
  212         -
                        crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
  213         -
                            .map_err(crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::unhandled)?;
  214         -
                    let output = output.meta(generic);
  215         -
                    output.build()
  216         -
                };
  217         -
                if tmp.message.is_none() {
  218         -
                    tmp.message = _error_message;
  219         -
                }
  220         -
                tmp
  221         -
            })
  222         -
        }
  223         -
        _ => crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::generic(generic),
  224         -
    })
  225         -
}
  226         -
  227         -
pub fn ser_start_medical_stream_transcription_headers(
  228         -
    input: &crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionInput,
  229         -
    mut builder: ::http_1x::request::Builder,
  230         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  231         -
    if let ::std::option::Option::Some(inner_1) = &input.language_code {
  232         -
        let formatted_2 = inner_1.as_str();
  233         -
        let header_value = formatted_2;
  234         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  235         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  236         -
                "language_code",
  237         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  238         -
            )
  239         -
        })?;
  240         -
        builder = builder.header("x-amzn-transcribe-language-code", header_value);
  241         -
    }
  242         -
    if let ::std::option::Option::Some(inner_3) = &input.media_sample_rate_hertz {
  243         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
  244         -
        let formatted_4 = encoder.encode();
  245         -
        let header_value = formatted_4;
  246         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  247         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  248         -
                "media_sample_rate_hertz",
  249         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  250         -
            )
  251         -
        })?;
  252         -
        builder = builder.header("x-amzn-transcribe-sample-rate", header_value);
  253         -
    }
  254         -
    if let ::std::option::Option::Some(inner_5) = &input.media_encoding {
  255         -
        let formatted_6 = inner_5.as_str();
  256         -
        let header_value = formatted_6;
  257         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  258         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  259         -
                "media_encoding",
  260         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  261         -
            )
  262         -
        })?;
  263         -
        builder = builder.header("x-amzn-transcribe-media-encoding", header_value);
  264         -
    }
  265         -
    if let ::std::option::Option::Some(inner_7) = &input.vocabulary_name {
  266         -
        let formatted_8 = inner_7.as_str();
  267         -
        let header_value = formatted_8;
  268         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  269         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  270         -
                "vocabulary_name",
  271         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  272         -
            )
  273         -
        })?;
  274         -
        builder = builder.header("x-amzn-transcribe-vocabulary-name", header_value);
  275         -
    }
  276         -
    if let ::std::option::Option::Some(inner_9) = &input.specialty {
  277         -
        let formatted_10 = inner_9.as_str();
  278         -
        let header_value = formatted_10;
  279         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  280         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  281         -
                "specialty",
  282         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  283         -
            )
  284         -
        })?;
  285         -
        builder = builder.header("x-amzn-transcribe-specialty", header_value);
  286         -
    }
  287         -
    if let ::std::option::Option::Some(inner_11) = &input.r#type {
  288         -
        let formatted_12 = inner_11.as_str();
  289         -
        let header_value = formatted_12;
  290         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  291         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  292         -
                "r#type",
  293         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  294         -
            )
  295         -
        })?;
  296         -
        builder = builder.header("x-amzn-transcribe-type", header_value);
  297         -
    }
  298         -
    if let ::std::option::Option::Some(inner_13) = &input.show_speaker_label {
  299         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_13);
  300         -
        let formatted_14 = encoder.encode();
  301         -
        let header_value = formatted_14;
  302         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  303         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  304         -
                "show_speaker_label",
  305         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  306         -
            )
  307         -
        })?;
  308         -
        builder = builder.header("x-amzn-transcribe-show-speaker-label", header_value);
  309         -
    }
  310         -
    if let ::std::option::Option::Some(inner_15) = &input.session_id {
  311         -
        let formatted_16 = inner_15.as_str();
  312         -
        let header_value = formatted_16;
  313         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  314         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  315         -
                "session_id",
  316         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  317         -
            )
  318         -
        })?;
  319         -
        builder = builder.header("x-amzn-transcribe-session-id", header_value);
  320         -
    }
  321         -
    if let ::std::option::Option::Some(inner_17) = &input.enable_channel_identification {
  322         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
  323         -
        let formatted_18 = encoder.encode();
  324         -
        let header_value = formatted_18;
  325         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  326         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  327         -
                "enable_channel_identification",
  328         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  329         -
            )
  330         -
        })?;
  331         -
        builder = builder.header("x-amzn-transcribe-enable-channel-identification", header_value);
  332         -
    }
  333         -
    if let ::std::option::Option::Some(inner_19) = &input.number_of_channels {
  334         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_19);
  335         -
        let formatted_20 = encoder.encode();
  336         -
        let header_value = formatted_20;
  337         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  338         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  339         -
                "number_of_channels",
  340         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  341         -
            )
  342         -
        })?;
  343         -
        builder = builder.header("x-amzn-transcribe-number-of-channels", header_value);
  344         -
    }
  345         -
    if let ::std::option::Option::Some(inner_21) = &input.content_identification_type {
  346         -
        let formatted_22 = inner_21.as_str();
  347         -
        let header_value = formatted_22;
  348         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  349         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  350         -
                "content_identification_type",
  351         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  352         -
            )
  353         -
        })?;
  354         -
        builder = builder.header("x-amzn-transcribe-content-identification-type", header_value);
  355         -
    }
  356         -
    Ok(builder)
  357         -
}