AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_invoke_model_with_response_stream.rs

@@ -1,1 +66,57 @@
   18     18   
        output = output.set_body(Some(
   19     19   
            crate::protocol_serde::shape_invoke_model_with_response_stream_output::de_body_payload(_response_body)?,
   20     20   
        ));
   21     21   
        output = output.set_content_type(
   22     22   
            crate::protocol_serde::shape_invoke_model_with_response_stream_output::de_content_type_header(_response_headers).map_err(|_| {
   23     23   
                crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled(
   24     24   
                    "Failed to parse contentType from header `X-Amzn-Bedrock-Content-Type",
   25     25   
                )
   26     26   
            })?,
   27     27   
        );
   28         -
        output = output.set_performance_config_latency(
   29         -
            crate::protocol_serde::shape_invoke_model_with_response_stream_output::de_performance_config_latency_header(_response_headers).map_err(
   30         -
                |_| {
   31         -
                    crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled(
   32         -
                        "Failed to parse performanceConfigLatency from header `X-Amzn-Bedrock-PerformanceConfig-Latency",
   33         -
                    )
   34         -
                },
   35         -
            )?,
   36         -
        );
   37     28   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   38     29   
        crate::serde_util::invoke_model_with_response_stream_output_output_correct_errors(output)
   39     30   
            .build()
   40     31   
            .map_err(crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled)?
   41     32   
    })
   42     33   
}
   43     34   
   44     35   
#[allow(clippy::unnecessary_wraps)]
   45     36   
pub fn de_invoke_model_with_response_stream_http_error(
   46     37   
    _response_status: u16,
@@ -98,89 +175,148 @@
  118    109   
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
  119    110   
                    .map_err(crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled)?;
  120    111   
                let output = output.meta(generic);
  121    112   
                output.build()
  122    113   
            };
  123    114   
            if tmp.message.is_none() {
  124    115   
                tmp.message = _error_message;
  125    116   
            }
  126    117   
            tmp
  127    118   
        }),
  128         -
        "ServiceUnavailableException" => {
  129         -
            crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ServiceUnavailableException({
  130         -
                #[allow(unused_mut)]
  131         -
                let mut tmp = {
  132         -
                    #[allow(unused_mut)]
  133         -
                    let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
  134         -
                    output =
  135         -
                        crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
  136         -
                            .map_err(crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled)?;
  137         -
                    let output = output.meta(generic);
  138         -
                    output.build()
  139         -
                };
  140         -
                if tmp.message.is_none() {
  141         -
                    tmp.message = _error_message;
  142         -
                }
  143         -
                tmp
  144         -
            })
  145         -
        }
  146    119   
        "InternalServerException" => {
  147    120   
            crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::InternalServerException({
  148    121   
                #[allow(unused_mut)]
  149    122   
                let mut tmp = {
  150    123   
                    #[allow(unused_mut)]
  151    124   
                    let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
  152    125   
                    output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
  153    126   
                        .map_err(crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::unhandled)?;
  154    127   
                    let output = output.meta(generic);
  155    128   
                    output.build()
@@ -281,254 +323,285 @@
  301    274   
        let formatted_10 = inner_9.as_str();
  302    275   
        let header_value = formatted_10;
  303    276   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  304    277   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  305    278   
                "guardrail_version",
  306    279   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  307    280   
            )
  308    281   
        })?;
  309    282   
        builder = builder.header("X-Amzn-Bedrock-GuardrailVersion", header_value);
  310    283   
    }
  311         -
    if let ::std::option::Option::Some(inner_11) = &input.performance_config_latency {
  312         -
        let formatted_12 = inner_11.as_str();
  313         -
        let header_value = formatted_12;
  314         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  315         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  316         -
                "performance_config_latency",
  317         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  318         -
            )
  319         -
        })?;
  320         -
        builder = builder.header("X-Amzn-Bedrock-PerformanceConfig-Latency", header_value);
  321         -
    }
  322    284   
    Ok(builder)
  323    285   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_invoke_model_with_response_stream_output.rs

@@ -1,1 +28,0 @@
   12     12   
        body,
   13     13   
    )))
   14     14   
}
   15     15   
   16     16   
pub(crate) fn de_content_type_header(
   17     17   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   18     18   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   19     19   
    let headers = header_map.get_all("X-Amzn-Bedrock-Content-Type");
   20     20   
    ::aws_smithy_http::header::one_or_none(headers)
   21     21   
}
   22         -
   23         -
pub(crate) fn de_performance_config_latency_header(
   24         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   25         -
) -> ::std::result::Result<::std::option::Option<crate::types::PerformanceConfigLatency>, ::aws_smithy_http::header::ParseError> {
   26         -
    let headers = header_map.get_all("X-Amzn-Bedrock-PerformanceConfig-Latency");
   27         -
    ::aws_smithy_http::header::one_or_none(headers)
   28         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_list_async_invokes.rs

@@ -1,0 +141,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_async_invokes_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_async_invokes::ListAsyncInvokesOutput, crate::operation::list_async_invokes::ListAsyncInvokesError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "AccessDeniedException" => crate::operation::list_async_invokes::ListAsyncInvokesError::AccessDeniedException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InternalServerException" => crate::operation::list_async_invokes::ListAsyncInvokesError::InternalServerException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "ThrottlingException" => crate::operation::list_async_invokes::ListAsyncInvokesError::ThrottlingException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "ValidationException" => crate::operation::list_async_invokes::ListAsyncInvokesError::ValidationException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        _ => crate::operation::list_async_invokes::ListAsyncInvokesError::generic(generic),
   81         -
    })
   82         -
}
   83         -
   84         -
#[allow(clippy::unnecessary_wraps)]
   85         -
pub fn de_list_async_invokes_http_response(
   86         -
    _response_status: u16,
   87         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   88         -
    _response_body: &[u8],
   89         -
) -> std::result::Result<crate::operation::list_async_invokes::ListAsyncInvokesOutput, crate::operation::list_async_invokes::ListAsyncInvokesError> {
   90         -
    Ok({
   91         -
        #[allow(unused_mut)]
   92         -
        let mut output = crate::operation::list_async_invokes::builders::ListAsyncInvokesOutputBuilder::default();
   93         -
        output = crate::protocol_serde::shape_list_async_invokes::de_list_async_invokes(_response_body, output)
   94         -
            .map_err(crate::operation::list_async_invokes::ListAsyncInvokesError::unhandled)?;
   95         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   96         -
        output.build()
   97         -
    })
   98         -
}
   99         -
  100         -
pub(crate) fn de_list_async_invokes(
  101         -
    value: &[u8],
  102         -
    mut builder: crate::operation::list_async_invokes::builders::ListAsyncInvokesOutputBuilder,
  103         -
) -> ::std::result::Result<
  104         -
    crate::operation::list_async_invokes::builders::ListAsyncInvokesOutputBuilder,
  105         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  106         -
> {
  107         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  108         -
    let tokens = &mut tokens_owned;
  109         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  110         -
    loop {
  111         -
        match tokens.next().transpose()? {
  112         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  113         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  114         -
                "asyncInvokeSummaries" => {
  115         -
                    builder =
  116         -
                        builder.set_async_invoke_summaries(crate::protocol_serde::shape_async_invoke_summaries::de_async_invoke_summaries(tokens)?);
  117         -
                }
  118         -
                "nextToken" => {
  119         -
                    builder = builder.set_next_token(
  120         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  121         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  122         -
                            .transpose()?,
  123         -
                    );
  124         -
                }
  125         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  126         -
            },
  127         -
            other => {
  128         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  129         -
                    "expected object key or end object, found: {:?}",
  130         -
                    other
  131         -
                )))
  132         -
            }
  133         -
        }
  134         -
    }
  135         -
    if tokens.next().is_some() {
  136         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  137         -
            "found more JSON tokens after completing parsing",
  138         -
        ));
  139         -
    }
  140         -
    Ok(builder)
  141         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_model_outputs.rs

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_model_outputs<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   11         -
            let mut items = Vec::new();
   12         -
            loop {
   13         -
                match tokens.peek() {
   14         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   15         -
                        tokens.next().transpose().unwrap();
   16         -
                        break;
   17         -
                    }
   18         -
                    _ => {
   19         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                            .transpose()?;
   22         -
                        if let Some(value) = value {
   23         -
                            items.push(value);
   24         -
                        }
   25         -
                    }
   26         -
                }
   27         -
            }
   28         -
            Ok(Some(items))
   29         -
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "expected start array or null",
   32         -
        )),
   33         -
    }
   34         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_performance_configuration.rs

@@ -1,0 +50,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_performance_configuration<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::PerformanceConfiguration>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::PerformanceConfigurationBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "latency" => {
   18         -
                            builder = builder.set_latency(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::PerformanceConfigLatency::from(u.as_ref())))
   21         -
                                    .transpose()?,
   22         -
                            );
   23         -
                        }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
   26         -
                    other => {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28         -
                            "expected object key or end object, found: {:?}",
   29         -
                            other
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}
   41         -
   42         -
pub fn ser_performance_configuration(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::PerformanceConfiguration,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    {
   47         -
        object.key("latency").string(input.latency.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_prompt_router_trace.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_prompt_variable_values.rs

@@ -1,0 +17,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_prompt_variable_values(
    3         -
    object_19: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::PromptVariableValues,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    match input {
    7         -
        crate::types::PromptVariableValues::Text(inner) => {
    8         -
            object_19.key("text").string(inner.as_str());
    9         -
        }
   10         -
        crate::types::PromptVariableValues::Unknown => {
   11         -
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
   12         -
                "PromptVariableValues",
   13         -
            ))
   14         -
        }
   15         -
    }
   16         -
    Ok(())
   17         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_reasoning_content_block.rs

@@ -1,0 +93,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_reasoning_content_block(
    3         -
    object_8: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ReasoningContentBlock,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    match input {
    7         -
        crate::types::ReasoningContentBlock::ReasoningText(inner) => {
    8         -
            #[allow(unused_mut)]
    9         -
            let mut object_1 = object_8.key("reasoningText").start_object();
   10         -
            crate::protocol_serde::shape_reasoning_text_block::ser_reasoning_text_block(&mut object_1, inner)?;
   11         -
            object_1.finish();
   12         -
        }
   13         -
        crate::types::ReasoningContentBlock::RedactedContent(inner) => {
   14         -
            object_8
   15         -
                .key("redactedContent")
   16         -
                .string_unchecked(&::aws_smithy_types::base64::encode(inner));
   17         -
        }
   18         -
        crate::types::ReasoningContentBlock::Unknown => {
   19         -
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
   20         -
                "ReasoningContentBlock",
   21         -
            ))
   22         -
        }
   23         -
    }
   24         -
    Ok(())
   25         -
}
   26         -
   27         -
pub(crate) fn de_reasoning_content_block<'a, I>(
   28         -
    tokens: &mut ::std::iter::Peekable<I>,
   29         -
) -> ::std::result::Result<Option<crate::types::ReasoningContentBlock>, ::aws_smithy_json::deserialize::error::DeserializeError>
   30         -
where
   31         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   32         -
{
   33         -
    let mut variant = None;
   34         -
    match tokens.next().transpose()? {
   35         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   36         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   37         -
            match tokens.next().transpose()? {
   38         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   39         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   40         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   41         -
                        tokens.peek()
   42         -
                    {
   43         -
                        let _ = tokens.next().expect("peek returned a token")?;
   44         -
                        continue;
   45         -
                    }
   46         -
                    let key = key.to_unescaped()?;
   47         -
                    if key == "__type" {
   48         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   49         -
                        continue;
   50         -
                    }
   51         -
                    if variant.is_some() {
   52         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53         -
                            "encountered mixed variants in union",
   54         -
                        ));
   55         -
                    }
   56         -
                    variant = match key.as_ref() {
   57         -
                        "reasoningText" => Some(crate::types::ReasoningContentBlock::ReasoningText(
   58         -
                            crate::protocol_serde::shape_reasoning_text_block::de_reasoning_text_block(tokens)?.ok_or_else(|| {
   59         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'reasoningText' cannot be null")
   60         -
                            })?,
   61         -
                        )),
   62         -
                        "redactedContent" => Some(crate::types::ReasoningContentBlock::RedactedContent(
   63         -
                            ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?.ok_or_else(|| {
   64         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'redactedContent' cannot be null")
   65         -
                            })?,
   66         -
                        )),
   67         -
                        _ => {
   68         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   69         -
                            Some(crate::types::ReasoningContentBlock::Unknown)
   70         -
                        }
   71         -
                    };
   72         -
                }
   73         -
                other => {
   74         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   75         -
                        "expected object key or end object, found: {:?}",
   76         -
                        other
   77         -
                    )))
   78         -
                }
   79         -
            }
   80         -
        },
   81         -
        _ => {
   82         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   83         -
                "expected start object or null",
   84         -
            ))
   85         -
        }
   86         -
    }
   87         -
    if variant.is_none() {
   88         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   89         -
            "Union did not contain a valid variant.",
   90         -
        ));
   91         -
    }
   92         -
    Ok(variant)
   93         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_reasoning_content_block_delta.rs

@@ -1,0 +77,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_reasoning_content_block_delta<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::ReasoningContentBlockDelta>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    let mut variant = None;
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   12         -
            match tokens.next().transpose()? {
   13         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   14         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   15         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   16         -
                        tokens.peek()
   17         -
                    {
   18         -
                        let _ = tokens.next().expect("peek returned a token")?;
   19         -
                        continue;
   20         -
                    }
   21         -
                    let key = key.to_unescaped()?;
   22         -
                    if key == "__type" {
   23         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   24         -
                        continue;
   25         -
                    }
   26         -
                    if variant.is_some() {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                            "encountered mixed variants in union",
   29         -
                        ));
   30         -
                    }
   31         -
                    variant = match key.as_ref() {
   32         -
                        "text" => Some(crate::types::ReasoningContentBlockDelta::Text(
   33         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   35         -
                                .transpose()?
   36         -
                                .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'text' cannot be null"))?,
   37         -
                        )),
   38         -
                        "redactedContent" => Some(crate::types::ReasoningContentBlockDelta::RedactedContent(
   39         -
                            ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?.ok_or_else(|| {
   40         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'redactedContent' cannot be null")
   41         -
                            })?,
   42         -
                        )),
   43         -
                        "signature" => Some(crate::types::ReasoningContentBlockDelta::Signature(
   44         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   45         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   46         -
                                .transpose()?
   47         -
                                .ok_or_else(|| {
   48         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'signature' cannot be null")
   49         -
                                })?,
   50         -
                        )),
   51         -
                        _ => {
   52         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   53         -
                            Some(crate::types::ReasoningContentBlockDelta::Unknown)
   54         -
                        }
   55         -
                    };
   56         -
                }
   57         -
                other => {
   58         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   59         -
                        "expected object key or end object, found: {:?}",
   60         -
                        other
   61         -
                    )))
   62         -
                }
   63         -
            }
   64         -
        },
   65         -
        _ => {
   66         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   67         -
                "expected start object or null",
   68         -
            ))
   69         -
        }
   70         -
    }
   71         -
    if variant.is_none() {
   72         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   73         -
            "Union did not contain a valid variant.",
   74         -
        ));
   75         -
    }
   76         -
    Ok(variant)
   77         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_reasoning_text_block.rs

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_reasoning_text_block(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ReasoningTextBlock,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("text").string(input.text.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.signature {
   10         -
        object.key("signature").string(var_1.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_reasoning_text_block<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
) -> ::std::result::Result<Option<crate::types::ReasoningTextBlock>, ::aws_smithy_json::deserialize::error::DeserializeError>
   18         -
where
   19         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   20         -
{
   21         -
    match tokens.next().transpose()? {
   22         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   23         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   24         -
            #[allow(unused_mut)]
   25         -
            let mut builder = crate::types::builders::ReasoningTextBlockBuilder::default();
   26         -
            loop {
   27         -
                match tokens.next().transpose()? {
   28         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   29         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   30         -
                        "text" => {
   31         -
                            builder = builder.set_text(
   32         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   33         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   34         -
                                    .transpose()?,
   35         -
                            );
   36         -
                        }
   37         -
                        "signature" => {
   38         -
                            builder = builder.set_signature(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   40         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   45         -
                    },
   46         -
                    other => {
   47         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   48         -
                            "expected object key or end object, found: {:?}",
   49         -
                            other
   50         -
                        )))
   51         -
                    }
   52         -
                }
   53         -
            }
   54         -
            Ok(Some(crate::serde_util::reasoning_text_block_correct_errors(builder).build().map_err(
   55         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   56         -
            )?))
   57         -
        }
   58         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   59         -
            "expected start object or null",
   60         -
        )),
   61         -
    }
   62         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_s3_location.rs

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_s3_location(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::S3Location,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("uri").string(input.uri.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.bucket_owner {
   10         -
        object.key("bucketOwner").string(var_1.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_s3_location<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
) -> ::std::result::Result<Option<crate::types::S3Location>, ::aws_smithy_json::deserialize::error::DeserializeError>
   18         -
where
   19         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   20         -
{
   21         -
    match tokens.next().transpose()? {
   22         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   23         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   24         -
            #[allow(unused_mut)]
   25         -
            let mut builder = crate::types::builders::S3LocationBuilder::default();
   26         -
            loop {
   27         -
                match tokens.next().transpose()? {
   28         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   29         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   30         -
                        "uri" => {
   31         -
                            builder = builder.set_uri(
   32         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   33         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   34         -
                                    .transpose()?,
   35         -
                            );
   36         -
                        }
   37         -
                        "bucketOwner" => {
   38         -
                            builder = builder.set_bucket_owner(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   40         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   45         -
                    },
   46         -
                    other => {
   47         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   48         -
                            "expected object key or end object, found: {:?}",
   49         -
                            other
   50         -
                        )))
   51         -
                    }
   52         -
                }
   53         -
            }
   54         -
            Ok(Some(crate::serde_util::s3_location_correct_errors(builder).build().map_err(|err| {
   55         -
                ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
   56         -
            })?))
   57         -
        }
   58         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   59         -
            "expected start object or null",
   60         -
        )),
   61         -
    }
   62         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_service_unavailable_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_start_async_invoke.rs

@@ -1,0 +213,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_start_async_invoke_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::start_async_invoke::StartAsyncInvokeOutput, crate::operation::start_async_invoke::StartAsyncInvokeError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "AccessDeniedException" => crate::operation::start_async_invoke::StartAsyncInvokeError::AccessDeniedException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "ConflictException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ConflictException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "InternalServerException" => crate::operation::start_async_invoke::StartAsyncInvokeError::InternalServerException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "ResourceNotFoundException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ResourceNotFoundException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "ServiceQuotaExceededException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceQuotaExceededException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   86         -
                    _response_body,
   87         -
                    output,
   88         -
                )
   89         -
                .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
   90         -
                let output = output.meta(generic);
   91         -
                output.build()
   92         -
            };
   93         -
            if tmp.message.is_none() {
   94         -
                tmp.message = _error_message;
   95         -
            }
   96         -
            tmp
   97         -
        }),
   98         -
        "ServiceUnavailableException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceUnavailableException({
   99         -
            #[allow(unused_mut)]
  100         -
            let mut tmp = {
  101         -
                #[allow(unused_mut)]
  102         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
  103         -
                output =
  104         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
  105         -
                        .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
  106         -
                let output = output.meta(generic);
  107         -
                output.build()
  108         -
            };
  109         -
            if tmp.message.is_none() {
  110         -
                tmp.message = _error_message;
  111         -
            }
  112         -
            tmp
  113         -
        }),
  114         -
        "ThrottlingException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ThrottlingException({
  115         -
            #[allow(unused_mut)]
  116         -
            let mut tmp = {
  117         -
                #[allow(unused_mut)]
  118         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
  119         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
  120         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
  121         -
                let output = output.meta(generic);
  122         -
                output.build()
  123         -
            };
  124         -
            if tmp.message.is_none() {
  125         -
                tmp.message = _error_message;
  126         -
            }
  127         -
            tmp
  128         -
        }),
  129         -
        "ValidationException" => crate::operation::start_async_invoke::StartAsyncInvokeError::ValidationException({
  130         -
            #[allow(unused_mut)]
  131         -
            let mut tmp = {
  132         -
                #[allow(unused_mut)]
  133         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
  134         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  135         -
                    .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
  136         -
                let output = output.meta(generic);
  137         -
                output.build()
  138         -
            };
  139         -
            if tmp.message.is_none() {
  140         -
                tmp.message = _error_message;
  141         -
            }
  142         -
            tmp
  143         -
        }),
  144         -
        _ => crate::operation::start_async_invoke::StartAsyncInvokeError::generic(generic),
  145         -
    })
  146         -
}
  147         -
  148         -
#[allow(clippy::unnecessary_wraps)]
  149         -
pub fn de_start_async_invoke_http_response(
  150         -
    _response_status: u16,
  151         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  152         -
    _response_body: &[u8],
  153         -
) -> std::result::Result<crate::operation::start_async_invoke::StartAsyncInvokeOutput, crate::operation::start_async_invoke::StartAsyncInvokeError> {
  154         -
    Ok({
  155         -
        #[allow(unused_mut)]
  156         -
        let mut output = crate::operation::start_async_invoke::builders::StartAsyncInvokeOutputBuilder::default();
  157         -
        output = crate::protocol_serde::shape_start_async_invoke::de_start_async_invoke(_response_body, output)
  158         -
            .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?;
  159         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  160         -
        crate::serde_util::start_async_invoke_output_output_correct_errors(output)
  161         -
            .build()
  162         -
            .map_err(crate::operation::start_async_invoke::StartAsyncInvokeError::unhandled)?
  163         -
    })
  164         -
}
  165         -
  166         -
pub fn ser_start_async_invoke_input(
  167         -
    input: &crate::operation::start_async_invoke::StartAsyncInvokeInput,
  168         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  169         -
    let mut out = String::new();
  170         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  171         -
    crate::protocol_serde::shape_start_async_invoke_input::ser_start_async_invoke_input_input(&mut object, input)?;
  172         -
    object.finish();
  173         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  174         -
}
  175         -
  176         -
pub(crate) fn de_start_async_invoke(
  177         -
    value: &[u8],
  178         -
    mut builder: crate::operation::start_async_invoke::builders::StartAsyncInvokeOutputBuilder,
  179         -
) -> ::std::result::Result<
  180         -
    crate::operation::start_async_invoke::builders::StartAsyncInvokeOutputBuilder,
  181         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  182         -
> {
  183         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  184         -
    let tokens = &mut tokens_owned;
  185         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  186         -
    loop {
  187         -
        match tokens.next().transpose()? {
  188         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  189         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  190         -
                "invocationArn" => {
  191         -
                    builder = builder.set_invocation_arn(
  192         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  193         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  194         -
                            .transpose()?,
  195         -
                    );
  196         -
                }
  197         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  198         -
            },
  199         -
            other => {
  200         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  201         -
                    "expected object key or end object, found: {:?}",
  202         -
                    other
  203         -
                )))
  204         -
            }
  205         -
        }
  206         -
    }
  207         -
    if tokens.next().is_some() {
  208         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  209         -
            "found more JSON tokens after completing parsing",
  210         -
        ));
  211         -
    }
  212         -
    Ok(builder)
  213         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_start_async_invoke_input.rs

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_start_async_invoke_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::start_async_invoke::StartAsyncInvokeInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.client_request_token {
    7         -
        object.key("clientRequestToken").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.model_id {
   10         -
        object.key("modelId").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.model_input {
   13         -
        object.key("modelInput").document(var_3);
   14         -
    }
   15         -
    if let Some(var_4) = &input.output_data_config {
   16         -
        #[allow(unused_mut)]
   17         -
        let mut object_5 = object.key("outputDataConfig").start_object();
   18         -
        crate::protocol_serde::shape_async_invoke_output_data_config::ser_async_invoke_output_data_config(&mut object_5, var_4)?;
   19         -
        object_5.finish();
   20         -
    }
   21         -
    if let Some(var_6) = &input.tags {
   22         -
        let mut array_7 = object.key("tags").start_array();
   23         -
        for item_8 in var_6 {
   24         -
            {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut object_9 = array_7.value().start_object();
   27         -
                crate::protocol_serde::shape_tag::ser_tag(&mut object_9, item_8)?;
   28         -
                object_9.finish();
   29         -
            }
   30         -
        }
   31         -
        array_7.finish();
   32         -
    }
   33         -
    Ok(())
   34         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_system_content_block.rs

@@ -1,1 +29,17 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn ser_system_content_block(
    3         -
    object_27: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           3  +
    object_14: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      4   
    input: &crate::types::SystemContentBlock,
    5      5   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6      6   
    match input {
    7      7   
        crate::types::SystemContentBlock::Text(inner) => {
    8         -
            object_27.key("text").string(inner.as_str());
    9         -
        }
   10         -
        crate::types::SystemContentBlock::GuardContent(inner) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut object_1 = object_27.key("guardContent").start_object();
   13         -
            crate::protocol_serde::shape_guardrail_converse_content_block::ser_guardrail_converse_content_block(&mut object_1, inner)?;
   14         -
            object_1.finish();
   15         -
        }
   16         -
        crate::types::SystemContentBlock::CachePoint(inner) => {
   17         -
            #[allow(unused_mut)]
   18         -
            let mut object_2 = object_27.key("cachePoint").start_object();
   19         -
            crate::protocol_serde::shape_cache_point_block::ser_cache_point_block(&mut object_2, inner)?;
   20         -
            object_2.finish();
           8  +
            object_14.key("text").string(inner.as_str());
   21      9   
        }
   22     10   
        crate::types::SystemContentBlock::Unknown => {
   23     11   
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
   24     12   
                "SystemContentBlock",
   25     13   
            ))
   26     14   
        }
   27     15   
    }
   28     16   
    Ok(())
   29     17   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_tag.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_tag(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::Tag,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("key").string(input.key.as_str());
    8         -
    }
    9         -
    {
   10         -
        object.key("value").string(input.value.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}