Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_server_statistics_output.rs

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_get_server_statistics_output_output_output(
    3      4   
    value: &crate::output::GetServerStatisticsOutput,
    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_get_server_statistics_output::ser_get_server_statistics_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_get_server_statistics_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::GetServerStatisticsOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
   16     23   
    {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("calls_count").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::NegInt((input.calls_count).into()),
   20     28   
        );
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_storage.rs

@@ -1,1 +163,222 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_get_storage_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetStorageInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::get_storage_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   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:856 */
   22     30   
        if let Some(value) =
   23     31   
            crate::protocol_serde::shape_get_storage_input::de_passcode_header(&headers)?
   24     32   
        {
   25     33   
            input = input.set_passcode(value)
   26     34   
        }
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:1134 */
   27     36   
        let input_string = uri.path();
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1146 */
   28     38   
        let (input_string, (_, m1)) =
   29     39   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   30     40   
                ::nom::sequence::preceded(
   31     41   
                    ::nom::bytes::complete::tag("/"),
   32     42   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("pokedex"),
   33     43   
                ),
   34     44   
                ::nom::sequence::preceded(
   35     45   
                    ::nom::bytes::complete::tag("/"),
   36     46   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   37     47   
                        ::nom::bytes::complete::take_until("/"),
   38     48   
                        ::nom::combinator::rest,
   39     49   
                    )),
   40     50   
                ),
   41     51   
            ))(input_string)?;
   42     52   
        debug_assert_eq!("", input_string);
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:1157 */
   43     54   
        input = input.set_user(crate::protocol_serde::shape_get_storage_input::de_user(m1)?);
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   44     56   
        input.build()?
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   45     58   
    })
          59  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   46     60   
}
   47     61   
          62  +
/* RustType.kt:534 */
   48     63   
#[allow(clippy::unnecessary_wraps)]
          64  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   49     65   
pub fn ser_get_storage_http_response(
   50     66   
    #[allow(unused_variables)] output: crate::output::GetStorageOutput,
   51     67   
) -> std::result::Result<
   52     68   
    ::aws_smithy_http_server::response::Response,
   53     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   54     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   55     72   
    Ok({
          73  +
        /* RustType.kt:534 */
   56     74   
        #[allow(unused_mut)]
   57         -
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          76  +
        let mut builder = ::http_1x::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   58     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     79   
            builder,
   60         -
            ::http::header::CONTENT_TYPE,
          80  +
            ::http_1x::header::CONTENT_TYPE,
   61     81   
            "application/json",
   62     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   63     84   
        let http_status: u16 = 200;
   64     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   65     87   
        let payload =
   66         -
            crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(
   67         -
                &output,
   68         -
            )?;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   69     91   
        let content_length = payload.len();
   70     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71     93   
            builder,
   72         -
            ::http::header::CONTENT_LENGTH,
          94  +
            ::http_1x::header::CONTENT_LENGTH,
   73     95   
            content_length,
   74     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   75     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   76    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   77    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   78    104   
}
   79    105   
         106  +
/* RustType.kt:534 */
   80    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
   81    109   
pub fn ser_get_storage_http_error(
   82    110   
    error: &crate::error::GetStorageError,
   83    111   
) -> std::result::Result<
   84    112   
    ::aws_smithy_http_server::response::Response,
   85    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   86    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:476 */
   87    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
   88    118   
        match error {
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
   89    120   
            crate::error::GetStorageError::ResourceNotFoundException(output) => {
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
   90    122   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         123  +
                /* RustType.kt:534 */
   91    124   
                #[allow(unused_mut)]
   92         -
                let mut builder = ::http::Response::builder();
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         126  +
                let mut builder = ::http_1x::Response::builder();
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   93    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    129   
                    builder,
   95         -
                    ::http::header::CONTENT_TYPE,
         130  +
                    ::http_1x::header::CONTENT_TYPE,
   96    131   
                    "application/json",
   97    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   98    134   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    135   
                    builder,
  100         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         136  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  101    137   
                    "ResourceNotFoundException",
  102    138   
                );
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  103    140   
                let content_length = payload.len();
  104    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    142   
                    builder,
  106         -
                    ::http::header::CONTENT_LENGTH,
         143  +
                    ::http_1x::header::CONTENT_LENGTH,
  107    144   
                    content_length,
  108    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  109    147   
                builder
  110    148   
                    .status(404)
  111    149   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  112    151   
            }
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  113    153   
            crate::error::GetStorageError::StorageAccessNotAuthorized(output) => {
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  114    155   
                let payload = crate::protocol_serde::shape_storage_access_not_authorized::ser_storage_access_not_authorized_error(output)?;
         156  +
                /* RustType.kt:534 */
  115    157   
                #[allow(unused_mut)]
  116         -
                let mut builder = ::http::Response::builder();
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         159  +
                let mut builder = ::http_1x::Response::builder();
         160  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  117    161   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    162   
                    builder,
  119         -
                    ::http::header::CONTENT_TYPE,
         163  +
                    ::http_1x::header::CONTENT_TYPE,
  120    164   
                    "application/json",
  121    165   
                );
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  122    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  123    168   
                    builder,
  124         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         169  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  125    170   
                    "StorageAccessNotAuthorized",
  126    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  127    173   
                let content_length = payload.len();
  128    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  129    175   
                    builder,
  130         -
                    ::http::header::CONTENT_LENGTH,
         176  +
                    ::http_1x::header::CONTENT_LENGTH,
  131    177   
                    content_length,
  132    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  133    180   
                builder
  134    181   
                    .status(401)
  135    182   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  136    184   
            }
         185  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  137    186   
            crate::error::GetStorageError::ValidationException(output) => {
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  138    188   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         189  +
                /* RustType.kt:534 */
  139    190   
                #[allow(unused_mut)]
  140         -
                let mut builder = ::http::Response::builder();
         191  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         192  +
                let mut builder = ::http_1x::Response::builder();
         193  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  141    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    195   
                    builder,
  143         -
                    ::http::header::CONTENT_TYPE,
         196  +
                    ::http_1x::header::CONTENT_TYPE,
  144    197   
                    "application/json",
  145    198   
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  146    200   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  147    201   
                    builder,
  148         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         202  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  149    203   
                    "ValidationException",
  150    204   
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  151    206   
                let content_length = payload.len();
  152    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  153    208   
                    builder,
  154         -
                    ::http::header::CONTENT_LENGTH,
         209  +
                    ::http_1x::header::CONTENT_LENGTH,
  155    210   
                    content_length,
  156    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  157    213   
                builder
  158    214   
                    .status(400)
  159    215   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         217  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
  160    218   
        }
  161         -
        }
         219  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
  162    220   
    })
         221  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
  163    222   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_storage_input.rs

@@ -1,1 +22,30 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:159 */
    2      3   
pub(crate) fn de_passcode_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::string::String>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:166 */
    8     10   
    let headers = header_map.get_all("passcode");
          11  +
    /* HttpBindingGenerator.kt:398 */
    9     12   
    ::aws_smithy_http::header::one_or_none(headers)
          13  +
    /* HttpBindingGenerator.kt:159 */
   10     14   
}
   11     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   12     17   
pub fn de_user(
   13     18   
    value: &str,
   14     19   
) -> std::result::Result<
   15     20   
    ::std::string::String,
   16     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     22   
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1463 */
   18     24   
    let value = ::percent_encoding::percent_decode_str(value)
   19     25   
        .decode_utf8()?
   20     26   
        .into_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   21     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   22     30   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_storage_output.rs

@@ -1,1 +29,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_get_storage_output_output_output(
    3      4   
    value: &crate::output::GetStorageOutput,
    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_get_storage_output::ser_get_storage_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_get_storage_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::GetStorageOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_1 = object.key("collection").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_2 in &input.collection {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:423 */
   23     34   
                array_1.value().string(item_2.as_str());
          35  +
                /* SerializerUtil.kt:42 */
   24     36   
            }
          37  +
            /* JsonSerializerGenerator.kt:524 */
   25     38   
        }
          39  +
        /* JsonSerializerGenerator.kt:486 */
   26     40   
        array_1.finish();
          41  +
        /* SerializerUtil.kt:42 */
   27     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:372 */
   28     44   
    Ok(())
          45  +
    /* JsonSerializerGenerator.kt:358 */
   29     46   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_invalid_pokeball_error.rs

@@ -1,1 +23,34 @@
    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_pokeball_error_error(
    3      4   
    value: &crate::error::InvalidPokeballError,
    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_pokeball_error::ser_invalid_pokeball_error(
    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_invalid_pokeball_error(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::InvalidPokeballError,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("pokeball").string(input.pokeball.as_str());
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_master_ball_unsuccessful.rs

@@ -1,1 +71,104 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_master_ball_unsuccessful_error(
    3      4   
    value: &crate::error::MasterBallUnsuccessful,
    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_master_ball_unsuccessful::ser_master_ball_unsuccessful(
    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_master_ball_unsuccessful(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::MasterBallUnsuccessful,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.message {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("message").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}
   24     35   
          36  +
/* JsonParserGenerator.kt:148 */
   25     37   
pub(crate) fn de_master_ball_unsuccessful_json_err(
   26     38   
    value: &[u8],
   27     39   
    mut builder: crate::error::master_ball_unsuccessful::Builder,
   28     40   
) -> ::std::result::Result<
   29     41   
    crate::error::master_ball_unsuccessful::Builder,
   30     42   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   31     43   
> {
          44  +
    /* JsonParserGenerator.kt:153 */
   32     45   
    let mut tokens_owned =
   33     46   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   34     47   
            .peekable();
   35     48   
    let tokens = &mut tokens_owned;
   36     49   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          50  +
    /* JsonParserGenerator.kt:684 */
   37     51   
    loop {
          52  +
        /* JsonParserGenerator.kt:685 */
   38     53   
        match tokens.next().transpose()? {
          54  +
            /* JsonParserGenerator.kt:686 */
   39     55   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   40     56   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          57  +
                /* JsonParserGenerator.kt:260 */
   41     58   
                match key.to_unescaped()?.as_ref() {
          59  +
                    /* JsonParserGenerator.kt:262 */
   42     60   
                    "message" => {
          61  +
                        /* JsonParserGenerator.kt:272 */
   43     62   
                        builder = builder.set_message(
          63  +
                            /* JsonParserGenerator.kt:354 */
   44     64   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   45     65   
                                tokens.next(),
   46     66   
                            )?
   47         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   48         -
                            .transpose()?,
          67  +
                            .map(|s|
          68  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          69  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          70  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          71  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   49     72   
                        );
          73  +
                        /* JsonParserGenerator.kt:262 */
   50     74   
                    }
   51         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          75  +
                    /* JsonParserGenerator.kt:290 */
          76  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   52     77   
                }
          78  +
                /* JsonParserGenerator.kt:686 */
   53     79   
            }
          80  +
            /* JsonParserGenerator.kt:695 */
   54     81   
            other => {
   55     82   
                return Err(
   56     83   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   57     84   
                        "expected object key or end object, found: {other:?}"
   58     85   
                    )),
   59     86   
                )
          87  +
            } /* JsonParserGenerator.kt:685 */
   60     88   
        }
          89  +
        /* JsonParserGenerator.kt:684 */
   61     90   
    }
   62         -
    }
          91  +
    /* JsonParserGenerator.kt:250 */
   63     92   
    if tokens.next().is_some() {
          93  +
        /* JsonParserGenerator.kt:251 */
   64     94   
        return Err(
   65     95   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   66     96   
                "found more JSON tokens after completing parsing",
   67     97   
            ),
   68     98   
        );
          99  +
        /* JsonParserGenerator.kt:250 */
   69    100   
    }
         101  +
    /* JsonParserGenerator.kt:163 */
   70    102   
    Ok(builder)
         103  +
    /* JsonParserGenerator.kt:148 */
   71    104   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_resource_not_found_exception.rs

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_resource_not_found_exception_error(
    3      4   
    value: &crate::error::ResourceNotFoundException,
    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_resource_not_found_exception::ser_resource_not_found_exception(
    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_resource_not_found_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ResourceNotFoundException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("message").string(input.message.as_str());
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_storage_access_not_authorized.rs

@@ -1,1 +20,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_storage_access_not_authorized_error(
    3      4   
    value: &crate::error::StorageAccessNotAuthorized,
    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_storage_access_not_authorized::ser_storage_access_not_authorized(
    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_storage_access_not_authorized(
   16     22   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    #[allow(unused_variables)] input: &crate::error::StorageAccessNotAuthorized,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:372 */
   19     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   20     28   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_stream_pokemon_radio.rs

@@ -1,1 +51,73 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_stream_pokemon_radio_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StreamPokemonRadioInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::stream_pokemon_radio_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   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:873 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:534 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   28     41   
pub fn ser_stream_pokemon_radio_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::StreamPokemonRadioOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:534 */
   35     50   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          52  +
        let mut builder = ::http_1x::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          56  +
            ::http_1x::header::CONTENT_TYPE,
   40     57   
            "application/octet-stream",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
   44         -
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
   45         -
            ::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
   46         -
                crate::protocol_serde::shape_stream_pokemon_radio_output::ser_data_http_payload( output.data)?
   47         -
            )
   48         -
        ));
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
          63  +
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream(
          64  +
            /* ServerProtocolLoader.kt:42 */::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
          65  +
                /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_stream_pokemon_radio_output::ser_data_http_payload( output.data)?
          66  +
            /* ServerProtocolLoader.kt:42 */)
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */));
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   49     69   
        builder.body(body)?
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   50     71   
    })
          72  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   51     73   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_stream_pokemon_radio_output.rs

@@ -1,1 +9,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:309 */
    2      3   
pub fn ser_data_http_payload(
    3      4   
    payload: ::aws_smithy_types::byte_stream::ByteStream,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    6      7   
    ::aws_smithy_types::error::operation::BuildError,
    7      8   
> {
    8         -
    Ok(payload)
           9  +
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
          10  +
    Ok(
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:372 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:343 */
          13  +
    )
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
    9     15   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_throttling_error.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_throttling_error_error(
    3      4   
    value: &crate::error::ThrottlingError,
    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_throttling_error::ser_throttling_error(&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_throttling_error(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::error::ThrottlingError,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_unsupported_region_error.rs

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_unsupported_region_error_error(
    3      4   
    value: &crate::error::UnsupportedRegionError,
    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_unsupported_region_error::ser_unsupported_region_error(
    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_unsupported_region_error(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::UnsupportedRegionError,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("region").string(input.region.as_str());
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    value: &crate::error::ValidationException,
    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_validation_exception::ser_validation_exception(
    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_validation_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ValidationException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.field_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_2 = object.key("fieldList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_3 in var_1 {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_4 = array_2.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_4.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_2.finish();
          47  +
        /* JsonSerializerGenerator.kt:382 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("message").string(input.message.as_str());
          53  +
        /* SerializerUtil.kt:42 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
   34     56   
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
   35     58   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

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

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/service.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`PokemonService`].
    3      4   
///
    4      5   
/// Constructed via [`PokemonService::builder`].
    5      6   
pub struct PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    capture_pokemon: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    check_health: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    do_nothing: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    get_pokemon_species: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    get_server_statistics: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    get_storage: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -41,42 +102,103 @@
   61     62   
                            <
   62     63   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   63     64   
                                as ::aws_smithy_http_server::plugin::Plugin<
   64     65   
                                    PokemonService<L>,
   65     66   
                                    crate::operation_shape::CapturePokemon,
   66     67   
                                    ModelPl::Output
   67     68   
                                >
   68     69   
                            >::Output
   69     70   
                        >,
   70     71   
   71         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   72         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          72  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          73  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   73     74   
   74     75   
                    {
   75     76   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   76     77   
        use ::aws_smithy_http_server::plugin::Plugin;
   77     78   
        let svc = crate::operation_shape::CapturePokemon::from_handler(handler);
   78     79   
        let svc = self.model_plugin.apply(svc);
   79     80   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   80     81   
            .apply(svc);
   81     82   
        let svc = self.http_plugin.apply(svc);
   82     83   
        self.capture_pokemon_custom(svc)
@@ -108,109 +188,189 @@
  128    129   
                            <
  129    130   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  130    131   
                                as ::aws_smithy_http_server::plugin::Plugin<
  131    132   
                                    PokemonService<L>,
  132    133   
                                    crate::operation_shape::CapturePokemon,
  133    134   
                                    ModelPl::Output
  134    135   
                                >
  135    136   
                            >::Output
  136    137   
                        >,
  137    138   
  138         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  139         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         139  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         140  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  140    141   
  141    142   
                    {
  142    143   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  143    144   
        use ::aws_smithy_http_server::plugin::Plugin;
  144    145   
        let svc = crate::operation_shape::CapturePokemon::from_service(service);
  145    146   
        let svc = self.model_plugin.apply(svc);
  146    147   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  147    148   
            .apply(svc);
  148    149   
        let svc = self.http_plugin.apply(svc);
  149    150   
        self.capture_pokemon_custom(svc)
  150    151   
    }
  151    152   
  152    153   
    /// Sets the [`CapturePokemon`](crate::operation_shape::CapturePokemon) to a custom [`Service`](tower::Service).
  153    154   
    /// not constrained by the Smithy contract.
  154    155   
    fn capture_pokemon_custom<S>(mut self, svc: S) -> Self
  155    156   
    where
  156    157   
        S: ::tower::Service<
  157         -
                ::http::Request<Body>,
  158         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         158  +
                ::http_1x::Request<Body>,
         159  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  159    160   
                Error = ::std::convert::Infallible,
  160    161   
            > + Clone
  161    162   
            + Send
  162    163   
            + 'static,
  163    164   
        S::Future: Send + 'static,
  164    165   
    {
  165    166   
        self.capture_pokemon = Some(::aws_smithy_http_server::routing::Route::new(svc));
  166    167   
        self
  167    168   
    }
  168    169   
@@ -191,192 +252,253 @@
  211    212   
                            <
  212    213   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  213    214   
                                as ::aws_smithy_http_server::plugin::Plugin<
  214    215   
                                    PokemonService<L>,
  215    216   
                                    crate::operation_shape::CheckHealth,
  216    217   
                                    ModelPl::Output
  217    218   
                                >
  218    219   
                            >::Output
  219    220   
                        >,
  220    221   
  221         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  222         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         222  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         223  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  223    224   
  224    225   
                    {
  225    226   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  226    227   
        use ::aws_smithy_http_server::plugin::Plugin;
  227    228   
        let svc = crate::operation_shape::CheckHealth::from_handler(handler);
  228    229   
        let svc = self.model_plugin.apply(svc);
  229    230   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  230    231   
            .apply(svc);
  231    232   
        let svc = self.http_plugin.apply(svc);
  232    233   
        self.check_health_custom(svc)
@@ -258,259 +338,339 @@
  278    279   
                            <
  279    280   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  280    281   
                                as ::aws_smithy_http_server::plugin::Plugin<
  281    282   
                                    PokemonService<L>,
  282    283   
                                    crate::operation_shape::CheckHealth,
  283    284   
                                    ModelPl::Output
  284    285   
                                >
  285    286   
                            >::Output
  286    287   
                        >,
  287    288   
  288         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  289         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         289  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         290  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  290    291   
  291    292   
                    {
  292    293   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  293    294   
        use ::aws_smithy_http_server::plugin::Plugin;
  294    295   
        let svc = crate::operation_shape::CheckHealth::from_service(service);
  295    296   
        let svc = self.model_plugin.apply(svc);
  296    297   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  297    298   
            .apply(svc);
  298    299   
        let svc = self.http_plugin.apply(svc);
  299    300   
        self.check_health_custom(svc)
  300    301   
    }
  301    302   
  302    303   
    /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) to a custom [`Service`](tower::Service).
  303    304   
    /// not constrained by the Smithy contract.
  304    305   
    fn check_health_custom<S>(mut self, svc: S) -> Self
  305    306   
    where
  306    307   
        S: ::tower::Service<
  307         -
                ::http::Request<Body>,
  308         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         308  +
                ::http_1x::Request<Body>,
         309  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  309    310   
                Error = ::std::convert::Infallible,
  310    311   
            > + Clone
  311    312   
            + Send
  312    313   
            + 'static,
  313    314   
        S::Future: Send + 'static,
  314    315   
    {
  315    316   
        self.check_health = Some(::aws_smithy_http_server::routing::Route::new(svc));
  316    317   
        self
  317    318   
    }
  318    319   
@@ -341,342 +402,403 @@
  361    362   
                            <
  362    363   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  363    364   
                                as ::aws_smithy_http_server::plugin::Plugin<
  364    365   
                                    PokemonService<L>,
  365    366   
                                    crate::operation_shape::DoNothing,
  366    367   
                                    ModelPl::Output
  367    368   
                                >
  368    369   
                            >::Output
  369    370   
                        >,
  370    371   
  371         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  372         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         372  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         373  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  373    374   
  374    375   
                    {
  375    376   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  376    377   
        use ::aws_smithy_http_server::plugin::Plugin;
  377    378   
        let svc = crate::operation_shape::DoNothing::from_handler(handler);
  378    379   
        let svc = self.model_plugin.apply(svc);
  379    380   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  380    381   
            .apply(svc);
  381    382   
        let svc = self.http_plugin.apply(svc);
  382    383   
        self.do_nothing_custom(svc)
@@ -408,409 +488,489 @@
  428    429   
                            <
  429    430   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  430    431   
                                as ::aws_smithy_http_server::plugin::Plugin<
  431    432   
                                    PokemonService<L>,
  432    433   
                                    crate::operation_shape::DoNothing,
  433    434   
                                    ModelPl::Output
  434    435   
                                >
  435    436   
                            >::Output
  436    437   
                        >,
  437    438   
  438         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  439         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         439  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         440  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  440    441   
  441    442   
                    {
  442    443   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  443    444   
        use ::aws_smithy_http_server::plugin::Plugin;
  444    445   
        let svc = crate::operation_shape::DoNothing::from_service(service);
  445    446   
        let svc = self.model_plugin.apply(svc);
  446    447   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  447    448   
            .apply(svc);
  448    449   
        let svc = self.http_plugin.apply(svc);
  449    450   
        self.do_nothing_custom(svc)
  450    451   
    }
  451    452   
  452    453   
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) to a custom [`Service`](tower::Service).
  453    454   
    /// not constrained by the Smithy contract.
  454    455   
    fn do_nothing_custom<S>(mut self, svc: S) -> Self
  455    456   
    where
  456    457   
        S: ::tower::Service<
  457         -
                ::http::Request<Body>,
  458         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         458  +
                ::http_1x::Request<Body>,
         459  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  459    460   
                Error = ::std::convert::Infallible,
  460    461   
            > + Clone
  461    462   
            + Send
  462    463   
            + 'static,
  463    464   
        S::Future: Send + 'static,
  464    465   
    {
  465    466   
        self.do_nothing = Some(::aws_smithy_http_server::routing::Route::new(svc));
  466    467   
        self
  467    468   
    }
  468    469   
@@ -491,492 +552,553 @@
  511    512   
                            <
  512    513   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  513    514   
                                as ::aws_smithy_http_server::plugin::Plugin<
  514    515   
                                    PokemonService<L>,
  515    516   
                                    crate::operation_shape::GetPokemonSpecies,
  516    517   
                                    ModelPl::Output
  517    518   
                                >
  518    519   
                            >::Output
  519    520   
                        >,
  520    521   
  521         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  522         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         522  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         523  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  523    524   
  524    525   
                    {
  525    526   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  526    527   
        use ::aws_smithy_http_server::plugin::Plugin;
  527    528   
        let svc = crate::operation_shape::GetPokemonSpecies::from_handler(handler);
  528    529   
        let svc = self.model_plugin.apply(svc);
  529    530   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  530    531   
            .apply(svc);
  531    532   
        let svc = self.http_plugin.apply(svc);
  532    533   
        self.get_pokemon_species_custom(svc)
@@ -558,559 +638,639 @@
  578    579   
                            <
  579    580   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  580    581   
                                as ::aws_smithy_http_server::plugin::Plugin<
  581    582   
                                    PokemonService<L>,
  582    583   
                                    crate::operation_shape::GetPokemonSpecies,
  583    584   
                                    ModelPl::Output
  584    585   
                                >
  585    586   
                            >::Output
  586    587   
                        >,
  587    588   
  588         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  589         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         589  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         590  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  590    591   
  591    592   
                    {
  592    593   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  593    594   
        use ::aws_smithy_http_server::plugin::Plugin;
  594    595   
        let svc = crate::operation_shape::GetPokemonSpecies::from_service(service);
  595    596   
        let svc = self.model_plugin.apply(svc);
  596    597   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  597    598   
            .apply(svc);
  598    599   
        let svc = self.http_plugin.apply(svc);
  599    600   
        self.get_pokemon_species_custom(svc)
  600    601   
    }
  601    602   
  602    603   
    /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) to a custom [`Service`](tower::Service).
  603    604   
    /// not constrained by the Smithy contract.
  604    605   
    fn get_pokemon_species_custom<S>(mut self, svc: S) -> Self
  605    606   
    where
  606    607   
        S: ::tower::Service<
  607         -
                ::http::Request<Body>,
  608         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         608  +
                ::http_1x::Request<Body>,
         609  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  609    610   
                Error = ::std::convert::Infallible,
  610    611   
            > + Clone
  611    612   
            + Send
  612    613   
            + 'static,
  613    614   
        S::Future: Send + 'static,
  614    615   
    {
  615    616   
        self.get_pokemon_species = Some(::aws_smithy_http_server::routing::Route::new(svc));
  616    617   
        self
  617    618   
    }
  618    619   
@@ -641,642 +702,703 @@
  661    662   
                            <
  662    663   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  663    664   
                                as ::aws_smithy_http_server::plugin::Plugin<
  664    665   
                                    PokemonService<L>,
  665    666   
                                    crate::operation_shape::GetServerStatistics,
  666    667   
                                    ModelPl::Output
  667    668   
                                >
  668    669   
                            >::Output
  669    670   
                        >,
  670    671   
  671         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  672         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         672  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         673  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  673    674   
  674    675   
                    {
  675    676   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  676    677   
        use ::aws_smithy_http_server::plugin::Plugin;
  677    678   
        let svc = crate::operation_shape::GetServerStatistics::from_handler(handler);
  678    679   
        let svc = self.model_plugin.apply(svc);
  679    680   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  680    681   
            .apply(svc);
  681    682   
        let svc = self.http_plugin.apply(svc);
  682    683   
        self.get_server_statistics_custom(svc)
@@ -708,709 +788,789 @@
  728    729   
                            <
  729    730   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  730    731   
                                as ::aws_smithy_http_server::plugin::Plugin<
  731    732   
                                    PokemonService<L>,
  732    733   
                                    crate::operation_shape::GetServerStatistics,
  733    734   
                                    ModelPl::Output
  734    735   
                                >
  735    736   
                            >::Output
  736    737   
                        >,
  737    738   
  738         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  739         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         739  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         740  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  740    741   
  741    742   
                    {
  742    743   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  743    744   
        use ::aws_smithy_http_server::plugin::Plugin;
  744    745   
        let svc = crate::operation_shape::GetServerStatistics::from_service(service);
  745    746   
        let svc = self.model_plugin.apply(svc);
  746    747   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  747    748   
            .apply(svc);
  748    749   
        let svc = self.http_plugin.apply(svc);
  749    750   
        self.get_server_statistics_custom(svc)
  750    751   
    }
  751    752   
  752    753   
    /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) to a custom [`Service`](tower::Service).
  753    754   
    /// not constrained by the Smithy contract.
  754    755   
    fn get_server_statistics_custom<S>(mut self, svc: S) -> Self
  755    756   
    where
  756    757   
        S: ::tower::Service<
  757         -
                ::http::Request<Body>,
  758         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         758  +
                ::http_1x::Request<Body>,
         759  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  759    760   
                Error = ::std::convert::Infallible,
  760    761   
            > + Clone
  761    762   
            + Send
  762    763   
            + 'static,
  763    764   
        S::Future: Send + 'static,
  764    765   
    {
  765    766   
        self.get_server_statistics = Some(::aws_smithy_http_server::routing::Route::new(svc));
  766    767   
        self
  767    768   
    }
  768    769   
@@ -791,792 +852,853 @@
  811    812   
                            <
  812    813   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  813    814   
                                as ::aws_smithy_http_server::plugin::Plugin<
  814    815   
                                    PokemonService<L>,
  815    816   
                                    crate::operation_shape::GetStorage,
  816    817   
                                    ModelPl::Output
  817    818   
                                >
  818    819   
                            >::Output
  819    820   
                        >,
  820    821   
  821         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  822         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         822  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         823  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  823    824   
  824    825   
                    {
  825    826   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  826    827   
        use ::aws_smithy_http_server::plugin::Plugin;
  827    828   
        let svc = crate::operation_shape::GetStorage::from_handler(handler);
  828    829   
        let svc = self.model_plugin.apply(svc);
  829    830   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  830    831   
            .apply(svc);
  831    832   
        let svc = self.http_plugin.apply(svc);
  832    833   
        self.get_storage_custom(svc)
@@ -858,859 +938,939 @@
  878    879   
                            <
  879    880   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  880    881   
                                as ::aws_smithy_http_server::plugin::Plugin<
  881    882   
                                    PokemonService<L>,
  882    883   
                                    crate::operation_shape::GetStorage,
  883    884   
                                    ModelPl::Output
  884    885   
                                >
  885    886   
                            >::Output
  886    887   
                        >,
  887    888   
  888         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  889         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         889  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         890  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  890    891   
  891    892   
                    {
  892    893   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  893    894   
        use ::aws_smithy_http_server::plugin::Plugin;
  894    895   
        let svc = crate::operation_shape::GetStorage::from_service(service);
  895    896   
        let svc = self.model_plugin.apply(svc);
  896    897   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  897    898   
            .apply(svc);
  898    899   
        let svc = self.http_plugin.apply(svc);
  899    900   
        self.get_storage_custom(svc)
  900    901   
    }
  901    902   
  902    903   
    /// Sets the [`GetStorage`](crate::operation_shape::GetStorage) to a custom [`Service`](tower::Service).
  903    904   
    /// not constrained by the Smithy contract.
  904    905   
    fn get_storage_custom<S>(mut self, svc: S) -> Self
  905    906   
    where
  906    907   
        S: ::tower::Service<
  907         -
                ::http::Request<Body>,
  908         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         908  +
                ::http_1x::Request<Body>,
         909  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  909    910   
                Error = ::std::convert::Infallible,
  910    911   
            > + Clone
  911    912   
            + Send
  912    913   
            + 'static,
  913    914   
        S::Future: Send + 'static,
  914    915   
    {
  915    916   
        self.get_storage = Some(::aws_smithy_http_server::routing::Route::new(svc));
  916    917   
        self
  917    918   
    }
  918    919   
@@ -941,942 +1002,1003 @@
  961    962   
                            <
  962    963   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  963    964   
                                as ::aws_smithy_http_server::plugin::Plugin<
  964    965   
                                    PokemonService<L>,
  965    966   
                                    crate::operation_shape::StreamPokemonRadio,
  966    967   
                                    ModelPl::Output
  967    968   
                                >
  968    969   
                            >::Output
  969    970   
                        >,
  970    971   
  971         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  972         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         972  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         973  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  973    974   
  974    975   
                    {
  975    976   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  976    977   
        use ::aws_smithy_http_server::plugin::Plugin;
  977    978   
        let svc = crate::operation_shape::StreamPokemonRadio::from_handler(handler);
  978    979   
        let svc = self.model_plugin.apply(svc);
  979    980   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  980    981   
            .apply(svc);
  981    982   
        let svc = self.http_plugin.apply(svc);
  982    983   
        self.stream_pokemon_radio_custom(svc)
@@ -1008,1009 +1088,1089 @@
 1028   1029   
                            <
 1029   1030   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
 1030   1031   
                                as ::aws_smithy_http_server::plugin::Plugin<
 1031   1032   
                                    PokemonService<L>,
 1032   1033   
                                    crate::operation_shape::StreamPokemonRadio,
 1033   1034   
                                    ModelPl::Output
 1034   1035   
                                >
 1035   1036   
                            >::Output
 1036   1037   
                        >,
 1037   1038   
 1038         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
 1039         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
        1039  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
        1040  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
 1040   1041   
 1041   1042   
                    {
 1042   1043   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
 1043   1044   
        use ::aws_smithy_http_server::plugin::Plugin;
 1044   1045   
        let svc = crate::operation_shape::StreamPokemonRadio::from_service(service);
 1045   1046   
        let svc = self.model_plugin.apply(svc);
 1046   1047   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
 1047   1048   
            .apply(svc);
 1048   1049   
        let svc = self.http_plugin.apply(svc);
 1049   1050   
        self.stream_pokemon_radio_custom(svc)
 1050   1051   
    }
 1051   1052   
 1052   1053   
    /// Sets the [`StreamPokemonRadio`](crate::operation_shape::StreamPokemonRadio) to a custom [`Service`](tower::Service).
 1053   1054   
    /// not constrained by the Smithy contract.
 1054   1055   
    fn stream_pokemon_radio_custom<S>(mut self, svc: S) -> Self
 1055   1056   
    where
 1056   1057   
        S: ::tower::Service<
 1057         -
                ::http::Request<Body>,
 1058         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1058  +
                ::http_1x::Request<Body>,
        1059  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1059   1060   
                Error = ::std::convert::Infallible,
 1060   1061   
            > + Clone
 1061   1062   
            + Send
 1062   1063   
            + 'static,
 1063   1064   
        S::Future: Send + 'static,
 1064   1065   
    {
 1065   1066   
        self.stream_pokemon_radio = Some(::aws_smithy_http_server::routing::Route::new(svc));
 1066   1067   
        self
 1067   1068   
    }
 1068   1069   
}
@@ -1267,1268 +1417,1418 @@
 1287   1288   
        Ok(())
 1288   1289   
    }
 1289   1290   
}
 1290   1291   
 1291   1292   
impl std::error::Error for MissingOperationsError {}
 1292   1293   
 1293   1294   
mod request_specs {
 1294   1295   
    pub(super) fn capture_pokemon() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec
 1295   1296   
    {
 1296   1297   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1297         -
                    ::http::Method::POST,
        1298  +
                    ::http_1x::Method::POST,
 1298   1299   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1299   1300   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1300   1301   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1301   1302   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("capture-pokemon-event")),
 1302   1303   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1303   1304   
]),
 1304   1305   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1305   1306   
])
 1306   1307   
                        )
 1307   1308   
                    ),
 1308   1309   
                )
 1309   1310   
    }
 1310   1311   
    pub(super) fn check_health() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1311   1312   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1312         -
                    ::http::Method::GET,
        1313  +
                    ::http_1x::Method::GET,
 1313   1314   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1314   1315   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1315   1316   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1316   1317   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("ping")),
 1317   1318   
]),
 1318   1319   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1319   1320   
])
 1320   1321   
                        )
 1321   1322   
                    ),
 1322   1323   
                )
 1323   1324   
    }
 1324   1325   
    pub(super) fn do_nothing() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1325   1326   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1326         -
                    ::http::Method::GET,
        1327  +
                    ::http_1x::Method::GET,
 1327   1328   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1328   1329   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1329   1330   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1330   1331   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("do-nothing")),
 1331   1332   
]),
 1332   1333   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1333   1334   
])
 1334   1335   
                        )
 1335   1336   
                    ),
 1336   1337   
                )
 1337   1338   
    }
 1338   1339   
    pub(super) fn get_pokemon_species(
 1339   1340   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1340   1341   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1341         -
                    ::http::Method::GET,
        1342  +
                    ::http_1x::Method::GET,
 1342   1343   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1343   1344   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1344   1345   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1345   1346   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokemon-species")),
 1346   1347   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1347   1348   
]),
 1348   1349   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1349   1350   
])
 1350   1351   
                        )
 1351   1352   
                    ),
 1352   1353   
                )
 1353   1354   
    }
 1354   1355   
    pub(super) fn get_server_statistics(
 1355   1356   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1356   1357   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1357         -
                    ::http::Method::GET,
        1358  +
                    ::http_1x::Method::GET,
 1358   1359   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1359   1360   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1360   1361   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1361   1362   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("stats")),
 1362   1363   
]),
 1363   1364   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1364   1365   
])
 1365   1366   
                        )
 1366   1367   
                    ),
 1367   1368   
                )
 1368   1369   
    }
 1369   1370   
    pub(super) fn get_storage() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1370   1371   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1371         -
                    ::http::Method::GET,
        1372  +
                    ::http_1x::Method::GET,
 1372   1373   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1373   1374   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1374   1375   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1375   1376   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokedex")),
 1376   1377   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1377   1378   
]),
 1378   1379   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1379   1380   
])
 1380   1381   
                        )
 1381   1382   
                    ),
 1382   1383   
                )
 1383   1384   
    }
 1384   1385   
    pub(super) fn stream_pokemon_radio(
 1385   1386   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1386   1387   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1387         -
                    ::http::Method::GET,
        1388  +
                    ::http_1x::Method::GET,
 1388   1389   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1389   1390   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1390   1391   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1391   1392   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("radio")),
 1392   1393   
]),
 1393   1394   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1394   1395   
])
 1395   1396   
                        )
 1396   1397   
                    ),
 1397   1398   
                )
@@ -1526,1527 +1587,1588 @@
 1546   1547   
    ) -> PokemonService<
 1547   1548   
        ::aws_smithy_http_server::routing::RoutingService<
 1548   1549   
            ::aws_smithy_http_server::protocol::rest::router::RestRouter<
 1549   1550   
                ::aws_smithy_http_server::routing::Route<B>,
 1550   1551   
            >,
 1551   1552   
            ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1552   1553   
        >,
 1553   1554   
    >
 1554   1555   
    where
 1555   1556   
        S: ::tower::Service<
 1556         -
            ::http::Request<B>,
 1557         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1557  +
            ::http_1x::Request<B>,
        1558  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1558   1559   
            Error = std::convert::Infallible,
 1559   1560   
        >,
 1560   1561   
        S: Clone + Send + 'static,
 1561   1562   
        S::Future: Send + 'static,
 1562   1563   
    {
 1563   1564   
        self.layer(&::tower::layer::layer_fn(
 1564   1565   
            ::aws_smithy_http_server::routing::Route::new,
 1565   1566   
        ))
 1566   1567   
    }
 1567   1568   
}
@@ -1668,1669 +1727,1729 @@
 1688   1689   
            "com.aws.example",
 1689   1690   
            "PokemonService",
 1690   1691   
        );
 1691   1692   
 1692   1693   
    const VERSION: Option<&'static str> = Some("2024-03-18");
 1693   1694   
 1694   1695   
    type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
 1695   1696   
 1696   1697   
    type Operations = Operation;
 1697   1698   
}
        1699  +
/* ServiceConfigGenerator.kt:178 */
 1698   1700   
/// Configuration for the [`PokemonService`]. This is the central place where to register and
 1699   1701   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 1700   1702   
///
 1701   1703   
/// ```rust,no_run
 1702   1704   
/// # use pokemon_service_server_sdk::PokemonServiceConfig;
 1703   1705   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 1704   1706   
/// # use ::tower::layer::util::Identity;
 1705   1707   
/// # let authentication_plugin = IdentityPlugin;
 1706   1708   
/// # let authorization_plugin = IdentityPlugin;
 1707   1709   
/// # let server_request_id_provider_layer = Identity::new();
@@ -1789,1791 +1848,1851 @@
 1809   1811   
 1810   1812   
    /// Build the configuration.
 1811   1813   
    pub fn build(self) -> super::PokemonServiceConfig<L, H, M> {
 1812   1814   
        super::PokemonServiceConfig {
 1813   1815   
            layers: self.layers,
 1814   1816   
            http_plugins: self.http_plugins,
 1815   1817   
            model_plugins: self.model_plugins,
 1816   1818   
        }
 1817   1819   
    }
 1818   1820   
}
        1821  +
/* ScopeMacroGenerator.kt:81 */
 1819   1822   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 1820   1823   
///
 1821   1824   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 1822   1825   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 1823   1826   
///
 1824   1827   
/// # Example
 1825   1828   
///
 1826   1829   
/// ```rust
 1827   1830   
/// scope! {
 1828   1831   
///     /// Includes [`CapturePokemon`], excluding all other operations.

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/types.rs

@@ -1,1 +0,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::body::SdkBody;
    3      4   
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
    4      5   
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
    5         -
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
/* SmithyTypesPubUseExtra.kt:86 */ pub use ::aws_smithy_types::byte_stream::ByteStream;
    6      7   
#[cfg(feature = "rt-tokio")]
    7      8   
pub use ::aws_smithy_types::byte_stream::FsBuilder;
    8      9   
#[cfg(feature = "rt-tokio")]
    9     10   
pub use ::aws_smithy_types::byte_stream::Length;
   10     11   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
          12  +
/* ServerRequiredCustomizations.kt:76 */
   11     13   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
   12     14   
pub use ::aws_smithy_types::Blob;
   13         -
pub use ::aws_smithy_types::DateTime;
          15  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;