Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
    2      3   
const CONTENT_TYPE_GETSTORAGE: ::mime::Mime = ::mime::APPLICATION_JSON;
    3      4   
::pin_project_lite::pin_project! {
    4      5   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    5      6   
    /// [`GetStorageInput`](crate::input::GetStorageInput) using modelled bindings.
    6      7   
    pub struct GetStorageInputFuture {
    7      8   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetStorageInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
    8      9   
    }
    9     10   
}
   10     11   
   11     12   
impl std::future::Future for GetStorageInputFuture {
@@ -38,39 +133,137 @@
   58     59   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     60   
                    e,
   60     61   
                )
   61     62   
            },
   62     63   
        );
   63     64   
        GetStorageInputFuture {
   64     65   
            inner: Box::pin(fut),
   65     66   
        }
   66     67   
    }
   67     68   
}
          69  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
   68     70   
impl
   69     71   
    ::aws_smithy_http_server::response::IntoResponse<
   70     72   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   71     73   
    > for crate::output::GetStorageOutput
   72     74   
{
   73     75   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   74     76   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_response(self) {
   75     77   
            Ok(response) => response,
   76     78   
            Err(e) => {
   77     79   
                ::tracing::error!(error = %e, "failed to serialize response");
   78     80   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   79     81   
            }
   80     82   
        }
   81     83   
    }
   82     84   
}
          85  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
   83     86   
impl
   84     87   
    ::aws_smithy_http_server::response::IntoResponse<
   85     88   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   86     89   
    > for crate::error::GetStorageError
   87     90   
{
   88     91   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   89     92   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_error(&self) {
   90     93   
            Ok(mut response) => {
   91     94   
                response.extensions_mut().insert(
   92     95   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
   93     96   
                );
   94     97   
                response
   95     98   
            }
   96     99   
            Err(e) => {
   97    100   
                ::tracing::error!(error = %e, "failed to serialize response");
   98    101   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   99    102   
            }
  100    103   
        }
  101    104   
    }
  102    105   
}
  103    106   
         107  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  104    108   
const CONTENT_TYPE_GETPOKEMONSPECIES: ::mime::Mime = ::mime::APPLICATION_JSON;
  105    109   
::pin_project_lite::pin_project! {
  106    110   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  107    111   
    /// [`GetPokemonSpeciesInput`](crate::input::GetPokemonSpeciesInput) using modelled bindings.
  108    112   
    pub struct GetPokemonSpeciesInputFuture {
  109    113   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetPokemonSpeciesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  110    114   
    }
  111    115   
}
  112    116   
  113    117   
impl std::future::Future for GetPokemonSpeciesInputFuture {
@@ -142,146 +239,246 @@
  162    166   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  163    167   
                    e,
  164    168   
                )
  165    169   
            },
  166    170   
        );
  167    171   
        GetPokemonSpeciesInputFuture {
  168    172   
            inner: Box::pin(fut),
  169    173   
        }
  170    174   
    }
  171    175   
}
         176  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  172    177   
impl
  173    178   
    ::aws_smithy_http_server::response::IntoResponse<
  174    179   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  175    180   
    > for crate::output::GetPokemonSpeciesOutput
  176    181   
{
  177    182   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  178    183   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_response(self) {
  179    184   
                        Ok(response) => response,
  180    185   
                        Err(e) => {
  181    186   
                            ::tracing::error!(error = %e, "failed to serialize response");
  182    187   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  183    188   
                        }
  184    189   
                    }
  185    190   
    }
  186    191   
}
         192  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  187    193   
impl
  188    194   
    ::aws_smithy_http_server::response::IntoResponse<
  189    195   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  190    196   
    > for crate::error::GetPokemonSpeciesError
  191    197   
{
  192    198   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  193    199   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_error(
  194    200   
            &self,
  195    201   
        ) {
  196    202   
            Ok(mut response) => {
  197    203   
                response.extensions_mut().insert(
  198    204   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  199    205   
                );
  200    206   
                response
  201    207   
            }
  202    208   
            Err(e) => {
  203    209   
                ::tracing::error!(error = %e, "failed to serialize response");
  204    210   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  205    211   
            }
  206    212   
        }
  207    213   
    }
  208    214   
}
  209    215   
         216  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  210    217   
const CONTENT_TYPE_STREAMPOKEMONRADIO: ::mime::Mime = ::mime::APPLICATION_OCTET_STREAM;
  211    218   
::pin_project_lite::pin_project! {
  212    219   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  213    220   
    /// [`StreamPokemonRadioInput`](crate::input::StreamPokemonRadioInput) using modelled bindings.
  214    221   
    pub struct StreamPokemonRadioInputFuture {
  215    222   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamPokemonRadioInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  216    223   
    }
  217    224   
}
  218    225   
  219    226   
impl std::future::Future for StreamPokemonRadioInputFuture {
@@ -248,255 +323,332 @@
  268    275   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  269    276   
                    e,
  270    277   
                )
  271    278   
            },
  272    279   
        );
  273    280   
        StreamPokemonRadioInputFuture {
  274    281   
            inner: Box::pin(fut),
  275    282   
        }
  276    283   
    }
  277    284   
}
         285  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  278    286   
impl
  279    287   
    ::aws_smithy_http_server::response::IntoResponse<
  280    288   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  281    289   
    > for crate::output::StreamPokemonRadioOutput
  282    290   
{
  283    291   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  284    292   
        match crate::protocol_serde::shape_stream_pokemon_radio::ser_stream_pokemon_radio_http_response(self) {
  285    293   
                        Ok(response) => response,
  286    294   
                        Err(e) => {
  287    295   
                            ::tracing::error!(error = %e, "failed to serialize response");
  288    296   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  289    297   
                        }
  290    298   
                    }
  291    299   
    }
  292    300   
}
  293    301   
         302  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  294    303   
const CONTENT_TYPE_CHECKHEALTH: ::mime::Mime = ::mime::APPLICATION_JSON;
  295    304   
::pin_project_lite::pin_project! {
  296    305   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  297    306   
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
  298    307   
    pub struct CheckHealthInputFuture {
  299    308   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CheckHealthInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  300    309   
    }
  301    310   
}
  302    311   
  303    312   
impl std::future::Future for CheckHealthInputFuture {
@@ -330,339 +405,416 @@
  350    359   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  351    360   
                    e,
  352    361   
                )
  353    362   
            },
  354    363   
        );
  355    364   
        CheckHealthInputFuture {
  356    365   
            inner: Box::pin(fut),
  357    366   
        }
  358    367   
    }
  359    368   
}
         369  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  360    370   
impl
  361    371   
    ::aws_smithy_http_server::response::IntoResponse<
  362    372   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  363    373   
    > for crate::output::CheckHealthOutput
  364    374   
{
  365    375   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  366    376   
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
  367    377   
            Ok(response) => response,
  368    378   
            Err(e) => {
  369    379   
                ::tracing::error!(error = %e, "failed to serialize response");
  370    380   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  371    381   
            }
  372    382   
        }
  373    383   
    }
  374    384   
}
  375    385   
         386  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  376    387   
static CONTENT_TYPE_CAPTUREPOKEMON: std::sync::LazyLock<::mime::Mime> =
  377    388   
    std::sync::LazyLock::new(|| {
  378    389   
        "application/vnd.amazon.eventstream"
  379    390   
            .parse::<::mime::Mime>()
  380    391   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  381    392   
    });
  382    393   
::pin_project_lite::pin_project! {
  383    394   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  384    395   
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
  385    396   
    pub struct CapturePokemonInputFuture {
@@ -418,429 +514,528 @@
  438    449   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  439    450   
                    e,
  440    451   
                )
  441    452   
            },
  442    453   
        );
  443    454   
        CapturePokemonInputFuture {
  444    455   
            inner: Box::pin(fut),
  445    456   
        }
  446    457   
    }
  447    458   
}
         459  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  448    460   
impl
  449    461   
    ::aws_smithy_http_server::response::IntoResponse<
  450    462   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  451    463   
    > for crate::output::CapturePokemonOutput
  452    464   
{
  453    465   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  454    466   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
  455    467   
        {
  456    468   
            Ok(response) => response,
  457    469   
            Err(e) => {
  458    470   
                ::tracing::error!(error = %e, "failed to serialize response");
  459    471   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  460    472   
            }
  461    473   
        }
  462    474   
    }
  463    475   
}
         476  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  464    477   
impl
  465    478   
    ::aws_smithy_http_server::response::IntoResponse<
  466    479   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  467    480   
    > for crate::error::CapturePokemonError
  468    481   
{
  469    482   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  470    483   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
  471    484   
            Ok(mut response) => {
  472    485   
                response.extensions_mut().insert(
  473    486   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  474    487   
                );
  475    488   
                response
  476    489   
            }
  477    490   
            Err(e) => {
  478    491   
                ::tracing::error!(error = %e, "failed to serialize response");
  479    492   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  480    493   
            }
  481    494   
        }
  482    495   
    }
  483    496   
}
  484    497   
         498  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  485    499   
const CONTENT_TYPE_DONOTHING: ::mime::Mime = ::mime::APPLICATION_JSON;
  486    500   
::pin_project_lite::pin_project! {
  487    501   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  488    502   
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
  489    503   
    pub struct DoNothingInputFuture {
  490    504   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DoNothingInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  491    505   
    }
  492    506   
}
  493    507   
  494    508   
impl std::future::Future for DoNothingInputFuture {
@@ -521,535 +596,612 @@
  541    555   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  542    556   
                    e,
  543    557   
                )
  544    558   
            },
  545    559   
        );
  546    560   
        DoNothingInputFuture {
  547    561   
            inner: Box::pin(fut),
  548    562   
        }
  549    563   
    }
  550    564   
}
         565  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  551    566   
impl
  552    567   
    ::aws_smithy_http_server::response::IntoResponse<
  553    568   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  554    569   
    > for crate::output::DoNothingOutput
  555    570   
{
  556    571   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  557    572   
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
  558    573   
            Ok(response) => response,
  559    574   
            Err(e) => {
  560    575   
                ::tracing::error!(error = %e, "failed to serialize response");
  561    576   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  562    577   
            }
  563    578   
        }
  564    579   
    }
  565    580   
}
  566    581   
         582  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  567    583   
const CONTENT_TYPE_GETSERVERSTATISTICS: ::mime::Mime = ::mime::APPLICATION_JSON;
  568    584   
::pin_project_lite::pin_project! {
  569    585   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  570    586   
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
  571    587   
    pub struct GetServerStatisticsInputFuture {
  572    588   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetServerStatisticsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  573    589   
    }
  574    590   
}
  575    591   
  576    592   
impl std::future::Future for GetServerStatisticsInputFuture {
@@ -603,619 +647,664 @@
  623    639   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  624    640   
                    e,
  625    641   
                )
  626    642   
            },
  627    643   
        );
  628    644   
        GetServerStatisticsInputFuture {
  629    645   
            inner: Box::pin(fut),
  630    646   
        }
  631    647   
    }
  632    648   
}
         649  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  633    650   
impl
  634    651   
    ::aws_smithy_http_server::response::IntoResponse<
  635    652   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  636    653   
    > for crate::output::GetServerStatisticsOutput
  637    654   
{
  638    655   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  639    656   
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
  640    657   
                        Ok(response) => response,
  641    658   
                        Err(e) => {
  642    659   
                            ::tracing::error!(error = %e, "failed to serialize response");

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

@@ -1,1 +0,303 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Retrieve information about your Pokédex.
           2  +
/* ServerOperationGenerator.kt:48 */
           3  +
/// /* ServerOperationGenerator.kt:48 */Retrieve information about your Pokédex.
           4  +
/* ServerOperationGenerator.kt:55 */
    4      5   
pub struct GetStorage;
    5      6   
    6      7   
impl ::aws_smithy_http_server::operation::OperationShape for GetStorage {
    7      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    8      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    9     10   
            "com.aws.example#GetStorage",
   10     11   
            "com.aws.example",
   11     12   
            "GetStorage",
   12     13   
        );
   13     14   
   14     15   
    type Input = crate::input::GetStorageInput;
   15     16   
    type Output = crate::output::GetStorageOutput;
   16     17   
    type Error = crate::error::GetStorageError;
   17     18   
}
   18     19   
   19     20   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetStorage {
   20     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   21     22   
        ::aws_smithy_http_server::instrumentation::sensitivity::headers::MakeHeaders<
   22     23   
            fn(
   23     24   
                &::http::header::HeaderName,
   24     25   
            )
   25     26   
                -> ::aws_smithy_http_server::instrumentation::sensitivity::headers::HeaderMarker,
   26     27   
        >,
   27     28   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   28     29   
            ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeLabel<
   29     30   
                fn(usize) -> bool,
   30     31   
            >,
   31     32   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   32     33   
        >,
   33     34   
    >;
   34     35   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   35     36   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   36     37   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   37     38   
    >;
   38     39   
   39     40   
    fn request_fmt() -> Self::RequestFmt {
   40     41   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   41     42   
            .header({
   42     43   
                |name: &::http::header::HeaderName| {
   43     44   
                    let name_match = matches!(name.as_str(), "passcode");
   44     45   
                    let key_suffix = None;
   45     46   
                    let value = name_match;
   46     47   
                    ::aws_smithy_http_server::instrumentation::sensitivity::headers::HeaderMarker {
   47     48   
                        key_suffix,
   48     49   
                        value,
   49     50   
                    }
   50     51   
                }
   51     52   
            } as fn(&_) -> _)
   52     53   
            .label(
   53     54   
                { |index: usize| matches!(index, 1) } as fn(usize) -> bool,
   54     55   
                None,
   55     56   
            )
   56     57   
    }
   57     58   
   58     59   
    fn response_fmt() -> Self::ResponseFmt {
   59     60   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   60     61   
    }
   61     62   
}
          63  +
/* ServerOperationGenerator.kt:88 */
   62     64   
   63         -
/// Retrieve information about a Pokémon species.
          65  +
/// /* ServerOperationGenerator.kt:48 */Retrieve information about a Pokémon species.
          66  +
/* ServerOperationGenerator.kt:55 */
   64     67   
pub struct GetPokemonSpecies;
   65     68   
   66     69   
impl ::aws_smithy_http_server::operation::OperationShape for GetPokemonSpecies {
   67     70   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   68     71   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   69     72   
            "com.aws.example#GetPokemonSpecies",
   70     73   
            "com.aws.example",
   71     74   
            "GetPokemonSpecies",
   72     75   
        );
   73     76   
   74     77   
    type Input = crate::input::GetPokemonSpeciesInput;
   75     78   
    type Output = crate::output::GetPokemonSpeciesOutput;
   76     79   
    type Error = crate::error::GetPokemonSpeciesError;
   77     80   
}
   78     81   
   79     82   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetPokemonSpecies {
   80     83   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   81     84   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   82     85   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   83     86   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   84     87   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   85     88   
        >,
   86     89   
    >;
   87     90   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   88     91   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   89     92   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   90     93   
    >;
   91     94   
   92     95   
    fn request_fmt() -> Self::RequestFmt {
   93     96   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   94     97   
    }
   95     98   
   96     99   
    fn response_fmt() -> Self::ResponseFmt {
   97    100   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   98    101   
    }
   99    102   
}
         103  +
/* ServerOperationGenerator.kt:88 */
  100    104   
  101         -
/// Fetch a radio song from the database and stream it back as a playable audio.
         105  +
/// /* ServerOperationGenerator.kt:48 */Fetch a radio song from the database and stream it back as a playable audio.
         106  +
/* ServerOperationGenerator.kt:55 */
  102    107   
pub struct StreamPokemonRadio;
  103    108   
  104    109   
impl ::aws_smithy_http_server::operation::OperationShape for StreamPokemonRadio {
  105    110   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  106    111   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  107    112   
            "com.aws.example#StreamPokemonRadio",
  108    113   
            "com.aws.example",
  109    114   
            "StreamPokemonRadio",
  110    115   
        );
  111    116   
  112    117   
    type Input = crate::input::StreamPokemonRadioInput;
  113    118   
    type Output = crate::output::StreamPokemonRadioOutput;
  114    119   
    type Error = std::convert::Infallible;
  115    120   
}
  116    121   
  117    122   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for StreamPokemonRadio {
  118    123   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  119    124   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  120    125   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  121    126   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  122    127   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  123    128   
        >,
  124    129   
    >;
  125    130   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  126    131   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  127    132   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  128    133   
    >;
  129    134   
  130    135   
    fn request_fmt() -> Self::RequestFmt {
  131    136   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  132    137   
    }
  133    138   
  134    139   
    fn response_fmt() -> Self::ResponseFmt {
  135    140   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  136    141   
    }
  137    142   
}
         143  +
/* ServerOperationGenerator.kt:88 */
  138    144   
  139         -
/// Health check operation, to check the service is up Not yet a deep check
         145  +
/// /* ServerOperationGenerator.kt:48 */Health check operation, to check the service is up Not yet a deep check
         146  +
/* ServerOperationGenerator.kt:55 */
  140    147   
pub struct CheckHealth;
  141    148   
  142    149   
impl ::aws_smithy_http_server::operation::OperationShape for CheckHealth {
  143    150   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  144    151   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  145    152   
            "com.aws.example#CheckHealth",
  146    153   
            "com.aws.example",
  147    154   
            "CheckHealth",
  148    155   
        );
  149    156   
  150    157   
    type Input = crate::input::CheckHealthInput;
  151    158   
    type Output = crate::output::CheckHealthOutput;
  152    159   
    type Error = std::convert::Infallible;
  153    160   
}
  154    161   
  155    162   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for CheckHealth {
  156    163   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  157    164   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  158    165   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  159    166   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  160    167   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  161    168   
        >,
  162    169   
    >;
  163    170   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  164    171   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  165    172   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  166    173   
    >;
  167    174   
  168    175   
    fn request_fmt() -> Self::RequestFmt {
  169    176   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  170    177   
    }
  171    178   
  172    179   
    fn response_fmt() -> Self::ResponseFmt {
  173    180   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  174    181   
    }
  175    182   
}
         183  +
/* ServerOperationGenerator.kt:88 */
  176    184   
  177         -
/// Capture Pokémons via event streams.
         185  +
/// /* ServerOperationGenerator.kt:48 */Capture Pokémons via event streams.
         186  +
/* ServerOperationGenerator.kt:55 */
  178    187   
pub struct CapturePokemon;
  179    188   
  180    189   
impl ::aws_smithy_http_server::operation::OperationShape for CapturePokemon {
  181    190   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  182    191   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  183    192   
            "com.aws.example#CapturePokemon",
  184    193   
            "com.aws.example",
  185    194   
            "CapturePokemon",
  186    195   
        );
  187    196   
  188    197   
    type Input = crate::input::CapturePokemonInput;
  189    198   
    type Output = crate::output::CapturePokemonOutput;
  190    199   
    type Error = crate::error::CapturePokemonError;
  191    200   
}
  192    201   
  193    202   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for CapturePokemon {
  194    203   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  195    204   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  196    205   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  197    206   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  198    207   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  199    208   
        >,
  200    209   
    >;
  201    210   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  202    211   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  203    212   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  204    213   
    >;
  205    214   
  206    215   
    fn request_fmt() -> Self::RequestFmt {
  207    216   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  208    217   
    }
  209    218   
  210    219   
    fn response_fmt() -> Self::ResponseFmt {
  211    220   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  212    221   
    }
  213    222   
}
         223  +
/* ServerOperationGenerator.kt:88 */
  214    224   
  215         -
/// DoNothing operation, used to stress test the framework.
         225  +
/// /* ServerOperationGenerator.kt:48 */DoNothing operation, used to stress test the framework.
         226  +
/* ServerOperationGenerator.kt:55 */
  216    227   
pub struct DoNothing;
  217    228   
  218    229   
impl ::aws_smithy_http_server::operation::OperationShape for DoNothing {
  219    230   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  220    231   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  221    232   
            "com.aws.example#DoNothing",
  222    233   
            "com.aws.example",
  223    234   
            "DoNothing",
  224    235   
        );
  225    236   
  226    237   
    type Input = crate::input::DoNothingInput;
  227    238   
    type Output = crate::output::DoNothingOutput;
  228    239   
    type Error = std::convert::Infallible;
  229    240   
}
  230    241   
  231    242   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for DoNothing {
  232    243   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  233    244   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  234    245   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  235    246   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  236    247   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  237    248   
        >,
  238    249   
    >;
  239    250   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  240    251   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  241    252   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  242    253   
    >;
  243    254   
  244    255   
    fn request_fmt() -> Self::RequestFmt {
  245    256   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  246    257   
    }
  247    258   
  248    259   
    fn response_fmt() -> Self::ResponseFmt {
  249    260   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  250    261   
    }
  251    262   
}
         263  +
/* ServerOperationGenerator.kt:88 */
  252    264   
  253         -
/// Retrieve HTTP server statistiscs, such as calls count.
         265  +
/// /* ServerOperationGenerator.kt:48 */Retrieve HTTP server statistiscs, such as calls count.
         266  +
/* ServerOperationGenerator.kt:55 */
  254    267   
pub struct GetServerStatistics;
  255    268   
  256    269   
impl ::aws_smithy_http_server::operation::OperationShape for GetServerStatistics {
  257    270   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  258    271   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  259    272   
            "com.aws.example#GetServerStatistics",
  260    273   
            "com.aws.example",
  261    274   
            "GetServerStatistics",
  262    275   
        );
  263    276   
  264    277   
    type Input = crate::input::GetServerStatisticsInput;
  265    278   
    type Output = crate::output::GetServerStatisticsOutput;
  266    279   
    type Error = std::convert::Infallible;
  267    280   
}
  268    281   
  269    282   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetServerStatistics {
  270    283   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  271    284   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  272    285   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  273    286   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  274    287   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  275    288   
        >,
  276    289   
    >;
  277    290   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  278    291   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  279    292   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  280    293   
    >;
  281    294   
  282    295   
    fn request_fmt() -> Self::RequestFmt {
  283    296   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  284    297   
    }
  285    298   
  286    299   
    fn response_fmt() -> Self::ResponseFmt {
  287    300   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  288    301   
    }
  289    302   
}
         303  +
/* ServerOperationGenerator.kt:88 */

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

@@ -1,1 +461,760 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Contents of the Pokémon storage.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Contents of the Pokémon storage.
           4  +
/* RustType.kt:516 */
    4      5   
#[derive(
    5      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6      7   
)]
    7         -
pub struct GetStorageOutput {
    8         -
    /// A list of Pokémon species.
           8  +
pub /* StructureGenerator.kt:201 */ struct GetStorageOutput {
           9  +
    /// /* StructureGenerator.kt:231 */A list of Pokémon species.
    9     10   
    pub collection: ::std::vec::Vec<::std::string::String>,
          11  +
    /* StructureGenerator.kt:201 */
   10     12   
}
          13  +
/* StructureGenerator.kt:135 */
   11     14   
impl GetStorageOutput {
   12         -
    /// A list of Pokémon species.
          15  +
    /// /* StructureGenerator.kt:231 */A list of Pokémon species.
          16  +
    /* StructureGenerator.kt:166 */
   13     17   
    pub fn collection(&self) -> &[::std::string::String] {
          18  +
        /* StructureGenerator.kt:171 */
   14     19   
        use std::ops::Deref;
   15     20   
        self.collection.deref()
          21  +
        /* StructureGenerator.kt:166 */
   16     22   
    }
          23  +
    /* StructureGenerator.kt:135 */
   17     24   
}
          25  +
/* ServerCodegenVisitor.kt:345 */
   18     26   
impl GetStorageOutput {
   19         -
    /// Creates a new builder-style object to manufacture [`GetStorageOutput`](crate::output::GetStorageOutput).
          27  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GetStorageOutput`](crate::output::GetStorageOutput).
          28  +
    /* ServerBuilderGenerator.kt:295 */
   20     29   
    pub fn builder() -> crate::output::get_storage_output::Builder {
          30  +
        /* ServerBuilderGenerator.kt:296 */
   21     31   
        crate::output::get_storage_output::Builder::default()
          32  +
        /* ServerBuilderGenerator.kt:295 */
   22     33   
    }
          34  +
    /* ServerCodegenVisitor.kt:345 */
   23     35   
}
   24     36   
          37  +
/* StructureGenerator.kt:197 */
   25     38   
#[allow(missing_docs)] // documentation missing in model
          39  +
/* RustType.kt:516 */
   26     40   
#[derive(
   27     41   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   28     42   
)]
   29         -
pub struct GetPokemonSpeciesOutput {
   30         -
    /// The name for this resource.
          43  +
pub /* StructureGenerator.kt:201 */ struct GetPokemonSpeciesOutput {
          44  +
    /// /* StructureGenerator.kt:231 */The name for this resource.
   31     45   
    pub name: ::std::string::String,
   32         -
    /// A list of flavor text entries for this Pokémon species.
          46  +
    /// /* StructureGenerator.kt:231 */A list of flavor text entries for this Pokémon species.
   33     47   
    pub flavor_text_entries: ::std::vec::Vec<crate::model::FlavorText>,
          48  +
    /* StructureGenerator.kt:201 */
   34     49   
}
          50  +
/* StructureGenerator.kt:135 */
   35     51   
impl GetPokemonSpeciesOutput {
   36         -
    /// The name for this resource.
          52  +
    /// /* StructureGenerator.kt:231 */The name for this resource.
          53  +
    /* StructureGenerator.kt:166 */
   37     54   
    pub fn name(&self) -> &str {
          55  +
        /* StructureGenerator.kt:171 */
   38     56   
        use std::ops::Deref;
   39     57   
        self.name.deref()
          58  +
        /* StructureGenerator.kt:166 */
   40     59   
    }
   41         -
    /// A list of flavor text entries for this Pokémon species.
          60  +
    /// /* StructureGenerator.kt:231 */A list of flavor text entries for this Pokémon species.
          61  +
    /* StructureGenerator.kt:166 */
   42     62   
    pub fn flavor_text_entries(&self) -> &[crate::model::FlavorText] {
          63  +
        /* StructureGenerator.kt:171 */
   43     64   
        use std::ops::Deref;
   44     65   
        self.flavor_text_entries.deref()
          66  +
        /* StructureGenerator.kt:166 */
   45     67   
    }
          68  +
    /* StructureGenerator.kt:135 */
   46     69   
}
          70  +
/* ServerCodegenVisitor.kt:345 */
   47     71   
impl GetPokemonSpeciesOutput {
   48         -
    /// Creates a new builder-style object to manufacture [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
          72  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
          73  +
    /* ServerBuilderGenerator.kt:295 */
   49     74   
    pub fn builder() -> crate::output::get_pokemon_species_output::Builder {
          75  +
        /* ServerBuilderGenerator.kt:296 */
   50     76   
        crate::output::get_pokemon_species_output::Builder::default()
          77  +
        /* ServerBuilderGenerator.kt:295 */
   51     78   
    }
          79  +
    /* ServerCodegenVisitor.kt:345 */
   52     80   
}
   53     81   
          82  +
/* StructureGenerator.kt:197 */
   54     83   
#[allow(missing_docs)] // documentation missing in model
          84  +
/* RustType.kt:516 */
   55     85   
#[derive(::std::fmt::Debug)]
   56         -
pub struct StreamPokemonRadioOutput {
          86  +
pub /* StructureGenerator.kt:201 */ struct StreamPokemonRadioOutput {
          87  +
    /* StructureGenerator.kt:231 */
   57     88   
    #[allow(missing_docs)] // documentation missing in model
   58     89   
    pub data: ::aws_smithy_types::byte_stream::ByteStream,
          90  +
    /* StructureGenerator.kt:201 */
   59     91   
}
          92  +
/* StructureGenerator.kt:135 */
   60     93   
impl StreamPokemonRadioOutput {
          94  +
    /* StructureGenerator.kt:231 */
   61     95   
    #[allow(missing_docs)] // documentation missing in model
          96  +
                           /* StructureGenerator.kt:166 */
   62     97   
    pub fn data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
          98  +
        /* StructureGenerator.kt:172 */
   63     99   
        &self.data
         100  +
        /* StructureGenerator.kt:166 */
   64    101   
    }
         102  +
    /* StructureGenerator.kt:135 */
   65    103   
}
         104  +
/* ServerCodegenVisitor.kt:345 */
   66    105   
impl StreamPokemonRadioOutput {
   67         -
    /// Creates a new builder-style object to manufacture [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         106  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         107  +
    /* ServerBuilderGenerator.kt:295 */
   68    108   
    pub fn builder() -> crate::output::stream_pokemon_radio_output::Builder {
         109  +
        /* ServerBuilderGenerator.kt:296 */
   69    110   
        crate::output::stream_pokemon_radio_output::Builder::default()
         111  +
        /* ServerBuilderGenerator.kt:295 */
   70    112   
    }
         113  +
    /* ServerCodegenVisitor.kt:345 */
   71    114   
}
   72    115   
         116  +
/* StructureGenerator.kt:197 */
   73    117   
#[allow(missing_docs)] // documentation missing in model
         118  +
/* RustType.kt:516 */
   74    119   
#[derive(
   75    120   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   76    121   
)]
   77         -
pub struct CheckHealthOutput {}
         122  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthOutput {/* StructureGenerator.kt:201 */}
         123  +
/* ServerCodegenVisitor.kt:345 */
   78    124   
impl CheckHealthOutput {
   79         -
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         125  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         126  +
    /* ServerBuilderGenerator.kt:295 */
   80    127   
    pub fn builder() -> crate::output::check_health_output::Builder {
         128  +
        /* ServerBuilderGenerator.kt:296 */
   81    129   
        crate::output::check_health_output::Builder::default()
         130  +
        /* ServerBuilderGenerator.kt:295 */
   82    131   
    }
         132  +
    /* ServerCodegenVisitor.kt:345 */
   83    133   
}
   84    134   
         135  +
/* StructureGenerator.kt:197 */
   85    136   
#[allow(missing_docs)] // documentation missing in model
         137  +
/* RustType.kt:516 */
   86    138   
#[derive(::std::fmt::Debug)]
   87         -
pub struct CapturePokemonOutput {
         139  +
pub /* StructureGenerator.kt:201 */ struct CapturePokemonOutput {
         140  +
    /* StructureGenerator.kt:231 */
   88    141   
    #[allow(missing_docs)] // documentation missing in model
   89    142   
    pub events: ::aws_smithy_http::event_stream::EventStreamSender<
   90    143   
        crate::model::CapturePokemonEvents,
   91    144   
        crate::error::CapturePokemonEventsError,
   92    145   
    >,
         146  +
    /* StructureGenerator.kt:201 */
   93    147   
}
         148  +
/* StructureGenerator.kt:135 */
   94    149   
impl CapturePokemonOutput {
         150  +
    /* StructureGenerator.kt:231 */
   95    151   
    #[allow(missing_docs)] // documentation missing in model
         152  +
                           /* StructureGenerator.kt:166 */
   96    153   
    pub fn events(
   97    154   
        &self,
   98    155   
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
   99    156   
        crate::model::CapturePokemonEvents,
  100    157   
        crate::error::CapturePokemonEventsError,
  101    158   
    > {
         159  +
        /* StructureGenerator.kt:172 */
  102    160   
        &self.events
         161  +
        /* StructureGenerator.kt:166 */
  103    162   
    }
         163  +
    /* StructureGenerator.kt:135 */
  104    164   
}
         165  +
/* ServerCodegenVisitor.kt:345 */
  105    166   
impl CapturePokemonOutput {
  106         -
    /// Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         167  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         168  +
    /* ServerBuilderGenerator.kt:295 */
  107    169   
    pub fn builder() -> crate::output::capture_pokemon_output::Builder {
         170  +
        /* ServerBuilderGenerator.kt:296 */
  108    171   
        crate::output::capture_pokemon_output::Builder::default()
         172  +
        /* ServerBuilderGenerator.kt:295 */
  109    173   
    }
         174  +
    /* ServerCodegenVisitor.kt:345 */
  110    175   
}
  111    176   
         177  +
/* StructureGenerator.kt:197 */
  112    178   
#[allow(missing_docs)] // documentation missing in model
         179  +
/* RustType.kt:516 */
  113    180   
#[derive(
  114    181   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  115    182   
)]
  116         -
pub struct DoNothingOutput {}
         183  +
pub /* StructureGenerator.kt:201 */ struct DoNothingOutput {/* StructureGenerator.kt:201 */}
         184  +
/* ServerCodegenVisitor.kt:345 */
  117    185   
impl DoNothingOutput {
  118         -
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
         186  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
         187  +
    /* ServerBuilderGenerator.kt:295 */
  119    188   
    pub fn builder() -> crate::output::do_nothing_output::Builder {
         189  +
        /* ServerBuilderGenerator.kt:296 */
  120    190   
        crate::output::do_nothing_output::Builder::default()
         191  +
        /* ServerBuilderGenerator.kt:295 */
  121    192   
    }
         193  +
    /* ServerCodegenVisitor.kt:345 */
  122    194   
}
  123    195   
         196  +
/* StructureGenerator.kt:197 */
  124    197   
#[allow(missing_docs)] // documentation missing in model
         198  +
/* RustType.kt:516 */
  125    199   
#[derive(
  126    200   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  127    201   
)]
  128         -
pub struct GetServerStatisticsOutput {
  129         -
    /// The number of calls executed by the server.
         202  +
pub /* StructureGenerator.kt:201 */ struct GetServerStatisticsOutput {
         203  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
  130    204   
    pub calls_count: i64,
         205  +
    /* StructureGenerator.kt:201 */
  131    206   
}
         207  +
/* StructureGenerator.kt:135 */
  132    208   
impl GetServerStatisticsOutput {
  133         -
    /// The number of calls executed by the server.
         209  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
         210  +
    /* StructureGenerator.kt:166 */
  134    211   
    pub fn calls_count(&self) -> i64 {
         212  +
        /* StructureGenerator.kt:168 */
  135    213   
        self.calls_count
         214  +
        /* StructureGenerator.kt:166 */
  136    215   
    }
         216  +
    /* StructureGenerator.kt:135 */
  137    217   
}
         218  +
/* ServerCodegenVisitor.kt:345 */
  138    219   
impl GetServerStatisticsOutput {
  139         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         220  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         221  +
    /* ServerBuilderGenerator.kt:295 */
  140    222   
    pub fn builder() -> crate::output::get_server_statistics_output::Builder {
         223  +
        /* ServerBuilderGenerator.kt:296 */
  141    224   
        crate::output::get_server_statistics_output::Builder::default()
         225  +
        /* ServerBuilderGenerator.kt:295 */
  142    226   
    }
         227  +
    /* ServerCodegenVisitor.kt:345 */
  143    228   
}
  144         -
/// See [`GetStorageOutput`](crate::output::GetStorageOutput).
         229  +
/// /* ServerBuilderGenerator.kt:171 */See [`GetStorageOutput`](crate::output::GetStorageOutput).
  145    230   
pub mod get_storage_output {
  146    231   
         232  +
    /* RustType.kt:516 */
  147    233   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  148         -
    /// Holds one variant for each of the ways the builder can fail.
         234  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         235  +
    /* RustType.kt:516 */
  149    236   
    #[non_exhaustive]
         237  +
    /* ServerBuilderConstraintViolations.kt:75 */
  150    238   
    #[allow(clippy::enum_variant_names)]
  151    239   
    pub enum ConstraintViolation {
  152         -
        /// `collection` was not provided but it is required when building `GetStorageOutput`.
         240  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`collection` was not provided but it is required when building `GetStorageOutput`.
         241  +
        /* ServerBuilderConstraintViolations.kt:143 */
  153    242   
        MissingCollection,
         243  +
        /* ServerBuilderConstraintViolations.kt:75 */
  154    244   
    }
         245  +
    /* ServerBuilderConstraintViolations.kt:117 */
  155    246   
    impl ::std::fmt::Display for ConstraintViolation {
         247  +
        /* ServerBuilderConstraintViolations.kt:118 */
  156    248   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         249  +
            /* ServerBuilderConstraintViolations.kt:119 */
  157    250   
            match self {
  158         -
                ConstraintViolation::MissingCollection => write!(f, "`collection` was not provided but it is required when building `GetStorageOutput`"),
  159         -
            }
         251  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingCollection => write!(f, "`collection` was not provided but it is required when building `GetStorageOutput`"),
         252  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         253  +
            /* ServerBuilderConstraintViolations.kt:118 */
  160    254   
        }
         255  +
        /* ServerBuilderConstraintViolations.kt:117 */
  161    256   
    }
         257  +
    /* ServerBuilderConstraintViolations.kt:84 */
  162    258   
    impl ::std::error::Error for ConstraintViolation {}
         259  +
    /* ServerBuilderGenerator.kt:446 */
  163    260   
    impl ::std::convert::TryFrom<Builder> for crate::output::GetStorageOutput {
  164    261   
        type Error = ConstraintViolation;
  165    262   
  166    263   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  167    264   
            builder.build()
  168    265   
        }
  169    266   
    }
  170         -
    /// A builder for [`GetStorageOutput`](crate::output::GetStorageOutput).
         267  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`GetStorageOutput`](crate::output::GetStorageOutput).
         268  +
    /* RustType.kt:516 */
  171    269   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         270  +
    /* ServerBuilderGenerator.kt:211 */
  172    271   
    pub struct Builder {
         272  +
        /* ServerBuilderGenerator.kt:308 */
  173    273   
        pub(crate) collection: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         274  +
        /* ServerBuilderGenerator.kt:211 */
  174    275   
    }
         276  +
    /* ServerBuilderGenerator.kt:215 */
  175    277   
    impl Builder {
  176         -
        /// A list of Pokémon species.
         278  +
        /// /* ServerBuilderGenerator.kt:331 */A list of Pokémon species.
         279  +
        /* ServerBuilderGenerator.kt:343 */
  177    280   
        pub fn collection(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
  178         -
            self.collection = Some(input);
         281  +
            /* ServerBuilderGenerator.kt:344 */
         282  +
            self.collection =
         283  +
                /* ServerBuilderGenerator.kt:345 */Some(
         284  +
                    /* ServerBuilderGenerator.kt:376 */input
         285  +
                /* ServerBuilderGenerator.kt:345 */)
         286  +
            /* ServerBuilderGenerator.kt:344 */;
  179    287   
            self
         288  +
            /* ServerBuilderGenerator.kt:343 */
  180    289   
        }
  181         -
        /// Consumes the builder and constructs a [`GetStorageOutput`](crate::output::GetStorageOutput).
  182         -
        ///
         290  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GetStorageOutput`](crate::output::GetStorageOutput).
         291  +
        /// /* ServerBuilderGenerator.kt:260 */
  183    292   
        /// The builder fails to construct a [`GetStorageOutput`](crate::output::GetStorageOutput) if a [`ConstraintViolation`] occurs.
  184    293   
        ///
         294  +
        /* ServerBuilderGenerator.kt:271 */
  185    295   
        pub fn build(self) -> Result<crate::output::GetStorageOutput, ConstraintViolation> {
  186    296   
            self.build_enforcing_all_constraints()
  187    297   
        }
         298  +
        /* ServerBuilderGenerator.kt:283 */
  188    299   
        fn build_enforcing_all_constraints(
  189    300   
            self,
  190    301   
        ) -> Result<crate::output::GetStorageOutput, ConstraintViolation> {
  191         -
            Ok(crate::output::GetStorageOutput {
         302  +
            /* ServerBuilderGenerator.kt:287 */
         303  +
            Ok(
         304  +
                /* ServerBuilderGenerator.kt:542 */
         305  +
                crate::output::GetStorageOutput {
         306  +
                    /* ServerBuilderGenerator.kt:546 */
  192    307   
                    collection: self
  193    308   
                        .collection
         309  +
                        /* ServerBuilderGenerator.kt:569 */
  194    310   
                        .ok_or(ConstraintViolation::MissingCollection)?,
  195         -
            })
         311  +
                    /* ServerBuilderGenerator.kt:542 */
         312  +
                }, /* ServerBuilderGenerator.kt:287 */
         313  +
            )
         314  +
            /* ServerBuilderGenerator.kt:283 */
  196    315   
        }
         316  +
        /* ServerBuilderGenerator.kt:215 */
  197    317   
    }
         318  +
         319  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  198    320   
}
  199         -
/// See [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
         321  +
/// /* ServerBuilderGenerator.kt:171 */See [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
  200    322   
pub mod get_pokemon_species_output {
  201    323   
         324  +
    /* RustType.kt:516 */
  202    325   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  203         -
    /// Holds one variant for each of the ways the builder can fail.
         326  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         327  +
    /* RustType.kt:516 */
  204    328   
    #[non_exhaustive]
         329  +
    /* ServerBuilderConstraintViolations.kt:75 */
  205    330   
    #[allow(clippy::enum_variant_names)]
  206    331   
    pub enum ConstraintViolation {
  207         -
        /// `name` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         332  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`name` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         333  +
        /* ServerBuilderConstraintViolations.kt:143 */
  208    334   
        MissingName,
  209         -
        /// `flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         335  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         336  +
        /* ServerBuilderConstraintViolations.kt:143 */
  210    337   
        MissingFlavorTextEntries,
         338  +
        /* ServerBuilderConstraintViolations.kt:75 */
  211    339   
    }
         340  +
    /* ServerBuilderConstraintViolations.kt:117 */
  212    341   
    impl ::std::fmt::Display for ConstraintViolation {
         342  +
        /* ServerBuilderConstraintViolations.kt:118 */
  213    343   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         344  +
            /* ServerBuilderConstraintViolations.kt:119 */
  214    345   
            match self {
  215         -
                ConstraintViolation::MissingName => write!(f, "`name` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
  216         -
                ConstraintViolation::MissingFlavorTextEntries => write!(f, "`flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
  217         -
            }
         346  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingName => write!(f, "`name` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
         347  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingFlavorTextEntries => write!(f, "`flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
         348  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         349  +
            /* ServerBuilderConstraintViolations.kt:118 */
  218    350   
        }
         351  +
        /* ServerBuilderConstraintViolations.kt:117 */
  219    352   
    }
         353  +
    /* ServerBuilderConstraintViolations.kt:84 */
  220    354   
    impl ::std::error::Error for ConstraintViolation {}
         355  +
    /* ServerBuilderGenerator.kt:446 */
  221    356   
    impl ::std::convert::TryFrom<Builder> for crate::output::GetPokemonSpeciesOutput {
  222    357   
        type Error = ConstraintViolation;
  223    358   
  224    359   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  225    360   
            builder.build()
  226    361   
        }
  227    362   
    }
  228         -
    /// A builder for [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
         363  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
         364  +
    /* RustType.kt:516 */
  229    365   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         366  +
    /* ServerBuilderGenerator.kt:211 */
  230    367   
    pub struct Builder {
         368  +
        /* ServerBuilderGenerator.kt:308 */
  231    369   
        pub(crate) name: ::std::option::Option<::std::string::String>,
         370  +
        /* ServerBuilderGenerator.kt:308 */
  232    371   
        pub(crate) flavor_text_entries:
  233    372   
            ::std::option::Option<::std::vec::Vec<crate::model::FlavorText>>,
         373  +
        /* ServerBuilderGenerator.kt:211 */
  234    374   
    }
         375  +
    /* ServerBuilderGenerator.kt:215 */
  235    376   
    impl Builder {
  236         -
        /// The name for this resource.
         377  +
        /// /* ServerBuilderGenerator.kt:331 */The name for this resource.
         378  +
        /* ServerBuilderGenerator.kt:343 */
  237    379   
        pub fn name(mut self, input: ::std::string::String) -> Self {
  238         -
            self.name = Some(input);
         380  +
            /* ServerBuilderGenerator.kt:344 */
         381  +
            self.name =
         382  +
                /* ServerBuilderGenerator.kt:345 */Some(
         383  +
                    /* ServerBuilderGenerator.kt:376 */input
         384  +
                /* ServerBuilderGenerator.kt:345 */)
         385  +
            /* ServerBuilderGenerator.kt:344 */;
  239    386   
            self
         387  +
            /* ServerBuilderGenerator.kt:343 */
  240    388   
        }
  241         -
        /// A list of flavor text entries for this Pokémon species.
         389  +
        /// /* ServerBuilderGenerator.kt:331 */A list of flavor text entries for this Pokémon species.
         390  +
        /* ServerBuilderGenerator.kt:343 */
  242    391   
        pub fn flavor_text_entries(
  243    392   
            mut self,
  244    393   
            input: ::std::vec::Vec<crate::model::FlavorText>,
  245    394   
        ) -> Self {
  246         -
            self.flavor_text_entries = Some(input);
         395  +
            /* ServerBuilderGenerator.kt:344 */
         396  +
            self.flavor_text_entries =
         397  +
                /* ServerBuilderGenerator.kt:345 */Some(
         398  +
                    /* ServerBuilderGenerator.kt:376 */input
         399  +
                /* ServerBuilderGenerator.kt:345 */)
         400  +
            /* ServerBuilderGenerator.kt:344 */;
  247    401   
            self
         402  +
            /* ServerBuilderGenerator.kt:343 */
  248    403   
        }
  249         -
        /// Consumes the builder and constructs a [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
  250         -
        ///
         404  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput).
         405  +
        /// /* ServerBuilderGenerator.kt:260 */
  251    406   
        /// The builder fails to construct a [`GetPokemonSpeciesOutput`](crate::output::GetPokemonSpeciesOutput) if a [`ConstraintViolation`] occurs.
  252    407   
        ///
  253         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         408  +
        /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         409  +
        /* ServerBuilderGenerator.kt:271 */
  254    410   
        pub fn build(self) -> Result<crate::output::GetPokemonSpeciesOutput, ConstraintViolation> {
  255    411   
            self.build_enforcing_all_constraints()
  256    412   
        }
         413  +
        /* ServerBuilderGenerator.kt:283 */
  257    414   
        fn build_enforcing_all_constraints(
  258    415   
            self,
  259    416   
        ) -> Result<crate::output::GetPokemonSpeciesOutput, ConstraintViolation> {
  260         -
            Ok(crate::output::GetPokemonSpeciesOutput {
  261         -
                name: self.name.ok_or(ConstraintViolation::MissingName)?,
         417  +
            /* ServerBuilderGenerator.kt:287 */
         418  +
            Ok(
         419  +
                /* ServerBuilderGenerator.kt:542 */
         420  +
                crate::output::GetPokemonSpeciesOutput {
         421  +
                    /* ServerBuilderGenerator.kt:546 */
         422  +
                    name: self
         423  +
                        .name
         424  +
                        /* ServerBuilderGenerator.kt:569 */
         425  +
                        .ok_or(ConstraintViolation::MissingName)?,
         426  +
                    /* ServerBuilderGenerator.kt:546 */
  262    427   
                    flavor_text_entries: self
  263    428   
                        .flavor_text_entries
         429  +
                        /* ServerBuilderGenerator.kt:569 */
  264    430   
                        .ok_or(ConstraintViolation::MissingFlavorTextEntries)?,
  265         -
            })
         431  +
                    /* ServerBuilderGenerator.kt:542 */
         432  +
                }, /* ServerBuilderGenerator.kt:287 */
         433  +
            )
         434  +
            /* ServerBuilderGenerator.kt:283 */
  266    435   
        }
         436  +
        /* ServerBuilderGenerator.kt:215 */
  267    437   
    }
         438  +
         439  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  268    440   
}
  269         -
/// See [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         441  +
/// /* ServerBuilderGenerator.kt:171 */See [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
  270    442   
pub mod stream_pokemon_radio_output {
  271    443   
         444  +
    /* ServerBuilderGenerator.kt:461 */
  272    445   
    impl ::std::convert::From<Builder> for crate::output::StreamPokemonRadioOutput {
  273    446   
        fn from(builder: Builder) -> Self {
  274    447   
            builder.build()
  275    448   
        }
  276    449   
    }
  277         -
    /// A builder for [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         450  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         451  +
    /* RustType.kt:516 */
  278    452   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
         453  +
    /* ServerBuilderGenerator.kt:211 */
  279    454   
    pub struct Builder {
         455  +
        /* ServerBuilderGenerator.kt:308 */
  280    456   
        pub(crate) data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
         457  +
        /* ServerBuilderGenerator.kt:211 */
  281    458   
    }
         459  +
    /* ServerBuilderGenerator.kt:215 */
  282    460   
    impl Builder {
         461  +
        /* ServerBuilderGenerator.kt:331 */
  283    462   
        #[allow(missing_docs)] // documentation missing in model
         463  +
                               /* ServerBuilderGenerator.kt:343 */
  284    464   
        pub fn data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
  285         -
            self.data = Some(input);
         465  +
            /* ServerBuilderGenerator.kt:344 */
         466  +
            self.data =
         467  +
                /* ServerBuilderGenerator.kt:345 */Some(
         468  +
                    /* ServerBuilderGenerator.kt:376 */input
         469  +
                /* ServerBuilderGenerator.kt:345 */)
         470  +
            /* ServerBuilderGenerator.kt:344 */;
  286    471   
            self
         472  +
            /* ServerBuilderGenerator.kt:343 */
  287    473   
        }
  288         -
        /// Consumes the builder and constructs a [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         474  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`StreamPokemonRadioOutput`](crate::output::StreamPokemonRadioOutput).
         475  +
        /* ServerBuilderGenerator.kt:271 */
  289    476   
        pub fn build(self) -> crate::output::StreamPokemonRadioOutput {
  290    477   
            self.build_enforcing_all_constraints()
  291    478   
        }
         479  +
        /* ServerBuilderGenerator.kt:283 */
  292    480   
        fn build_enforcing_all_constraints(self) -> crate::output::StreamPokemonRadioOutput {
         481  +
            /* ServerBuilderGenerator.kt:542 */
  293    482   
            crate::output::StreamPokemonRadioOutput {
  294         -
                data: self.data.unwrap_or_default(),
         483  +
                /* ServerBuilderGenerator.kt:546 */
         484  +
                data: self
         485  +
                    .data
         486  +
                    /* ServerBuilderGeneratorCommon.kt:113 */
         487  +
                    .unwrap_or_default(),
         488  +
                /* ServerBuilderGenerator.kt:542 */
  295    489   
            }
         490  +
            /* ServerBuilderGenerator.kt:283 */
  296    491   
        }
         492  +
        /* ServerBuilderGenerator.kt:215 */
  297    493   
    }
         494  +
         495  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  298    496   
}
  299         -
/// See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         497  +
/// /* ServerBuilderGenerator.kt:171 */See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
  300    498   
pub mod check_health_output {
  301    499   
         500  +
    /* ServerBuilderGenerator.kt:461 */
  302    501   
    impl ::std::convert::From<Builder> for crate::output::CheckHealthOutput {
  303    502   
        fn from(builder: Builder) -> Self {
  304    503   
            builder.build()
  305    504   
        }
  306    505   
    }
  307         -
    /// A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         506  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         507  +
    /* RustType.kt:516 */
  308    508   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  309         -
    pub struct Builder {}
         509  +
    /* ServerBuilderGenerator.kt:211 */
         510  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         511  +
    /* ServerBuilderGenerator.kt:215 */
  310    512   
    impl Builder {
  311         -
        /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         513  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         514  +
        /* ServerBuilderGenerator.kt:271 */
  312    515   
        pub fn build(self) -> crate::output::CheckHealthOutput {
  313    516   
            self.build_enforcing_all_constraints()
  314    517   
        }
         518  +
        /* ServerBuilderGenerator.kt:283 */
  315    519   
        fn build_enforcing_all_constraints(self) -> crate::output::CheckHealthOutput {
  316         -
            crate::output::CheckHealthOutput {}
         520  +
            /* ServerBuilderGenerator.kt:542 */
         521  +
            crate::output::CheckHealthOutput {
         522  +
            /* ServerBuilderGenerator.kt:542 */}
         523  +
            /* ServerBuilderGenerator.kt:283 */
  317    524   
        }
         525  +
        /* ServerBuilderGenerator.kt:215 */
  318    526   
    }
         527  +
         528  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  319    529   
}
  320         -
/// See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         530  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
  321    531   
pub mod capture_pokemon_output {
  322    532   
         533  +
    /* RustType.kt:516 */
  323    534   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  324         -
    /// Holds one variant for each of the ways the builder can fail.
         535  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         536  +
    /* RustType.kt:516 */
  325    537   
    #[non_exhaustive]
         538  +
    /* ServerBuilderConstraintViolations.kt:75 */
  326    539   
    #[allow(clippy::enum_variant_names)]
  327    540   
    pub enum ConstraintViolation {
  328         -
        /// `events` was not provided but it is required when building `CapturePokemonOutput`.
         541  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`events` was not provided but it is required when building `CapturePokemonOutput`.
         542  +
        /* ServerBuilderConstraintViolations.kt:143 */
  329    543   
        MissingEvents,
         544  +
        /* ServerBuilderConstraintViolations.kt:75 */
  330    545   
    }
         546  +
    /* ServerBuilderConstraintViolations.kt:117 */
  331    547   
    impl ::std::fmt::Display for ConstraintViolation {
         548  +
        /* ServerBuilderConstraintViolations.kt:118 */
  332    549   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         550  +
            /* ServerBuilderConstraintViolations.kt:119 */
  333    551   
            match self {
  334         -
                ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
  335         -
            }
         552  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
         553  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         554  +
            /* ServerBuilderConstraintViolations.kt:118 */
  336    555   
        }
         556  +
        /* ServerBuilderConstraintViolations.kt:117 */
  337    557   
    }
         558  +
    /* ServerBuilderConstraintViolations.kt:84 */
  338    559   
    impl ::std::error::Error for ConstraintViolation {}
         560  +
    /* ServerBuilderGenerator.kt:446 */
  339    561   
    impl ::std::convert::TryFrom<Builder> for crate::output::CapturePokemonOutput {
  340    562   
        type Error = ConstraintViolation;
  341    563   
  342    564   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  343    565   
            builder.build()
  344    566   
        }
  345    567   
    }
  346         -
    /// A builder for [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         568  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         569  +
    /* RustType.kt:516 */
  347    570   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
         571  +
    /* ServerBuilderGenerator.kt:211 */
  348    572   
    pub struct Builder {
         573  +
        /* ServerBuilderGenerator.kt:308 */
  349    574   
        pub(crate) events: ::std::option::Option<
  350    575   
            ::aws_smithy_http::event_stream::EventStreamSender<
  351    576   
                crate::model::CapturePokemonEvents,
  352    577   
                crate::error::CapturePokemonEventsError,
  353    578   
            >,
  354    579   
        >,
         580  +
        /* ServerBuilderGenerator.kt:211 */
  355    581   
    }
         582  +
    /* ServerBuilderGenerator.kt:215 */
  356    583   
    impl Builder {
         584  +
        /* ServerBuilderGenerator.kt:331 */
  357    585   
        #[allow(missing_docs)] // documentation missing in model
         586  +
                               /* ServerBuilderGenerator.kt:343 */
  358    587   
        pub fn events(
  359    588   
            mut self,
  360    589   
            input: ::aws_smithy_http::event_stream::EventStreamSender<
  361    590   
                crate::model::CapturePokemonEvents,
  362    591   
                crate::error::CapturePokemonEventsError,
  363    592   
            >,
  364    593   
        ) -> Self {
  365         -
            self.events = Some(input);
         594  +
            /* ServerBuilderGenerator.kt:344 */
         595  +
            self.events =
         596  +
                /* ServerBuilderGenerator.kt:345 */Some(
         597  +
                    /* ServerBuilderGenerator.kt:376 */input
         598  +
                /* ServerBuilderGenerator.kt:345 */)
         599  +
            /* ServerBuilderGenerator.kt:344 */;
  366    600   
            self
         601  +
            /* ServerBuilderGenerator.kt:343 */
  367    602   
        }
  368         -
        /// Consumes the builder and constructs a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
  369         -
        ///
         603  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         604  +
        /// /* ServerBuilderGenerator.kt:260 */
  370    605   
        /// The builder fails to construct a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput) if a [`ConstraintViolation`] occurs.
  371    606   
        ///
         607  +
        /* ServerBuilderGenerator.kt:271 */
  372    608   
        pub fn build(self) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
  373    609   
            self.build_enforcing_all_constraints()
  374    610   
        }
         611  +
        /* ServerBuilderGenerator.kt:283 */
  375    612   
        fn build_enforcing_all_constraints(
  376    613   
            self,
  377    614   
        ) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
  378         -
            Ok(crate::output::CapturePokemonOutput {
  379         -
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
  380         -
            })
  381         -
        }
         615  +
            /* ServerBuilderGenerator.kt:287 */
         616  +
            Ok(
         617  +
                /* ServerBuilderGenerator.kt:542 */
         618  +
                crate::output::CapturePokemonOutput {
         619  +
                    /* ServerBuilderGenerator.kt:546 */
         620  +
                    events: self
         621  +
                        .events
         622  +
                        /* ServerBuilderGenerator.kt:569 */
         623  +
                        .ok_or(ConstraintViolation::MissingEvents)?,
         624  +
                    /* ServerBuilderGenerator.kt:542 */
         625  +
                }, /* ServerBuilderGenerator.kt:287 */
         626  +
            )
         627  +
            /* ServerBuilderGenerator.kt:283 */
         628  +
        }
         629  +
        /* ServerBuilderGenerator.kt:215 */
  382    630   
    }
         631  +
         632  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  383    633   
}
  384         -
/// See [`DoNothingOutput`](crate::output::DoNothingOutput).
         634  +
/// /* ServerBuilderGenerator.kt:171 */See [`DoNothingOutput`](crate::output::DoNothingOutput).
  385    635   
pub mod do_nothing_output {
  386    636   
         637  +
    /* ServerBuilderGenerator.kt:461 */
  387    638   
    impl ::std::convert::From<Builder> for crate::output::DoNothingOutput {
  388    639   
        fn from(builder: Builder) -> Self {
  389    640   
            builder.build()
  390    641   
        }
  391    642   
    }
  392         -
    /// A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         643  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         644  +
    /* RustType.kt:516 */
  393    645   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  394         -
    pub struct Builder {}
         646  +
    /* ServerBuilderGenerator.kt:211 */
         647  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         648  +
    /* ServerBuilderGenerator.kt:215 */
  395    649   
    impl Builder {
  396         -
        /// Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         650  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         651  +
        /* ServerBuilderGenerator.kt:271 */
  397    652   
        pub fn build(self) -> crate::output::DoNothingOutput {
  398    653   
            self.build_enforcing_all_constraints()
  399    654   
        }
         655  +
        /* ServerBuilderGenerator.kt:283 */
  400    656   
        fn build_enforcing_all_constraints(self) -> crate::output::DoNothingOutput {
  401         -
            crate::output::DoNothingOutput {}
         657  +
            /* ServerBuilderGenerator.kt:542 */
         658  +
            crate::output::DoNothingOutput {
         659  +
            /* ServerBuilderGenerator.kt:542 */}
         660  +
            /* ServerBuilderGenerator.kt:283 */
  402    661   
        }
         662  +
        /* ServerBuilderGenerator.kt:215 */
  403    663   
    }
         664  +
         665  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  404    666   
}
  405         -
/// See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         667  +
/// /* ServerBuilderGenerator.kt:171 */See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  406    668   
pub mod get_server_statistics_output {
  407    669   
         670  +
    /* RustType.kt:516 */
  408    671   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  409         -
    /// Holds one variant for each of the ways the builder can fail.
         672  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         673  +
    /* RustType.kt:516 */
  410    674   
    #[non_exhaustive]
         675  +
    /* ServerBuilderConstraintViolations.kt:75 */
  411    676   
    #[allow(clippy::enum_variant_names)]
  412    677   
    pub enum ConstraintViolation {
  413         -
        /// `calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         678  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         679  +
        /* ServerBuilderConstraintViolations.kt:143 */
  414    680   
        MissingCallsCount,
         681  +
        /* ServerBuilderConstraintViolations.kt:75 */
  415    682   
    }
         683  +
    /* ServerBuilderConstraintViolations.kt:117 */
  416    684   
    impl ::std::fmt::Display for ConstraintViolation {
         685  +
        /* ServerBuilderConstraintViolations.kt:118 */
  417    686   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         687  +
            /* ServerBuilderConstraintViolations.kt:119 */
  418    688   
            match self {
  419         -
                ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
  420         -
            }
         689  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
         690  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         691  +
            /* ServerBuilderConstraintViolations.kt:118 */
  421    692   
        }
         693  +
        /* ServerBuilderConstraintViolations.kt:117 */
  422    694   
    }
         695  +
    /* ServerBuilderConstraintViolations.kt:84 */
  423    696   
    impl ::std::error::Error for ConstraintViolation {}
         697  +
    /* ServerBuilderGenerator.kt:446 */
  424    698   
    impl ::std::convert::TryFrom<Builder> for crate::output::GetServerStatisticsOutput {
  425    699   
        type Error = ConstraintViolation;
  426    700   
  427    701   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  428    702   
            builder.build()
  429    703   
        }
  430    704   
    }
  431         -
    /// A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         705  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         706  +
    /* RustType.kt:516 */
  432    707   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         708  +
    /* ServerBuilderGenerator.kt:211 */
  433    709   
    pub struct Builder {
         710  +
        /* ServerBuilderGenerator.kt:308 */
  434    711   
        pub(crate) calls_count: ::std::option::Option<i64>,
         712  +
        /* ServerBuilderGenerator.kt:211 */
  435    713   
    }
         714  +
    /* ServerBuilderGenerator.kt:215 */
  436    715   
    impl Builder {
  437         -
        /// The number of calls executed by the server.
         716  +
        /// /* ServerBuilderGenerator.kt:331 */The number of calls executed by the server.
         717  +
        /* ServerBuilderGenerator.kt:343 */
  438    718   
        pub fn calls_count(mut self, input: i64) -> Self {
  439         -
            self.calls_count = Some(input);
         719  +
            /* ServerBuilderGenerator.kt:344 */
         720  +
            self.calls_count =
         721  +
                /* ServerBuilderGenerator.kt:345 */Some(
         722  +
                    /* ServerBuilderGenerator.kt:376 */input
         723  +
                /* ServerBuilderGenerator.kt:345 */)
         724  +
            /* ServerBuilderGenerator.kt:344 */;
  440    725   
            self
         726  +
            /* ServerBuilderGenerator.kt:343 */
  441    727   
        }
  442         -
        /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  443         -
        ///
         728  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         729  +
        /// /* ServerBuilderGenerator.kt:260 */
  444    730   
        /// The builder fails to construct a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput) if a [`ConstraintViolation`] occurs.
  445    731   
        ///
         732  +
        /* ServerBuilderGenerator.kt:271 */
  446    733   
        pub fn build(
  447    734   
            self,
  448    735   
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
  449    736   
            self.build_enforcing_all_constraints()
  450    737   
        }
         738  +
        /* ServerBuilderGenerator.kt:283 */
  451    739   
        fn build_enforcing_all_constraints(
  452    740   
            self,
  453    741   
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
  454         -
            Ok(crate::output::GetServerStatisticsOutput {
         742  +
            /* ServerBuilderGenerator.kt:287 */
         743  +
            Ok(
         744  +
                /* ServerBuilderGenerator.kt:542 */
         745  +
                crate::output::GetServerStatisticsOutput {
         746  +
                    /* ServerBuilderGenerator.kt:546 */
  455    747   
                    calls_count: self
  456    748   
                        .calls_count
         749  +
                        /* ServerBuilderGenerator.kt:569 */
  457    750   
                        .ok_or(ConstraintViolation::MissingCallsCount)?,
  458         -
            })
         751  +
                    /* ServerBuilderGenerator.kt:542 */
         752  +
                }, /* ServerBuilderGenerator.kt:287 */
         753  +
            )
         754  +
            /* ServerBuilderGenerator.kt:283 */
  459    755   
        }
         756  +
        /* ServerBuilderGenerator.kt:215 */
  460    757   
    }
         758  +
         759  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  461    760   
}

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

@@ -16,16 +58,59 @@
   36     36   
pub(crate) mod shape_storage_access_not_authorized;
   37     37   
   38     38   
pub(crate) mod shape_stream_pokemon_radio_output;
   39     39   
   40     40   
pub(crate) mod shape_throttling_error;
   41     41   
   42     42   
pub(crate) mod shape_unsupported_region_error;
   43     43   
   44     44   
pub(crate) mod shape_validation_exception;
   45     45   
          46  +
/* JsonParserGenerator.kt:227 */
   46     47   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   47     48   
    if data.is_empty() {
   48     49   
        b"{}"
   49     50   
    } else {
   50     51   
        data
   51     52   
    }
   52     53   
}
   53     54   
   54     55   
pub(crate) mod shape_capturing_payload;
   55     56   

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

@@ -1,1 +223,304 @@
    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_capture_pokemon_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CapturePokemonInput,
    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: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     14   
    B::Data: Send,
   13     15   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14     16   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     17   
{
          18  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   16     19   
    Ok({
          20  +
        /* RustType.kt:516 */
   17     21   
        #[allow(unused_mut)]
          22  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   18     23   
        let mut input = crate::input::capture_pokemon_input::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = {
   24     32   
            Some(
   25     33   
                crate::protocol_serde::shape_capture_pokemon_input::de_events_payload(
   26     34   
                    &mut body.into().into_inner(),
   27     35   
                )?,
   28     36   
            )
   29     37   
        } {
   30     38   
            input = input.set_events(value)
   31     39   
        }
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   32     41   
        let input_string = uri.path();
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   33     43   
        let (input_string, (_, m1)) =
   34     44   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   35     45   
                ::nom::sequence::preceded(
   36     46   
                    ::nom::bytes::complete::tag("/"),
   37     47   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   38     48   
                        "capture-pokemon-event",
   39     49   
                    ),
   40     50   
                ),
   41     51   
                ::nom::sequence::preceded(
   42     52   
                    ::nom::bytes::complete::tag("/"),
   43     53   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   44     54   
                        ::nom::bytes::complete::take_until("/"),
   45     55   
                        ::nom::combinator::rest,
   46     56   
                    )),
   47     57   
                ),
   48     58   
            ))(input_string)?;
   49     59   
        debug_assert_eq!("", input_string);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   50     61   
        input =
   51     62   
            input.set_region(crate::protocol_serde::shape_capture_pokemon_input::de_region(m1)?);
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   52     64   
        input.build()?
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   53     66   
    })
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   54     68   
}
   55     69   
          70  +
/* RustType.kt:516 */
   56     71   
#[allow(clippy::unnecessary_wraps)]
          72  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   57     73   
pub fn ser_capture_pokemon_http_response(
   58     74   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   59     75   
) -> std::result::Result<
   60     76   
    ::aws_smithy_http_server::response::Response,
   61     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     78   
> {
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     80   
    Ok({
          81  +
        /* RustType.kt:516 */
   64     82   
        #[allow(unused_mut)]
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   65     84   
        let mut builder = ::http::Response::builder();
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   66     86   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   67     87   
            builder,
   68     88   
            ::http::header::CONTENT_TYPE,
   69     89   
            "application/vnd.amazon.eventstream",
   70     90   
        );
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   71     92   
        let http_status: u16 = 200;
   72     93   
        builder = builder.status(http_status);
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   73     95   
        let body = ::aws_smithy_http_server::body::boxed(
   74         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
          96  +
            ::aws_smithy_http_server::body::Body::wrap_stream(
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:135 */
          98  +
                {
   75     99   
                    let error_marshaller =
   76    100   
                        crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   77         -
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
         101  +
                    let marshaller =
         102  +
                        crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   78    103   
                    let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   79         -
                let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> = output
         104  +
                    let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> =
         105  +
                        output
   80    106   
                            .events
   81    107   
                            .into_body_stream(marshaller, error_marshaller, signer);
   82    108   
                    adapter
   83         -
            }),
         109  +
                }, /* ServerHttpBoundProtocolGenerator.kt:543 */
         110  +
            ),
   84    111   
        );
         112  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   85    113   
        builder.body(body)?
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   86    115   
    })
         116  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   87    117   
}
   88    118   
         119  +
/* RustType.kt:516 */
   89    120   
#[allow(clippy::unnecessary_wraps)]
         121  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   90    122   
pub fn ser_capture_pokemon_http_error(
   91    123   
    error: &crate::error::CapturePokemonError,
   92    124   
) -> std::result::Result<
   93    125   
    ::aws_smithy_http_server::response::Response,
   94    126   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   95    127   
> {
         128  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   96    129   
    Ok({
         130  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   97    131   
        match error {
         132  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    133   
            crate::error::CapturePokemonError::ValidationException(output) => {
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   99    135   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         136  +
                /* RustType.kt:516 */
  100    137   
                #[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  101    139   
                let mut builder = ::http::Response::builder();
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  102    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    142   
                    builder,
  104    143   
                    ::http::header::CONTENT_TYPE,
  105    144   
                    "application/vnd.amazon.eventstream",
  106    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  107    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  108    148   
                    builder,
  109    149   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  110    150   
                    "ValidationException",
  111    151   
                );
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  112    153   
                let content_length = payload.len();
  113    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  114    155   
                    builder,
  115    156   
                    ::http::header::CONTENT_LENGTH,
  116    157   
                    content_length,
  117    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  118    160   
                builder
  119    161   
                    .status(400)
  120    162   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  121    164   
            }
         165  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  122    166   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  123    168   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
         169  +
                /* RustType.kt:516 */
  124    170   
                #[allow(unused_mut)]
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  125    172   
                let mut builder = ::http::Response::builder();
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  126    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    175   
                    builder,
  128    176   
                    ::http::header::CONTENT_TYPE,
  129    177   
                    "application/vnd.amazon.eventstream",
  130    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  131    180   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  132    181   
                    builder,
  133    182   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  134    183   
                    "MasterBallUnsuccessful",
  135    184   
                );
         185  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  136    186   
                let content_length = payload.len();
  137    187   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  138    188   
                    builder,
  139    189   
                    ::http::header::CONTENT_LENGTH,
  140    190   
                    content_length,
  141    191   
                );
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  142    193   
                builder
  143    194   
                    .status(500)
  144    195   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         196  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  145    197   
            }
         198  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  146    199   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
         200  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  147    201   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
         202  +
                /* RustType.kt:516 */
  148    203   
                #[allow(unused_mut)]
         204  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  149    205   
                let mut builder = ::http::Response::builder();
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  150    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  151    208   
                    builder,
  152    209   
                    ::http::header::CONTENT_TYPE,
  153    210   
                    "application/vnd.amazon.eventstream",
  154    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  155    213   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  156    214   
                    builder,
  157    215   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  158    216   
                    "InvalidPokeballError",
  159    217   
                );
         218  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  160    219   
                let content_length = payload.len();
  161    220   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  162    221   
                    builder,
  163    222   
                    ::http::header::CONTENT_LENGTH,
  164    223   
                    content_length,
  165    224   
                );
         225  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  166    226   
                builder
  167    227   
                    .status(400)
  168    228   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         229  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  169    230   
            }
         231  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  170    232   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
         233  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  171    234   
                let payload =
  172    235   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  173    236   
                        output,
  174    237   
                    )?;
         238  +
                /* RustType.kt:516 */
  175    239   
                #[allow(unused_mut)]
         240  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  176    241   
                let mut builder = ::http::Response::builder();
         242  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  177    243   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  178    244   
                    builder,
  179    245   
                    ::http::header::CONTENT_TYPE,
  180    246   
                    "application/vnd.amazon.eventstream",
  181    247   
                );
         248  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  182    249   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  183    250   
                    builder,
  184    251   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  185    252   
                    "ThrottlingError",
  186    253   
                );
         254  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  187    255   
                let content_length = payload.len();
  188    256   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  189    257   
                    builder,
  190    258   
                    ::http::header::CONTENT_LENGTH,
  191    259   
                    content_length,
  192    260   
                );
         261  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  193    262   
                builder
  194    263   
                    .status(400)
  195    264   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         265  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  196    266   
            }
         267  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  197    268   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
         269  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  198    270   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
         271  +
                /* RustType.kt:516 */
  199    272   
                #[allow(unused_mut)]
         273  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  200    274   
                let mut builder = ::http::Response::builder();
         275  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  201    276   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  202    277   
                    builder,
  203    278   
                    ::http::header::CONTENT_TYPE,
  204    279   
                    "application/vnd.amazon.eventstream",
  205    280   
                );
         281  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  206    282   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  207    283   
                    builder,
  208    284   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  209    285   
                    "UnsupportedRegionError",
  210    286   
                );
         287  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  211    288   
                let content_length = payload.len();
  212    289   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  213    290   
                    builder,
  214    291   
                    ::http::header::CONTENT_LENGTH,
  215    292   
                    content_length,
  216    293   
                );
         294  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  217    295   
                builder
  218    296   
                    .status(500)
  219    297   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         298  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         299  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  220    300   
        }
  221         -
        }
         301  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  222    302   
    })
         303  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  223    304   
}

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

@@ -1,1 +29,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_events_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    ::aws_smithy_http::event_stream::Receiver<
    6      7   
        crate::model::AttemptCapturingPokemonEvent,
    7      8   
        crate::error::AttemptCapturingPokemonEventError,
    8      9   
    >,
    9     10   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   10     11   
> {
          12  +
    /* HttpBindingGenerator.kt:272 */
   11     13   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
   12     14   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13     15   
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   14     16   
        unmarshaller,
   15     17   
        body,
   16     18   
    ))
          19  +
    /* HttpBindingGenerator.kt:230 */
   17     20   
}
   18     21   
          22  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   19     23   
pub fn de_region(
   20     24   
    value: &str,
   21     25   
) -> std::result::Result<
   22     26   
    ::std::string::String,
   23     27   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   24     28   
> {
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   25     30   
    let value = ::percent_encoding::percent_decode_str(value)
   26     31   
        .decode_utf8()?
   27     32   
        .into_owned();
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   28     34   
    Ok(value)
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   29     36   
}

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

@@ -1,1 +90,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:175 */
    2      3   
pub(crate) fn de_capturing_payload_payload(
    3      4   
    input: &[u8],
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::CapturingPayload,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
           9  +
    /* JsonParserGenerator.kt:187 */
    8     10   
    let mut tokens_owned =
    9     11   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input))
   10     12   
            .peekable();
   11     13   
    let tokens = &mut tokens_owned;
   12         -
    let result = crate::protocol_serde::shape_capturing_payload::de_capturing_payload(tokens)?
   13         -
        .ok_or_else(|| {
   14         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   15         -
                "expected payload member value",
   16         -
            )
   17         -
        });
          14  +
    /* JsonParserGenerator.kt:194 */
          15  +
    let result =
          16  +
    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_capturing_payload::de_capturing_payload(tokens)?
          17  +
    /* JsonParserGenerator.kt:196 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
          18  +
    /* JsonParserGenerator.kt:250 */
   18     19   
    if tokens.next().is_some() {
          20  +
        /* JsonParserGenerator.kt:251 */
   19     21   
        return Err(
   20     22   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   21     23   
                "found more JSON tokens after completing parsing",
   22     24   
            ),
   23     25   
        );
          26  +
        /* JsonParserGenerator.kt:250 */
   24     27   
    }
          28  +
    /* JsonParserGenerator.kt:198 */
   25     29   
    result
          30  +
    /* JsonParserGenerator.kt:175 */
   26     31   
}
   27     32   
          33  +
/* JsonParserGenerator.kt:516 */
   28     34   
pub(crate) fn de_capturing_payload<'a, I>(
   29     35   
    tokens: &mut ::std::iter::Peekable<I>,
   30     36   
) -> ::std::result::Result<
   31     37   
    Option<crate::model::CapturingPayload>,
   32     38   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   33     39   
>
   34     40   
where
   35     41   
    I: Iterator<
   36     42   
        Item = Result<
   37     43   
            ::aws_smithy_json::deserialize::Token<'a>,
   38     44   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   39     45   
        >,
   40     46   
    >,
   41     47   
{
          48  +
    /* JsonParserGenerator.kt:712 */
   42     49   
    match tokens.next().transpose()? {
          50  +
        /* JsonParserGenerator.kt:713 */
   43     51   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   44     52   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          53  +
            /* RustType.kt:516 */
   45     54   
            #[allow(unused_mut)]
          55  +
            /* JsonParserGenerator.kt:526 */
   46     56   
            let mut builder = crate::model::capturing_payload::Builder::default();
          57  +
            /* JsonParserGenerator.kt:684 */
   47     58   
            loop {
          59  +
                /* JsonParserGenerator.kt:685 */
   48     60   
                match tokens.next().transpose()? {
          61  +
                    /* JsonParserGenerator.kt:686 */
   49     62   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50     63   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          64  +
                        /* JsonParserGenerator.kt:260 */
   51     65   
                        match key.to_unescaped()?.as_ref() {
          66  +
                            /* JsonParserGenerator.kt:262 */
   52     67   
                            "name" => {
          68  +
                                /* JsonParserGenerator.kt:272 */
   53     69   
                                builder = builder.set_name(
   54         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   55         -
                                        tokens.next(),
   56         -
                                    )?
   57         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   58         -
                                    .transpose()?,
   59         -
                                );
          70  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          71  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          72  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          73  +
                                        /* JsonParserGenerator.kt:339 */)
          74  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          75  +
                                /* JsonParserGenerator.kt:272 */);
          76  +
                                /* JsonParserGenerator.kt:262 */
   60     77   
                            }
          78  +
                            /* JsonParserGenerator.kt:262 */
   61     79   
                            "pokeball" => {
          80  +
                                /* JsonParserGenerator.kt:272 */
   62     81   
                                builder = builder.set_pokeball(
   63         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   64         -
                                        tokens.next(),
   65         -
                                    )?
   66         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   67         -
                                    .transpose()?,
   68         -
                                );
          82  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          83  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          84  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          85  +
                                        /* JsonParserGenerator.kt:339 */)
          86  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          87  +
                                /* JsonParserGenerator.kt:272 */);
          88  +
                                /* JsonParserGenerator.kt:262 */
   69     89   
                            }
   70         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          90  +
                            /* JsonParserGenerator.kt:290 */
          91  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   71     92   
                        }
          93  +
                        /* JsonParserGenerator.kt:686 */
   72     94   
                    }
          95  +
                    /* JsonParserGenerator.kt:695 */
   73     96   
                    other => {
   74     97   
                        return Err(
   75     98   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76     99   
                                format!("expected object key or end object, found: {:?}", other),
   77    100   
                            ),
   78    101   
                        )
         102  +
                    } /* JsonParserGenerator.kt:685 */
   79    103   
                }
         104  +
                /* JsonParserGenerator.kt:684 */
   80    105   
            }
   81         -
            }
         106  +
            /* JsonParserGenerator.kt:540 */
   82    107   
            Ok(Some(builder.build()))
         108  +
            /* JsonParserGenerator.kt:713 */
   83    109   
        }
   84         -
        _ => Err(
         110  +
        /* JsonParserGenerator.kt:722 */
         111  +
        _ => {
         112  +
            /* JsonParserGenerator.kt:723 */
         113  +
            Err(
   85    114   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   86    115   
                    "expected start object or null",
   87    116   
                ),
   88         -
        ),
         117  +
            )
         118  +
            /* JsonParserGenerator.kt:722 */
         119  +
        } /* JsonParserGenerator.kt:712 */
   89    120   
    }
         121  +
    /* JsonParserGenerator.kt:516 */
   90    122   
}

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

@@ -1,1 +54,80 @@
    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_check_health_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CheckHealthInput,
    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::check_health_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_check_health_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
   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/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
   44         -
        let payload = "";
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          63  +
        let payload =
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   45     67   
        let content_length = payload.len();
   46     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     69   
            builder,
   48     70   
            ::http::header::CONTENT_LENGTH,
   49     71   
            content_length,
   50     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   51     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   52     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   54     80   
}

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

@@ -1,1 +56,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_do_nothing_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::DoNothingInput,
    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::do_nothing_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_do_nothing_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::DoNothingOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(
   45         -
                &output,
   46         -
            )?;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     65   
        let content_length = payload.len();
   48     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     67   
            builder,
   50     68   
            ::http::header::CONTENT_LENGTH,
   51     69   
            content_length,
   52     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     78   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_do_nothing_output.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_do_nothing_output_output_output(
    3      4   
    value: &crate::output::DoNothingOutput,
    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_do_nothing_output::ser_do_nothing_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_do_nothing_output_output(
   16     22   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    #[allow(unused_variables)] input: &crate::output::DoNothingOutput,
   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_flavor_text.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_flavor_text(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::FlavorText,
    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("flavorText").string(input.flavor_text.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:42 */
    9     14   
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("language").string(input.language.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/protocol_serde/shape_get_pokemon_species.rs

@@ -1,1 +136,186 @@
    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_pokemon_species_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetPokemonSpeciesInput,
    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_pokemon_species_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:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   28     37   
                        "pokemon-species",
   29     38   
                    ),
   30     39   
                ),
   31     40   
                ::nom::sequence::preceded(
   32     41   
                    ::nom::bytes::complete::tag("/"),
   33     42   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   34     43   
                        ::nom::bytes::complete::take_until("/"),
   35     44   
                        ::nom::combinator::rest,
   36     45   
                    )),
   37     46   
                ),
   38     47   
            ))(input_string)?;
   39     48   
        debug_assert_eq!("", input_string);
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   40     50   
        input =
   41     51   
            input.set_name(crate::protocol_serde::shape_get_pokemon_species_input::de_name(m1)?);
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   42     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   43     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   44     57   
}
   45     58   
          59  +
/* RustType.kt:516 */
   46     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   47     62   
pub fn ser_get_pokemon_species_http_response(
   48     63   
    #[allow(unused_variables)] output: crate::output::GetPokemonSpeciesOutput,
   49     64   
) -> std::result::Result<
   50     65   
    ::aws_smithy_http_server::response::Response,
   51     66   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   52     67   
> {
          68  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     69   
    Ok({
          70  +
        /* RustType.kt:516 */
   54     71   
        #[allow(unused_mut)]
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   55     73   
        let mut builder = ::http::Response::builder();
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   56     75   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     76   
            builder,
   58     77   
            ::http::header::CONTENT_TYPE,
   59     78   
            "application/json",
   60     79   
        );
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   61     81   
        let http_status: u16 = 200;
   62     82   
        builder = builder.status(http_status);
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   63     84   
        let payload =
   64         -
            crate::protocol_serde::shape_get_pokemon_species_output::ser_get_pokemon_species_output_output_output(&output)?
   65         -
        ;
          85  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_pokemon_species_output::ser_get_pokemon_species_output_output_output(&output)?
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   66     88   
        let content_length = payload.len();
   67     89   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   68     90   
            builder,
   69     91   
            ::http::header::CONTENT_LENGTH,
   70     92   
            content_length,
   71     93   
        );
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   72     95   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   73     97   
        builder.body(body)?
          98  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   74     99   
    })
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   75    101   
}
   76    102   
         103  +
/* RustType.kt:516 */
   77    104   
#[allow(clippy::unnecessary_wraps)]
         105  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   78    106   
pub fn ser_get_pokemon_species_http_error(
   79    107   
    error: &crate::error::GetPokemonSpeciesError,
   80    108   
) -> std::result::Result<
   81    109   
    ::aws_smithy_http_server::response::Response,
   82    110   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   83    111   
> {
         112  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   84    113   
    Ok({
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   85    115   
        match error {
         116  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   86    117   
            crate::error::GetPokemonSpeciesError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   87    119   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         120  +
                /* RustType.kt:516 */
   88    121   
                #[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   89    123   
                let mut builder = ::http::Response::builder();
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    126   
                    builder,
   92    127   
                    ::http::header::CONTENT_TYPE,
   93    128   
                    "application/json",
   94    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   95    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    132   
                    builder,
   97    133   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   98    134   
                    "ValidationException",
   99    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  100    137   
                let content_length = payload.len();
  101    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    139   
                    builder,
  103    140   
                    ::http::header::CONTENT_LENGTH,
  104    141   
                    content_length,
  105    142   
                );
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  106    144   
                builder
  107    145   
                    .status(400)
  108    146   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  109    148   
            }
         149  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  110    150   
            crate::error::GetPokemonSpeciesError::ResourceNotFoundException(output) => {
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  111    152   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         153  +
                /* RustType.kt:516 */
  112    154   
                #[allow(unused_mut)]
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  113    156   
                let mut builder = ::http::Response::builder();
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  114    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    159   
                    builder,
  116    160   
                    ::http::header::CONTENT_TYPE,
  117    161   
                    "application/json",
  118    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  119    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  120    165   
                    builder,
  121    166   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  122    167   
                    "ResourceNotFoundException",
  123    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  124    170   
                let content_length = payload.len();
  125    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  126    172   
                    builder,
  127    173   
                    ::http::header::CONTENT_LENGTH,
  128    174   
                    content_length,
  129    175   
                );
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  130    177   
                builder
  131    178   
                    .status(404)
  132    179   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         181  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  133    182   
        }
  134         -
        }
         183  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  135    184   
    })
         185  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  136    186   
}

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

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_name(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_pokemon_species_output.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_get_pokemon_species_output_output_output(
    3      4   
    value: &crate::output::GetPokemonSpeciesOutput,
    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_pokemon_species_output::ser_get_pokemon_species_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_pokemon_species_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::GetPokemonSpeciesOutput,
   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("flavorTextEntries").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_2 in &input.flavor_text_entries {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_3 = array_1.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_flavor_text::ser_flavor_text(&mut object_3, item_2)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_3.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_1.finish();
          47  +
        /* SerializerUtil.kt:42 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("name").string(input.name.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_get_server_statistics.rs

@@ -1,1 +55,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_get_server_statistics_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetServerStatisticsInput,
    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_server_statistics_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_get_server_statistics_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::GetServerStatisticsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}

tmp-codegen-diff/codegen-server-test/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   
}