Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_and_get_inline_documents_input.rs

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_put_and_get_inline_documents_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.inline_document {
           9  +
        /* JsonSerializerGenerator.kt:474 */
    7     10   
        object.key("inlineDocument").document(var_1);
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +42,64 @@
    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_put_with_content_encoding_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<
    8     10   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
    9     11   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_put_with_content_encoding_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   25     34   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* JsonSerializerGenerator.kt:287 */
   34     50   
pub fn ser_put_with_content_encoding_input(
   35     51   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   36     52   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          53  +
    /* JsonSerializerGenerator.kt:291 */
   37     54   
    let mut out = String::new();
          55  +
    /* JsonSerializerGenerator.kt:292 */
   38     56   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          57  +
    /* JsonSerializerGenerator.kt:375 */
   39     58   
    crate::protocol_serde::shape_put_with_content_encoding_input::ser_put_with_content_encoding_input_input(&mut object, input)?;
          59  +
    /* JsonSerializerGenerator.kt:295 */
   40     60   
    object.finish();
          61  +
    /* JsonSerializerGenerator.kt:296 */
   41     62   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          63  +
    /* JsonSerializerGenerator.kt:287 */
   42     64   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding_input.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_put_with_content_encoding_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.encoding {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("encoding").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_2) = &input.data {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("data").string(var_2.as_str());
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_scalar_properties.rs

@@ -1,1 +84,131 @@
    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_simple_scalar_properties_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<
    8     10   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
    9     11   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_simple_scalar_properties_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   25     34   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(_response_body, output)
   31     44   
            .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* JsonSerializerGenerator.kt:287 */
   36     53   
pub fn ser_simple_scalar_properties_input(
   37     54   
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   38     55   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          56  +
    /* JsonSerializerGenerator.kt:291 */
   39     57   
    let mut out = String::new();
          58  +
    /* JsonSerializerGenerator.kt:292 */
   40     59   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          60  +
    /* JsonSerializerGenerator.kt:375 */
   41     61   
    crate::protocol_serde::shape_simple_scalar_properties_input::ser_simple_scalar_properties_input_input(&mut object, input)?;
          62  +
    /* JsonSerializerGenerator.kt:295 */
   42     63   
    object.finish();
          64  +
    /* JsonSerializerGenerator.kt:296 */
   43     65   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          66  +
    /* JsonSerializerGenerator.kt:287 */
   44     67   
}
   45     68   
          69  +
/* JsonParserGenerator.kt:148 */
   46     70   
pub(crate) fn de_simple_scalar_properties(
   47     71   
    value: &[u8],
   48     72   
    mut builder: crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   49     73   
) -> ::std::result::Result<
   50     74   
    crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   51     75   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52     76   
> {
          77  +
    /* JsonParserGenerator.kt:153 */
   53     78   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   54     79   
    let tokens = &mut tokens_owned;
   55     80   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          81  +
    /* JsonParserGenerator.kt:684 */
   56     82   
    loop {
          83  +
        /* JsonParserGenerator.kt:685 */
   57     84   
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          85  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          86  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          87  +
                /* JsonParserGenerator.kt:260 */
          88  +
                match key.to_unescaped()?.as_ref() {
          89  +
                    /* JsonParserGenerator.kt:262 */
   60     90   
                    "floatValue" => {
   61         -
                    builder = builder
   62         -
                        .set_float_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_float_value(
          93  +
                            /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
          94  +
                        /* JsonParserGenerator.kt:265 */);
          95  +
                        /* JsonParserGenerator.kt:262 */
   63     96   
                    }
          97  +
                    /* JsonParserGenerator.kt:262 */
   64     98   
                    "doubleValue" => {
   65         -
                    builder = builder
   66         -
                        .set_double_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
          99  +
                        /* JsonParserGenerator.kt:265 */
         100  +
                        builder = builder.set_double_value(
         101  +
                            /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         102  +
                        /* JsonParserGenerator.kt:265 */);
         103  +
                        /* JsonParserGenerator.kt:262 */
   67    104   
                    }
   68         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   69         -
            },
         105  +
                    /* JsonParserGenerator.kt:290 */
         106  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         107  +
                }
         108  +
                /* JsonParserGenerator.kt:686 */
         109  +
            }
         110  +
            /* JsonParserGenerator.kt:695 */
   70    111   
            other => {
   71    112   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   72    113   
                    "expected object key or end object, found: {:?}",
   73    114   
                    other
   74    115   
                )))
         116  +
            } /* JsonParserGenerator.kt:685 */
   75    117   
        }
         118  +
        /* JsonParserGenerator.kt:684 */
   76    119   
    }
   77         -
    }
         120  +
    /* JsonParserGenerator.kt:250 */
   78    121   
    if tokens.next().is_some() {
         122  +
        /* JsonParserGenerator.kt:251 */
   79    123   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   80    124   
            "found more JSON tokens after completing parsing",
   81    125   
        ));
         126  +
        /* JsonParserGenerator.kt:250 */
   82    127   
    }
         128  +
    /* JsonParserGenerator.kt:163 */
   83    129   
    Ok(builder)
         130  +
    /* JsonParserGenerator.kt:148 */
   84    131   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_scalar_properties_input.rs

@@ -1,1 +19,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_simple_scalar_properties_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.float_value {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("floatValue").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:382 */
   12     17   
    if let Some(var_2) = &input.double_value {
          18  +
        /* JsonSerializerGenerator.kt:432 */
   13     19   
        object.key("doubleValue").number(
   14     20   
            #[allow(clippy::useless_conversion)]
   15     21   
            ::aws_smithy_types::Number::Float((*var_2).into()),
   16     22   
        );
          23  +
        /* JsonSerializerGenerator.kt:382 */
   17     24   
    }
          25  +
    /* JsonSerializerGenerator.kt:372 */
   18     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   19     28   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_struct.rs

@@ -1,1 +50,84 @@
    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_simple_struct<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::SimpleStruct>, ::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::SimpleStructBuilder::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   
                            "Value" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_value(
          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| u.into_owned()))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
          39  +
                            /* JsonParserGenerator.kt:290 */
          40  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          41  +
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
          43  +
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   26     45   
                    other => {
   27     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     47   
                            "expected object key or end object, found: {:?}",
   29     48   
                            other
   30     49   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   31     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   32     53   
            }
   33         -
            }
          54  +
            /* JsonParserGenerator.kt:540 */
   34     55   
            Ok(Some(builder.build()))
          56  +
            /* JsonParserGenerator.kt:713 */
   35     57   
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     62   
                "expected start object or null",
   38         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   39     66   
    }
          67  +
    /* JsonParserGenerator.kt:516 */
   40     68   
}
   41     69   
          70  +
/* JsonSerializerGenerator.kt:358 */
   42     71   
pub fn ser_simple_struct(
   43     72   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44     73   
    input: &crate::types::SimpleStruct,
   45     74   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          75  +
    /* JsonSerializerGenerator.kt:382 */
   46     76   
    if let Some(var_1) = &input.value {
          77  +
        /* JsonSerializerGenerator.kt:423 */
   47     78   
        object.key("Value").string(var_1.as_str());
          79  +
        /* JsonSerializerGenerator.kt:382 */
   48     80   
    }
          81  +
    /* JsonSerializerGenerator.kt:372 */
   49     82   
    Ok(())
          83  +
    /* JsonSerializerGenerator.kt:358 */
   50     84   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_nulls_operation.rs

@@ -1,1 +82,133 @@
    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_sparse_nulls_operation_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<
    8     10   
    crate::operation::sparse_nulls_operation::SparseNullsOperationOutput,
    9     11   
    crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_sparse_nulls_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::sparse_nulls_operation::SparseNullsOperationOutput,
   25     34   
    crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_sparse_nulls_operation::de_sparse_nulls_operation(_response_body, output)
   31     44   
            .map_err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* JsonSerializerGenerator.kt:287 */
   36     53   
pub fn ser_sparse_nulls_operation_input(
   37     54   
    input: &crate::operation::sparse_nulls_operation::SparseNullsOperationInput,
   38     55   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          56  +
    /* JsonSerializerGenerator.kt:291 */
   39     57   
    let mut out = String::new();
          58  +
    /* JsonSerializerGenerator.kt:292 */
   40     59   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          60  +
    /* JsonSerializerGenerator.kt:375 */
   41     61   
    crate::protocol_serde::shape_sparse_nulls_operation_input::ser_sparse_nulls_operation_input_input(&mut object, input)?;
          62  +
    /* JsonSerializerGenerator.kt:295 */
   42     63   
    object.finish();
          64  +
    /* JsonSerializerGenerator.kt:296 */
   43     65   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          66  +
    /* JsonSerializerGenerator.kt:287 */
   44     67   
}
   45     68   
          69  +
/* JsonParserGenerator.kt:148 */
   46     70   
pub(crate) fn de_sparse_nulls_operation(
   47     71   
    value: &[u8],
   48     72   
    mut builder: crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder,
   49     73   
) -> ::std::result::Result<
   50     74   
    crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder,
   51     75   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52     76   
> {
          77  +
    /* JsonParserGenerator.kt:153 */
   53     78   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   54     79   
    let tokens = &mut tokens_owned;
   55     80   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          81  +
    /* JsonParserGenerator.kt:684 */
   56     82   
    loop {
          83  +
        /* JsonParserGenerator.kt:685 */
   57     84   
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          85  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          86  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          87  +
                /* JsonParserGenerator.kt:260 */
          88  +
                match key.to_unescaped()?.as_ref() {
          89  +
                    /* JsonParserGenerator.kt:262 */
   60     90   
                    "sparseStringList" => {
   61         -
                    builder = builder.set_sparse_string_list(crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(tokens)?);
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_sparse_string_list(
          93  +
                            /* JsonParserGenerator.kt:451 */
          94  +
                            crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(tokens)?, /* JsonParserGenerator.kt:265 */
          95  +
                        );
          96  +
                        /* JsonParserGenerator.kt:262 */
   62     97   
                    }
          98  +
                    /* JsonParserGenerator.kt:262 */
   63     99   
                    "sparseStringMap" => {
   64         -
                    builder = builder.set_sparse_string_map(crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?);
         100  +
                        /* JsonParserGenerator.kt:265 */
         101  +
                        builder = builder.set_sparse_string_map(
         102  +
                            /* JsonParserGenerator.kt:509 */
         103  +
                            crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?, /* JsonParserGenerator.kt:265 */
         104  +
                        );
         105  +
                        /* JsonParserGenerator.kt:262 */
   65    106   
                    }
   66         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   67         -
            },
         107  +
                    /* JsonParserGenerator.kt:290 */
         108  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         109  +
                }
         110  +
                /* JsonParserGenerator.kt:686 */
         111  +
            }
         112  +
            /* JsonParserGenerator.kt:695 */
   68    113   
            other => {
   69    114   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   70    115   
                    "expected object key or end object, found: {:?}",
   71    116   
                    other
   72    117   
                )))
         118  +
            } /* JsonParserGenerator.kt:685 */
   73    119   
        }
         120  +
        /* JsonParserGenerator.kt:684 */
   74    121   
    }
   75         -
    }
         122  +
    /* JsonParserGenerator.kt:250 */
   76    123   
    if tokens.next().is_some() {
         124  +
        /* JsonParserGenerator.kt:251 */
   77    125   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   78    126   
            "found more JSON tokens after completing parsing",
   79    127   
        ));
         128  +
        /* JsonParserGenerator.kt:250 */
   80    129   
    }
         130  +
    /* JsonParserGenerator.kt:163 */
   81    131   
    Ok(builder)
         132  +
    /* JsonParserGenerator.kt:148 */
   82    133   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_nulls_operation_input.rs

@@ -1,1 +30,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_sparse_nulls_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::sparse_nulls_operation::SparseNullsOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.sparse_string_list {
           9  +
        /* JsonSerializerGenerator.kt:484 */
    7     10   
        let mut array_2 = object.key("sparseStringList").start_array();
          11  +
        /* JsonSerializerGenerator.kt:524 */
    8     12   
        for item_3 in var_1 {
          13  +
            /* JsonSerializerGenerator.kt:382 */
    9     14   
            if let Some(var_4) = item_3 {
          15  +
                /* JsonSerializerGenerator.kt:423 */
   10     16   
                array_2.value().string(var_4.as_str());
   11         -
            } else {
          17  +
            /* JsonSerializerGenerator.kt:382 */
          18  +
            }
          19  +
            /* JsonSerializerGenerator.kt:395 */
          20  +
            else {
          21  +
                /* JsonSerializerGenerator.kt:396 */
   12     22   
                array_2.value().null();
          23  +
                /* JsonSerializerGenerator.kt:395 */
   13     24   
            }
          25  +
            /* JsonSerializerGenerator.kt:524 */
   14     26   
        }
          27  +
        /* JsonSerializerGenerator.kt:486 */
   15     28   
        array_2.finish();
          29  +
        /* JsonSerializerGenerator.kt:382 */
   16     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   17     32   
    if let Some(var_5) = &input.sparse_string_map {
          33  +
        /* JsonSerializerGenerator.kt:495 */
   18     34   
        #[allow(unused_mut)]
          35  +
        /* JsonSerializerGenerator.kt:496 */
   19     36   
        let mut object_6 = object.key("sparseStringMap").start_object();
          37  +
        /* JsonSerializerGenerator.kt:537 */
   20     38   
        for (key_7, value_8) in var_5 {
          39  +
            /* JsonSerializerGenerator.kt:382 */
   21     40   
            if let Some(var_9) = value_8 {
          41  +
                /* JsonSerializerGenerator.kt:423 */
   22     42   
                object_6.key(key_7.as_str()).string(var_9.as_str());
   23         -
            } else {
          43  +
            /* JsonSerializerGenerator.kt:382 */
          44  +
            }
          45  +
            /* JsonSerializerGenerator.kt:395 */
          46  +
            else {
          47  +
                /* JsonSerializerGenerator.kt:396 */
   24     48   
                object_6.key(key_7.as_str()).null();
          49  +
                /* JsonSerializerGenerator.kt:395 */
   25     50   
            }
          51  +
            /* JsonSerializerGenerator.kt:537 */
   26     52   
        }
          53  +
        /* JsonSerializerGenerator.kt:515 */
   27     54   
        object_6.finish();
          55  +
        /* JsonSerializerGenerator.kt:382 */
   28     56   
    }
          57  +
    /* JsonSerializerGenerator.kt:372 */
   29     58   
    Ok(())
          59  +
    /* JsonSerializerGenerator.kt:358 */
   30     60   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_string_list.rs

@@ -1,1 +36,60 @@
    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_sparse_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
    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::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
          31  +
                        /* JsonParserGenerator.kt:415 */
   22     32   
                        items.push(
          33  +
                            /* JsonParserGenerator.kt:354 */
   23     34   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   24         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   25         -
                                .transpose()?,
          35  +
                                .map(|s|
          36  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          37  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          38  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          39  +
                                .transpose()?, /* JsonParserGenerator.kt:415 */
   26     40   
                        );
          41  +
                        /* JsonParserGenerator.kt:413 */
          42  +
                    } /* JsonParserGenerator.kt:409 */
   27     43   
                }
          44  +
                /* JsonParserGenerator.kt:408 */
   28     45   
            }
   29         -
            }
          46  +
            /* JsonParserGenerator.kt:446 */
   30     47   
            Ok(Some(items))
          48  +
            /* JsonParserGenerator.kt:713 */
   31     49   
        }
   32         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          50  +
        /* JsonParserGenerator.kt:722 */
          51  +
        _ => {
          52  +
            /* JsonParserGenerator.kt:723 */
          53  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     54   
                "expected start array or null",
   34         -
        )),
          55  +
            ))
          56  +
            /* JsonParserGenerator.kt:722 */
          57  +
        } /* JsonParserGenerator.kt:712 */
   35     58   
    }
          59  +
    /* JsonParserGenerator.kt:398 */
   36     60   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_string_map.rs

@@ -1,1 +39,66 @@
    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_sparse_string_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::option::Option<::std::string::String>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
          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:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          33  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          34  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                                /* JsonParserGenerator.kt:339 */)
          36  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          37  +
                        /* JsonParserGenerator.kt:474 */;
          38  +
                        /* JsonParserGenerator.kt:478 */
   23     39   
                        map.insert(key, value);
          40  +
                        /* JsonParserGenerator.kt:686 */
   24     41   
                    }
          42  +
                    /* JsonParserGenerator.kt:695 */
   25     43   
                    other => {
   26     44   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     45   
                            "expected object key or end object, found: {:?}",
   28     46   
                            other
   29     47   
                        )))
          48  +
                    } /* JsonParserGenerator.kt:685 */
   30     49   
                }
          50  +
                /* JsonParserGenerator.kt:684 */
   31     51   
            }
   32         -
            }
          52  +
            /* JsonParserGenerator.kt:504 */
   33     53   
            Ok(Some(map))
          54  +
            /* JsonParserGenerator.kt:713 */
   34     55   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          56  +
        /* JsonParserGenerator.kt:722 */
          57  +
        _ => {
          58  +
            /* JsonParserGenerator.kt:723 */
          59  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     60   
                "expected start object or null",
   37         -
        )),
          61  +
            ))
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   38     64   
    }
          65  +
    /* JsonParserGenerator.kt:460 */
   39     66   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_string_list.rs

@@ -1,1 +34,59 @@
    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_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::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_string_or_null(tokens.next())?
   20         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                            .transpose()?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          31  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          32  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          33  +
                                /* JsonParserGenerator.kt:339 */)
          34  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          35  +
                        /* JsonParserGenerator.kt:419 */;
          36  +
                        /* JsonParserGenerator.kt:422 */
   22     37   
                        if let Some(value) = value {
   23     38   
                            items.push(value);
   24     39   
                        }
          40  +
                        /* JsonParserGenerator.kt:413 */
          41  +
                    } /* JsonParserGenerator.kt:409 */
   25     42   
                }
          43  +
                /* JsonParserGenerator.kt:408 */
   26     44   
            }
   27         -
            }
          45  +
            /* JsonParserGenerator.kt:446 */
   28     46   
            Ok(Some(items))
          47  +
            /* JsonParserGenerator.kt:713 */
   29     48   
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
        /* JsonParserGenerator.kt:722 */
          50  +
        _ => {
          51  +
            /* JsonParserGenerator.kt:723 */
          52  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31     53   
                "expected start array or null",
   32         -
        )),
          54  +
            ))
          55  +
            /* JsonParserGenerator.kt:722 */
          56  +
        } /* JsonParserGenerator.kt:712 */
   33     57   
    }
          58  +
    /* JsonParserGenerator.kt:398 */
   34     59   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_string_map.rs

@@ -1,1 +41,68 @@
    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_string_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::string::String>>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
          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:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          33  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          34  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                                /* JsonParserGenerator.kt:339 */)
          36  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          37  +
                        /* JsonParserGenerator.kt:474 */;
          38  +
                        /* JsonParserGenerator.kt:491 */
   23     39   
                        if let Some(value) = value {
   24     40   
                            map.insert(key, value);
   25     41   
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
   26     43   
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   27     45   
                    other => {
   28     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29     47   
                            "expected object key or end object, found: {:?}",
   30     48   
                            other
   31     49   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   32     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   33     53   
            }
   34         -
            }
          54  +
            /* JsonParserGenerator.kt:504 */
   35     55   
            Ok(Some(map))
          56  +
            /* JsonParserGenerator.kt:713 */
   36     57   
        }
   37         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     62   
                "expected start object or null",
   39         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   40     66   
    }
          67  +
    /* JsonParserGenerator.kt:460 */
   41     68   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_struct_with_json_name.rs

@@ -1,1 +50,84 @@
    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_struct_with_json_name<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::StructWithJsonName>, ::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::StructWithJsonNameBuilder::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   
                            "Value" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_value(
          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| u.into_owned()))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
          39  +
                            /* JsonParserGenerator.kt:290 */
          40  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          41  +
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
          43  +
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   26     45   
                    other => {
   27     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     47   
                            "expected object key or end object, found: {:?}",
   29     48   
                            other
   30     49   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   31     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   32     53   
            }
   33         -
            }
          54  +
            /* JsonParserGenerator.kt:540 */
   34     55   
            Ok(Some(builder.build()))
          56  +
            /* JsonParserGenerator.kt:713 */
   35     57   
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     62   
                "expected start object or null",
   38         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   39     66   
    }
          67  +
    /* JsonParserGenerator.kt:516 */
   40     68   
}
   41     69   
          70  +
/* JsonSerializerGenerator.kt:358 */
   42     71   
pub fn ser_struct_with_json_name(
   43     72   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44     73   
    input: &crate::types::StructWithJsonName,
   45     74   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          75  +
    /* JsonSerializerGenerator.kt:382 */
   46     76   
    if let Some(var_1) = &input.value {
          77  +
        /* JsonSerializerGenerator.kt:423 */
   47     78   
        object.key("Value").string(var_1.as_str());
          79  +
        /* JsonSerializerGenerator.kt:382 */
   48     80   
    }
          81  +
    /* JsonSerializerGenerator.kt:372 */
   49     82   
    Ok(())
          83  +
    /* JsonSerializerGenerator.kt:358 */
   50     84   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types.rs

@@ -1,1 +38,54 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_my_union::MyUnion;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_greeting_struct::GreetingStruct;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_foo_enum::FooEnum;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorData;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_kitchen_sink::KitchenSink;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_struct_with_json_name::StructWithJsonName;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::_simple_struct::SimpleStruct;
   15     22   
          23  +
/* CodegenDelegator.kt:255 */
   16     24   
pub use crate::types::_empty_struct::EmptyStruct;
   17     25   
          26  +
/* RustModule.kt:172 */
   18     27   
mod _complex_nested_error_data;
   19     28   
          29  +
/* RustModule.kt:172 */
   20     30   
mod _empty_struct;
   21     31   
          32  +
/* RustModule.kt:172 */
   22     33   
mod _foo_enum;
   23     34   
          35  +
/* RustModule.kt:172 */
   24     36   
mod _greeting_struct;
   25     37   
          38  +
/* RustModule.kt:172 */
   26     39   
mod _kitchen_sink;
   27     40   
          41  +
/* RustModule.kt:172 */
   28     42   
mod _my_union;
   29     43   
          44  +
/* RustModule.kt:172 */
   30     45   
mod _simple_struct;
   31     46   
          47  +
/* RustModule.kt:172 */
   32     48   
mod _struct_with_json_name;
   33     49   
   34         -
/// Builders
          50  +
/// /* CodegenDelegator.kt:51 */Builders
   35     51   
pub mod builders;
   36     52   
   37         -
/// Error types that Sample Json 1.1 Protocol Service can respond with.
          53  +
/// /* ClientRustModule.kt:121 */Error types that Sample Json 1.1 Protocol Service can respond with.
   38     54   
pub mod error;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_complex_nested_error_data.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ComplexNestedErrorData {
           8  +
pub /* StructureGenerator.kt:201 */ struct ComplexNestedErrorData {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl ComplexNestedErrorData {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.foo.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl ComplexNestedErrorData {
   16         -
    /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::ComplexNestedErrorDataBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::ComplexNestedErrorDataBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct ComplexNestedErrorDataBuilder {
   26         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl ComplexNestedErrorDataBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.foo = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.foo = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.foo
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::ComplexNestedErrorData {
   45         -
        crate::types::ComplexNestedErrorData { foo: self.foo }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::ComplexNestedErrorData {
          82  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_empty_struct.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EmptyStruct {}
           8  +
pub /* StructureGenerator.kt:201 */ struct EmptyStruct {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl EmptyStruct {
    7         -
    /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::types::EmptyStruct).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EmptyStruct`](crate::types::EmptyStruct).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::types::builders::EmptyStructBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::types::builders::EmptyStructBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`EmptyStruct`](crate::types::EmptyStruct).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`EmptyStruct`](crate::types::EmptyStruct).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct EmptyStructBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct EmptyStructBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl EmptyStructBuilder {
   18         -
    /// Consumes the builder and constructs a [`EmptyStruct`](crate::types::EmptyStruct).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EmptyStruct`](crate::types::EmptyStruct).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::types::EmptyStruct {
   20         -
        crate::types::EmptyStruct {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::types::EmptyStruct {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}