Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_export_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_export_not_found_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ExportNotFoundErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ExportNotFoundErrorBuilder, ::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/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_export_summaries.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_export_summary.rs

@@ -1,0 +47,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_export_summary<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ExportSummary>, ::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::ExportSummaryBuilder::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         -
                        "ExportArn" => {
   19         -
                            builder = builder.set_export_arn(
   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         -
                        "ExportStatus" => {
   26         -
                            builder = builder.set_export_status(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ExportStatus::from(u.as_ref())))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
   34         -
                    other => {
   35         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36         -
                            "expected object key or end object, found: {other:?}"
   37         -
                        )))
   38         -
                    }
   39         -
                }
   40         -
            }
   41         -
            Ok(Some(builder.build()))
   42         -
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
   46         -
    }
   47         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_export_table_to_point_in_time.rs

@@ -1,0 +182,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_export_table_to_point_in_time_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeOutput,
    9         -
    crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => {
   18         -
            return Err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled(
   19         -
                generic,
   20         -
            ))
   21         -
        }
   22         -
    };
   23         -
   24         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   25         -
    Err(match error_code {
   26         -
        "ExportConflictException" => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::ExportConflictError({
   27         -
            #[allow(unused_mut)]
   28         -
            let mut tmp = {
   29         -
                #[allow(unused_mut)]
   30         -
                let mut output = crate::types::error::builders::ExportConflictErrorBuilder::default();
   31         -
                output = crate::protocol_serde::shape_export_conflict_exception::de_export_conflict_exception_json_err(_response_body, output)
   32         -
                    .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   33         -
                let output = output.meta(generic);
   34         -
                output.build()
   35         -
            };
   36         -
            if tmp.message.is_none() {
   37         -
                tmp.message = _error_message;
   38         -
            }
   39         -
            tmp
   40         -
        }),
   41         -
        "InternalServerError" => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::InternalServerError({
   42         -
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   48         -
                let output = output.meta(generic);
   49         -
                output.build()
   50         -
            };
   51         -
            if tmp.message.is_none() {
   52         -
                tmp.message = _error_message;
   53         -
            }
   54         -
            tmp
   55         -
        }),
   56         -
        "InvalidExportTimeException" => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::InvalidExportTimeError({
   57         -
            #[allow(unused_mut)]
   58         -
            let mut tmp = {
   59         -
                #[allow(unused_mut)]
   60         -
                let mut output = crate::types::error::builders::InvalidExportTimeErrorBuilder::default();
   61         -
                output =
   62         -
                    crate::protocol_serde::shape_invalid_export_time_exception::de_invalid_export_time_exception_json_err(_response_body, output)
   63         -
                        .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   64         -
                let output = output.meta(generic);
   65         -
                output.build()
   66         -
            };
   67         -
            if tmp.message.is_none() {
   68         -
                tmp.message = _error_message;
   69         -
            }
   70         -
            tmp
   71         -
        }),
   72         -
        "LimitExceededException" => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::LimitExceededError({
   73         -
            #[allow(unused_mut)]
   74         -
            let mut tmp = {
   75         -
                #[allow(unused_mut)]
   76         -
                let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
   77         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   78         -
                    .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   79         -
                let output = output.meta(generic);
   80         -
                output.build()
   81         -
            };
   82         -
            if tmp.message.is_none() {
   83         -
                tmp.message = _error_message;
   84         -
            }
   85         -
            tmp
   86         -
        }),
   87         -
        "PointInTimeRecoveryUnavailableException" => {
   88         -
            crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::PointInTimeRecoveryUnavailableError({
   89         -
                #[allow(unused_mut)]
   90         -
                let mut tmp = {
   91         -
                    #[allow(unused_mut)]
   92         -
                    let mut output = crate::types::error::builders::PointInTimeRecoveryUnavailableErrorBuilder::default();
   93         -
                    output = crate::protocol_serde::shape_point_in_time_recovery_unavailable_exception::de_point_in_time_recovery_unavailable_exception_json_err(_response_body, output).map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
   94         -
                    let output = output.meta(generic);
   95         -
                    output.build()
   96         -
                };
   97         -
                if tmp.message.is_none() {
   98         -
                    tmp.message = _error_message;
   99         -
                }
  100         -
                tmp
  101         -
            })
  102         -
        }
  103         -
        "TableNotFoundException" => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::TableNotFoundError({
  104         -
            #[allow(unused_mut)]
  105         -
            let mut tmp = {
  106         -
                #[allow(unused_mut)]
  107         -
                let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
  108         -
                output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
  109         -
                    .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::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         -
        _ => crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::generic(generic),
  119         -
    })
  120         -
}
  121         -
  122         -
#[allow(clippy::unnecessary_wraps)]
  123         -
pub fn de_export_table_to_point_in_time_http_response(
  124         -
    _response_status: u16,
  125         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  126         -
    _response_body: &[u8],
  127         -
) -> std::result::Result<
  128         -
    crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeOutput,
  129         -
    crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError,
  130         -
> {
  131         -
    Ok({
  132         -
        #[allow(unused_mut)]
  133         -
        let mut output = crate::operation::export_table_to_point_in_time::builders::ExportTableToPointInTimeOutputBuilder::default();
  134         -
        output = crate::protocol_serde::shape_export_table_to_point_in_time::de_export_table_to_point_in_time(_response_body, output)
  135         -
            .map_err(crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeError::unhandled)?;
  136         -
        output.build()
  137         -
    })
  138         -
}
  139         -
  140         -
pub fn ser_export_table_to_point_in_time_input(
  141         -
    input: &crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeInput,
  142         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  143         -
    let mut out = String::new();
  144         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  145         -
    crate::protocol_serde::shape_export_table_to_point_in_time_input::ser_export_table_to_point_in_time_input_input(&mut object, input)?;
  146         -
    object.finish();
  147         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  148         -
}
  149         -
  150         -
pub(crate) fn de_export_table_to_point_in_time(
  151         -
    _value: &[u8],
  152         -
    mut builder: crate::operation::export_table_to_point_in_time::builders::ExportTableToPointInTimeOutputBuilder,
  153         -
) -> ::std::result::Result<
  154         -
    crate::operation::export_table_to_point_in_time::builders::ExportTableToPointInTimeOutputBuilder,
  155         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  156         -
> {
  157         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  158         -
    let tokens = &mut tokens_owned;
  159         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  160         -
    loop {
  161         -
        match tokens.next().transpose()? {
  162         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  163         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  164         -
                "ExportDescription" => {
  165         -
                    builder = builder.set_export_description(crate::protocol_serde::shape_export_description::de_export_description(tokens, _value)?);
  166         -
                }
  167         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  168         -
            },
  169         -
            other => {
  170         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  171         -
                    "expected object key or end object, found: {other:?}"
  172         -
                )))
  173         -
            }
  174         -
        }
  175         -
    }
  176         -
    if tokens.next().is_some() {
  177         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  178         -
            "found more JSON tokens after completing parsing",
  179         -
        ));
  180         -
    }
  181         -
    Ok(builder)
  182         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_export_table_to_point_in_time_input.rs

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_export_table_to_point_in_time_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::export_table_to_point_in_time::ExportTableToPointInTimeInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.table_arn {
    7         -
        object.key("TableArn").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.export_time {
   10         -
        object
   11         -
            .key("ExportTime")
   12         -
            .date_time(var_2, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   13         -
    }
   14         -
    if let Some(var_3) = &input.client_token {
   15         -
        object.key("ClientToken").string(var_3.as_str());
   16         -
    }
   17         -
    if let Some(var_4) = &input.s3_bucket {
   18         -
        object.key("S3Bucket").string(var_4.as_str());
   19         -
    }
   20         -
    if let Some(var_5) = &input.s3_bucket_owner {
   21         -
        object.key("S3BucketOwner").string(var_5.as_str());
   22         -
    }
   23         -
    if let Some(var_6) = &input.s3_prefix {
   24         -
        object.key("S3Prefix").string(var_6.as_str());
   25         -
    }
   26         -
    if let Some(var_7) = &input.s3_sse_algorithm {
   27         -
        object.key("S3SseAlgorithm").string(var_7.as_str());
   28         -
    }
   29         -
    if let Some(var_8) = &input.s3_sse_kms_key_id {
   30         -
        object.key("S3SseKmsKeyId").string(var_8.as_str());
   31         -
    }
   32         -
    if let Some(var_9) = &input.export_format {
   33         -
        object.key("ExportFormat").string(var_9.as_str());
   34         -
    }
   35         -
    Ok(())
   36         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_expression_attribute_name_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_expression_attribute_name_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    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::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_failure_exception.rs

@@ -1,0 +47,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_failure_exception<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::FailureException>, ::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::FailureExceptionBuilder::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         -
                        "ExceptionName" => {
   19         -
                            builder = builder.set_exception_name(
   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         -
                        "ExceptionDescription" => {
   26         -
                            builder = builder.set_exception_description(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
   34         -
                    other => {
   35         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36         -
                            "expected object key or end object, found: {other:?}"
   37         -
                        )))
   38         -
                    }
   39         -
                }
   40         -
            }
   41         -
            Ok(Some(builder.build()))
   42         -
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
   46         -
    }
   47         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_get.rs

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::Get,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_1 = object.key("Key").start_object();
    9         -
        for (key_2, value_3) in &input.key {
   10         -
            {
   11         -
                #[allow(unused_mut)]
   12         -
                let mut object_4 = object_1.key(key_2.as_str()).start_object();
   13         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_4, value_3)?;
   14         -
                object_4.finish();
   15         -
            }
   16         -
        }
   17         -
        object_1.finish();
   18         -
    }
   19         -
    {
   20         -
        object.key("TableName").string(input.table_name.as_str());
   21         -
    }
   22         -
    if let Some(var_5) = &input.projection_expression {
   23         -
        object.key("ProjectionExpression").string(var_5.as_str());
   24         -
    }
   25         -
    if let Some(var_6) = &input.expression_attribute_names {
   26         -
        #[allow(unused_mut)]
   27         -
        let mut object_7 = object.key("ExpressionAttributeNames").start_object();
   28         -
        for (key_8, value_9) in var_6 {
   29         -
            {
   30         -
                object_7.key(key_8.as_str()).string(value_9.as_str());
   31         -
            }
   32         -
        }
   33         -
        object_7.finish();
   34         -
    }
   35         -
    Ok(())
   36         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_get_item.rs

@@ -1,0 +156,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_item_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::get_item::GetItemOutput, crate::operation::get_item::GetItemError> {
    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::get_item::GetItemError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::get_item::GetItemError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::get_item::GetItemError::InternalServerError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::get_item::GetItemError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
   29         -
            if tmp.message.is_none() {
   30         -
                tmp.message = _error_message;
   31         -
            }
   32         -
            tmp
   33         -
        }),
   34         -
        "InvalidEndpointException" => crate::operation::get_item::GetItemError::InvalidEndpointError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::get_item::GetItemError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
   44         -
            if tmp.message.is_none() {
   45         -
                tmp.message = _error_message;
   46         -
            }
   47         -
            tmp
   48         -
        }),
   49         -
        "ProvisionedThroughputExceededException" => {
   50         -
            crate::operation::get_item::GetItemError::ProvisionedThroughputExceededError({
   51         -
                #[allow(unused_mut)]
   52         -
                let mut tmp = {
   53         -
                    #[allow(unused_mut)]
   54         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   55         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::get_item::GetItemError::unhandled)?;
   56         -
                    let output = output.meta(generic);
   57         -
                    output.build()
   58         -
                };
   59         -
                if tmp.message.is_none() {
   60         -
                    tmp.message = _error_message;
   61         -
                }
   62         -
                tmp
   63         -
            })
   64         -
        }
   65         -
        "RequestLimitExceeded" => crate::operation::get_item::GetItemError::RequestLimitExceeded({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
   70         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::get_item::GetItemError::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         -
        "ResourceNotFoundException" => crate::operation::get_item::GetItemError::ResourceNotFoundError({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   85         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::get_item::GetItemError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        _ => crate::operation::get_item::GetItemError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_get_item_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<crate::operation::get_item::GetItemOutput, crate::operation::get_item::GetItemError> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::get_item::builders::GetItemOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_get_item::de_get_item(_response_body, output)
  109         -
            .map_err(crate::operation::get_item::GetItemError::unhandled)?;
  110         -
        output.build()
  111         -
    })
  112         -
}
  113         -
  114         -
pub fn ser_get_item_input(
  115         -
    input: &crate::operation::get_item::GetItemInput,
  116         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  117         -
    let mut out = String::new();
  118         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  119         -
    crate::protocol_serde::shape_get_item_input::ser_get_item_input_input(&mut object, input)?;
  120         -
    object.finish();
  121         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  122         -
}
  123         -
  124         -
pub(crate) fn de_get_item(
  125         -
    _value: &[u8],
  126         -
    mut builder: crate::operation::get_item::builders::GetItemOutputBuilder,
  127         -
) -> ::std::result::Result<crate::operation::get_item::builders::GetItemOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  128         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  129         -
    let tokens = &mut tokens_owned;
  130         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  131         -
    loop {
  132         -
        match tokens.next().transpose()? {
  133         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  134         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  135         -
                "Item" => {
  136         -
                    builder = builder.set_item(crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens, _value)?);
  137         -
                }
  138         -
                "ConsumedCapacity" => {
  139         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity::de_consumed_capacity(tokens, _value)?);
  140         -
                }
  141         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  142         -
            },
  143         -
            other => {
  144         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  145         -
                    "expected object key or end object, found: {other:?}"
  146         -
                )))
  147         -
            }
  148         -
        }
  149         -
    }
  150         -
    if tokens.next().is_some() {
  151         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  152         -
            "found more JSON tokens after completing parsing",
  153         -
        ));
  154         -
    }
  155         -
    Ok(builder)
  156         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_get_item_input.rs

@@ -1,0 +51,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_item_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_item::GetItemInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.table_name {
    7         -
        object.key("TableName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.key {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("Key").start_object();
   12         -
        for (key_4, value_5) in var_2 {
   13         -
            {
   14         -
                #[allow(unused_mut)]
   15         -
                let mut object_6 = object_3.key(key_4.as_str()).start_object();
   16         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_6, value_5)?;
   17         -
                object_6.finish();
   18         -
            }
   19         -
        }
   20         -
        object_3.finish();
   21         -
    }
   22         -
    if let Some(var_7) = &input.attributes_to_get {
   23         -
        let mut array_8 = object.key("AttributesToGet").start_array();
   24         -
        for item_9 in var_7 {
   25         -
            {
   26         -
                array_8.value().string(item_9.as_str());
   27         -
            }
   28         -
        }
   29         -
        array_8.finish();
   30         -
    }
   31         -
    if let Some(var_10) = &input.consistent_read {
   32         -
        object.key("ConsistentRead").boolean(*var_10);
   33         -
    }
   34         -
    if let Some(var_11) = &input.return_consumed_capacity {
   35         -
        object.key("ReturnConsumedCapacity").string(var_11.as_str());
   36         -
    }
   37         -
    if let Some(var_12) = &input.projection_expression {
   38         -
        object.key("ProjectionExpression").string(var_12.as_str());
   39         -
    }
   40         -
    if let Some(var_13) = &input.expression_attribute_names {
   41         -
        #[allow(unused_mut)]
   42         -
        let mut object_14 = object.key("ExpressionAttributeNames").start_object();
   43         -
        for (key_15, value_16) in var_13 {
   44         -
            {
   45         -
                object_14.key(key_15.as_str()).string(value_16.as_str());
   46         -
            }
   47         -
        }
   48         -
        object_14.finish();
   49         -
    }
   50         -
    Ok(())
   51         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index.rs

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_global_secondary_index(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::GlobalSecondaryIndex,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("IndexName").string(input.index_name.as_str());
    8         -
    }
    9         -
    {
   10         -
        let mut array_1 = object.key("KeySchema").start_array();
   11         -
        for item_2 in &input.key_schema {
   12         -
            {
   13         -
                #[allow(unused_mut)]
   14         -
                let mut object_3 = array_1.value().start_object();
   15         -
                crate::protocol_serde::shape_key_schema_element::ser_key_schema_element(&mut object_3, item_2)?;
   16         -
                object_3.finish();
   17         -
            }
   18         -
        }
   19         -
        array_1.finish();
   20         -
    }
   21         -
    {
   22         -
        #[allow(unused_mut)]
   23         -
        let mut object_4 = object.key("Projection").start_object();
   24         -
        crate::protocol_serde::shape_projection::ser_projection(&mut object_4, &input.projection)?;
   25         -
        object_4.finish();
   26         -
    }
   27         -
    if let Some(var_5) = &input.provisioned_throughput {
   28         -
        #[allow(unused_mut)]
   29         -
        let mut object_6 = object.key("ProvisionedThroughput").start_object();
   30         -
        crate::protocol_serde::shape_provisioned_throughput::ser_provisioned_throughput(&mut object_6, var_5)?;
   31         -
        object_6.finish();
   32         -
    }
   33         -
    Ok(())
   34         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index_auto_scaling_update.rs

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_global_secondary_index_auto_scaling_update(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::GlobalSecondaryIndexAutoScalingUpdate,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.index_name {
    7         -
        object.key("IndexName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.provisioned_write_capacity_auto_scaling_update {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("ProvisionedWriteCapacityAutoScalingUpdate").start_object();
   12         -
        crate::protocol_serde::shape_auto_scaling_settings_update::ser_auto_scaling_settings_update(&mut object_3, var_2)?;
   13         -
        object_3.finish();
   14         -
    }
   15         -
    Ok(())
   16         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index_description.rs

@@ -1,0 +84,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_global_secondary_index_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::GlobalSecondaryIndexDescription>, ::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::GlobalSecondaryIndexDescriptionBuilder::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         -
                        "IndexName" => {
   19         -
                            builder = builder.set_index_name(
   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         -
                        "KeySchema" => {
   26         -
                            builder = builder.set_key_schema(crate::protocol_serde::shape_key_schema::de_key_schema(tokens, _value)?);
   27         -
                        }
   28         -
                        "Projection" => {
   29         -
                            builder = builder.set_projection(crate::protocol_serde::shape_projection::de_projection(tokens, _value)?);
   30         -
                        }
   31         -
                        "IndexStatus" => {
   32         -
                            builder = builder.set_index_status(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref())))
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        "Backfilling" => {
   39         -
                            builder = builder.set_backfilling(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   40         -
                        }
   41         -
                        "ProvisionedThroughput" => {
   42         -
                            builder = builder.set_provisioned_throughput(
   43         -
                                crate::protocol_serde::shape_provisioned_throughput_description::de_provisioned_throughput_description(
   44         -
                                    tokens, _value,
   45         -
                                )?,
   46         -
                            );
   47         -
                        }
   48         -
                        "IndexSizeBytes" => {
   49         -
                            builder = builder.set_index_size_bytes(
   50         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   51         -
                                    .map(i64::try_from)
   52         -
                                    .transpose()?,
   53         -
                            );
   54         -
                        }
   55         -
                        "ItemCount" => {
   56         -
                            builder = builder.set_item_count(
   57         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   58         -
                                    .map(i64::try_from)
   59         -
                                    .transpose()?,
   60         -
                            );
   61         -
                        }
   62         -
                        "IndexArn" => {
   63         -
                            builder = builder.set_index_arn(
   64         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   65         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   66         -
                                    .transpose()?,
   67         -
                            );
   68         -
                        }
   69         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   70         -
                    },
   71         -
                    other => {
   72         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   73         -
                            "expected object key or end object, found: {other:?}"
   74         -
                        )))
   75         -
                    }
   76         -
                }
   77         -
            }
   78         -
            Ok(Some(builder.build()))
   79         -
        }
   80         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   81         -
            "expected start object or null",
   82         -
        )),
   83         -
    }
   84         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index_description_list.rs

@@ -1,0 +41,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_global_secondary_index_description_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<crate::types::GlobalSecondaryIndexDescription>>,
    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_global_secondary_index_description::de_global_secondary_index_description(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/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index_info.rs

@@ -1,0 +51,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_global_secondary_index_info<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::GlobalSecondaryIndexInfo>, ::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::GlobalSecondaryIndexInfoBuilder::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         -
                        "IndexName" => {
   19         -
                            builder = builder.set_index_name(
   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         -
                        "KeySchema" => {
   26         -
                            builder = builder.set_key_schema(crate::protocol_serde::shape_key_schema::de_key_schema(tokens, _value)?);
   27         -
                        }
   28         -
                        "Projection" => {
   29         -
                            builder = builder.set_projection(crate::protocol_serde::shape_projection::de_projection(tokens, _value)?);
   30         -
                        }
   31         -
                        "ProvisionedThroughput" => {
   32         -
                            builder = builder.set_provisioned_throughput(
   33         -
                                crate::protocol_serde::shape_provisioned_throughput::de_provisioned_throughput(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(builder.build()))
   46         -
        }
   47         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
            "expected start object or null",
   49         -
        )),
   50         -
    }
   51         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_global_secondary_index_update.rs

@@ -1,0 +25,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_global_secondary_index_update(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::GlobalSecondaryIndexUpdate,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.update {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("Update").start_object();
    9         -
        crate::protocol_serde::shape_update_global_secondary_index_action::ser_update_global_secondary_index_action(&mut object_2, var_1)?;
   10         -
        object_2.finish();
   11         -
    }
   12         -
    if let Some(var_3) = &input.create {
   13         -
        #[allow(unused_mut)]
   14         -
        let mut object_4 = object.key("Create").start_object();
   15         -
        crate::protocol_serde::shape_create_global_secondary_index_action::ser_create_global_secondary_index_action(&mut object_4, var_3)?;
   16         -
        object_4.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.delete {
   19         -
        #[allow(unused_mut)]
   20         -
        let mut object_6 = object.key("Delete").start_object();
   21         -
        crate::protocol_serde::shape_delete_global_secondary_index_action::ser_delete_global_secondary_index_action(&mut object_6, var_5)?;
   22         -
        object_6.finish();
   23         -
    }
   24         -
    Ok(())
   25         -
}