Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +165,250 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_batch_get_item_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::batch_get_item::BatchGetItemOutput, crate::operation::batch_get_item::BatchGetItemError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:122 */
   12     18   
    let error_code = match generic.code() {
   13     19   
        Some(code) => code,
   14     20   
        None => return Err(crate::operation::batch_get_item::BatchGetItemError::unhandled(generic)),
   15     21   
    };
   16     22   
   17     23   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          24  +
    /* ProtocolParserGenerator.kt:133 */
   18     25   
    Err(match error_code {
          26  +
        /* ProtocolParserGenerator.kt:139 */
   19     27   
        "InternalServerError" => crate::operation::batch_get_item::BatchGetItemError::InternalServerError({
          28  +
            /* RustType.kt:516 */
   20     29   
            #[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::batch_get_item::BatchGetItemError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
          30  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          31  +
                /* ProtocolParserGenerator.kt:146 */ {
          32  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          33  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
          34  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output).map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
          35  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          36  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          37  +
                /* ProtocolParserGenerator.kt:146 */}
          38  +
            /* ProtocolParserGenerator.kt:145 */;
          39  +
            /* ProtocolParserGenerator.kt:170 */
   29     40   
            if tmp.message.is_none() {
   30     41   
                tmp.message = _error_message;
   31     42   
            }
          43  +
            /* ProtocolParserGenerator.kt:179 */
   32     44   
            tmp
          45  +
            /* ProtocolParserGenerator.kt:139 */
   33     46   
        }),
          47  +
        /* ProtocolParserGenerator.kt:139 */
   34     48   
        "InvalidEndpointException" => crate::operation::batch_get_item::BatchGetItemError::InvalidEndpointError({
          49  +
            /* RustType.kt:516 */
   35     50   
            #[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::batch_get_item::BatchGetItemError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
          51  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          52  +
                /* ProtocolParserGenerator.kt:146 */ {
          53  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          54  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
          55  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output).map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
          56  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          57  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          58  +
                /* ProtocolParserGenerator.kt:146 */}
          59  +
            /* ProtocolParserGenerator.kt:145 */;
          60  +
            /* ProtocolParserGenerator.kt:170 */
   44     61   
            if tmp.message.is_none() {
   45     62   
                tmp.message = _error_message;
   46     63   
            }
          64  +
            /* ProtocolParserGenerator.kt:179 */
   47     65   
            tmp
          66  +
            /* ProtocolParserGenerator.kt:139 */
   48     67   
        }),
   49         -
        "ProvisionedThroughputExceededException" => {
   50         -
            crate::operation::batch_get_item::BatchGetItemError::ProvisionedThroughputExceededError({
   51         -
                #[allow(unused_mut)]
   52         -
                let mut tmp = {
          68  +
        /* ProtocolParserGenerator.kt:139 */
          69  +
        "ProvisionedThroughputExceededException" => crate::operation::batch_get_item::BatchGetItemError::ProvisionedThroughputExceededError({
          70  +
            /* RustType.kt:516 */
   53     71   
            #[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::batch_get_item::BatchGetItemError::unhandled)?;
   56         -
                    let output = output.meta(generic);
   57         -
                    output.build()
   58         -
                };
          72  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          73  +
                /* ProtocolParserGenerator.kt:146 */ {
          74  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          75  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
          76  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
          77  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          78  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          79  +
                /* ProtocolParserGenerator.kt:146 */}
          80  +
            /* ProtocolParserGenerator.kt:145 */;
          81  +
            /* ProtocolParserGenerator.kt:170 */
   59     82   
            if tmp.message.is_none() {
   60     83   
                tmp.message = _error_message;
   61     84   
            }
          85  +
            /* ProtocolParserGenerator.kt:179 */
   62     86   
            tmp
   63         -
            })
   64         -
        }
          87  +
            /* ProtocolParserGenerator.kt:139 */
          88  +
        }),
          89  +
        /* ProtocolParserGenerator.kt:139 */
   65     90   
        "RequestLimitExceeded" => crate::operation::batch_get_item::BatchGetItemError::RequestLimitExceeded({
          91  +
            /* RustType.kt:516 */
   66     92   
            #[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::batch_get_item::BatchGetItemError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
          93  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          94  +
                /* ProtocolParserGenerator.kt:146 */ {
          95  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          96  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
          97  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output).map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
          98  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          99  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         100  +
                /* ProtocolParserGenerator.kt:146 */}
         101  +
            /* ProtocolParserGenerator.kt:145 */;
         102  +
            /* ProtocolParserGenerator.kt:170 */
   75    103   
            if tmp.message.is_none() {
   76    104   
                tmp.message = _error_message;
   77    105   
            }
         106  +
            /* ProtocolParserGenerator.kt:179 */
   78    107   
            tmp
         108  +
            /* ProtocolParserGenerator.kt:139 */
   79    109   
        }),
         110  +
        /* ProtocolParserGenerator.kt:139 */
   80    111   
        "ResourceNotFoundException" => crate::operation::batch_get_item::BatchGetItemError::ResourceNotFoundError({
         112  +
            /* RustType.kt:516 */
   81    113   
            #[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::batch_get_item::BatchGetItemError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
         114  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         115  +
                /* ProtocolParserGenerator.kt:146 */ {
         116  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         117  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
         118  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
         119  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         120  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         121  +
                /* ProtocolParserGenerator.kt:146 */}
         122  +
            /* ProtocolParserGenerator.kt:145 */;
         123  +
            /* ProtocolParserGenerator.kt:170 */
   90    124   
            if tmp.message.is_none() {
   91    125   
                tmp.message = _error_message;
   92    126   
            }
         127  +
            /* ProtocolParserGenerator.kt:179 */
   93    128   
            tmp
         129  +
            /* ProtocolParserGenerator.kt:139 */
   94    130   
        }),
   95         -
        _ => crate::operation::batch_get_item::BatchGetItemError::generic(generic),
         131  +
        /* ProtocolParserGenerator.kt:182 */
         132  +
        _ => crate::operation::batch_get_item::BatchGetItemError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   96    133   
    })
         134  +
    /* ProtocolParserGenerator.kt:99 */
   97    135   
}
   98    136   
         137  +
/* RustType.kt:516 */
   99    138   
#[allow(clippy::unnecessary_wraps)]
         139  +
/* ProtocolParserGenerator.kt:71 */
  100    140   
pub fn de_batch_get_item_http_response(
  101    141   
    _response_status: u16,
  102    142   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103    143   
    _response_body: &[u8],
  104    144   
) -> std::result::Result<crate::operation::batch_get_item::BatchGetItemOutput, crate::operation::batch_get_item::BatchGetItemError> {
         145  +
    /* ProtocolParserGenerator.kt:77 */
  105    146   
    Ok({
         147  +
        /* RustType.kt:516 */
  106    148   
        #[allow(unused_mut)]
         149  +
        /* ProtocolParserGenerator.kt:240 */
  107    150   
        let mut output = crate::operation::batch_get_item::builders::BatchGetItemOutputBuilder::default();
         151  +
        /* ProtocolParserGenerator.kt:247 */
  108    152   
        output = crate::protocol_serde::shape_batch_get_item::de_batch_get_item(_response_body, output)
  109    153   
            .map_err(crate::operation::batch_get_item::BatchGetItemError::unhandled)?;
         154  +
        /* ClientBuilderInstantiator.kt:56 */
  110    155   
        output.build()
         156  +
        /* ProtocolParserGenerator.kt:77 */
  111    157   
    })
         158  +
    /* ProtocolParserGenerator.kt:71 */
  112    159   
}
  113    160   
         161  +
/* JsonSerializerGenerator.kt:287 */
  114    162   
pub fn ser_batch_get_item_input(
  115    163   
    input: &crate::operation::batch_get_item::BatchGetItemInput,
  116    164   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
         165  +
    /* JsonSerializerGenerator.kt:291 */
  117    166   
    let mut out = String::new();
         167  +
    /* JsonSerializerGenerator.kt:292 */
  118    168   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
         169  +
    /* JsonSerializerGenerator.kt:375 */
  119    170   
    crate::protocol_serde::shape_batch_get_item_input::ser_batch_get_item_input_input(&mut object, input)?;
         171  +
    /* JsonSerializerGenerator.kt:295 */
  120    172   
    object.finish();
         173  +
    /* JsonSerializerGenerator.kt:296 */
  121    174   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
         175  +
    /* JsonSerializerGenerator.kt:287 */
  122    176   
}
  123    177   
         178  +
/* JsonParserGenerator.kt:148 */
  124    179   
pub(crate) fn de_batch_get_item(
  125    180   
    value: &[u8],
  126    181   
    mut builder: crate::operation::batch_get_item::builders::BatchGetItemOutputBuilder,
  127    182   
) -> ::std::result::Result<
  128    183   
    crate::operation::batch_get_item::builders::BatchGetItemOutputBuilder,
  129    184   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  130    185   
> {
         186  +
    /* JsonParserGenerator.kt:153 */
  131    187   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  132    188   
    let tokens = &mut tokens_owned;
  133    189   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         190  +
    /* JsonParserGenerator.kt:684 */
  134    191   
    loop {
         192  +
        /* JsonParserGenerator.kt:685 */
  135    193   
        match tokens.next().transpose()? {
  136         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  137         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
         194  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         195  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         196  +
                /* JsonParserGenerator.kt:260 */
         197  +
                match key.to_unescaped()?.as_ref() {
         198  +
                    /* JsonParserGenerator.kt:262 */
  138    199   
                    "Responses" => {
  139         -
                    builder = builder.set_responses(crate::protocol_serde::shape_batch_get_response_map::de_batch_get_response_map(tokens)?);
         200  +
                        /* JsonParserGenerator.kt:265 */
         201  +
                        builder = builder.set_responses(
         202  +
                            /* JsonParserGenerator.kt:509 */
         203  +
                            crate::protocol_serde::shape_batch_get_response_map::de_batch_get_response_map(tokens)?, /* JsonParserGenerator.kt:265 */
         204  +
                        );
         205  +
                        /* JsonParserGenerator.kt:262 */
  140    206   
                    }
         207  +
                    /* JsonParserGenerator.kt:262 */
  141    208   
                    "UnprocessedKeys" => {
  142         -
                    builder = builder.set_unprocessed_keys(crate::protocol_serde::shape_batch_get_request_map::de_batch_get_request_map(tokens)?);
         209  +
                        /* JsonParserGenerator.kt:265 */
         210  +
                        builder = builder.set_unprocessed_keys(
         211  +
                            /* JsonParserGenerator.kt:509 */
         212  +
                            crate::protocol_serde::shape_batch_get_request_map::de_batch_get_request_map(tokens)?, /* JsonParserGenerator.kt:265 */
         213  +
                        );
         214  +
                        /* JsonParserGenerator.kt:262 */
  143    215   
                    }
         216  +
                    /* JsonParserGenerator.kt:262 */
  144    217   
                    "ConsumedCapacity" => {
  145         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity_multiple::de_consumed_capacity_multiple(
  146         -
                        tokens,
  147         -
                    )?);
         218  +
                        /* JsonParserGenerator.kt:265 */
         219  +
                        builder = builder.set_consumed_capacity(
         220  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_consumed_capacity_multiple::de_consumed_capacity_multiple(tokens)?
         221  +
                        /* JsonParserGenerator.kt:265 */);
         222  +
                        /* JsonParserGenerator.kt:262 */
  148    223   
                    }
  149         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  150         -
            },
         224  +
                    /* JsonParserGenerator.kt:290 */
         225  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         226  +
                }
         227  +
                /* JsonParserGenerator.kt:686 */
         228  +
            }
         229  +
            /* JsonParserGenerator.kt:695 */
  151    230   
            other => {
  152    231   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  153    232   
                    "expected object key or end object, found: {:?}",
  154    233   
                    other
  155    234   
                )))
         235  +
            } /* JsonParserGenerator.kt:685 */
  156    236   
        }
         237  +
        /* JsonParserGenerator.kt:684 */
  157    238   
    }
  158         -
    }
         239  +
    /* JsonParserGenerator.kt:250 */
  159    240   
    if tokens.next().is_some() {
         241  +
        /* JsonParserGenerator.kt:251 */
  160    242   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  161    243   
            "found more JSON tokens after completing parsing",
  162    244   
        ));
         245  +
        /* JsonParserGenerator.kt:250 */
  163    246   
    }
         247  +
    /* JsonParserGenerator.kt:163 */
  164    248   
    Ok(builder)
         249  +
    /* JsonParserGenerator.kt:148 */
  165    250   
}

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

@@ -1,1 +23,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_batch_get_item_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::batch_get_item::BatchGetItemInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.request_items {
           9  +
        /* JsonSerializerGenerator.kt:495 */
    7     10   
        #[allow(unused_mut)]
          11  +
        /* JsonSerializerGenerator.kt:496 */
    8     12   
        let mut object_2 = object.key("RequestItems").start_object();
          13  +
        /* JsonSerializerGenerator.kt:537 */
    9     14   
        for (key_3, value_4) in var_1 {
          15  +
            /* SerializerUtil.kt:42 */
   10     16   
            {
          17  +
                /* JsonSerializerGenerator.kt:495 */
   11     18   
                #[allow(unused_mut)]
          19  +
                /* JsonSerializerGenerator.kt:496 */
   12     20   
                let mut object_5 = object_2.key(key_3.as_str()).start_object();
          21  +
                /* JsonSerializerGenerator.kt:375 */
   13     22   
                crate::protocol_serde::shape_keys_and_attributes::ser_keys_and_attributes(&mut object_5, value_4)?;
          23  +
                /* JsonSerializerGenerator.kt:515 */
   14     24   
                object_5.finish();
          25  +
                /* SerializerUtil.kt:42 */
   15     26   
            }
          27  +
            /* JsonSerializerGenerator.kt:537 */
   16     28   
        }
          29  +
        /* JsonSerializerGenerator.kt:515 */
   17     30   
        object_2.finish();
          31  +
        /* JsonSerializerGenerator.kt:382 */
   18     32   
    }
          33  +
    /* JsonSerializerGenerator.kt:382 */
   19     34   
    if let Some(var_6) = &input.return_consumed_capacity {
          35  +
        /* JsonSerializerGenerator.kt:423 */
   20     36   
        object.key("ReturnConsumedCapacity").string(var_6.as_str());
          37  +
        /* JsonSerializerGenerator.kt:382 */
   21     38   
    }
          39  +
    /* JsonSerializerGenerator.kt:372 */
   22     40   
    Ok(())
          41  +
    /* JsonSerializerGenerator.kt:358 */
   23     42   
}

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

@@ -1,1 +39,64 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_batch_get_request_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, crate::types::KeysAndAttributes>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_keys_and_attributes::de_keys_and_attributes(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_keys_and_attributes::de_keys_and_attributes(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
          46  +
                    } /* JsonParserGenerator.kt:685 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   31     49   
            }
   32         -
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     58   
                "expected start object or null",
   37         -
        )),
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

@@ -1,1 +44,69 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_batch_get_response_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::collections::HashMap<
    7      8   
            ::std::string::String,
    8      9   
            ::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
    9     10   
        >,
   10     11   
    >,
   11     12   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   12     13   
>
   13     14   
where
   14     15   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
   17         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          19  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     20   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          21  +
            /* JsonParserGenerator.kt:469 */
   19     22   
            let mut map = ::std::collections::HashMap::new();
          23  +
            /* JsonParserGenerator.kt:684 */
   20     24   
            loop {
          25  +
                /* JsonParserGenerator.kt:685 */
   21     26   
                match tokens.next().transpose()? {
   22         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          27  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     28   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = crate::protocol_serde::shape_item_list::de_item_list(tokens)?;
          29  +
                        /* JsonParserGenerator.kt:471 */
          30  +
                        let key =
          31  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          32  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          33  +
                            /* JsonParserGenerator.kt:339 */)
          34  +
                        /* JsonParserGenerator.kt:471 */?;
          35  +
                        /* JsonParserGenerator.kt:474 */
          36  +
                        let value =
          37  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_item_list::de_item_list(tokens)?
          38  +
                        /* JsonParserGenerator.kt:474 */;
          39  +
                        /* JsonParserGenerator.kt:491 */
   26     40   
                        if let Some(value) = value {
   27     41   
                            map.insert(key, value);
   28     42   
                        }
          43  +
                        /* JsonParserGenerator.kt:686 */
   29     44   
                    }
          45  +
                    /* JsonParserGenerator.kt:695 */
   30     46   
                    other => {
   31     47   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   32     48   
                            "expected object key or end object, found: {:?}",
   33     49   
                            other
   34     50   
                        )))
          51  +
                    } /* JsonParserGenerator.kt:685 */
   35     52   
                }
          53  +
                /* JsonParserGenerator.kt:684 */
   36     54   
            }
   37         -
            }
          55  +
            /* JsonParserGenerator.kt:504 */
   38     56   
            Ok(Some(map))
          57  +
            /* JsonParserGenerator.kt:713 */
   39     58   
        }
   40         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
        /* JsonParserGenerator.kt:722 */
          60  +
        _ => {
          61  +
            /* JsonParserGenerator.kt:723 */
          62  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     63   
                "expected start object or null",
   42         -
        )),
          64  +
            ))
          65  +
            /* JsonParserGenerator.kt:722 */
          66  +
        } /* JsonParserGenerator.kt:712 */
   43     67   
    }
          68  +
    /* JsonParserGenerator.kt:460 */
   44     69   
}

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

@@ -1,1 +47,82 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_batch_statement_error<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::BatchStatementError>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::BatchStatementErrorBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                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() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "Code" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_code(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::BatchStatementErrorCodeEnum::from(u.as_ref())))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:345 */crate::types::BatchStatementErrorCodeEnum::from(u.as_ref())
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
   24     40   
                            "Message" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
   25     42   
                                builder = builder.set_message(
          43  +
                                    /* JsonParserGenerator.kt:354 */
   26     44   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
          45  +
                                        .map(|s|
          46  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          47  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          48  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          49  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   29     50   
                                );
          51  +
                                /* JsonParserGenerator.kt:262 */
   30     52   
                            }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
          53  +
                            /* JsonParserGenerator.kt:290 */
          54  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          55  +
                        }
          56  +
                        /* JsonParserGenerator.kt:686 */
          57  +
                    }
          58  +
                    /* JsonParserGenerator.kt:695 */
   33     59   
                    other => {
   34     60   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35     61   
                            "expected object key or end object, found: {:?}",
   36     62   
                            other
   37     63   
                        )))
          64  +
                    } /* JsonParserGenerator.kt:685 */
   38     65   
                }
          66  +
                /* JsonParserGenerator.kt:684 */
   39     67   
            }
   40         -
            }
          68  +
            /* JsonParserGenerator.kt:540 */
   41     69   
            Ok(Some(builder.build()))
          70  +
            /* JsonParserGenerator.kt:713 */
   42     71   
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          72  +
        /* JsonParserGenerator.kt:722 */
          73  +
        _ => {
          74  +
            /* JsonParserGenerator.kt:723 */
          75  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44     76   
                "expected start object or null",
   45         -
        )),
          77  +
            ))
          78  +
            /* JsonParserGenerator.kt:722 */
          79  +
        } /* JsonParserGenerator.kt:712 */
   46     80   
    }
          81  +
    /* JsonParserGenerator.kt:516 */
   47     82   
}

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

@@ -1,1 +25,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_batch_statement_request(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::types::BatchStatementRequest,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:42 */
    6      8   
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("Statement").string(input.statement.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_1) = &input.parameters {
          15  +
        /* JsonSerializerGenerator.kt:484 */
   10     16   
        let mut array_2 = object.key("Parameters").start_array();
          17  +
        /* JsonSerializerGenerator.kt:524 */
   11     18   
        for item_3 in var_1 {
          19  +
            /* SerializerUtil.kt:42 */
   12     20   
            {
          21  +
                /* JsonSerializerGenerator.kt:495 */
   13     22   
                #[allow(unused_mut)]
          23  +
                /* JsonSerializerGenerator.kt:496 */
   14     24   
                let mut object_4 = array_2.value().start_object();
          25  +
                /* JsonSerializerGenerator.kt:579 */
   15     26   
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_4, item_3)?;
          27  +
                /* JsonSerializerGenerator.kt:515 */
   16     28   
                object_4.finish();
          29  +
                /* SerializerUtil.kt:42 */
   17     30   
            }
          31  +
            /* JsonSerializerGenerator.kt:524 */
   18     32   
        }
          33  +
        /* JsonSerializerGenerator.kt:486 */
   19     34   
        array_2.finish();
          35  +
        /* JsonSerializerGenerator.kt:382 */
   20     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:382 */
   21     38   
    if let Some(var_5) = &input.consistent_read {
          39  +
        /* JsonSerializerGenerator.kt:424 */
   22     40   
        object.key("ConsistentRead").boolean(*var_5);
          41  +
        /* JsonSerializerGenerator.kt:382 */
   23     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:372 */
   24     44   
    Ok(())
          45  +
    /* JsonSerializerGenerator.kt:358 */
   25     46   
}

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

@@ -1,1 +46,85 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_batch_statement_response<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::BatchStatementResponse>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::BatchStatementResponseBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                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() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "Error" => {
   18         -
                            builder = builder.set_error(crate::protocol_serde::shape_batch_statement_error::de_batch_statement_error(tokens)?);
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_error(
          29  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_batch_statement_error::de_batch_statement_error(tokens)?
          30  +
                                /* JsonParserGenerator.kt:265 */);
          31  +
                                /* JsonParserGenerator.kt:262 */
   19     32   
                            }
          33  +
                            /* JsonParserGenerator.kt:262 */
   20     34   
                            "TableName" => {
          35  +
                                /* JsonParserGenerator.kt:265 */
   21     36   
                                builder = builder.set_table_name(
          37  +
                                    /* JsonParserGenerator.kt:354 */
   22     38   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   24         -
                                    .transpose()?,
          39  +
                                        .map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          43  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   25     44   
                                );
          45  +
                                /* JsonParserGenerator.kt:262 */
   26     46   
                            }
          47  +
                            /* JsonParserGenerator.kt:262 */
   27     48   
                            "Item" => {
   28         -
                            builder = builder.set_item(crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens)?);
          49  +
                                /* JsonParserGenerator.kt:265 */
          50  +
                                builder = builder.set_item(
          51  +
                                    /* JsonParserGenerator.kt:509 */
          52  +
                                    crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens)?, /* JsonParserGenerator.kt:265 */
          53  +
                                );
          54  +
                                /* JsonParserGenerator.kt:262 */
          55  +
                            }
          56  +
                            /* JsonParserGenerator.kt:290 */
          57  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   29     58   
                        }
   30         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   31         -
                    },
          59  +
                        /* JsonParserGenerator.kt:686 */
          60  +
                    }
          61  +
                    /* JsonParserGenerator.kt:695 */
   32     62   
                    other => {
   33     63   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   34     64   
                            "expected object key or end object, found: {:?}",
   35     65   
                            other
   36     66   
                        )))
          67  +
                    } /* JsonParserGenerator.kt:685 */
   37     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   38     70   
            }
   39         -
            }
          71  +
            /* JsonParserGenerator.kt:540 */
   40     72   
            Ok(Some(builder.build()))
          73  +
            /* JsonParserGenerator.kt:713 */
   41     74   
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43     79   
                "expected start object or null",
   44         -
        )),
          80  +
            ))
          81  +
            /* JsonParserGenerator.kt:722 */
          82  +
        } /* JsonParserGenerator.kt:712 */
   45     83   
    }
          84  +
    /* JsonParserGenerator.kt:516 */
   46     85   
}

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

@@ -1,1 +184,271 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_batch_write_item_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::batch_write_item::BatchWriteItemOutput, crate::operation::batch_write_item::BatchWriteItemError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:122 */
   12     18   
    let error_code = match generic.code() {
   13     19   
        Some(code) => code,
   14     20   
        None => return Err(crate::operation::batch_write_item::BatchWriteItemError::unhandled(generic)),
   15     21   
    };
   16     22   
   17     23   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          24  +
    /* ProtocolParserGenerator.kt:133 */
   18     25   
    Err(match error_code {
          26  +
        /* ProtocolParserGenerator.kt:139 */
   19     27   
        "InternalServerError" => crate::operation::batch_write_item::BatchWriteItemError::InternalServerError({
          28  +
            /* RustType.kt:516 */
   20     29   
            #[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::batch_write_item::BatchWriteItemError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
          30  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          31  +
                /* ProtocolParserGenerator.kt:146 */ {
          32  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          33  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
          34  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
          35  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          36  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          37  +
                /* ProtocolParserGenerator.kt:146 */}
          38  +
            /* ProtocolParserGenerator.kt:145 */;
          39  +
            /* ProtocolParserGenerator.kt:170 */
   29     40   
            if tmp.message.is_none() {
   30     41   
                tmp.message = _error_message;
   31     42   
            }
          43  +
            /* ProtocolParserGenerator.kt:179 */
   32     44   
            tmp
          45  +
            /* ProtocolParserGenerator.kt:139 */
   33     46   
        }),
          47  +
        /* ProtocolParserGenerator.kt:139 */
   34     48   
        "InvalidEndpointException" => crate::operation::batch_write_item::BatchWriteItemError::InvalidEndpointError({
          49  +
            /* RustType.kt:516 */
   35     50   
            #[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::batch_write_item::BatchWriteItemError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
          51  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          52  +
                /* ProtocolParserGenerator.kt:146 */ {
          53  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          54  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
          55  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
          56  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          57  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          58  +
                /* ProtocolParserGenerator.kt:146 */}
          59  +
            /* ProtocolParserGenerator.kt:145 */;
          60  +
            /* ProtocolParserGenerator.kt:170 */
   44     61   
            if tmp.message.is_none() {
   45     62   
                tmp.message = _error_message;
   46     63   
            }
          64  +
            /* ProtocolParserGenerator.kt:179 */
   47     65   
            tmp
          66  +
            /* ProtocolParserGenerator.kt:139 */
   48     67   
        }),
          68  +
        /* ProtocolParserGenerator.kt:139 */
   49     69   
        "ItemCollectionSizeLimitExceededException" => {
   50     70   
            crate::operation::batch_write_item::BatchWriteItemError::ItemCollectionSizeLimitExceededError({
          71  +
                /* RustType.kt:516 */
   51     72   
                #[allow(unused_mut)]
   52         -
                let mut tmp = {
   53         -
                    #[allow(unused_mut)]
   54         -
                    let mut output = crate::types::error::builders::ItemCollectionSizeLimitExceededErrorBuilder::default();
   55         -
                    output = crate::protocol_serde::shape_item_collection_size_limit_exceeded_exception::de_item_collection_size_limit_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
   56         -
                    let output = output.meta(generic);
   57         -
                    output.build()
   58         -
                };
          73  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          74  +
                /* ProtocolParserGenerator.kt:146 */ {
          75  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          76  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ItemCollectionSizeLimitExceededErrorBuilder::default();
          77  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_item_collection_size_limit_exceeded_exception::de_item_collection_size_limit_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
          78  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          79  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          80  +
                /* ProtocolParserGenerator.kt:146 */}
          81  +
            /* ProtocolParserGenerator.kt:145 */;
          82  +
                /* ProtocolParserGenerator.kt:170 */
   59     83   
                if tmp.message.is_none() {
   60     84   
                    tmp.message = _error_message;
   61     85   
                }
          86  +
                /* ProtocolParserGenerator.kt:179 */
   62     87   
                tmp
          88  +
                /* ProtocolParserGenerator.kt:139 */
   63     89   
            })
   64     90   
        }
   65         -
        "ProvisionedThroughputExceededException" => {
   66         -
            crate::operation::batch_write_item::BatchWriteItemError::ProvisionedThroughputExceededError({
          91  +
        /* ProtocolParserGenerator.kt:139 */
          92  +
        "ProvisionedThroughputExceededException" => crate::operation::batch_write_item::BatchWriteItemError::ProvisionedThroughputExceededError({
          93  +
            /* RustType.kt:516 */
   67     94   
            #[allow(unused_mut)]
   68         -
                let mut tmp = {
   69         -
                    #[allow(unused_mut)]
   70         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   71         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
   72         -
                    let output = output.meta(generic);
   73         -
                    output.build()
   74         -
                };
          95  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          96  +
                /* ProtocolParserGenerator.kt:146 */ {
          97  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          98  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
          99  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
         100  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         101  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         102  +
                /* ProtocolParserGenerator.kt:146 */}
         103  +
            /* ProtocolParserGenerator.kt:145 */;
         104  +
            /* ProtocolParserGenerator.kt:170 */
   75    105   
            if tmp.message.is_none() {
   76    106   
                tmp.message = _error_message;
   77    107   
            }
         108  +
            /* ProtocolParserGenerator.kt:179 */
   78    109   
            tmp
   79         -
            })
   80         -
        }
         110  +
            /* ProtocolParserGenerator.kt:139 */
         111  +
        }),
         112  +
        /* ProtocolParserGenerator.kt:139 */
   81    113   
        "RequestLimitExceeded" => crate::operation::batch_write_item::BatchWriteItemError::RequestLimitExceeded({
         114  +
            /* RustType.kt:516 */
   82    115   
            #[allow(unused_mut)]
   83         -
            let mut tmp = {
   84         -
                #[allow(unused_mut)]
   85         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
   86         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
   87         -
                    .map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
   88         -
                let output = output.meta(generic);
   89         -
                output.build()
   90         -
            };
         116  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         117  +
                /* ProtocolParserGenerator.kt:146 */ {
         118  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         119  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
         120  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
         121  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         122  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         123  +
                /* ProtocolParserGenerator.kt:146 */}
         124  +
            /* ProtocolParserGenerator.kt:145 */;
         125  +
            /* ProtocolParserGenerator.kt:170 */
   91    126   
            if tmp.message.is_none() {
   92    127   
                tmp.message = _error_message;
   93    128   
            }
         129  +
            /* ProtocolParserGenerator.kt:179 */
   94    130   
            tmp
         131  +
            /* ProtocolParserGenerator.kt:139 */
   95    132   
        }),
         133  +
        /* ProtocolParserGenerator.kt:139 */
   96    134   
        "ResourceNotFoundException" => crate::operation::batch_write_item::BatchWriteItemError::ResourceNotFoundError({
         135  +
            /* RustType.kt:516 */
   97    136   
            #[allow(unused_mut)]
   98         -
            let mut tmp = {
   99         -
                #[allow(unused_mut)]
  100         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
  101         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
  102         -
                    .map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
  103         -
                let output = output.meta(generic);
  104         -
                output.build()
  105         -
            };
         137  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         138  +
                /* ProtocolParserGenerator.kt:146 */ {
         139  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
         141  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
         142  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         143  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         144  +
                /* ProtocolParserGenerator.kt:146 */}
         145  +
            /* ProtocolParserGenerator.kt:145 */;
         146  +
            /* ProtocolParserGenerator.kt:170 */
  106    147   
            if tmp.message.is_none() {
  107    148   
                tmp.message = _error_message;
  108    149   
            }
         150  +
            /* ProtocolParserGenerator.kt:179 */
  109    151   
            tmp
         152  +
            /* ProtocolParserGenerator.kt:139 */
  110    153   
        }),
  111         -
        _ => crate::operation::batch_write_item::BatchWriteItemError::generic(generic),
         154  +
        /* ProtocolParserGenerator.kt:182 */
         155  +
        _ => crate::operation::batch_write_item::BatchWriteItemError::generic(generic), /* ProtocolParserGenerator.kt:133 */
  112    156   
    })
         157  +
    /* ProtocolParserGenerator.kt:99 */
  113    158   
}
  114    159   
         160  +
/* RustType.kt:516 */
  115    161   
#[allow(clippy::unnecessary_wraps)]
         162  +
/* ProtocolParserGenerator.kt:71 */
  116    163   
pub fn de_batch_write_item_http_response(
  117    164   
    _response_status: u16,
  118    165   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  119    166   
    _response_body: &[u8],
  120    167   
) -> std::result::Result<crate::operation::batch_write_item::BatchWriteItemOutput, crate::operation::batch_write_item::BatchWriteItemError> {
         168  +
    /* ProtocolParserGenerator.kt:77 */
  121    169   
    Ok({
         170  +
        /* RustType.kt:516 */
  122    171   
        #[allow(unused_mut)]
         172  +
        /* ProtocolParserGenerator.kt:240 */
  123    173   
        let mut output = crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder::default();
         174  +
        /* ProtocolParserGenerator.kt:247 */
  124    175   
        output = crate::protocol_serde::shape_batch_write_item::de_batch_write_item(_response_body, output)
  125    176   
            .map_err(crate::operation::batch_write_item::BatchWriteItemError::unhandled)?;
         177  +
        /* ClientBuilderInstantiator.kt:56 */
  126    178   
        output.build()
         179  +
        /* ProtocolParserGenerator.kt:77 */
  127    180   
    })
         181  +
    /* ProtocolParserGenerator.kt:71 */
  128    182   
}
  129    183   
         184  +
/* JsonSerializerGenerator.kt:287 */
  130    185   
pub fn ser_batch_write_item_input(
  131    186   
    input: &crate::operation::batch_write_item::BatchWriteItemInput,
  132    187   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
         188  +
    /* JsonSerializerGenerator.kt:291 */
  133    189   
    let mut out = String::new();
         190  +
    /* JsonSerializerGenerator.kt:292 */
  134    191   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
         192  +
    /* JsonSerializerGenerator.kt:375 */
  135    193   
    crate::protocol_serde::shape_batch_write_item_input::ser_batch_write_item_input_input(&mut object, input)?;
         194  +
    /* JsonSerializerGenerator.kt:295 */
  136    195   
    object.finish();
         196  +
    /* JsonSerializerGenerator.kt:296 */
  137    197   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
         198  +
    /* JsonSerializerGenerator.kt:287 */
  138    199   
}
  139    200   
         201  +
/* JsonParserGenerator.kt:148 */
  140    202   
pub(crate) fn de_batch_write_item(
  141    203   
    value: &[u8],
  142    204   
    mut builder: crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder,
  143    205   
) -> ::std::result::Result<
  144    206   
    crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder,
  145    207   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  146    208   
> {
         209  +
    /* JsonParserGenerator.kt:153 */
  147    210   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  148    211   
    let tokens = &mut tokens_owned;
  149    212   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         213  +
    /* JsonParserGenerator.kt:684 */
  150    214   
    loop {
         215  +
        /* JsonParserGenerator.kt:685 */
  151    216   
        match tokens.next().transpose()? {
  152         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  153         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
         217  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         218  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         219  +
                /* JsonParserGenerator.kt:260 */
         220  +
                match key.to_unescaped()?.as_ref() {
         221  +
                    /* JsonParserGenerator.kt:262 */
  154    222   
                    "UnprocessedItems" => {
  155         -
                    builder = builder
  156         -
                        .set_unprocessed_items(crate::protocol_serde::shape_batch_write_item_request_map::de_batch_write_item_request_map(tokens)?);
         223  +
                        /* JsonParserGenerator.kt:265 */
         224  +
                        builder = builder.set_unprocessed_items(
         225  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_batch_write_item_request_map::de_batch_write_item_request_map(tokens)?
         226  +
                        /* JsonParserGenerator.kt:265 */);
         227  +
                        /* JsonParserGenerator.kt:262 */
  157    228   
                    }
         229  +
                    /* JsonParserGenerator.kt:262 */
  158    230   
                    "ItemCollectionMetrics" => {
         231  +
                        /* JsonParserGenerator.kt:265 */
  159    232   
                        builder = builder.set_item_collection_metrics(
  160         -
                        crate::protocol_serde::shape_item_collection_metrics_per_table::de_item_collection_metrics_per_table(tokens)?,
  161         -
                    );
         233  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_item_collection_metrics_per_table::de_item_collection_metrics_per_table(tokens)?
         234  +
                        /* JsonParserGenerator.kt:265 */);
         235  +
                        /* JsonParserGenerator.kt:262 */
  162    236   
                    }
         237  +
                    /* JsonParserGenerator.kt:262 */
  163    238   
                    "ConsumedCapacity" => {
  164         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity_multiple::de_consumed_capacity_multiple(
  165         -
                        tokens,
  166         -
                    )?);
         239  +
                        /* JsonParserGenerator.kt:265 */
         240  +
                        builder = builder.set_consumed_capacity(
         241  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_consumed_capacity_multiple::de_consumed_capacity_multiple(tokens)?
         242  +
                        /* JsonParserGenerator.kt:265 */);
         243  +
                        /* JsonParserGenerator.kt:262 */
  167    244   
                    }
  168         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  169         -
            },
         245  +
                    /* JsonParserGenerator.kt:290 */
         246  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         247  +
                }
         248  +
                /* JsonParserGenerator.kt:686 */
         249  +
            }
         250  +
            /* JsonParserGenerator.kt:695 */
  170    251   
            other => {
  171    252   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  172    253   
                    "expected object key or end object, found: {:?}",
  173    254   
                    other
  174    255   
                )))
         256  +
            } /* JsonParserGenerator.kt:685 */
  175    257   
        }
         258  +
        /* JsonParserGenerator.kt:684 */
  176    259   
    }
  177         -
    }
         260  +
    /* JsonParserGenerator.kt:250 */
  178    261   
    if tokens.next().is_some() {
         262  +
        /* JsonParserGenerator.kt:251 */
  179    263   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  180    264   
            "found more JSON tokens after completing parsing",
  181    265   
        ));
         266  +
        /* JsonParserGenerator.kt:250 */
  182    267   
    }
         268  +
    /* JsonParserGenerator.kt:163 */
  183    269   
    Ok(builder)
         270  +
    /* JsonParserGenerator.kt:148 */
  184    271   
}

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

@@ -1,1 +32,60 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_batch_write_item_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::batch_write_item::BatchWriteItemInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.request_items {
           9  +
        /* JsonSerializerGenerator.kt:495 */
    7     10   
        #[allow(unused_mut)]
          11  +
        /* JsonSerializerGenerator.kt:496 */
    8     12   
        let mut object_2 = object.key("RequestItems").start_object();
          13  +
        /* JsonSerializerGenerator.kt:537 */
    9     14   
        for (key_3, value_4) in var_1 {
          15  +
            /* SerializerUtil.kt:42 */
   10     16   
            {
          17  +
                /* JsonSerializerGenerator.kt:484 */
   11     18   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          19  +
                /* JsonSerializerGenerator.kt:524 */
   12     20   
                for item_6 in value_4 {
          21  +
                    /* SerializerUtil.kt:42 */
   13     22   
                    {
          23  +
                        /* JsonSerializerGenerator.kt:495 */
   14     24   
                        #[allow(unused_mut)]
          25  +
                        /* JsonSerializerGenerator.kt:496 */
   15     26   
                        let mut object_7 = array_5.value().start_object();
          27  +
                        /* JsonSerializerGenerator.kt:375 */
   16     28   
                        crate::protocol_serde::shape_write_request::ser_write_request(&mut object_7, item_6)?;
          29  +
                        /* JsonSerializerGenerator.kt:515 */
   17     30   
                        object_7.finish();
          31  +
                        /* SerializerUtil.kt:42 */
   18     32   
                    }
          33  +
                    /* JsonSerializerGenerator.kt:524 */
   19     34   
                }
          35  +
                /* JsonSerializerGenerator.kt:486 */
   20     36   
                array_5.finish();
          37  +
                /* SerializerUtil.kt:42 */
   21     38   
            }
          39  +
            /* JsonSerializerGenerator.kt:537 */
   22     40   
        }
          41  +
        /* JsonSerializerGenerator.kt:515 */
   23     42   
        object_2.finish();
          43  +
        /* JsonSerializerGenerator.kt:382 */
   24     44   
    }
          45  +
    /* JsonSerializerGenerator.kt:382 */
   25     46   
    if let Some(var_8) = &input.return_consumed_capacity {
          47  +
        /* JsonSerializerGenerator.kt:423 */
   26     48   
        object.key("ReturnConsumedCapacity").string(var_8.as_str());
          49  +
        /* JsonSerializerGenerator.kt:382 */
   27     50   
    }
          51  +
    /* JsonSerializerGenerator.kt:382 */
   28     52   
    if let Some(var_9) = &input.return_item_collection_metrics {
          53  +
        /* JsonSerializerGenerator.kt:423 */
   29     54   
        object.key("ReturnItemCollectionMetrics").string(var_9.as_str());
          55  +
        /* JsonSerializerGenerator.kt:382 */
   30     56   
    }
          57  +
    /* JsonSerializerGenerator.kt:372 */
   31     58   
    Ok(())
          59  +
    /* JsonSerializerGenerator.kt:358 */
   32     60   
}

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

@@ -1,1 +39,64 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_batch_write_item_request_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::WriteRequest>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_write_requests::de_write_requests(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_write_requests::de_write_requests(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
          46  +
                    } /* JsonParserGenerator.kt:685 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   31     49   
            }
   32         -
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     58   
                "expected start object or null",
   37         -
        )),
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

@@ -1,1 +48,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_billing_mode_summary<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::BillingModeSummary>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::BillingModeSummaryBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                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() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "BillingMode" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_billing_mode(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::BillingMode::from(u.as_ref())))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:345 */crate::types::BillingMode::from(u.as_ref())
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
   24     40   
                            "LastUpdateToPayPerRequestDateTime" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
   25     42   
                                builder = builder.set_last_update_to_pay_per_request_date_time(
          43  +
                                    /* JsonParserGenerator.kt:384 */
   26     44   
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   27     45   
                                        tokens.next(),
   28     46   
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   29         -
                                )?,
          47  +
                                    )?, /* JsonParserGenerator.kt:265 */
   30     48   
                                );
          49  +
                                /* JsonParserGenerator.kt:262 */
   31     50   
                            }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
          51  +
                            /* JsonParserGenerator.kt:290 */
          52  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          53  +
                        }
          54  +
                        /* JsonParserGenerator.kt:686 */
          55  +
                    }
          56  +
                    /* JsonParserGenerator.kt:695 */
   34     57   
                    other => {
   35     58   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36     59   
                            "expected object key or end object, found: {:?}",
   37     60   
                            other
   38     61   
                        )))
          62  +
                    } /* JsonParserGenerator.kt:685 */
   39     63   
                }
          64  +
                /* JsonParserGenerator.kt:684 */
   40     65   
            }
   41         -
            }
          66  +
            /* JsonParserGenerator.kt:540 */
   42     67   
            Ok(Some(builder.build()))
          68  +
            /* JsonParserGenerator.kt:713 */
   43     69   
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          70  +
        /* JsonParserGenerator.kt:722 */
          71  +
        _ => {
          72  +
            /* JsonParserGenerator.kt:723 */
          73  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45     74   
                "expected start object or null",
   46         -
        )),
          75  +
            ))
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   47     78   
    }
          79  +
    /* JsonParserGenerator.kt:516 */
   48     80   
}

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_binary_set_attribute_value<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<::aws_smithy_types::Blob>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   23     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   24     40   
            }
   25         -
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29     49   
                "expected start array or null",
   30         -
        )),
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +50,91 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_cancellation_reason<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::CancellationReason>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::CancellationReasonBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                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() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "Item" => {
   18         -
                            builder = builder.set_item(crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens)?);
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_item(
          29  +
                                    /* JsonParserGenerator.kt:509 */
          30  +
                                    crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens)?, /* JsonParserGenerator.kt:265 */
          31  +
                                );
          32  +
                                /* JsonParserGenerator.kt:262 */
   19     33   
                            }
          34  +
                            /* JsonParserGenerator.kt:262 */
   20     35   
                            "Code" => {
          36  +
                                /* JsonParserGenerator.kt:265 */
   21     37   
                                builder = builder.set_code(
          38  +
                                    /* JsonParserGenerator.kt:354 */
   22     39   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   24         -
                                    .transpose()?,
          40  +
                                        .map(|s|
          41  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          42  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          43  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          44  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   25     45   
                                );
          46  +
                                /* JsonParserGenerator.kt:262 */
   26     47   
                            }
          48  +
                            /* JsonParserGenerator.kt:262 */
   27     49   
                            "Message" => {
          50  +
                                /* JsonParserGenerator.kt:265 */
   28     51   
                                builder = builder.set_message(
          52  +
                                    /* JsonParserGenerator.kt:354 */
   29     53   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   30         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                                    .transpose()?,
          54  +
                                        .map(|s|
          55  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          56  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          57  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          58  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   32     59   
                                );
          60  +
                                /* JsonParserGenerator.kt:262 */
          61  +
                            }
          62  +
                            /* JsonParserGenerator.kt:290 */
          63  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   33     64   
                        }
   34         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   35         -
                    },
          65  +
                        /* JsonParserGenerator.kt:686 */
          66  +
                    }
          67  +
                    /* JsonParserGenerator.kt:695 */
   36     68   
                    other => {
   37     69   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38     70   
                            "expected object key or end object, found: {:?}",
   39     71   
                            other
   40     72   
                        )))
          73  +
                    } /* JsonParserGenerator.kt:685 */
   41     74   
                }
          75  +
                /* JsonParserGenerator.kt:684 */
   42     76   
            }
   43         -
            }
          77  +
            /* JsonParserGenerator.kt:540 */
   44     78   
            Ok(Some(builder.build()))
          79  +
            /* JsonParserGenerator.kt:713 */
   45     80   
        }
   46         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          81  +
        /* JsonParserGenerator.kt:722 */
          82  +
        _ => {
          83  +
            /* JsonParserGenerator.kt:723 */
          84  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47     85   
                "expected start object or null",
   48         -
        )),
          86  +
            ))
          87  +
            /* JsonParserGenerator.kt:722 */
          88  +
        } /* JsonParserGenerator.kt:712 */
   49     89   
    }
          90  +
    /* JsonParserGenerator.kt:516 */
   50     91   
}

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_cancellation_reason_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::CancellationReason>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_cancellation_reason::de_cancellation_reason(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_cancellation_reason::de_cancellation_reason(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   23     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   24     40   
            }
   25         -
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29     49   
                "expected start array or null",
   30         -
        )),
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +48,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_capacity<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::Capacity>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::CapacityBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                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() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "ReadCapacityUnits" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_read_capacity_units(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()),
   20         -
                            );
          29  +
                                    /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
          30  +
                                /* JsonParserGenerator.kt:265 */);
          31  +
                                /* JsonParserGenerator.kt:262 */
   21     32   
                            }
          33  +
                            /* JsonParserGenerator.kt:262 */
   22     34   
                            "WriteCapacityUnits" => {
          35  +
                                /* JsonParserGenerator.kt:265 */
   23     36   
                                builder = builder.set_write_capacity_units(
   24         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()),
   25         -
                            );
          37  +
                                    /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
          38  +
                                /* JsonParserGenerator.kt:265 */);
          39  +
                                /* JsonParserGenerator.kt:262 */
   26     40   
                            }
          41  +
                            /* JsonParserGenerator.kt:262 */
   27     42   
                            "CapacityUnits" => {
          43  +
                                /* JsonParserGenerator.kt:265 */
   28     44   
                                builder = builder.set_capacity_units(
   29         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()),
   30         -
                            );
          45  +
                                    /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
          46  +
                                /* JsonParserGenerator.kt:265 */);
          47  +
                                /* JsonParserGenerator.kt:262 */
   31     48   
                            }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
          49  +
                            /* JsonParserGenerator.kt:290 */
          50  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          51  +
                        }
          52  +
                        /* JsonParserGenerator.kt:686 */
          53  +
                    }
          54  +
                    /* JsonParserGenerator.kt:695 */
   34     55   
                    other => {
   35     56   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36     57   
                            "expected object key or end object, found: {:?}",
   37     58   
                            other
   38     59   
                        )))
          60  +
                    } /* JsonParserGenerator.kt:685 */
   39     61   
                }
          62  +
                /* JsonParserGenerator.kt:684 */
   40     63   
            }
   41         -
            }
          64  +
            /* JsonParserGenerator.kt:540 */
   42     65   
            Ok(Some(builder.build()))
          66  +
            /* JsonParserGenerator.kt:713 */
   43     67   
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45     72   
                "expected start object or null",
   46         -
        )),
          73  +
            ))
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   47     76   
    }
          77  +
    /* JsonParserGenerator.kt:516 */
   48     78   
}

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

@@ -1,1 +22,40 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_condition(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::types::Condition,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.attribute_value_list {
           9  +
        /* JsonSerializerGenerator.kt:484 */
    7     10   
        let mut array_2 = object.key("AttributeValueList").start_array();
          11  +
        /* JsonSerializerGenerator.kt:524 */
    8     12   
        for item_3 in var_1 {
          13  +
            /* SerializerUtil.kt:42 */
    9     14   
            {
          15  +
                /* JsonSerializerGenerator.kt:495 */
   10     16   
                #[allow(unused_mut)]
          17  +
                /* JsonSerializerGenerator.kt:496 */
   11     18   
                let mut object_4 = array_2.value().start_object();
          19  +
                /* JsonSerializerGenerator.kt:579 */
   12     20   
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_4, item_3)?;
          21  +
                /* JsonSerializerGenerator.kt:515 */
   13     22   
                object_4.finish();
          23  +
                /* SerializerUtil.kt:42 */
   14     24   
            }
          25  +
            /* JsonSerializerGenerator.kt:524 */
   15     26   
        }
          27  +
        /* JsonSerializerGenerator.kt:486 */
   16     28   
        array_2.finish();
          29  +
        /* JsonSerializerGenerator.kt:382 */
   17     30   
    }
          31  +
    /* SerializerUtil.kt:42 */
   18     32   
    {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   19     34   
        object.key("ComparisonOperator").string(input.comparison_operator.as_str());
          35  +
        /* SerializerUtil.kt:42 */
   20     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:372 */
   21     38   
    Ok(())
          39  +
    /* JsonSerializerGenerator.kt:358 */
   22     40   
}