Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_foo_error.rs

@@ -1,1 +18,27 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_foo_error_error(
    3      4   
    value: &crate::error::FooError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_foo_error::ser_foo_error(&mut object, value)?;
          11  +
    /* ServerAwsJson.kt:95 */
    8     12   
    object.key("__type").string("FooError");
          13  +
    /* JsonSerializerGenerator.kt:227 */
    9     14   
    object.finish();
   10     15   
    Ok(out)
          16  +
    /* JsonSerializerGenerator.kt:213 */
   11     17   
}
   12     18   
          19  +
/* JsonSerializerGenerator.kt:358 */
   13     20   
pub fn ser_foo_error(
   14     21   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   15     22   
    #[allow(unused_variables)] input: &crate::error::FooError,
   16     23   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          24  +
    /* JsonSerializerGenerator.kt:372 */
   17     25   
    Ok(())
          26  +
    /* JsonSerializerGenerator.kt:358 */
   18     27   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_fractional_seconds.rs

@@ -1,1 +55,78 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_fractional_seconds_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::FractionalSecondsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::fractional_seconds_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_fractional_seconds_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::FractionalSecondsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_fractional_seconds_output.rs

@@ -1,1 +25,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_fractional_seconds_output_output_output(
    3      4   
    value: &crate::output::FractionalSecondsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_fractional_seconds_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::FractionalSecondsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.datetime {
          27  +
        /* JsonSerializerGenerator.kt:448 */
   20     28   
        object
   21     29   
            .key("datetime")
   22     30   
            .date_time(var_1, ::aws_smithy_types::date_time::Format::DateTime)?;
          31  +
        /* JsonSerializerGenerator.kt:382 */
   23     32   
    }
          33  +
    /* JsonSerializerGenerator.kt:372 */
   24     34   
    Ok(())
          35  +
    /* JsonSerializerGenerator.kt:358 */
   25     36   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_greeting_struct.rs

@@ -1,1 +65,95 @@
    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_greeting_struct<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::GreetingStruct>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::greeting_struct::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "hi" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_hi(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?,
   33         -
                                );
          39  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */)
          43  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
   34     46   
                            }
   35         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   36     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   37     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   38     53   
                    other => {
   39     54   
                        return Err(
   40     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     56   
                                format!("expected object key or end object, found: {:?}", other),
   42     57   
                            ),
   43     58   
                        )
   44         -
                    }
          59  +
                    } /* JsonParserGenerator.kt:685 */
   45     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   46     62   
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   47     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   48     66   
        }
   49         -
        _ => Err(
   50         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                "expected start object or null",
   52         -
            ),
   53         -
        ),
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
          71  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          72  +
                    "expected start object or null",
          73  +
                ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   54     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   55     79   
}
   56     80   
          81  +
/* JsonSerializerGenerator.kt:358 */
   57     82   
pub fn ser_greeting_struct(
   58     83   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   59     84   
    input: &crate::model::GreetingStruct,
   60     85   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          86  +
    /* JsonSerializerGenerator.kt:382 */
   61     87   
    if let Some(var_1) = &input.hi {
          88  +
        /* JsonSerializerGenerator.kt:423 */
   62     89   
        object.key("hi").string(var_1.as_str());
          90  +
        /* JsonSerializerGenerator.kt:382 */
   63     91   
    }
          92  +
    /* JsonSerializerGenerator.kt:372 */
   64     93   
    Ok(())
          94  +
    /* JsonSerializerGenerator.kt:358 */
   65     95   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,1 +129,182 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_greeting_with_errors_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GreetingWithErrorsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::greeting_with_errors_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_greeting_with_errors_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}
   56     79   
          80  +
/* RustType.kt:516 */
   57     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   58     83   
pub fn ser_greeting_with_errors_http_error(
   59     84   
    error: &crate::error::GreetingWithErrorsError,
   60     85   
) -> std::result::Result<
   61     86   
    ::aws_smithy_http_server::response::Response,
   62     87   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   63     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   64     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   65     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   66     94   
            crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   67     96   
                let payload =
   68     97   
                    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
   69     98   
                        output,
   70     99   
                    )?;
         100  +
                /* RustType.kt:516 */
   71    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   72    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   73    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74    106   
                    builder,
   75    107   
                    ::http::header::CONTENT_TYPE,
   76    108   
                    "application/x-amz-json-1.1",
   77    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   78    111   
                let content_length = payload.len();
   79    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    113   
                    builder,
   81    114   
                    ::http::header::CONTENT_LENGTH,
   82    115   
                    content_length,
   83    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   84    118   
                builder
   85    119   
                    .status(400)
   86    120   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   87    122   
            }
         123  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   88    124   
            crate::error::GreetingWithErrorsError::ComplexError(output) => {
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   89    126   
                let payload =
   90    127   
                    crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
         128  +
                /* RustType.kt:516 */
   91    129   
                #[allow(unused_mut)]
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   92    131   
                let mut builder = ::http::Response::builder();
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    133   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    134   
                    builder,
   95    135   
                    ::http::header::CONTENT_TYPE,
   96    136   
                    "application/x-amz-json-1.1",
   97    137   
                );
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   98    139   
                let content_length = payload.len();
   99    140   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    141   
                    builder,
  101    142   
                    ::http::header::CONTENT_LENGTH,
  102    143   
                    content_length,
  103    144   
                );
         145  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  104    146   
                builder
  105    147   
                    .status(400)
  106    148   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  107    150   
            }
         151  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  108    152   
            crate::error::GreetingWithErrorsError::FooError(output) => {
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  109    154   
                let payload = crate::protocol_serde::shape_foo_error::ser_foo_error_error(output)?;
         155  +
                /* RustType.kt:516 */
  110    156   
                #[allow(unused_mut)]
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  111    158   
                let mut builder = ::http::Response::builder();
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  112    160   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    161   
                    builder,
  114    162   
                    ::http::header::CONTENT_TYPE,
  115    163   
                    "application/x-amz-json-1.1",
  116    164   
                );
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  117    166   
                let content_length = payload.len();
  118    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  119    168   
                    builder,
  120    169   
                    ::http::header::CONTENT_LENGTH,
  121    170   
                    content_length,
  122    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  123    173   
                builder
  124    174   
                    .status(500)
  125    175   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  126         -
            }
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         177  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  127    178   
        }
         179  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  128    180   
    })
         181  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  129    182   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_greeting_with_errors_output.rs

@@ -1,1 +20,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_greeting_with_errors_output_output_output(
    3      4   
    value: &crate::output::GreetingWithErrorsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_greeting_with_errors_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::GreetingWithErrorsOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.greeting {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("greeting").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:372 */
   19     29   
    Ok(())
          30  +
    /* JsonSerializerGenerator.kt:358 */
   20     31   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_host_with_path_operation.rs

@@ -1,1 +53,78 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_host_with_path_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HostWithPathOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::host_with_path_operation_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_host_with_path_operation_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::HostWithPathOperationOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
   43         -
        let payload = "";
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   44     65   
        let content_length = payload.len();
   45     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     67   
            builder,
   47     68   
            ::http::header::CONTENT_LENGTH,
   48     69   
            content_length,
   49     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   50     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   51     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   52     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   53     78   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_invalid_greeting.rs

@@ -1,1 +21,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_invalid_greeting_error(
    3      4   
    value: &crate::error::InvalidGreeting,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting(&mut object, value)?;
          11  +
    /* ServerAwsJson.kt:95 */
    8     12   
    object.key("__type").string("InvalidGreeting");
          13  +
    /* JsonSerializerGenerator.kt:227 */
    9     14   
    object.finish();
   10     15   
    Ok(out)
          16  +
    /* JsonSerializerGenerator.kt:213 */
   11     17   
}
   12     18   
          19  +
/* JsonSerializerGenerator.kt:358 */
   13     20   
pub fn ser_invalid_greeting(
   14     21   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   15     22   
    input: &crate::error::InvalidGreeting,
   16     23   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          24  +
    /* JsonSerializerGenerator.kt:382 */
   17     25   
    if let Some(var_1) = &input.message {
          26  +
        /* JsonSerializerGenerator.kt:423 */
   18     27   
        object.key("Message").string(var_1.as_str());
          28  +
        /* JsonSerializerGenerator.kt:382 */
   19     29   
    }
          30  +
    /* JsonSerializerGenerator.kt:372 */
   20     31   
    Ok(())
          32  +
    /* JsonSerializerGenerator.kt:358 */
   21     33   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_json_enums.rs

@@ -1,1 +178,267 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_json_enums_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::JsonEnumsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::json_enums_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_json_enums::de_json_enums(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_json_enums_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::JsonEnumsOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output_output(
   53         -
                &output,
   54         -
            )?;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     77   
        let content_length = payload.len();
   56     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     79   
            builder,
   58     80   
            ::http::header::CONTENT_LENGTH,
   59     81   
            content_length,
   60     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     90   
}
   65     91   
          92  +
/* RustType.kt:516 */
   66     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   67     95   
pub fn ser_json_enums_http_error(
   68     96   
    error: &crate::error::JsonEnumsError,
   69     97   
) -> std::result::Result<
   70     98   
    ::aws_smithy_http_server::response::Response,
   71     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   72    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   73    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   74    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   75    106   
            crate::error::JsonEnumsError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   76    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   77    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   78    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   79    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    115   
                    builder,
   81    116   
                    ::http::header::CONTENT_TYPE,
   82    117   
                    "application/x-amz-json-1.1",
   83    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   84    120   
                let content_length = payload.len();
   85    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    122   
                    builder,
   87    123   
                    ::http::header::CONTENT_LENGTH,
   88    124   
                    content_length,
   89    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   90    127   
                builder
   91    128   
                    .status(400)
   92    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   93         -
            }
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   94    132   
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   95    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   96    136   
}
   97    137   
         138  +
/* JsonParserGenerator.kt:148 */
   98    139   
pub(crate) fn de_json_enums(
   99    140   
    value: &[u8],
  100    141   
    mut builder: crate::input::json_enums_input::Builder,
  101    142   
) -> ::std::result::Result<
  102    143   
    crate::input::json_enums_input::Builder,
  103    144   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  104    145   
> {
         146  +
    /* JsonParserGenerator.kt:153 */
  105    147   
    let mut tokens_owned =
  106    148   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  107    149   
            .peekable();
  108    150   
    let tokens = &mut tokens_owned;
  109    151   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         152  +
    /* JsonParserGenerator.kt:684 */
  110    153   
    loop {
         154  +
        /* JsonParserGenerator.kt:685 */
  111    155   
        match tokens.next().transpose()? {
         156  +
            /* JsonParserGenerator.kt:686 */
  112    157   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  113    158   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         159  +
                /* JsonParserGenerator.kt:260 */
  114    160   
                match key.to_unescaped()?.as_ref() {
         161  +
                    /* JsonParserGenerator.kt:262 */
  115    162   
                    "fooEnum1" => {
         163  +
                        /* JsonParserGenerator.kt:272 */
  116    164   
                        builder = builder.set_foo_enum1(
         165  +
                            /* JsonParserGenerator.kt:354 */
  117    166   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  118    167   
                                tokens.next(),
  119    168   
                            )?
  120         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  121         -
                            .transpose()?,
         169  +
                            .map(|s|
         170  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         171  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         172  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         173  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  122    174   
                        );
         175  +
                        /* JsonParserGenerator.kt:262 */
  123    176   
                    }
         177  +
                    /* JsonParserGenerator.kt:262 */
  124    178   
                    "fooEnum2" => {
         179  +
                        /* JsonParserGenerator.kt:272 */
  125    180   
                        builder = builder.set_foo_enum2(
         181  +
                            /* JsonParserGenerator.kt:354 */
  126    182   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  127    183   
                                tokens.next(),
  128    184   
                            )?
  129         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  130         -
                            .transpose()?,
         185  +
                            .map(|s|
         186  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         187  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         188  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         189  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  131    190   
                        );
         191  +
                        /* JsonParserGenerator.kt:262 */
  132    192   
                    }
         193  +
                    /* JsonParserGenerator.kt:262 */
  133    194   
                    "fooEnum3" => {
         195  +
                        /* JsonParserGenerator.kt:272 */
  134    196   
                        builder = builder.set_foo_enum3(
         197  +
                            /* JsonParserGenerator.kt:354 */
  135    198   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  136    199   
                                tokens.next(),
  137    200   
                            )?
  138         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  139         -
                            .transpose()?,
         201  +
                            .map(|s|
         202  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         203  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         204  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         205  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  140    206   
                        );
         207  +
                        /* JsonParserGenerator.kt:262 */
  141    208   
                    }
         209  +
                    /* JsonParserGenerator.kt:262 */
  142    210   
                    "fooEnumList" => {
  143         -
                        builder = builder.set_foo_enum_list(
  144         -
                            crate::protocol_serde::shape_foo_enum_list::de_foo_enum_list(tokens)?,
  145         -
                        );
         211  +
                        /* JsonParserGenerator.kt:272 */
         212  +
                        builder =
         213  +
                            builder.set_foo_enum_list(
         214  +
                                /* JsonParserGenerator.kt:451 */
         215  +
                                crate::protocol_serde::shape_foo_enum_list::de_foo_enum_list(
         216  +
                                    tokens,
         217  +
                                )?, /* JsonParserGenerator.kt:272 */
         218  +
                            );
         219  +
                        /* JsonParserGenerator.kt:262 */
  146    220   
                    }
         221  +
                    /* JsonParserGenerator.kt:262 */
  147    222   
                    "fooEnumSet" => {
         223  +
                        /* JsonParserGenerator.kt:272 */
  148    224   
                        builder = builder.set_foo_enum_set(
  149         -
                            crate::protocol_serde::shape_foo_enum_set::de_foo_enum_set(tokens)?,
  150         -
                        );
         225  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_foo_enum_set::de_foo_enum_set(tokens)?
         226  +
                        /* JsonParserGenerator.kt:272 */);
         227  +
                        /* JsonParserGenerator.kt:262 */
  151    228   
                    }
         229  +
                    /* JsonParserGenerator.kt:262 */
  152    230   
                    "fooEnumMap" => {
         231  +
                        /* JsonParserGenerator.kt:272 */
  153    232   
                        builder = builder.set_foo_enum_map(
  154         -
                            crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(tokens)?,
  155         -
                        );
         233  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(tokens)?
         234  +
                        /* JsonParserGenerator.kt:272 */);
         235  +
                        /* JsonParserGenerator.kt:262 */
  156    236   
                    }
  157         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         237  +
                    /* JsonParserGenerator.kt:290 */
         238  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  158    239   
                }
         240  +
                /* JsonParserGenerator.kt:686 */
  159    241   
            }
         242  +
            /* JsonParserGenerator.kt:695 */
  160    243   
            other => {
  161    244   
                return Err(
  162    245   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  163    246   
                        "expected object key or end object, found: {:?}",
  164    247   
                        other
  165    248   
                    )),
  166    249   
                )
  167         -
            }
         250  +
            } /* JsonParserGenerator.kt:685 */
  168    251   
        }
         252  +
        /* JsonParserGenerator.kt:684 */
  169    253   
    }
         254  +
    /* JsonParserGenerator.kt:250 */
  170    255   
    if tokens.next().is_some() {
         256  +
        /* JsonParserGenerator.kt:251 */
  171    257   
        return Err(
  172    258   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  173    259   
                "found more JSON tokens after completing parsing",
  174    260   
            ),
  175    261   
        );
         262  +
        /* JsonParserGenerator.kt:250 */
  176    263   
    }
         264  +
    /* JsonParserGenerator.kt:163 */
  177    265   
    Ok(builder)
         266  +
    /* JsonParserGenerator.kt:148 */
  178    267   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_json_enums_output.rs

@@ -1,1 +57,102 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_json_enums_output_output_output(
    3      4   
    value: &crate::output::JsonEnumsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_json_enums_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::JsonEnumsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.foo_enum1 {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("fooEnum1").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.foo_enum2 {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   23     34   
        object.key("fooEnum2").string(var_2.as_str());
          35  +
        /* JsonSerializerGenerator.kt:382 */
   24     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:382 */
   25     38   
    if let Some(var_3) = &input.foo_enum3 {
          39  +
        /* JsonSerializerGenerator.kt:423 */
   26     40   
        object.key("fooEnum3").string(var_3.as_str());
          41  +
        /* JsonSerializerGenerator.kt:382 */
   27     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:382 */
   28     44   
    if let Some(var_4) = &input.foo_enum_list {
          45  +
        /* JsonSerializerGenerator.kt:484 */
   29     46   
        let mut array_5 = object.key("fooEnumList").start_array();
          47  +
        /* JsonSerializerGenerator.kt:524 */
   30     48   
        for item_6 in var_4 {
          49  +
            /* SerializerUtil.kt:42 */
   31     50   
            {
          51  +
                /* JsonSerializerGenerator.kt:423 */
   32     52   
                array_5.value().string(item_6.as_str());
          53  +
                /* SerializerUtil.kt:42 */
   33     54   
            }
          55  +
            /* JsonSerializerGenerator.kt:524 */
   34     56   
        }
          57  +
        /* JsonSerializerGenerator.kt:486 */
   35     58   
        array_5.finish();
          59  +
        /* JsonSerializerGenerator.kt:382 */
   36     60   
    }
          61  +
    /* JsonSerializerGenerator.kt:382 */
   37     62   
    if let Some(var_7) = &input.foo_enum_set {
          63  +
        /* JsonSerializerGenerator.kt:484 */
   38     64   
        let mut array_8 = object.key("fooEnumSet").start_array();
          65  +
        /* JsonSerializerGenerator.kt:524 */
   39     66   
        for item_9 in &var_7.0 {
          67  +
            /* SerializerUtil.kt:42 */
   40     68   
            {
          69  +
                /* JsonSerializerGenerator.kt:423 */
   41     70   
                array_8.value().string(item_9.as_str());
          71  +
                /* SerializerUtil.kt:42 */
   42     72   
            }
          73  +
            /* JsonSerializerGenerator.kt:524 */
   43     74   
        }
          75  +
        /* JsonSerializerGenerator.kt:486 */
   44     76   
        array_8.finish();
          77  +
        /* JsonSerializerGenerator.kt:382 */
   45     78   
    }
          79  +
    /* JsonSerializerGenerator.kt:382 */
   46     80   
    if let Some(var_10) = &input.foo_enum_map {
          81  +
        /* JsonSerializerGenerator.kt:495 */
   47     82   
        #[allow(unused_mut)]
          83  +
        /* JsonSerializerGenerator.kt:496 */
   48     84   
        let mut object_11 = object.key("fooEnumMap").start_object();
          85  +
        /* JsonSerializerGenerator.kt:537 */
   49     86   
        for (key_12, value_13) in var_10 {
          87  +
            /* SerializerUtil.kt:42 */
   50     88   
            {
          89  +
                /* JsonSerializerGenerator.kt:423 */
   51     90   
                object_11.key(key_12.as_str()).string(value_13.as_str());
          91  +
                /* SerializerUtil.kt:42 */
   52     92   
            }
          93  +
            /* JsonSerializerGenerator.kt:537 */
   53     94   
        }
          95  +
        /* JsonSerializerGenerator.kt:515 */
   54     96   
        object_11.finish();
          97  +
        /* JsonSerializerGenerator.kt:382 */
   55     98   
    }
          99  +
    /* JsonSerializerGenerator.kt:372 */
   56    100   
    Ok(())
         101  +
    /* JsonSerializerGenerator.kt:358 */
   57    102   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_json_unions.rs

@@ -1,1 +142,200 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_json_unions_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::JsonUnionsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::json_unions_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_json_unions::de_json_unions(bytes.as_ref(), input)?;
          40  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   30     41   
        }
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   31     43   
        input.build()?
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   32     45   
    })
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   33     47   
}
   34     48   
          49  +
/* RustType.kt:516 */
   35     50   
#[allow(clippy::unnecessary_wraps)]
          51  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   36     52   
pub fn ser_json_unions_http_response(
   37     53   
    #[allow(unused_variables)] output: crate::output::JsonUnionsOutput,
   38     54   
) -> std::result::Result<
   39     55   
    ::aws_smithy_http_server::response::Response,
   40     56   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   41     57   
> {
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   42     59   
    Ok({
          60  +
        /* RustType.kt:516 */
   43     61   
        #[allow(unused_mut)]
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   44     63   
        let mut builder = ::http::Response::builder();
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   45     65   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     66   
            builder,
   47     67   
            ::http::header::CONTENT_TYPE,
   48     68   
            "application/x-amz-json-1.1",
   49     69   
        );
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   50     71   
        let http_status: u16 = 200;
   51     72   
        builder = builder.status(http_status);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   52     74   
        let payload =
   53         -
            crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(
   54         -
                &output,
   55         -
            )?;
          75  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(&output)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   56     78   
        let content_length = payload.len();
   57     79   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     80   
            builder,
   59     81   
            ::http::header::CONTENT_LENGTH,
   60     82   
            content_length,
   61     83   
        );
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   62     85   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   63     87   
        builder.body(body)?
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   64     89   
    })
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   65     91   
}
   66     92   
          93  +
/* RustType.kt:516 */
   67     94   
#[allow(clippy::unnecessary_wraps)]
          95  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   68     96   
pub fn ser_json_unions_http_error(
   69     97   
    error: &crate::error::JsonUnionsError,
   70     98   
) -> std::result::Result<
   71     99   
    ::aws_smithy_http_server::response::Response,
   72    100   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   73    101   
> {
         102  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   74    103   
    Ok({
         104  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   75    105   
        match error {
         106  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   76    107   
            crate::error::JsonUnionsError::ValidationException(output) => {
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   77    109   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         110  +
                /* RustType.kt:516 */
   78    111   
                #[allow(unused_mut)]
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   79    113   
                let mut builder = ::http::Response::builder();
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   80    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81    116   
                    builder,
   82    117   
                    ::http::header::CONTENT_TYPE,
   83    118   
                    "application/x-amz-json-1.1",
   84    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   85    121   
                let content_length = payload.len();
   86    122   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    123   
                    builder,
   88    124   
                    ::http::header::CONTENT_LENGTH,
   89    125   
                    content_length,
   90    126   
                );
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   91    128   
                builder
   92    129   
                    .status(400)
   93    130   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   94         -
            }
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         132  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   95    133   
        }
         134  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   96    135   
    })
         136  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   97    137   
}
   98    138   
         139  +
/* JsonParserGenerator.kt:148 */
   99    140   
pub(crate) fn de_json_unions(
  100    141   
    value: &[u8],
  101    142   
    mut builder: crate::input::json_unions_input::Builder,
  102    143   
) -> ::std::result::Result<
  103    144   
    crate::input::json_unions_input::Builder,
  104    145   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  105    146   
> {
         147  +
    /* JsonParserGenerator.kt:153 */
  106    148   
    let mut tokens_owned =
  107    149   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  108    150   
            .peekable();
  109    151   
    let tokens = &mut tokens_owned;
  110    152   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         153  +
    /* JsonParserGenerator.kt:684 */
  111    154   
    loop {
         155  +
        /* JsonParserGenerator.kt:685 */
  112    156   
        match tokens.next().transpose()? {
         157  +
            /* JsonParserGenerator.kt:686 */
  113    158   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  114    159   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         160  +
                /* JsonParserGenerator.kt:260 */
  115    161   
                match key.to_unescaped()?.as_ref() {
         162  +
                    /* JsonParserGenerator.kt:262 */
  116    163   
                    "contents" => {
         164  +
                        /* JsonParserGenerator.kt:272 */
  117    165   
                        builder = builder.set_contents(
  118         -
                            crate::protocol_serde::shape_my_union::de_my_union(tokens)?,
  119         -
                        );
         166  +
                            /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_my_union::de_my_union(tokens)?
         167  +
                        /* JsonParserGenerator.kt:272 */);
         168  +
                        /* JsonParserGenerator.kt:262 */
  120    169   
                    }
  121         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         170  +
                    /* JsonParserGenerator.kt:290 */
         171  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  122    172   
                }
         173  +
                /* JsonParserGenerator.kt:686 */
  123    174   
            }
         175  +
            /* JsonParserGenerator.kt:695 */
  124    176   
            other => {
  125    177   
                return Err(
  126    178   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  127    179   
                        "expected object key or end object, found: {:?}",
  128    180   
                        other
  129    181   
                    )),
  130    182   
                )
  131         -
            }
         183  +
            } /* JsonParserGenerator.kt:685 */
  132    184   
        }
         185  +
        /* JsonParserGenerator.kt:684 */
  133    186   
    }
         187  +
    /* JsonParserGenerator.kt:250 */
  134    188   
    if tokens.next().is_some() {
         189  +
        /* JsonParserGenerator.kt:251 */
  135    190   
        return Err(
  136    191   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  137    192   
                "found more JSON tokens after completing parsing",
  138    193   
            ),
  139    194   
        );
         195  +
        /* JsonParserGenerator.kt:250 */
  140    196   
    }
         197  +
    /* JsonParserGenerator.kt:163 */
  141    198   
    Ok(builder)
         199  +
    /* JsonParserGenerator.kt:148 */
  142    200   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_json_unions_output.rs

@@ -1,1 +26,40 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_json_unions_output_output_output(
    3      4   
    value: &crate::output::JsonUnionsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_json_unions_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::JsonUnionsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.contents {
          27  +
        /* JsonSerializerGenerator.kt:495 */
   20     28   
        #[allow(unused_mut)]
          29  +
        /* JsonSerializerGenerator.kt:496 */
   21     30   
        let mut object_2 = object.key("contents").start_object();
          31  +
        /* JsonSerializerGenerator.kt:579 */
   22     32   
        crate::protocol_serde::shape_my_union::ser_my_union(&mut object_2, var_1)?;
          33  +
        /* JsonSerializerGenerator.kt:515 */
   23     34   
        object_2.finish();
          35  +
        /* JsonSerializerGenerator.kt:382 */
   24     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:372 */
   25     38   
    Ok(())
          39  +
    /* JsonSerializerGenerator.kt:358 */
   26     40   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_kitchen_sink.rs

@@ -1,1 +450,757 @@
    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_kitchen_sink<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::KitchenSink>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::kitchen_sink::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "Blob" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_blob(
          39  +
                                    /* JsonParserGenerator.kt:326 */
   28     40   
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
   29     41   
                                        tokens.next(),
   30         -
                                    )?,
          42  +
                                    )?, /* JsonParserGenerator.kt:272 */
   31     43   
                                );
          44  +
                                /* JsonParserGenerator.kt:262 */
   32     45   
                            }
          46  +
                            /* JsonParserGenerator.kt:262 */
   33     47   
                            "Boolean" => {
          48  +
                                /* JsonParserGenerator.kt:272 */
   34     49   
                                builder = builder.set_boolean(
          50  +
                                    /* JsonParserGenerator.kt:298 */
   35     51   
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   36     52   
                                        tokens.next(),
   37         -
                                    )?,
          53  +
                                    )?, /* JsonParserGenerator.kt:272 */
   38     54   
                                );
          55  +
                                /* JsonParserGenerator.kt:262 */
   39     56   
                            }
          57  +
                            /* JsonParserGenerator.kt:262 */
   40     58   
                            "Double" => {
          59  +
                                /* JsonParserGenerator.kt:272 */
   41     60   
                                builder = builder.set_double(
          61  +
                                    /* JsonParserGenerator.kt:363 */
   42     62   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   43     63   
                                        tokens.next(),
   44     64   
                                    )?
   45         -
                                    .map(|v| v.to_f64_lossy()),
          65  +
                                    .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
   46     66   
                                );
          67  +
                                /* JsonParserGenerator.kt:262 */
   47     68   
                            }
          69  +
                            /* JsonParserGenerator.kt:262 */
   48     70   
                            "EmptyStruct" => {
          71  +
                                /* JsonParserGenerator.kt:272 */
   49     72   
                                builder = builder.set_empty_struct(
          73  +
                                    /* JsonParserGenerator.kt:544 */
   50     74   
                                    crate::protocol_serde::shape_empty_struct::de_empty_struct(
   51     75   
                                        tokens,
   52         -
                                    )?,
          76  +
                                    )?, /* JsonParserGenerator.kt:272 */
   53     77   
                                );
          78  +
                                /* JsonParserGenerator.kt:262 */
   54     79   
                            }
          80  +
                            /* JsonParserGenerator.kt:262 */
   55     81   
                            "Float" => {
          82  +
                                /* JsonParserGenerator.kt:272 */
   56     83   
                                builder = builder.set_float(
          84  +
                                    /* JsonParserGenerator.kt:361 */
   57     85   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   58     86   
                                        tokens.next(),
   59     87   
                                    )?
   60         -
                                    .map(|v| v.to_f32_lossy()),
          88  +
                                    .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
   61     89   
                                );
          90  +
                                /* JsonParserGenerator.kt:262 */
   62     91   
                            }
          92  +
                            /* JsonParserGenerator.kt:262 */
   63     93   
                            "HttpdateTimestamp" => {
          94  +
                                /* JsonParserGenerator.kt:272 */
   64     95   
                                builder = builder.set_httpdate_timestamp(
   65         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::HttpDate)?
   66         -
                                );
          96  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::HttpDate)?
          97  +
                                /* JsonParserGenerator.kt:272 */);
          98  +
                                /* JsonParserGenerator.kt:262 */
   67     99   
                            }
         100  +
                            /* JsonParserGenerator.kt:262 */
   68    101   
                            "Integer" => {
         102  +
                                /* JsonParserGenerator.kt:272 */
   69    103   
                                builder = builder.set_integer(
         104  +
                                    /* JsonParserGenerator.kt:365 */
   70    105   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   71    106   
                                        tokens.next(),
   72    107   
                                    )?
   73    108   
                                    .map(i32::try_from)
   74         -
                                    .transpose()?,
         109  +
                                    .transpose()?, /* JsonParserGenerator.kt:272 */
   75    110   
                                );
         111  +
                                /* JsonParserGenerator.kt:262 */
   76    112   
                            }
         113  +
                            /* JsonParserGenerator.kt:262 */
   77    114   
                            "Iso8601Timestamp" => {
         115  +
                                /* JsonParserGenerator.kt:272 */
   78    116   
                                builder = builder.set_iso8601_timestamp(
   79         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
   80         -
                                );
         117  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
         118  +
                                /* JsonParserGenerator.kt:272 */);
         119  +
                                /* JsonParserGenerator.kt:262 */
   81    120   
                            }
         121  +
                            /* JsonParserGenerator.kt:262 */
   82    122   
                            "JsonValue" => {
         123  +
                                /* JsonParserGenerator.kt:272 */
   83    124   
                                builder = builder.set_json_value(
   84         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   85         -
                                        tokens.next(),
   86         -
                                    )?
   87         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   88         -
                                    .transpose()?,
   89         -
                                );
         125  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         126  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         127  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
         128  +
                                        /* JsonParserGenerator.kt:339 */)
         129  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         130  +
                                /* JsonParserGenerator.kt:272 */);
         131  +
                                /* JsonParserGenerator.kt:262 */
   90    132   
                            }
         133  +
                            /* JsonParserGenerator.kt:262 */
   91    134   
                            "ListOfLists" => {
         135  +
                                /* JsonParserGenerator.kt:272 */
   92    136   
                                builder = builder.set_list_of_lists(
   93         -
                                    crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
   94         -
                                );
         137  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
         138  +
                                /* JsonParserGenerator.kt:272 */);
         139  +
                                /* JsonParserGenerator.kt:262 */
   95    140   
                            }
         141  +
                            /* JsonParserGenerator.kt:262 */
   96    142   
                            "ListOfMapsOfStrings" => {
         143  +
                                /* JsonParserGenerator.kt:272 */
   97    144   
                                builder = builder.set_list_of_maps_of_strings(
   98         -
                                    crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
   99         -
                                );
         145  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
         146  +
                                /* JsonParserGenerator.kt:272 */);
         147  +
                                /* JsonParserGenerator.kt:262 */
  100    148   
                            }
         149  +
                            /* JsonParserGenerator.kt:262 */
  101    150   
                            "ListOfStrings" => {
         151  +
                                /* JsonParserGenerator.kt:272 */
  102    152   
                                builder = builder.set_list_of_strings(
  103         -
                                    crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?
  104         -
                                );
         153  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?
         154  +
                                /* JsonParserGenerator.kt:272 */);
         155  +
                                /* JsonParserGenerator.kt:262 */
  105    156   
                            }
         157  +
                            /* JsonParserGenerator.kt:262 */
  106    158   
                            "ListOfStructs" => {
         159  +
                                /* JsonParserGenerator.kt:272 */
  107    160   
                                builder = builder.set_list_of_structs(
  108         -
                                    crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens)?
  109         -
                                );
         161  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens)?
         162  +
                                /* JsonParserGenerator.kt:272 */);
         163  +
                                /* JsonParserGenerator.kt:262 */
  110    164   
                            }
         165  +
                            /* JsonParserGenerator.kt:262 */
  111    166   
                            "Long" => {
         167  +
                                /* JsonParserGenerator.kt:272 */
  112    168   
                                builder = builder.set_long(
         169  +
                                    /* JsonParserGenerator.kt:365 */
  113    170   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  114    171   
                                        tokens.next(),
  115    172   
                                    )?
  116    173   
                                    .map(i64::try_from)
  117         -
                                    .transpose()?,
         174  +
                                    .transpose()?, /* JsonParserGenerator.kt:272 */
  118    175   
                                );
         176  +
                                /* JsonParserGenerator.kt:262 */
  119    177   
                            }
         178  +
                            /* JsonParserGenerator.kt:262 */
  120    179   
                            "MapOfListsOfStrings" => {
         180  +
                                /* JsonParserGenerator.kt:272 */
  121    181   
                                builder = builder.set_map_of_lists_of_strings(
  122         -
                                    crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
  123         -
                                );
         182  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
         183  +
                                /* JsonParserGenerator.kt:272 */);
         184  +
                                /* JsonParserGenerator.kt:262 */
  124    185   
                            }
         186  +
                            /* JsonParserGenerator.kt:262 */
  125    187   
                            "MapOfMaps" => {
         188  +
                                /* JsonParserGenerator.kt:272 */
  126    189   
                                builder = builder.set_map_of_maps(
  127         -
                                    crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
  128         -
                                );
         190  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
         191  +
                                /* JsonParserGenerator.kt:272 */);
         192  +
                                /* JsonParserGenerator.kt:262 */
  129    193   
                            }
         194  +
                            /* JsonParserGenerator.kt:262 */
  130    195   
                            "MapOfStrings" => {
         196  +
                                /* JsonParserGenerator.kt:272 */
  131    197   
                                builder = builder.set_map_of_strings(
         198  +
                                    /* JsonParserGenerator.kt:509 */
  132    199   
                                    crate::protocol_serde::shape_map_of_strings::de_map_of_strings(
  133    200   
                                        tokens,
  134         -
                                    )?,
         201  +
                                    )?, /* JsonParserGenerator.kt:272 */
  135    202   
                                );
         203  +
                                /* JsonParserGenerator.kt:262 */
  136    204   
                            }
         205  +
                            /* JsonParserGenerator.kt:262 */
  137    206   
                            "MapOfStructs" => {
         207  +
                                /* JsonParserGenerator.kt:272 */
  138    208   
                                builder = builder.set_map_of_structs(
         209  +
                                    /* JsonParserGenerator.kt:509 */
  139    210   
                                    crate::protocol_serde::shape_map_of_structs::de_map_of_structs(
  140    211   
                                        tokens,
  141         -
                                    )?,
         212  +
                                    )?, /* JsonParserGenerator.kt:272 */
  142    213   
                                );
         214  +
                                /* JsonParserGenerator.kt:262 */
  143    215   
                            }
         216  +
                            /* JsonParserGenerator.kt:262 */
  144    217   
                            "RecursiveList" => {
         218  +
                                /* JsonParserGenerator.kt:272 */
  145    219   
                                builder = builder.set_recursive_list(
  146         -
                                    crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
  147         -
                                );
         220  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
         221  +
                                /* JsonParserGenerator.kt:272 */);
         222  +
                                /* JsonParserGenerator.kt:262 */
  148    223   
                            }
         224  +
                            /* JsonParserGenerator.kt:262 */
  149    225   
                            "RecursiveMap" => {
         226  +
                                /* JsonParserGenerator.kt:272 */
  150    227   
                                builder = builder.set_recursive_map(
  151         -
                                    crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
  152         -
                                );
         228  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
         229  +
                                /* JsonParserGenerator.kt:272 */);
         230  +
                                /* JsonParserGenerator.kt:262 */
  153    231   
                            }
         232  +
                            /* JsonParserGenerator.kt:262 */
  154    233   
                            "RecursiveStruct" => {
         234  +
                                /* JsonParserGenerator.kt:272 */
  155    235   
                                builder = builder.set_recursive_struct(
         236  +
                                    /* JsonParserGenerator.kt:544 */
  156    237   
                                    crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(
  157    238   
                                        tokens,
  158    239   
                                    )?
  159         -
                                    .map(Box::new),
         240  +
                                    /* JsonParserGenerator.kt:314 */
         241  +
                                    .map(Box::new), /* JsonParserGenerator.kt:272 */
  160    242   
                                );
         243  +
                                /* JsonParserGenerator.kt:262 */
  161    244   
                            }
         245  +
                            /* JsonParserGenerator.kt:262 */
  162    246   
                            "SimpleStruct" => {
         247  +
                                /* JsonParserGenerator.kt:272 */
  163    248   
                                builder = builder.set_simple_struct(
         249  +
                                    /* JsonParserGenerator.kt:544 */
  164    250   
                                    crate::protocol_serde::shape_simple_struct::de_simple_struct(
  165    251   
                                        tokens,
  166         -
                                    )?,
         252  +
                                    )?, /* JsonParserGenerator.kt:272 */
  167    253   
                                );
         254  +
                                /* JsonParserGenerator.kt:262 */
  168    255   
                            }
         256  +
                            /* JsonParserGenerator.kt:262 */
  169    257   
                            "String" => {
         258  +
                                /* JsonParserGenerator.kt:272 */
  170    259   
                                builder = builder.set_string(
  171         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  172         -
                                        tokens.next(),
  173         -
                                    )?
  174         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  175         -
                                    .transpose()?,
  176         -
                                );
         260  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         261  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         262  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
         263  +
                                        /* JsonParserGenerator.kt:339 */)
         264  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         265  +
                                /* JsonParserGenerator.kt:272 */);
         266  +
                                /* JsonParserGenerator.kt:262 */
  177    267   
                            }
         268  +
                            /* JsonParserGenerator.kt:262 */
  178    269   
                            "StructWithJsonName" => {
         270  +
                                /* JsonParserGenerator.kt:272 */
  179    271   
                                builder = builder.set_struct_with_json_name(
  180         -
                                    crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
  181         -
                                );
         272  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
         273  +
                                /* JsonParserGenerator.kt:272 */);
         274  +
                                /* JsonParserGenerator.kt:262 */
  182    275   
                            }
         276  +
                            /* JsonParserGenerator.kt:262 */
  183    277   
                            "Timestamp" => {
         278  +
                                /* JsonParserGenerator.kt:272 */
  184    279   
                                builder = builder.set_timestamp(
  185         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
  186         -
                                );
         280  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         281  +
                                /* JsonParserGenerator.kt:272 */);
         282  +
                                /* JsonParserGenerator.kt:262 */
  187    283   
                            }
         284  +
                            /* JsonParserGenerator.kt:262 */
  188    285   
                            "UnixTimestamp" => {
         286  +
                                /* JsonParserGenerator.kt:272 */
  189    287   
                                builder = builder.set_unix_timestamp(
  190         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
  191         -
                                );
         288  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         289  +
                                /* JsonParserGenerator.kt:272 */);
         290  +
                                /* JsonParserGenerator.kt:262 */
  192    291   
                            }
  193         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         292  +
                            /* JsonParserGenerator.kt:290 */
         293  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  194    294   
                        }
         295  +
                        /* JsonParserGenerator.kt:686 */
  195    296   
                    }
         297  +
                    /* JsonParserGenerator.kt:695 */
  196    298   
                    other => {
  197    299   
                        return Err(
  198    300   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  199    301   
                                format!("expected object key or end object, found: {:?}", other),
  200    302   
                            ),
  201    303   
                        )
  202         -
                    }
         304  +
                    } /* JsonParserGenerator.kt:685 */
  203    305   
                }
         306  +
                /* JsonParserGenerator.kt:684 */
  204    307   
            }
         308  +
            /* JsonParserGenerator.kt:540 */
  205    309   
            Ok(Some(builder.build()))
         310  +
            /* JsonParserGenerator.kt:713 */
  206    311   
        }
  207         -
        _ => Err(
  208         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  209         -
                "expected start object or null",
  210         -
            ),
  211         -
        ),
         312  +
        /* JsonParserGenerator.kt:722 */
         313  +
        _ => {
         314  +
            /* JsonParserGenerator.kt:723 */
         315  +
            Err(
         316  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         317  +
                    "expected start object or null",
         318  +
                ),
         319  +
            )
         320  +
            /* JsonParserGenerator.kt:722 */
         321  +
        } /* JsonParserGenerator.kt:712 */
  212    322   
    }
         323  +
    /* JsonParserGenerator.kt:516 */
  213    324   
}
  214    325   
         326  +
/* JsonSerializerGenerator.kt:358 */
  215    327   
pub fn ser_kitchen_sink(
  216    328   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  217    329   
    input: &crate::model::KitchenSink,
  218    330   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         331  +
    /* JsonSerializerGenerator.kt:382 */
  219    332   
    if let Some(var_1) = &input.blob {
         333  +
        /* JsonSerializerGenerator.kt:439 */
  220    334   
        object
  221    335   
            .key("Blob")
  222    336   
            .string_unchecked(&::aws_smithy_types::base64::encode(var_1));
         337  +
        /* JsonSerializerGenerator.kt:382 */
  223    338   
    }
         339  +
    /* JsonSerializerGenerator.kt:382 */
  224    340   
    if let Some(var_2) = &input.boolean {
         341  +
        /* JsonSerializerGenerator.kt:424 */
  225    342   
        object.key("Boolean").boolean(*var_2);
         343  +
        /* JsonSerializerGenerator.kt:382 */
  226    344   
    }
         345  +
    /* JsonSerializerGenerator.kt:382 */
  227    346   
    if let Some(var_3) = &input.double {
         347  +
        /* JsonSerializerGenerator.kt:432 */
  228    348   
        object.key("Double").number(
  229    349   
            #[allow(clippy::useless_conversion)]
  230    350   
            ::aws_smithy_types::Number::Float((*var_3).into()),
  231    351   
        );
         352  +
        /* JsonSerializerGenerator.kt:382 */
  232    353   
    }
         354  +
    /* JsonSerializerGenerator.kt:382 */
  233    355   
    if let Some(var_4) = &input.empty_struct {
         356  +
        /* JsonSerializerGenerator.kt:495 */
  234    357   
        #[allow(unused_mut)]
         358  +
        /* JsonSerializerGenerator.kt:496 */
  235    359   
        let mut object_5 = object.key("EmptyStruct").start_object();
         360  +
        /* JsonSerializerGenerator.kt:375 */
  236    361   
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_5, var_4)?;
         362  +
        /* JsonSerializerGenerator.kt:515 */
  237    363   
        object_5.finish();
         364  +
        /* JsonSerializerGenerator.kt:382 */
  238    365   
    }
         366  +
    /* JsonSerializerGenerator.kt:382 */
  239    367   
    if let Some(var_6) = &input.float {
         368  +
        /* JsonSerializerGenerator.kt:432 */
  240    369   
        object.key("Float").number(
  241    370   
            #[allow(clippy::useless_conversion)]
  242    371   
            ::aws_smithy_types::Number::Float((*var_6).into()),
  243    372   
        );
         373  +
        /* JsonSerializerGenerator.kt:382 */
  244    374   
    }
         375  +
    /* JsonSerializerGenerator.kt:382 */
  245    376   
    if let Some(var_7) = &input.httpdate_timestamp {
         377  +
        /* JsonSerializerGenerator.kt:448 */
  246    378   
        object
  247    379   
            .key("HttpdateTimestamp")
  248    380   
            .date_time(var_7, ::aws_smithy_types::date_time::Format::HttpDate)?;
         381  +
        /* JsonSerializerGenerator.kt:382 */
  249    382   
    }
         383  +
    /* JsonSerializerGenerator.kt:382 */
  250    384   
    if let Some(var_8) = &input.integer {
         385  +
        /* JsonSerializerGenerator.kt:432 */
  251    386   
        object.key("Integer").number(
  252    387   
            #[allow(clippy::useless_conversion)]
  253    388   
            ::aws_smithy_types::Number::NegInt((*var_8).into()),
  254    389   
        );
         390  +
        /* JsonSerializerGenerator.kt:382 */
  255    391   
    }
         392  +
    /* JsonSerializerGenerator.kt:382 */
  256    393   
    if let Some(var_9) = &input.iso8601_timestamp {
         394  +
        /* JsonSerializerGenerator.kt:448 */
  257    395   
        object
  258    396   
            .key("Iso8601Timestamp")
  259    397   
            .date_time(var_9, ::aws_smithy_types::date_time::Format::DateTime)?;
         398  +
        /* JsonSerializerGenerator.kt:382 */
  260    399   
    }
         400  +
    /* JsonSerializerGenerator.kt:382 */
  261    401   
    if let Some(var_10) = &input.json_value {
         402  +
        /* JsonSerializerGenerator.kt:423 */
  262    403   
        object.key("JsonValue").string(var_10.as_str());
         404  +
        /* JsonSerializerGenerator.kt:382 */
  263    405   
    }
         406  +
    /* JsonSerializerGenerator.kt:382 */
  264    407   
    if let Some(var_11) = &input.list_of_lists {
         408  +
        /* JsonSerializerGenerator.kt:484 */
  265    409   
        let mut array_12 = object.key("ListOfLists").start_array();
         410  +
        /* JsonSerializerGenerator.kt:524 */
  266    411   
        for item_13 in var_11 {
         412  +
            /* SerializerUtil.kt:42 */
  267    413   
            {
         414  +
                /* JsonSerializerGenerator.kt:484 */
  268    415   
                let mut array_14 = array_12.value().start_array();
         416  +
                /* JsonSerializerGenerator.kt:524 */
  269    417   
                for item_15 in item_13 {
         418  +
                    /* SerializerUtil.kt:42 */
  270    419   
                    {
         420  +
                        /* JsonSerializerGenerator.kt:423 */
  271    421   
                        array_14.value().string(item_15.as_str());
         422  +
                        /* SerializerUtil.kt:42 */
  272    423   
                    }
         424  +
                    /* JsonSerializerGenerator.kt:524 */
  273    425   
                }
         426  +
                /* JsonSerializerGenerator.kt:486 */
  274    427   
                array_14.finish();
         428  +
                /* SerializerUtil.kt:42 */
  275    429   
            }
         430  +
            /* JsonSerializerGenerator.kt:524 */
  276    431   
        }
         432  +
        /* JsonSerializerGenerator.kt:486 */
  277    433   
        array_12.finish();
         434  +
        /* JsonSerializerGenerator.kt:382 */
  278    435   
    }
         436  +
    /* JsonSerializerGenerator.kt:382 */
  279    437   
    if let Some(var_16) = &input.list_of_maps_of_strings {
         438  +
        /* JsonSerializerGenerator.kt:484 */
  280    439   
        let mut array_17 = object.key("ListOfMapsOfStrings").start_array();
         440  +
        /* JsonSerializerGenerator.kt:524 */
  281    441   
        for item_18 in var_16 {
         442  +
            /* SerializerUtil.kt:42 */
  282    443   
            {
         444  +
                /* JsonSerializerGenerator.kt:495 */
  283    445   
                #[allow(unused_mut)]
         446  +
                /* JsonSerializerGenerator.kt:496 */
  284    447   
                let mut object_19 = array_17.value().start_object();
         448  +
                /* JsonSerializerGenerator.kt:537 */
  285    449   
                for (key_20, value_21) in item_18 {
         450  +
                    /* SerializerUtil.kt:42 */
  286    451   
                    {
         452  +
                        /* JsonSerializerGenerator.kt:423 */
  287    453   
                        object_19.key(key_20.as_str()).string(value_21.as_str());
         454  +
                        /* SerializerUtil.kt:42 */
  288    455   
                    }
         456  +
                    /* JsonSerializerGenerator.kt:537 */
  289    457   
                }
         458  +
                /* JsonSerializerGenerator.kt:515 */
  290    459   
                object_19.finish();
         460  +
                /* SerializerUtil.kt:42 */
  291    461   
            }
         462  +
            /* JsonSerializerGenerator.kt:524 */
  292    463   
        }
         464  +
        /* JsonSerializerGenerator.kt:486 */
  293    465   
        array_17.finish();
         466  +
        /* JsonSerializerGenerator.kt:382 */
  294    467   
    }
         468  +
    /* JsonSerializerGenerator.kt:382 */
  295    469   
    if let Some(var_22) = &input.list_of_strings {
         470  +
        /* JsonSerializerGenerator.kt:484 */
  296    471   
        let mut array_23 = object.key("ListOfStrings").start_array();
         472  +
        /* JsonSerializerGenerator.kt:524 */
  297    473   
        for item_24 in var_22 {
         474  +
            /* SerializerUtil.kt:42 */
  298    475   
            {
         476  +
                /* JsonSerializerGenerator.kt:423 */
  299    477   
                array_23.value().string(item_24.as_str());
         478  +
                /* SerializerUtil.kt:42 */
  300    479   
            }
         480  +
            /* JsonSerializerGenerator.kt:524 */
  301    481   
        }
         482  +
        /* JsonSerializerGenerator.kt:486 */
  302    483   
        array_23.finish();
         484  +
        /* JsonSerializerGenerator.kt:382 */
  303    485   
    }
         486  +
    /* JsonSerializerGenerator.kt:382 */
  304    487   
    if let Some(var_25) = &input.list_of_structs {
         488  +
        /* JsonSerializerGenerator.kt:484 */
  305    489   
        let mut array_26 = object.key("ListOfStructs").start_array();
         490  +
        /* JsonSerializerGenerator.kt:524 */
  306    491   
        for item_27 in var_25 {
         492  +
            /* SerializerUtil.kt:42 */
  307    493   
            {
         494  +
                /* JsonSerializerGenerator.kt:495 */
  308    495   
                #[allow(unused_mut)]
         496  +
                /* JsonSerializerGenerator.kt:496 */
  309    497   
                let mut object_28 = array_26.value().start_object();
         498  +
                /* JsonSerializerGenerator.kt:375 */
  310    499   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  311    500   
                    &mut object_28,
  312    501   
                    item_27,
  313    502   
                )?;
         503  +
                /* JsonSerializerGenerator.kt:515 */
  314    504   
                object_28.finish();
         505  +
                /* SerializerUtil.kt:42 */
  315    506   
            }
         507  +
            /* JsonSerializerGenerator.kt:524 */
  316    508   
        }
         509  +
        /* JsonSerializerGenerator.kt:486 */
  317    510   
        array_26.finish();
         511  +
        /* JsonSerializerGenerator.kt:382 */
  318    512   
    }
         513  +
    /* JsonSerializerGenerator.kt:382 */
  319    514   
    if let Some(var_29) = &input.long {
         515  +
        /* JsonSerializerGenerator.kt:432 */
  320    516   
        object.key("Long").number(
  321    517   
            #[allow(clippy::useless_conversion)]
  322    518   
            ::aws_smithy_types::Number::NegInt((*var_29).into()),
  323    519   
        );
         520  +
        /* JsonSerializerGenerator.kt:382 */
  324    521   
    }
         522  +
    /* JsonSerializerGenerator.kt:382 */
  325    523   
    if let Some(var_30) = &input.map_of_lists_of_strings {
         524  +
        /* JsonSerializerGenerator.kt:495 */
  326    525   
        #[allow(unused_mut)]
         526  +
        /* JsonSerializerGenerator.kt:496 */
  327    527   
        let mut object_31 = object.key("MapOfListsOfStrings").start_object();
         528  +
        /* JsonSerializerGenerator.kt:537 */
  328    529   
        for (key_32, value_33) in var_30 {
         530  +
            /* SerializerUtil.kt:42 */
  329    531   
            {
         532  +
                /* JsonSerializerGenerator.kt:484 */
  330    533   
                let mut array_34 = object_31.key(key_32.as_str()).start_array();
         534  +
                /* JsonSerializerGenerator.kt:524 */
  331    535   
                for item_35 in value_33 {
         536  +
                    /* SerializerUtil.kt:42 */
  332    537   
                    {
         538  +
                        /* JsonSerializerGenerator.kt:423 */
  333    539   
                        array_34.value().string(item_35.as_str());
         540  +
                        /* SerializerUtil.kt:42 */
  334    541   
                    }
         542  +
                    /* JsonSerializerGenerator.kt:524 */
  335    543   
                }
         544  +
                /* JsonSerializerGenerator.kt:486 */
  336    545   
                array_34.finish();
         546  +
                /* SerializerUtil.kt:42 */
  337    547   
            }
         548  +
            /* JsonSerializerGenerator.kt:537 */
  338    549   
        }
         550  +
        /* JsonSerializerGenerator.kt:515 */
  339    551   
        object_31.finish();
         552  +
        /* JsonSerializerGenerator.kt:382 */
  340    553   
    }
         554  +
    /* JsonSerializerGenerator.kt:382 */
  341    555   
    if let Some(var_36) = &input.map_of_maps {
         556  +
        /* JsonSerializerGenerator.kt:495 */
  342    557   
        #[allow(unused_mut)]
         558  +
        /* JsonSerializerGenerator.kt:496 */
  343    559   
        let mut object_37 = object.key("MapOfMaps").start_object();
         560  +
        /* JsonSerializerGenerator.kt:537 */
  344    561   
        for (key_38, value_39) in var_36 {
         562  +
            /* SerializerUtil.kt:42 */
  345    563   
            {
         564  +
                /* JsonSerializerGenerator.kt:495 */
  346    565   
                #[allow(unused_mut)]
         566  +
                /* JsonSerializerGenerator.kt:496 */
  347    567   
                let mut object_40 = object_37.key(key_38.as_str()).start_object();
         568  +
                /* JsonSerializerGenerator.kt:537 */
  348    569   
                for (key_41, value_42) in value_39 {
         570  +
                    /* SerializerUtil.kt:42 */
  349    571   
                    {
         572  +
                        /* JsonSerializerGenerator.kt:423 */
  350    573   
                        object_40.key(key_41.as_str()).string(value_42.as_str());
         574  +
                        /* SerializerUtil.kt:42 */
  351    575   
                    }
         576  +
                    /* JsonSerializerGenerator.kt:537 */
  352    577   
                }
         578  +
                /* JsonSerializerGenerator.kt:515 */
  353    579   
                object_40.finish();
         580  +
                /* SerializerUtil.kt:42 */
  354    581   
            }
         582  +
            /* JsonSerializerGenerator.kt:537 */
  355    583   
        }
         584  +
        /* JsonSerializerGenerator.kt:515 */
  356    585   
        object_37.finish();
         586  +
        /* JsonSerializerGenerator.kt:382 */
  357    587   
    }
         588  +
    /* JsonSerializerGenerator.kt:382 */
  358    589   
    if let Some(var_43) = &input.map_of_strings {
         590  +
        /* JsonSerializerGenerator.kt:495 */
  359    591   
        #[allow(unused_mut)]
         592  +
        /* JsonSerializerGenerator.kt:496 */
  360    593   
        let mut object_44 = object.key("MapOfStrings").start_object();
         594  +
        /* JsonSerializerGenerator.kt:537 */
  361    595   
        for (key_45, value_46) in var_43 {
         596  +
            /* SerializerUtil.kt:42 */
  362    597   
            {
         598  +
                /* JsonSerializerGenerator.kt:423 */
  363    599   
                object_44.key(key_45.as_str()).string(value_46.as_str());
         600  +
                /* SerializerUtil.kt:42 */
  364    601   
            }
         602  +
            /* JsonSerializerGenerator.kt:537 */
  365    603   
        }
         604  +
        /* JsonSerializerGenerator.kt:515 */
  366    605   
        object_44.finish();
         606  +
        /* JsonSerializerGenerator.kt:382 */
  367    607   
    }
         608  +
    /* JsonSerializerGenerator.kt:382 */
  368    609   
    if let Some(var_47) = &input.map_of_structs {
         610  +
        /* JsonSerializerGenerator.kt:495 */
  369    611   
        #[allow(unused_mut)]
         612  +
        /* JsonSerializerGenerator.kt:496 */
  370    613   
        let mut object_48 = object.key("MapOfStructs").start_object();
         614  +
        /* JsonSerializerGenerator.kt:537 */
  371    615   
        for (key_49, value_50) in var_47 {
         616  +
            /* SerializerUtil.kt:42 */
  372    617   
            {
         618  +
                /* JsonSerializerGenerator.kt:495 */
  373    619   
                #[allow(unused_mut)]
         620  +
                /* JsonSerializerGenerator.kt:496 */
  374    621   
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
         622  +
                /* JsonSerializerGenerator.kt:375 */
  375    623   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  376    624   
                    &mut object_51,
  377    625   
                    value_50,
  378    626   
                )?;
         627  +
                /* JsonSerializerGenerator.kt:515 */
  379    628   
                object_51.finish();
         629  +
                /* SerializerUtil.kt:42 */
  380    630   
            }
         631  +
            /* JsonSerializerGenerator.kt:537 */
  381    632   
        }
         633  +
        /* JsonSerializerGenerator.kt:515 */
  382    634   
        object_48.finish();
         635  +
        /* JsonSerializerGenerator.kt:382 */
  383    636   
    }
         637  +
    /* JsonSerializerGenerator.kt:382 */
  384    638   
    if let Some(var_52) = &input.recursive_list {
         639  +
        /* JsonSerializerGenerator.kt:484 */
  385    640   
        let mut array_53 = object.key("RecursiveList").start_array();
         641  +
        /* JsonSerializerGenerator.kt:524 */
  386    642   
        for item_54 in var_52 {
         643  +
            /* SerializerUtil.kt:42 */
  387    644   
            {
         645  +
                /* JsonSerializerGenerator.kt:495 */
  388    646   
                #[allow(unused_mut)]
         647  +
                /* JsonSerializerGenerator.kt:496 */
  389    648   
                let mut object_55 = array_53.value().start_object();
         649  +
                /* JsonSerializerGenerator.kt:375 */
  390    650   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  391    651   
                    &mut object_55,
  392    652   
                    item_54,
  393    653   
                )?;
         654  +
                /* JsonSerializerGenerator.kt:515 */
  394    655   
                object_55.finish();
         656  +
                /* SerializerUtil.kt:42 */
  395    657   
            }
         658  +
            /* JsonSerializerGenerator.kt:524 */
  396    659   
        }
         660  +
        /* JsonSerializerGenerator.kt:486 */
  397    661   
        array_53.finish();
         662  +
        /* JsonSerializerGenerator.kt:382 */
  398    663   
    }
         664  +
    /* JsonSerializerGenerator.kt:382 */
  399    665   
    if let Some(var_56) = &input.recursive_map {
         666  +
        /* JsonSerializerGenerator.kt:495 */
  400    667   
        #[allow(unused_mut)]
         668  +
        /* JsonSerializerGenerator.kt:496 */
  401    669   
        let mut object_57 = object.key("RecursiveMap").start_object();
         670  +
        /* JsonSerializerGenerator.kt:537 */
  402    671   
        for (key_58, value_59) in var_56 {
         672  +
            /* SerializerUtil.kt:42 */
  403    673   
            {
         674  +
                /* JsonSerializerGenerator.kt:495 */
  404    675   
                #[allow(unused_mut)]
         676  +
                /* JsonSerializerGenerator.kt:496 */
  405    677   
                let mut object_60 = object_57.key(key_58.as_str()).start_object();
         678  +
                /* JsonSerializerGenerator.kt:375 */
  406    679   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  407    680   
                    &mut object_60,
  408    681   
                    value_59,
  409    682   
                )?;
         683  +
                /* JsonSerializerGenerator.kt:515 */
  410    684   
                object_60.finish();
         685  +
                /* SerializerUtil.kt:42 */
  411    686   
            }
         687  +
            /* JsonSerializerGenerator.kt:537 */
  412    688   
        }
         689  +
        /* JsonSerializerGenerator.kt:515 */
  413    690   
        object_57.finish();
         691  +
        /* JsonSerializerGenerator.kt:382 */
  414    692   
    }
         693  +
    /* JsonSerializerGenerator.kt:382 */
  415    694   
    if let Some(var_61) = &input.recursive_struct {
         695  +
        /* JsonSerializerGenerator.kt:495 */
  416    696   
        #[allow(unused_mut)]
         697  +
        /* JsonSerializerGenerator.kt:496 */
  417    698   
        let mut object_62 = object.key("RecursiveStruct").start_object();
         699  +
        /* JsonSerializerGenerator.kt:375 */
  418    700   
        crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_62, var_61)?;
         701  +
        /* JsonSerializerGenerator.kt:515 */
  419    702   
        object_62.finish();
         703  +
        /* JsonSerializerGenerator.kt:382 */
  420    704   
    }
         705  +
    /* JsonSerializerGenerator.kt:382 */
  421    706   
    if let Some(var_63) = &input.simple_struct {
         707  +
        /* JsonSerializerGenerator.kt:495 */
  422    708   
        #[allow(unused_mut)]
         709  +
        /* JsonSerializerGenerator.kt:496 */
  423    710   
        let mut object_64 = object.key("SimpleStruct").start_object();
         711  +
        /* JsonSerializerGenerator.kt:375 */
  424    712   
        crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_64, var_63)?;
         713  +
        /* JsonSerializerGenerator.kt:515 */
  425    714   
        object_64.finish();
         715  +
        /* JsonSerializerGenerator.kt:382 */
  426    716   
    }
         717  +
    /* JsonSerializerGenerator.kt:382 */
  427    718   
    if let Some(var_65) = &input.string {
         719  +
        /* JsonSerializerGenerator.kt:423 */
  428    720   
        object.key("String").string(var_65.as_str());
         721  +
        /* JsonSerializerGenerator.kt:382 */
  429    722   
    }
         723  +
    /* JsonSerializerGenerator.kt:382 */
  430    724   
    if let Some(var_66) = &input.struct_with_json_name {
         725  +
        /* JsonSerializerGenerator.kt:495 */
  431    726   
        #[allow(unused_mut)]
         727  +
        /* JsonSerializerGenerator.kt:496 */
  432    728   
        let mut object_67 = object.key("StructWithJsonName").start_object();
         729  +
        /* JsonSerializerGenerator.kt:375 */
  433    730   
        crate::protocol_serde::shape_struct_with_json_name::ser_struct_with_json_name(
  434    731   
            &mut object_67,
  435    732   
            var_66,
  436    733   
        )?;
         734  +
        /* JsonSerializerGenerator.kt:515 */
  437    735   
        object_67.finish();
         736  +
        /* JsonSerializerGenerator.kt:382 */
  438    737   
    }
         738  +
    /* JsonSerializerGenerator.kt:382 */
  439    739   
    if let Some(var_68) = &input.timestamp {
         740  +
        /* JsonSerializerGenerator.kt:448 */
  440    741   
        object
  441    742   
            .key("Timestamp")
  442    743   
            .date_time(var_68, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         744  +
        /* JsonSerializerGenerator.kt:382 */
  443    745   
    }
         746  +
    /* JsonSerializerGenerator.kt:382 */
  444    747   
    if let Some(var_69) = &input.unix_timestamp {
         748  +
        /* JsonSerializerGenerator.kt:448 */
  445    749   
        object
  446    750   
            .key("UnixTimestamp")
  447    751   
            .date_time(var_69, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         752  +
        /* JsonSerializerGenerator.kt:382 */
  448    753   
    }
         754  +
    /* JsonSerializerGenerator.kt:372 */
  449    755   
    Ok(())
         756  +
    /* JsonSerializerGenerator.kt:358 */
  450    757   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/protocol_serde/shape_kitchen_sink_operation.rs

@@ -1,1 +333,509 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_kitchen_sink_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::KitchenSinkOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::kitchen_sink_operation_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_kitchen_sink_operation_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::KitchenSinkOperationOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/x-amz-json-1.1",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_kitchen_sink_operation_output::ser_kitchen_sink_operation_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_kitchen_sink_operation_output::ser_kitchen_sink_operation_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_kitchen_sink_operation_http_error(
   70     99   
    error: &crate::error::KitchenSinkOperationError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::KitchenSinkOperationError::ErrorWithMembers(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload =
   79    112   
                    crate::protocol_serde::shape_error_with_members::ser_error_with_members_error(
   80    113   
                        output,
   81    114   
                    )?;
         115  +
                /* RustType.kt:516 */
   82    116   
                #[allow(unused_mut)]
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   83    118   
                let mut builder = ::http::Response::builder();
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   84    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    121   
                    builder,
   86    122   
                    ::http::header::CONTENT_TYPE,
   87    123   
                    "application/x-amz-json-1.1",
   88    124   
                );
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   89    126   
                let content_length = payload.len();
   90    127   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    128   
                    builder,
   92    129   
                    ::http::header::CONTENT_LENGTH,
   93    130   
                    content_length,
   94    131   
                );
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   95    133   
                builder
   96    134   
                    .status(400)
   97    135   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    137   
            }
         138  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   99    139   
            crate::error::KitchenSinkOperationError::ErrorWithoutMembers(output) => {
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  100    141   
                let payload = crate::protocol_serde::shape_error_without_members::ser_error_without_members_error(output)?;
         142  +
                /* RustType.kt:516 */
  101    143   
                #[allow(unused_mut)]
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  102    145   
                let mut builder = ::http::Response::builder();
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  103    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    148   
                    builder,
  105    149   
                    ::http::header::CONTENT_TYPE,
  106    150   
                    "application/x-amz-json-1.1",
  107    151   
                );
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  108    153   
                let content_length = payload.len();
  109    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  110    155   
                    builder,
  111    156   
                    ::http::header::CONTENT_LENGTH,
  112    157   
                    content_length,
  113    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  114    160   
                builder
  115    161   
                    .status(500)
  116    162   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  117         -
            }
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         164  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  118    165   
        }
         166  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  119    167   
    })
         168  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  120    169   
}
  121    170   
         171  +
/* JsonParserGenerator.kt:148 */
  122    172   
pub(crate) fn de_kitchen_sink_operation(
  123    173   
    value: &[u8],
  124    174   
    mut builder: crate::input::kitchen_sink_operation_input::Builder,
  125    175   
) -> ::std::result::Result<
  126    176   
    crate::input::kitchen_sink_operation_input::Builder,
  127    177   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  128    178   
> {
         179  +
    /* JsonParserGenerator.kt:153 */
  129    180   
    let mut tokens_owned =
  130    181   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  131    182   
            .peekable();
  132    183   
    let tokens = &mut tokens_owned;
  133    184   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         185  +
    /* JsonParserGenerator.kt:684 */
  134    186   
    loop {
         187  +
        /* JsonParserGenerator.kt:685 */
  135    188   
        match tokens.next().transpose()? {
         189  +
            /* JsonParserGenerator.kt:686 */
  136    190   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  137    191   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         192  +
                /* JsonParserGenerator.kt:260 */
  138    193   
                match key.to_unescaped()?.as_ref() {
         194  +
                    /* JsonParserGenerator.kt:262 */
  139    195   
                    "Blob" => {
         196  +
                        /* JsonParserGenerator.kt:272 */
  140    197   
                        builder = builder.set_blob(
         198  +
                            /* JsonParserGenerator.kt:326 */
  141    199   
                            ::aws_smithy_json::deserialize::token::expect_blob_or_null(
  142    200   
                                tokens.next(),
  143         -
                            )?,
         201  +
                            )?, /* JsonParserGenerator.kt:272 */
  144    202   
                        );
         203  +
                        /* JsonParserGenerator.kt:262 */
  145    204   
                    }
         205  +
                    /* JsonParserGenerator.kt:262 */
  146    206   
                    "Boolean" => {
         207  +
                        /* JsonParserGenerator.kt:272 */
  147    208   
                        builder = builder.set_boolean(
         209  +
                            /* JsonParserGenerator.kt:298 */
  148    210   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  149    211   
                                tokens.next(),
  150         -
                            )?,
         212  +
                            )?, /* JsonParserGenerator.kt:272 */
  151    213   
                        );
         214  +
                        /* JsonParserGenerator.kt:262 */
  152    215   
                    }
         216  +
                    /* JsonParserGenerator.kt:262 */
  153    217   
                    "Double" => {
         218  +
                        /* JsonParserGenerator.kt:272 */
  154    219   
                        builder = builder.set_double(
         220  +
                            /* JsonParserGenerator.kt:363 */
  155    221   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  156    222   
                                tokens.next(),
  157    223   
                            )?
  158         -
                            .map(|v| v.to_f64_lossy()),
         224  +
                            .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
  159    225   
                        );
         226  +
                        /* JsonParserGenerator.kt:262 */
  160    227   
                    }
         228  +
                    /* JsonParserGenerator.kt:262 */
  161    229   
                    "EmptyStruct" => {
         230  +
                        /* JsonParserGenerator.kt:272 */
  162    231   
                        builder = builder.set_empty_struct(
  163         -
                            crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?,
  164         -
                        );
         232  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?
         233  +
                        /* JsonParserGenerator.kt:272 */);
         234  +
                        /* JsonParserGenerator.kt:262 */
  165    235   
                    }
         236  +
                    /* JsonParserGenerator.kt:262 */
  166    237   
                    "Float" => {
         238  +
                        /* JsonParserGenerator.kt:272 */
  167    239   
                        builder = builder.set_float(
         240  +
                            /* JsonParserGenerator.kt:361 */
  168    241   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  169    242   
                                tokens.next(),
  170    243   
                            )?
  171         -
                            .map(|v| v.to_f32_lossy()),
         244  +
                            .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
  172    245   
                        );
         246  +
                        /* JsonParserGenerator.kt:262 */
  173    247   
                    }
         248  +
                    /* JsonParserGenerator.kt:262 */
  174    249   
                    "HttpdateTimestamp" => {
         250  +
                        /* JsonParserGenerator.kt:272 */
  175    251   
                        builder = builder.set_httpdate_timestamp(
         252  +
                            /* JsonParserGenerator.kt:384 */
  176    253   
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  177    254   
                                tokens.next(),
  178    255   
                                ::aws_smithy_types::date_time::Format::HttpDate,
  179         -
                            )?,
         256  +
                            )?, /* JsonParserGenerator.kt:272 */
  180    257   
                        );
         258  +
                        /* JsonParserGenerator.kt:262 */
  181    259   
                    }
         260  +
                    /* JsonParserGenerator.kt:262 */
  182    261   
                    "Integer" => {
         262  +
                        /* JsonParserGenerator.kt:272 */
  183    263   
                        builder = builder.set_integer(
         264  +
                            /* JsonParserGenerator.kt:365 */
  184    265   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  185    266   
                                tokens.next(),
  186    267   
                            )?
  187    268   
                            .map(i32::try_from)
  188         -
                            .transpose()?,
         269  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  189    270   
                        );
         271  +
                        /* JsonParserGenerator.kt:262 */
  190    272   
                    }
         273  +
                    /* JsonParserGenerator.kt:262 */
  191    274   
                    "Iso8601Timestamp" => {
         275  +
                        /* JsonParserGenerator.kt:272 */
  192    276   
                        builder = builder.set_iso8601_timestamp(
         277  +
                            /* JsonParserGenerator.kt:384 */
  193    278   
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  194    279   
                                tokens.next(),
  195    280   
                                ::aws_smithy_types::date_time::Format::DateTime,
  196         -
                            )?,
         281  +
                            )?, /* JsonParserGenerator.kt:272 */
  197    282   
                        );
         283  +
                        /* JsonParserGenerator.kt:262 */
  198    284   
                    }
         285  +
                    /* JsonParserGenerator.kt:262 */
  199    286   
                    "JsonValue" => {
         287  +
                        /* JsonParserGenerator.kt:272 */
  200    288   
                        builder = builder.set_json_value(
         289  +
                            /* JsonParserGenerator.kt:354 */
  201    290   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  202    291   
                                tokens.next(),
  203    292   
                            )?
  204         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  205         -
                            .transpose()?,
         293  +
                            .map(|s|
         294  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         295  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         296  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         297  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  206    298   
                        );
         299  +
                        /* JsonParserGenerator.kt:262 */
  207    300   
                    }
         301  +
                    /* JsonParserGenerator.kt:262 */
  208    302   
                    "ListOfLists" => {
         303  +
                        /* JsonParserGenerator.kt:272 */
  209    304   
                        builder = builder.set_list_of_lists(
  210         -
                            crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
  211         -
                        );
         305  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
         306  +
                        /* JsonParserGenerator.kt:272 */);
         307  +
                        /* JsonParserGenerator.kt:262 */
  212    308   
                    }
         309  +
                    /* JsonParserGenerator.kt:262 */
  213    310   
                    "ListOfMapsOfStrings" => {
         311  +
                        /* JsonParserGenerator.kt:272 */
  214    312   
                        builder = builder.set_list_of_maps_of_strings(
  215         -
                            crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
  216         -
                        );
         313  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
         314  +
                        /* JsonParserGenerator.kt:272 */);
         315  +
                        /* JsonParserGenerator.kt:262 */
  217    316   
                    }
         317  +
                    /* JsonParserGenerator.kt:262 */
  218    318   
                    "ListOfStrings" => {
         319  +
                        /* JsonParserGenerator.kt:272 */
  219    320   
                        builder = builder.set_list_of_strings(
         321  +
                            /* JsonParserGenerator.kt:451 */
  220    322   
                            crate::protocol_serde::shape_list_of_strings::de_list_of_strings(
  221    323   
                                tokens,
  222         -
                            )?,
         324  +
                            )?, /* JsonParserGenerator.kt:272 */
  223    325   
                        );
         326  +
                        /* JsonParserGenerator.kt:262 */
  224    327   
                    }
         328  +
                    /* JsonParserGenerator.kt:262 */
  225    329   
                    "ListOfStructs" => {
         330  +
                        /* JsonParserGenerator.kt:272 */
  226    331   
                        builder = builder.set_list_of_structs(
         332  +
                            /* JsonParserGenerator.kt:451 */
  227    333   
                            crate::protocol_serde::shape_list_of_structs::de_list_of_structs(
  228    334   
                                tokens,
  229         -
                            )?,
         335  +
                            )?, /* JsonParserGenerator.kt:272 */
  230    336   
                        );
         337  +
                        /* JsonParserGenerator.kt:262 */
  231    338   
                    }
         339  +
                    /* JsonParserGenerator.kt:262 */
  232    340   
                    "Long" => {
         341  +
                        /* JsonParserGenerator.kt:272 */
  233    342   
                        builder = builder.set_long(
         343  +
                            /* JsonParserGenerator.kt:365 */
  234    344   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  235    345   
                                tokens.next(),
  236    346   
                            )?
  237    347   
                            .map(i64::try_from)
  238         -
                            .transpose()?,
         348  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  239    349   
                        );
         350  +
                        /* JsonParserGenerator.kt:262 */
  240    351   
                    }
         352  +
                    /* JsonParserGenerator.kt:262 */
  241    353   
                    "MapOfListsOfStrings" => {
         354  +
                        /* JsonParserGenerator.kt:272 */
  242    355   
                        builder = builder.set_map_of_lists_of_strings(
  243         -
                            crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
  244         -
                        );
         356  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
         357  +
                        /* JsonParserGenerator.kt:272 */);
         358  +
                        /* JsonParserGenerator.kt:262 */
  245    359   
                    }
         360  +
                    /* JsonParserGenerator.kt:262 */
  246    361   
                    "MapOfMaps" => {
         362  +
                        /* JsonParserGenerator.kt:272 */
  247    363   
                        builder = builder.set_map_of_maps(
  248         -
                            crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
  249         -
                        );
         364  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
         365  +
                        /* JsonParserGenerator.kt:272 */);
         366  +
                        /* JsonParserGenerator.kt:262 */
  250    367   
                    }
         368  +
                    /* JsonParserGenerator.kt:262 */
  251    369   
                    "MapOfStrings" => {
  252         -
                        builder = builder.set_map_of_strings(
  253         -
                            crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?,
  254         -
                        );
         370  +
                        /* JsonParserGenerator.kt:272 */
         371  +
                        builder =
         372  +
                            builder.set_map_of_strings(
         373  +
                                /* JsonParserGenerator.kt:509 */
         374  +
                                crate::protocol_serde::shape_map_of_strings::de_map_of_strings(
         375  +
                                    tokens,
         376  +
                                )?, /* JsonParserGenerator.kt:272 */
         377  +
                            );
         378  +
                        /* JsonParserGenerator.kt:262 */
  255    379   
                    }
         380  +
                    /* JsonParserGenerator.kt:262 */
  256    381   
                    "MapOfStructs" => {
  257         -
                        builder = builder.set_map_of_structs(
  258         -
                            crate::protocol_serde::shape_map_of_structs::de_map_of_structs(tokens)?,
  259         -
                        );
         382  +
                        /* JsonParserGenerator.kt:272 */
         383  +
                        builder =
         384  +
                            builder.set_map_of_structs(
         385  +
                                /* JsonParserGenerator.kt:509 */
         386  +
                                crate::protocol_serde::shape_map_of_structs::de_map_of_structs(
         387  +
                                    tokens,
         388  +
                                )?, /* JsonParserGenerator.kt:272 */
         389  +
                            );
         390  +
                        /* JsonParserGenerator.kt:262 */
  260    391   
                    }
         392  +
                    /* JsonParserGenerator.kt:262 */
  261    393   
                    "RecursiveList" => {
         394  +
                        /* JsonParserGenerator.kt:272 */
  262    395   
                        builder = builder.set_recursive_list(
  263         -
                            crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
  264         -
                        );
         396  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
         397  +
                        /* JsonParserGenerator.kt:272 */);
         398  +
                        /* JsonParserGenerator.kt:262 */
  265    399   
                    }
         400  +
                    /* JsonParserGenerator.kt:262 */
  266    401   
                    "RecursiveMap" => {
         402  +
                        /* JsonParserGenerator.kt:272 */
  267    403   
                        builder = builder.set_recursive_map(
  268         -
                            crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
  269         -
                        );
         404  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
         405  +
                        /* JsonParserGenerator.kt:272 */);
         406  +
                        /* JsonParserGenerator.kt:262 */
  270    407   
                    }
         408  +
                    /* JsonParserGenerator.kt:262 */
  271    409   
                    "RecursiveStruct" => {
         410  +
                        /* JsonParserGenerator.kt:272 */
  272    411   
                        builder = builder.set_recursive_struct(
         412  +
                            /* JsonParserGenerator.kt:544 */
  273    413   
                            crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?
  274         -
                                .map(Box::new),
         414  +
                                /* JsonParserGenerator.kt:314 */
         415  +
                                .map(Box::new), /* JsonParserGenerator.kt:272 */
  275    416   
                        );
         417  +
                        /* JsonParserGenerator.kt:262 */
  276    418   
                    }
         419  +
                    /* JsonParserGenerator.kt:262 */
  277    420   
                    "SimpleStruct" => {
  278         -
                        builder = builder.set_simple_struct(
  279         -
                            crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?,
  280         -
                        );
         421  +
                        /* JsonParserGenerator.kt:272 */
         422  +
                        builder =
         423  +
                            builder.set_simple_struct(
         424  +
                                /* JsonParserGenerator.kt:544 */
         425  +
                                crate::protocol_serde::shape_simple_struct::de_simple_struct(
         426  +
                                    tokens,
         427  +
                                )?, /* JsonParserGenerator.kt:272 */
         428  +
                            );
         429  +
                        /* JsonParserGenerator.kt:262 */
  281    430   
                    }
         431  +
                    /* JsonParserGenerator.kt:262 */
  282    432   
                    "String" => {
         433  +
                        /* JsonParserGenerator.kt:272 */
  283    434   
                        builder = builder.set_string(
         435  +
                            /* JsonParserGenerator.kt:354 */
  284    436   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  285    437   
                                tokens.next(),
  286    438   
                            )?
  287         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  288         -
                            .transpose()?,
         439  +
                            .map(|s|
         440  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         441  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         442  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         443  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  289    444   
                        );
         445  +
                        /* JsonParserGenerator.kt:262 */
  290    446   
                    }
         447  +
                    /* JsonParserGenerator.kt:262 */
  291    448   
                    "StructWithJsonName" => {
         449  +
                        /* JsonParserGenerator.kt:272 */
  292    450   
                        builder = builder.set_struct_with_json_name(
  293         -
                            crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
  294         -
                        );
         451  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
         452  +
                        /* JsonParserGenerator.kt:272 */);
         453  +
                        /* JsonParserGenerator.kt:262 */
  295    454   
                    }
         455  +
                    /* JsonParserGenerator.kt:262 */
  296    456   
                    "Timestamp" => {
         457  +
                        /* JsonParserGenerator.kt:272 */
  297    458   
                        builder = builder.set_timestamp(
         459  +
                            /* JsonParserGenerator.kt:384 */
  298    460   
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  299    461   
                                tokens.next(),
  300    462   
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  301         -
                            )?,
         463  +
                            )?, /* JsonParserGenerator.kt:272 */
  302    464   
                        );
         465  +
                        /* JsonParserGenerator.kt:262 */
  303    466   
                    }
         467  +
                    /* JsonParserGenerator.kt:262 */
  304    468   
                    "UnixTimestamp" => {
         469  +
                        /* JsonParserGenerator.kt:272 */
  305    470   
                        builder = builder.set_unix_timestamp(
         471  +
                            /* JsonParserGenerator.kt:384 */
  306    472   
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  307    473   
                                tokens.next(),
  308    474   
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  309         -
                            )?,
         475  +
                            )?, /* JsonParserGenerator.kt:272 */
  310    476   
                        );
         477  +
                        /* JsonParserGenerator.kt:262 */
  311    478   
                    }
  312         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         479  +
                    /* JsonParserGenerator.kt:290 */
         480  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  313    481   
                }
         482  +
                /* JsonParserGenerator.kt:686 */
  314    483   
            }
         484  +
            /* JsonParserGenerator.kt:695 */
  315    485   
            other => {
  316    486   
                return Err(
  317    487   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  318    488   
                        "expected object key or end object, found: {:?}",
  319    489   
                        other
  320    490   
                    )),
  321    491   
                )
  322         -
            }
         492  +
            } /* JsonParserGenerator.kt:685 */
  323    493   
        }
         494  +
        /* JsonParserGenerator.kt:684 */
  324    495   
    }
         496  +
    /* JsonParserGenerator.kt:250 */
  325    497   
    if tokens.next().is_some() {
         498  +
        /* JsonParserGenerator.kt:251 */
  326    499   
        return Err(
  327    500   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  328    501   
                "found more JSON tokens after completing parsing",
  329    502   
            ),
  330    503   
        );
         504  +
        /* JsonParserGenerator.kt:250 */
  331    505   
    }
         506  +
    /* JsonParserGenerator.kt:163 */
  332    507   
    Ok(builder)
         508  +
    /* JsonParserGenerator.kt:148 */
  333    509   
}