Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_get_storage_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::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:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_storage_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   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:986 */
   27     36   
        let input_string = uri.path();
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   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:1009 */
   43     54   
        input = input.set_user(crate::protocol_serde::shape_get_storage_input::de_user(m1)?);
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   44     56   
        input.build()?
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   45     58   
    })
          59  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   46     60   
}
   47     61   
          62  +
/* RustType.kt:516 */
   48     63   
#[allow(clippy::unnecessary_wraps)]
          64  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   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:433 */
   55     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   56     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   57     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   58     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     79   
            builder,
   60     80   
            ::http::header::CONTENT_TYPE,
   61     81   
            "application/json",
   62     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   63     84   
        let http_status: u16 = 200;
   64     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   65     87   
        let payload =
   66         -
            crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(
   67         -
                &output,
   68         -
            )?;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   69     91   
        let content_length = payload.len();
   70     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71     93   
            builder,
   72     94   
            ::http::header::CONTENT_LENGTH,
   73     95   
            content_length,
   74     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   75     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   76    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   77    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   78    104   
}
   79    105   
         106  +
/* RustType.kt:516 */
   80    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   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:452 */
   87    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   88    118   
        match error {
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   89    120   
            crate::error::GetStorageError::ValidationException(output) => {
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   90    122   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         123  +
                /* RustType.kt:516 */
   91    124   
                #[allow(unused_mut)]
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   92    126   
                let mut builder = ::http::Response::builder();
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    129   
                    builder,
   95    130   
                    ::http::header::CONTENT_TYPE,
   96    131   
                    "application/json",
   97    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   98    134   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    135   
                    builder,
  100    136   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  101    137   
                    "ValidationException",
  102    138   
                );
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  103    140   
                let content_length = payload.len();
  104    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    142   
                    builder,
  106    143   
                    ::http::header::CONTENT_LENGTH,
  107    144   
                    content_length,
  108    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  109    147   
                builder
  110    148   
                    .status(400)
  111    149   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  112    151   
            }
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  113    153   
            crate::error::GetStorageError::StorageAccessNotAuthorized(output) => {
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  114    155   
                let payload = crate::protocol_serde::shape_storage_access_not_authorized::ser_storage_access_not_authorized_error(output)?;
         156  +
                /* RustType.kt:516 */
  115    157   
                #[allow(unused_mut)]
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  116    159   
                let mut builder = ::http::Response::builder();
         160  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  117    161   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    162   
                    builder,
  119    163   
                    ::http::header::CONTENT_TYPE,
  120    164   
                    "application/json",
  121    165   
                );
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  122    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  123    168   
                    builder,
  124    169   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  125    170   
                    "StorageAccessNotAuthorized",
  126    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  127    173   
                let content_length = payload.len();
  128    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  129    175   
                    builder,
  130    176   
                    ::http::header::CONTENT_LENGTH,
  131    177   
                    content_length,
  132    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  133    180   
                builder
  134    181   
                    .status(401)
  135    182   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  136    184   
            }
         185  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  137    186   
            crate::error::GetStorageError::ResourceNotFoundException(output) => {
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  138    188   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         189  +
                /* RustType.kt:516 */
  139    190   
                #[allow(unused_mut)]
         191  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  140    192   
                let mut builder = ::http::Response::builder();
         193  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  141    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    195   
                    builder,
  143    196   
                    ::http::header::CONTENT_TYPE,
  144    197   
                    "application/json",
  145    198   
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  146    200   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  147    201   
                    builder,
  148    202   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  149    203   
                    "ResourceNotFoundException",
  150    204   
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  151    206   
                let content_length = payload.len();
  152    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  153    208   
                    builder,
  154    209   
                    ::http::header::CONTENT_LENGTH,
  155    210   
                    content_length,
  156    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  157    213   
                builder
  158    214   
                    .status(404)
  159    215   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         217  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  160    218   
        }
  161         -
        }
         219  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  162    220   
    })
         221  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  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:153 */
    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:160 */
    8     10   
    let headers = header_map.get_all("passcode");
          11  +
    /* HttpBindingGenerator.kt:375 */
    9     12   
    ::aws_smithy_http::header::one_or_none(headers)
          13  +
    /* HttpBindingGenerator.kt:153 */
   10     14   
}
   11     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   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:1302 */
   18     24   
    let value = ::percent_encoding::percent_decode_str(value)
   19     25   
        .decode_utf8()?
   20     26   
        .into_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   21     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   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 +72,105 @@
    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: {:?}",
   58     85   
                        other
   59     86   
                    )),
   60     87   
                )
          88  +
            } /* JsonParserGenerator.kt:685 */
   61     89   
        }
          90  +
        /* JsonParserGenerator.kt:684 */
   62     91   
    }
   63         -
    }
          92  +
    /* JsonParserGenerator.kt:250 */
   64     93   
    if tokens.next().is_some() {
          94  +
        /* JsonParserGenerator.kt:251 */
   65     95   
        return Err(
   66     96   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   67     97   
                "found more JSON tokens after completing parsing",
   68     98   
            ),
   69     99   
        );
         100  +
        /* JsonParserGenerator.kt:250 */
   70    101   
    }
         102  +
    /* JsonParserGenerator.kt:163 */
   71    103   
    Ok(builder)
         104  +
    /* JsonParserGenerator.kt:148 */
   72    105   
}

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:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_stream_pokemon_radio_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::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:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::stream_pokemon_radio_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:811 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:516 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   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:433 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:516 */
   35     50   
        #[allow(unused_mut)]
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     52   
        let mut builder = ::http::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39     56   
            ::http::header::CONTENT_TYPE,
   40     57   
            "application/octet-stream",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   44     63   
        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         -
        ));
          64  +
            /* ServerProtocolLoader.kt:36 */::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
          65  +
                /* HttpBoundProtocolPayloadGenerator.kt:350 */crate::protocol_serde::shape_stream_pokemon_radio_output::ser_data_http_payload( output.data)?
          66  +
            /* ServerProtocolLoader.kt:36 */)
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */));
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   49     69   
        builder.body(body)?
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   50     71   
    })
          72  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   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:311 */
    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:345 */
          10  +
    Ok(
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:374 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:345 */
          13  +
    )
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
    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>>,
@@ -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:69 */
   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;

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/constrained.rs

@@ -1,1 +144,160 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
pub(crate) mod sparse_set_map_constrained {
    4      4   
           5  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
    5      6   
    #[derive(Debug, Clone)]
    6      7   
    pub(crate) struct SparseSetMapConstrained(
    7      8   
        pub(crate)  std::collections::HashMap<
    8      9   
            ::std::string::String,
    9     10   
            ::std::option::Option<crate::model::StringSet>,
   10     11   
        >,
   11     12   
    );
   12     13   
   13     14   
    impl crate::constrained::Constrained for SparseSetMapConstrained {
   14     15   
        type Unconstrained =
   15     16   
            crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained;
   16     17   
    }
          18  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   17     19   
    impl
   18     20   
        ::std::convert::From<
   19     21   
            ::std::collections::HashMap<
   20     22   
                ::std::string::String,
   21     23   
                ::std::option::Option<crate::model::StringSet>,
   22     24   
            >,
   23     25   
        > for SparseSetMapConstrained
   24     26   
    {
   25     27   
        fn from(
   26     28   
            v: ::std::collections::HashMap<
   27     29   
                ::std::string::String,
   28     30   
                ::std::option::Option<crate::model::StringSet>,
   29     31   
            >,
   30     32   
        ) -> Self {
   31     33   
            Self(v)
   32     34   
        }
   33     35   
    }
   34     36   
   35     37   
    impl ::std::convert::From<SparseSetMapConstrained>
   36     38   
        for ::std::collections::HashMap<
   37     39   
            ::std::string::String,
   38     40   
            ::std::option::Option<crate::model::StringSet>,
   39     41   
        >
   40     42   
    {
   41     43   
        fn from(v: SparseSetMapConstrained) -> Self {
   42     44   
            v.0
   43     45   
        }
   44     46   
    }
          47  +
          48  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   45     49   
}
   46     50   
pub(crate) mod dense_set_map_constrained {
   47     51   
          52  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
   48     53   
    #[derive(Debug, Clone)]
   49     54   
    pub(crate) struct DenseSetMapConstrained(
   50     55   
        pub(crate) std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   51     56   
    );
   52     57   
   53     58   
    impl crate::constrained::Constrained for DenseSetMapConstrained {
   54     59   
        type Unconstrained =
   55     60   
            crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained;
   56     61   
    }
          62  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   57     63   
    impl
   58     64   
        ::std::convert::From<
   59     65   
            ::std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   60     66   
        > for DenseSetMapConstrained
   61     67   
    {
   62     68   
        fn from(
   63     69   
            v: ::std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   64     70   
        ) -> Self {
   65     71   
            Self(v)
   66     72   
        }
   67     73   
    }
   68     74   
   69     75   
    impl ::std::convert::From<DenseSetMapConstrained>
   70     76   
        for ::std::collections::HashMap<::std::string::String, crate::model::StringSet>
   71     77   
    {
   72     78   
        fn from(v: DenseSetMapConstrained) -> Self {
   73     79   
            v.0
   74     80   
        }
   75     81   
    }
          82  +
          83  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   76     84   
}
   77     85   
pub(crate) mod foo_enum_list_constrained {
   78     86   
          87  +
    /* PubCrateConstrainedCollectionGenerator.kt:79 */
   79     88   
    #[derive(Debug, Clone)]
   80     89   
    pub(crate) struct FooEnumListConstrained(pub(crate) std::vec::Vec<crate::model::FooEnum>);
   81     90   
   82     91   
    impl crate::constrained::Constrained for FooEnumListConstrained {
   83     92   
        type Unconstrained =
   84     93   
            crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained;
   85     94   
    }
          95  +
    /* PubCrateConstrainedCollectionGenerator.kt:108 */
   86     96   
    impl ::std::convert::From<::std::vec::Vec<crate::model::FooEnum>> for FooEnumListConstrained {
   87     97   
        fn from(v: ::std::vec::Vec<crate::model::FooEnum>) -> Self {
   88     98   
            Self(v)
   89     99   
        }
   90    100   
    }
   91    101   
   92    102   
    impl ::std::convert::From<FooEnumListConstrained> for ::std::vec::Vec<crate::model::FooEnum> {
   93    103   
        fn from(v: FooEnumListConstrained) -> Self {
   94    104   
            v.0
   95    105   
        }
   96    106   
    }
         107  +
         108  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   97    109   
}
   98    110   
pub(crate) mod foo_enum_map_constrained {
   99    111   
         112  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
  100    113   
    #[derive(Debug, Clone)]
  101    114   
    pub(crate) struct FooEnumMapConstrained(
  102    115   
        pub(crate) std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  103    116   
    );
  104    117   
  105    118   
    impl crate::constrained::Constrained for FooEnumMapConstrained {
  106    119   
        type Unconstrained =
  107    120   
            crate::unconstrained::foo_enum_map_unconstrained::FooEnumMapUnconstrained;
  108    121   
    }
         122  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
  109    123   
    impl
  110    124   
        ::std::convert::From<
  111    125   
            ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  112    126   
        > for FooEnumMapConstrained
  113    127   
    {
  114    128   
        fn from(
  115    129   
            v: ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  116    130   
        ) -> Self {
  117    131   
            Self(v)
  118    132   
        }
  119    133   
    }
  120    134   
  121    135   
    impl ::std::convert::From<FooEnumMapConstrained>
  122    136   
        for ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>
  123    137   
    {
  124    138   
        fn from(v: FooEnumMapConstrained) -> Self {
  125    139   
            v.0
  126    140   
        }
  127    141   
    }
         142  +
         143  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  128    144   
}
  129    145   
  130    146   
/*
  131    147   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  132    148   
 * SPDX-License-Identifier: Apache-2.0
  133    149   
 */
  134    150   
  135    151   
pub(crate) trait Constrained {
  136    152   
    type Unconstrained;
  137    153   
}