Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405 (ignoring whitespace)

Files changed:

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

@@ -1,1 +625,647 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
    2      3   
::pin_project_lite::pin_project! {
    3      4   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4      5   
    /// [`GetStorageInput`](crate::input::GetStorageInput) using modelled bindings.
    5      6   
    pub struct GetStorageInputFuture {
    6      7   
        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>>
    7      8   
    }
    8      9   
}
    9     10   
   10     11   
impl std::future::Future for GetStorageInputFuture {
   11     12   
    type Output = Result<
   12     13   
        crate::input::GetStorageInput,
   13     14   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
   14     15   
    >;
   15     16   
   16     17   
    fn poll(
   17     18   
        self: std::pin::Pin<&mut Self>,
   18     19   
        cx: &mut std::task::Context<'_>,
   19     20   
    ) -> std::task::Poll<Self::Output> {
   20     21   
        let this = self.project();
   21     22   
        this.inner.as_mut().poll(cx)
   22     23   
    }
   23     24   
}
   24     25   
   25     26   
impl<B>
   26     27   
    ::aws_smithy_http_server::request::FromRequest<
   27     28   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   28     29   
        B,
   29     30   
    > for crate::input::GetStorageInput
   30     31   
where
   31     32   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     33   
    B: 'static,
   33     34   
   34     35   
    B::Data: Send,
   35     36   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   36     37   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   37     38   
{
   38     39   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
   39     40   
    type Future = GetStorageInputFuture;
   40     41   
   41         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          42  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
   42     43   
        let fut = async move {
   43     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   44     45   
                request.headers(),
   45     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
   46     47   
            ) {
   47     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   48     49   
            }
   49     50   
            crate::protocol_serde::shape_get_storage::de_get_storage_http_request(request).await
   50     51   
        };
   51     52   
        use ::futures_util::future::TryFutureExt;
   52     53   
        let fut = fut.map_err(
   53     54   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   54     55   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   55     56   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   56     57   
                    e,
   57     58   
                )
   58     59   
            },
   59     60   
        );
   60     61   
        GetStorageInputFuture {
   61     62   
            inner: Box::pin(fut),
   62     63   
        }
   63     64   
    }
   64     65   
}
          66  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
   65     67   
impl
   66     68   
    ::aws_smithy_http_server::response::IntoResponse<
   67     69   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   68     70   
    > for crate::output::GetStorageOutput
   69     71   
{
   70     72   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   71     73   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_response(self) {
   72     74   
            Ok(response) => response,
   73     75   
            Err(e) => {
   74     76   
                ::tracing::error!(error = %e, "failed to serialize response");
   75     77   
                ::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))
   76     78   
            }
   77     79   
        }
   78     80   
    }
   79     81   
}
          82  +
/* ServerHttpBoundProtocolGenerator.kt:356 */
   80     83   
impl
   81     84   
    ::aws_smithy_http_server::response::IntoResponse<
   82     85   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   83     86   
    > for crate::error::GetStorageError
   84     87   
{
   85     88   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   86     89   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_error(&self) {
   87     90   
            Ok(mut response) => {
   88     91   
                response.extensions_mut().insert(
   89     92   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
   90     93   
                );
   91     94   
                response
   92     95   
            }
   93     96   
            Err(e) => {
   94     97   
                ::tracing::error!(error = %e, "failed to serialize response");
   95     98   
                ::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))
   96     99   
            }
   97    100   
        }
   98    101   
    }
   99    102   
}
  100    103   
         104  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  101    105   
::pin_project_lite::pin_project! {
  102    106   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  103    107   
    /// [`GetPokemonSpeciesInput`](crate::input::GetPokemonSpeciesInput) using modelled bindings.
  104    108   
    pub struct GetPokemonSpeciesInputFuture {
  105    109   
        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>>
  106    110   
    }
  107    111   
}
  108    112   
  109    113   
impl std::future::Future for GetPokemonSpeciesInputFuture {
  110    114   
    type Output = Result<
  111    115   
        crate::input::GetPokemonSpeciesInput,
  112    116   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  113    117   
    >;
  114    118   
  115    119   
    fn poll(
  116    120   
        self: std::pin::Pin<&mut Self>,
  117    121   
        cx: &mut std::task::Context<'_>,
  118    122   
    ) -> std::task::Poll<Self::Output> {
  119    123   
        let this = self.project();
  120    124   
        this.inner.as_mut().poll(cx)
  121    125   
    }
  122    126   
}
  123    127   
  124    128   
impl<B>
  125    129   
    ::aws_smithy_http_server::request::FromRequest<
  126    130   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  127    131   
        B,
  128    132   
    > for crate::input::GetPokemonSpeciesInput
  129    133   
where
  130    134   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  131    135   
    B: 'static,
  132    136   
  133    137   
    B::Data: Send,
  134    138   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  135    139   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  136    140   
{
  137    141   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  138    142   
    type Future = GetPokemonSpeciesInputFuture;
  139    143   
  140         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         144  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  141    145   
        let fut = async move {
  142    146   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  143    147   
                request.headers(),
  144    148   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  145    149   
            ) {
  146    150   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  147    151   
            }
  148    152   
            crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_request(
  149    153   
                request,
  150    154   
            )
  151    155   
            .await
  152    156   
        };
  153    157   
        use ::futures_util::future::TryFutureExt;
  154    158   
        let fut = fut.map_err(
  155    159   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  156    160   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  157    161   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  158    162   
                    e,
  159    163   
                )
  160    164   
            },
  161    165   
        );
  162    166   
        GetPokemonSpeciesInputFuture {
  163    167   
            inner: Box::pin(fut),
  164    168   
        }
  165    169   
    }
  166    170   
}
         171  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  167    172   
impl
  168    173   
    ::aws_smithy_http_server::response::IntoResponse<
  169    174   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  170    175   
    > for crate::output::GetPokemonSpeciesOutput
  171    176   
{
  172    177   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  173    178   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_response(self) {
  174    179   
                        Ok(response) => response,
  175    180   
                        Err(e) => {
  176    181   
                            ::tracing::error!(error = %e, "failed to serialize response");
  177    182   
                            ::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))
  178    183   
                        }
  179    184   
                    }
  180    185   
    }
  181    186   
}
         187  +
/* ServerHttpBoundProtocolGenerator.kt:356 */
  182    188   
impl
  183    189   
    ::aws_smithy_http_server::response::IntoResponse<
  184    190   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  185    191   
    > for crate::error::GetPokemonSpeciesError
  186    192   
{
  187    193   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  188    194   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_error(
  189    195   
            &self,
  190    196   
        ) {
  191    197   
            Ok(mut response) => {
  192    198   
                response.extensions_mut().insert(
  193    199   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  194    200   
                );
  195    201   
                response
  196    202   
            }
  197    203   
            Err(e) => {
  198    204   
                ::tracing::error!(error = %e, "failed to serialize response");
  199    205   
                ::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))
  200    206   
            }
  201    207   
        }
  202    208   
    }
  203    209   
}
  204    210   
         211  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  205    212   
::pin_project_lite::pin_project! {
  206    213   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  207    214   
    /// [`StreamPokemonRadioInput`](crate::input::StreamPokemonRadioInput) using modelled bindings.
  208    215   
    pub struct StreamPokemonRadioInputFuture {
  209    216   
        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>>
  210    217   
    }
  211    218   
}
  212    219   
  213    220   
impl std::future::Future for StreamPokemonRadioInputFuture {
  214    221   
    type Output = Result<
  215    222   
        crate::input::StreamPokemonRadioInput,
  216    223   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  217    224   
    >;
  218    225   
  219    226   
    fn poll(
  220    227   
        self: std::pin::Pin<&mut Self>,
  221    228   
        cx: &mut std::task::Context<'_>,
  222    229   
    ) -> std::task::Poll<Self::Output> {
  223    230   
        let this = self.project();
  224    231   
        this.inner.as_mut().poll(cx)
  225    232   
    }
  226    233   
}
  227    234   
  228    235   
impl<B>
  229    236   
    ::aws_smithy_http_server::request::FromRequest<
  230    237   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  231    238   
        B,
  232    239   
    > for crate::input::StreamPokemonRadioInput
  233    240   
where
  234    241   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  235    242   
    B: 'static,
  236    243   
  237    244   
    B::Data: Send,
  238    245   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  239    246   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  240    247   
{
  241    248   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  242    249   
    type Future = StreamPokemonRadioInputFuture;
  243    250   
  244         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         251  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  245    252   
        let fut = async move {
  246    253   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  247    254   
                request.headers(),
  248    255   
                &crate::mimes::CONTENT_TYPE_APPLICATION_OCTET_STREAM,
  249    256   
            ) {
  250    257   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  251    258   
            }
  252    259   
            crate::protocol_serde::shape_stream_pokemon_radio::de_stream_pokemon_radio_http_request(
  253    260   
                request,
  254    261   
            )
  255    262   
            .await
  256    263   
        };
  257    264   
        use ::futures_util::future::TryFutureExt;
  258    265   
        let fut = fut.map_err(
  259    266   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  260    267   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  261    268   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  262    269   
                    e,
  263    270   
                )
  264    271   
            },
  265    272   
        );
  266    273   
        StreamPokemonRadioInputFuture {
  267    274   
            inner: Box::pin(fut),
  268    275   
        }
  269    276   
    }
  270    277   
}
         278  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  271    279   
impl
  272    280   
    ::aws_smithy_http_server::response::IntoResponse<
  273    281   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  274    282   
    > for crate::output::StreamPokemonRadioOutput
  275    283   
{
  276    284   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  277    285   
        match crate::protocol_serde::shape_stream_pokemon_radio::ser_stream_pokemon_radio_http_response(self) {
  278    286   
                        Ok(response) => response,
  279    287   
                        Err(e) => {
  280    288   
                            ::tracing::error!(error = %e, "failed to serialize response");
  281    289   
                            ::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))
  282    290   
                        }
  283    291   
                    }
  284    292   
    }
  285    293   
}
  286    294   
         295  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  287    296   
::pin_project_lite::pin_project! {
  288    297   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  289    298   
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
  290    299   
    pub struct CheckHealthInputFuture {
  291    300   
        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>>
  292    301   
    }
  293    302   
}
  294    303   
  295    304   
impl std::future::Future for CheckHealthInputFuture {
  296    305   
    type Output = Result<
  297    306   
        crate::input::CheckHealthInput,
  298    307   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  299    308   
    >;
  300    309   
  301    310   
    fn poll(
  302    311   
        self: std::pin::Pin<&mut Self>,
  303    312   
        cx: &mut std::task::Context<'_>,
  304    313   
    ) -> std::task::Poll<Self::Output> {
  305    314   
        let this = self.project();
  306    315   
        this.inner.as_mut().poll(cx)
  307    316   
    }
  308    317   
}
  309    318   
  310    319   
impl<B>
  311    320   
    ::aws_smithy_http_server::request::FromRequest<
  312    321   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  313    322   
        B,
  314    323   
    > for crate::input::CheckHealthInput
  315    324   
where
  316    325   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  317    326   
    B: 'static,
  318    327   
  319    328   
    B::Data: Send,
  320    329   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  321    330   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  322    331   
{
  323    332   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  324    333   
    type Future = CheckHealthInputFuture;
  325    334   
  326         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         335  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  327    336   
        let fut = async move {
  328    337   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  329    338   
                request.headers(),
  330    339   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  331    340   
            ) {
  332    341   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  333    342   
            }
  334    343   
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
  335    344   
        };
  336    345   
        use ::futures_util::future::TryFutureExt;
  337    346   
        let fut = fut.map_err(
  338    347   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  339    348   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  340    349   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  341    350   
                    e,
  342    351   
                )
  343    352   
            },
  344    353   
        );
  345    354   
        CheckHealthInputFuture {
  346    355   
            inner: Box::pin(fut),
  347    356   
        }
  348    357   
    }
  349    358   
}
         359  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  350    360   
impl
  351    361   
    ::aws_smithy_http_server::response::IntoResponse<
  352    362   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  353    363   
    > for crate::output::CheckHealthOutput
  354    364   
{
  355    365   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  356    366   
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
  357    367   
            Ok(response) => response,
  358    368   
            Err(e) => {
  359    369   
                ::tracing::error!(error = %e, "failed to serialize response");
  360    370   
                ::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))
  361    371   
            }
  362    372   
        }
  363    373   
    }
  364    374   
}
  365    375   
         376  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  366    377   
::pin_project_lite::pin_project! {
  367    378   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  368    379   
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
  369    380   
    pub struct CapturePokemonInputFuture {
  370    381   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CapturePokemonInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  371    382   
    }
  372    383   
}
  373    384   
  374    385   
impl std::future::Future for CapturePokemonInputFuture {
  375    386   
    type Output = Result<
  376    387   
        crate::input::CapturePokemonInput,
  377    388   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  378    389   
    >;
  379    390   
  380    391   
    fn poll(
  381    392   
        self: std::pin::Pin<&mut Self>,
  382    393   
        cx: &mut std::task::Context<'_>,
  383    394   
    ) -> std::task::Poll<Self::Output> {
  384    395   
        let this = self.project();
  385    396   
        this.inner.as_mut().poll(cx)
  386    397   
    }
  387    398   
}
  388    399   
  389    400   
impl<B>
  390    401   
    ::aws_smithy_http_server::request::FromRequest<
  391    402   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  392    403   
        B,
  393    404   
    > for crate::input::CapturePokemonInput
  394    405   
where
  395    406   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  396    407   
    B: 'static,
  397    408   
  398         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
         409  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
         410  +
        + ::std::marker::Send
         411  +
        + ::std::marker::Sync
         412  +
        + 'static,
         413  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
         414  +
  399    415   
    B::Data: Send,
  400    416   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  401    417   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  402    418   
{
  403    419   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  404    420   
    type Future = CapturePokemonInputFuture;
  405    421   
  406         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         422  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  407    423   
        let fut = async move {
  408    424   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  409    425   
                request.headers(),
  410    426   
                &crate::mimes::CONTENT_TYPE_APPLICATION_VND_AMAZON_EVENTSTREAM,
  411    427   
            ) {
  412    428   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  413    429   
            }
  414    430   
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_request(request)
  415    431   
                .await
  416    432   
        };
  417    433   
        use ::futures_util::future::TryFutureExt;
  418    434   
        let fut = fut.map_err(
  419    435   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  420    436   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  421    437   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  422    438   
                    e,
  423    439   
                )
  424    440   
            },
  425    441   
        );
  426    442   
        CapturePokemonInputFuture {
  427    443   
            inner: Box::pin(fut),
  428    444   
        }
  429    445   
    }
  430    446   
}
         447  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  431    448   
impl
  432    449   
    ::aws_smithy_http_server::response::IntoResponse<
  433    450   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  434    451   
    > for crate::output::CapturePokemonOutput
  435    452   
{
  436    453   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  437    454   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
  438    455   
        {
  439    456   
            Ok(response) => response,
  440    457   
            Err(e) => {
  441    458   
                ::tracing::error!(error = %e, "failed to serialize response");
  442    459   
                ::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))
  443    460   
            }
  444    461   
        }
  445    462   
    }
  446    463   
}
         464  +
/* ServerHttpBoundProtocolGenerator.kt:356 */
  447    465   
impl
  448    466   
    ::aws_smithy_http_server::response::IntoResponse<
  449    467   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  450    468   
    > for crate::error::CapturePokemonError
  451    469   
{
  452    470   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  453    471   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
  454    472   
            Ok(mut response) => {
  455    473   
                response.extensions_mut().insert(
  456    474   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  457    475   
                );
  458    476   
                response
  459    477   
            }
  460    478   
            Err(e) => {
  461    479   
                ::tracing::error!(error = %e, "failed to serialize response");
  462    480   
                ::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))
  463    481   
            }
  464    482   
        }
  465    483   
    }
  466    484   
}
  467    485   
         486  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  468    487   
::pin_project_lite::pin_project! {
  469    488   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  470    489   
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
  471    490   
    pub struct DoNothingInputFuture {
  472    491   
        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>>
  473    492   
    }
  474    493   
}
  475    494   
  476    495   
impl std::future::Future for DoNothingInputFuture {
  477    496   
    type Output = Result<
  478    497   
        crate::input::DoNothingInput,
  479    498   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  480    499   
    >;
  481    500   
  482    501   
    fn poll(
  483    502   
        self: std::pin::Pin<&mut Self>,
  484    503   
        cx: &mut std::task::Context<'_>,
  485    504   
    ) -> std::task::Poll<Self::Output> {
  486    505   
        let this = self.project();
  487    506   
        this.inner.as_mut().poll(cx)
  488    507   
    }
  489    508   
}
  490    509   
  491    510   
impl<B>
  492    511   
    ::aws_smithy_http_server::request::FromRequest<
  493    512   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  494    513   
        B,
  495    514   
    > for crate::input::DoNothingInput
  496    515   
where
  497    516   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  498    517   
    B: 'static,
  499    518   
  500    519   
    B::Data: Send,
  501    520   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  502    521   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  503    522   
{
  504    523   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  505    524   
    type Future = DoNothingInputFuture;
  506    525   
  507         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         526  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  508    527   
        let fut = async move {
  509    528   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  510    529   
                request.headers(),
  511    530   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  512    531   
            ) {
  513    532   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  514    533   
            }
  515    534   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
  516    535   
        };
  517    536   
        use ::futures_util::future::TryFutureExt;
  518    537   
        let fut = fut.map_err(
  519    538   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  520    539   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  521    540   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  522    541   
                    e,
  523    542   
                )
  524    543   
            },
  525    544   
        );
  526    545   
        DoNothingInputFuture {
  527    546   
            inner: Box::pin(fut),
  528    547   
        }
  529    548   
    }
  530    549   
}
         550  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  531    551   
impl
  532    552   
    ::aws_smithy_http_server::response::IntoResponse<
  533    553   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  534    554   
    > for crate::output::DoNothingOutput
  535    555   
{
  536    556   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  537    557   
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
  538    558   
            Ok(response) => response,
  539    559   
            Err(e) => {
  540    560   
                ::tracing::error!(error = %e, "failed to serialize response");
  541    561   
                ::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))
  542    562   
            }
  543    563   
        }
  544    564   
    }
  545    565   
}
  546    566   
         567  +
/* ServerHttpBoundProtocolGenerator.kt:276 */
  547    568   
::pin_project_lite::pin_project! {
  548    569   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  549    570   
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
  550    571   
    pub struct GetServerStatisticsInputFuture {
  551    572   
        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>>
  552    573   
    }
  553    574   
}
  554    575   
  555    576   
impl std::future::Future for GetServerStatisticsInputFuture {
  556    577   
    type Output = Result<
  557    578   
        crate::input::GetServerStatisticsInput,
  558    579   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  559    580   
    >;
  560    581   
  561    582   
    fn poll(
  562    583   
        self: std::pin::Pin<&mut Self>,
  563    584   
        cx: &mut std::task::Context<'_>,
  564    585   
    ) -> std::task::Poll<Self::Output> {
  565    586   
        let this = self.project();
  566    587   
        this.inner.as_mut().poll(cx)
  567    588   
    }
  568    589   
}
  569    590   
  570    591   
impl<B>
  571    592   
    ::aws_smithy_http_server::request::FromRequest<
  572    593   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  573    594   
        B,
  574    595   
    > for crate::input::GetServerStatisticsInput
  575    596   
where
  576    597   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  577    598   
    B: 'static,
  578    599   
  579    600   
    B::Data: Send,
  580    601   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  581    602   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  582    603   
{
  583    604   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  584    605   
    type Future = GetServerStatisticsInputFuture;
  585    606   
  586         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         607  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  587    608   
        let fut = async move {
  588    609   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  589    610   
                request.headers(),
  590    611   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  591    612   
            ) {
  592    613   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  593    614   
            }
  594    615   
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
  595    616   
                            .await
  596    617   
        };
  597    618   
        use ::futures_util::future::TryFutureExt;
  598    619   
        let fut = fut.map_err(
  599    620   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  600    621   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  601    622   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  602    623   
                    e,
  603    624   
                )
  604    625   
            },
  605    626   
        );
  606    627   
        GetServerStatisticsInputFuture {
  607    628   
            inner: Box::pin(fut),
  608    629   
        }
  609    630   
    }
  610    631   
}
         632  +
/* ServerHttpBoundProtocolGenerator.kt:335 */
  611    633   
impl
  612    634   
    ::aws_smithy_http_server::response::IntoResponse<
  613    635   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  614    636   
    > for crate::output::GetServerStatisticsOutput
  615    637   
{
  616    638   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  617    639   
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
  618    640   
                        Ok(response) => response,
  619    641   
                        Err(e) => {
  620    642   
                            ::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         -
                &::http::header::HeaderName,
          24  +
                &::http_1x::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         -
                |name: &::http::header::HeaderName| {
          43  +
                |name: &::http_1x::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:534 */
    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:356 */
   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:356 */
   23     35   
}
   24     36   
          37  +
/* StructureGenerator.kt:197 */
   25     38   
#[allow(missing_docs)] // documentation missing in model
          39  +
/* RustType.kt:534 */
   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:356 */
   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:356 */
   52     80   
}
   53     81   
          82  +
/* StructureGenerator.kt:197 */
   54     83   
#[allow(missing_docs)] // documentation missing in model
          84  +
/* RustType.kt:534 */
   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:356 */
   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:356 */
   71    114   
}
   72    115   
         116  +
/* StructureGenerator.kt:197 */
   73    117   
#[allow(missing_docs)] // documentation missing in model
         118  +
/* RustType.kt:534 */
   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:356 */
   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:356 */
   83    133   
}
   84    134   
         135  +
/* StructureGenerator.kt:197 */
   85    136   
#[allow(missing_docs)] // documentation missing in model
         137  +
/* RustType.kt:534 */
   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:356 */
  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:356 */
  110    175   
}
  111    176   
         177  +
/* StructureGenerator.kt:197 */
  112    178   
#[allow(missing_docs)] // documentation missing in model
         179  +
/* RustType.kt:534 */
  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:356 */
  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:356 */
  122    194   
}
  123    195   
         196  +
/* StructureGenerator.kt:197 */
  124    197   
#[allow(missing_docs)] // documentation missing in model
         198  +
/* RustType.kt:534 */
  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:356 */
  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:356 */
  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:534 */
  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:534 */
  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:137 */`collection` was not provided but it is required when building `GetStorageOutput`.
         241  +
        /* ServerBuilderConstraintViolations.kt:144 */
  153    242   
        MissingCollection,
         243  +
        /* ServerBuilderConstraintViolations.kt:75 */
  154    244   
    }
         245  +
    /* ServerBuilderConstraintViolations.kt:116 */
  155    246   
    impl ::std::fmt::Display for ConstraintViolation {
         247  +
        /* ServerBuilderConstraintViolations.kt:117 */
  156    248   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         249  +
            /* ServerBuilderConstraintViolations.kt:118 */
  157    250   
            match self {
  158         -
                ConstraintViolation::MissingCollection => write!(f, "`collection` was not provided but it is required when building `GetStorageOutput`"),
  159         -
            }
         251  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingCollection => write!(f, "`collection` was not provided but it is required when building `GetStorageOutput`"),
         252  +
            /* ServerBuilderConstraintViolations.kt:118 */}
         253  +
            /* ServerBuilderConstraintViolations.kt:117 */
  160    254   
        }
         255  +
        /* ServerBuilderConstraintViolations.kt:116 */
  161    256   
    }
         257  +
    /* ServerBuilderConstraintViolations.kt:83 */
  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:534 */
  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:534 */
  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:534 */
  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:137 */`name` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         333  +
        /* ServerBuilderConstraintViolations.kt:144 */
  208    334   
        MissingName,
  209         -
        /// `flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         335  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`.
         336  +
        /* ServerBuilderConstraintViolations.kt:144 */
  210    337   
        MissingFlavorTextEntries,
         338  +
        /* ServerBuilderConstraintViolations.kt:75 */
  211    339   
    }
         340  +
    /* ServerBuilderConstraintViolations.kt:116 */
  212    341   
    impl ::std::fmt::Display for ConstraintViolation {
         342  +
        /* ServerBuilderConstraintViolations.kt:117 */
  213    343   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         344  +
            /* ServerBuilderConstraintViolations.kt:118 */
  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:126 */ConstraintViolation::MissingName => write!(f, "`name` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
         347  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingFlavorTextEntries => write!(f, "`flavor_text_entries` was not provided but it is required when building `GetPokemonSpeciesOutput`"),
         348  +
            /* ServerBuilderConstraintViolations.kt:118 */}
         349  +
            /* ServerBuilderConstraintViolations.kt:117 */
  218    350   
        }
         351  +
        /* ServerBuilderConstraintViolations.kt:116 */
  219    352   
    }
         353  +
    /* ServerBuilderConstraintViolations.kt:83 */
  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:534 */
  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:534 */
  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:95 */
         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:534 */
  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:534 */
  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:534 */
  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:137 */`events` was not provided but it is required when building `CapturePokemonOutput`.
         542  +
        /* ServerBuilderConstraintViolations.kt:144 */
  329    543   
        MissingEvents,
         544  +
        /* ServerBuilderConstraintViolations.kt:75 */
  330    545   
    }
         546  +
    /* ServerBuilderConstraintViolations.kt:116 */
  331    547   
    impl ::std::fmt::Display for ConstraintViolation {
         548  +
        /* ServerBuilderConstraintViolations.kt:117 */
  332    549   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         550  +
            /* ServerBuilderConstraintViolations.kt:118 */
  333    551   
            match self {
  334         -
                ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
  335         -
            }
         552  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
         553  +
            /* ServerBuilderConstraintViolations.kt:118 */}
         554  +
            /* ServerBuilderConstraintViolations.kt:117 */
  336    555   
        }
         556  +
        /* ServerBuilderConstraintViolations.kt:116 */
  337    557   
    }
         558  +
    /* ServerBuilderConstraintViolations.kt:83 */
  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:534 */
  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:534 */
  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:534 */
  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:534 */
  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:137 */`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         679  +
        /* ServerBuilderConstraintViolations.kt:144 */
  414    680   
        MissingCallsCount,
         681  +
        /* ServerBuilderConstraintViolations.kt:75 */
  415    682   
    }
         683  +
    /* ServerBuilderConstraintViolations.kt:116 */
  416    684   
    impl ::std::fmt::Display for ConstraintViolation {
         685  +
        /* ServerBuilderConstraintViolations.kt:117 */
  417    686   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         687  +
            /* ServerBuilderConstraintViolations.kt:118 */
  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:126 */ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
         690  +
            /* ServerBuilderConstraintViolations.kt:118 */}
         691  +
            /* ServerBuilderConstraintViolations.kt:117 */
  421    692   
        }
         693  +
        /* ServerBuilderConstraintViolations.kt:116 */
  422    694   
    }
         695  +
    /* ServerBuilderConstraintViolations.kt:83 */
  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:534 */
  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 +233,317 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_capture_pokemon_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::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         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
          13  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
          14  +
        + ::std::marker::Send
          15  +
        + ::std::marker::Sync
          16  +
        + 'static,
          17  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
          18  +
   12     19   
    B::Data: Send,
   13     20   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14     21   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     22   
{
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   16     24   
    Ok({
          25  +
        /* RustType.kt:534 */
   17     26   
        #[allow(unused_mut)]
          27  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   18     28   
        let mut input = crate::input::capture_pokemon_input::Builder::default();
          29  +
        /* RustType.kt:534 */
   19     30   
        #[allow(unused_variables)]
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   20     32   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     33   
            uri, headers, body, ..
   22     34   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   23     36   
        if let Some(value) = {
   24     37   
            let mut receiver =
   25     38   
                crate::protocol_serde::shape_capture_pokemon_input::de_events_payload(
   26         -
                    &mut body.into().into_inner(),
          39  +
                    &mut ::aws_smithy_types::body::SdkBody::from_body_1_x(body),
   27     40   
                )?;
   28     41   
            if let Some(_initial_event) = receiver
   29     42   
                                                .try_recv_initial(::aws_smithy_http::event_stream::InitialMessageType::Request)
   30     43   
                                                .await
   31     44   
                                                .map_err(
   32     45   
                                                    |ev_error| ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::ConstraintViolation(
   33     46   
                                                        #[allow(clippy::useless_conversion)]
   34     47   
                                                        format!("{ev_error}").into()
   35     48   
                                                    )
   36     49   
                                                )? {
   37     50   
                                                
   38     51   
                                            }
   39     52   
            Some(receiver)
   40     53   
        } {
   41     54   
            input = input.set_events(value)
   42     55   
        }
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:1134 */
   43     57   
        let input_string = uri.path();
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:1146 */
   44     59   
        let (input_string, (_, m1)) =
   45     60   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   46     61   
                ::nom::sequence::preceded(
   47     62   
                    ::nom::bytes::complete::tag("/"),
   48     63   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   49     64   
                        "capture-pokemon-event",
   50     65   
                    ),
   51     66   
                ),
   52     67   
                ::nom::sequence::preceded(
   53     68   
                    ::nom::bytes::complete::tag("/"),
   54     69   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   55     70   
                        ::nom::bytes::complete::take_until("/"),
   56     71   
                        ::nom::combinator::rest,
   57     72   
                    )),
   58     73   
                ),
   59     74   
            ))(input_string)?;
   60     75   
        debug_assert_eq!("", input_string);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:1157 */
   61     77   
        input =
   62     78   
            input.set_region(crate::protocol_serde::shape_capture_pokemon_input::de_region(m1)?);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   63     80   
        input.build()?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   64     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   65     84   
}
   66     85   
          86  +
/* RustType.kt:534 */
   67     87   
#[allow(clippy::unnecessary_wraps)]
          88  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   68     89   
pub fn ser_capture_pokemon_http_response(
   69     90   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   70     91   
) -> std::result::Result<
   71     92   
    ::aws_smithy_http_server::response::Response,
   72     93   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     94   
> {
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   74     96   
    Ok({
          97  +
        /* RustType.kt:534 */
   75     98   
        #[allow(unused_mut)]
   76         -
        let mut builder = ::http::Response::builder();
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
         100  +
        let mut builder = ::http_1x::Response::builder();
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   77    102   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    103   
            builder,
   79         -
            ::http::header::CONTENT_TYPE,
         104  +
            ::http_1x::header::CONTENT_TYPE,
   80    105   
            "application/vnd.amazon.eventstream",
   81    106   
        );
         107  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   82    108   
        let http_status: u16 = 200;
   83    109   
        builder = builder.status(http_status);
   84         -
        let body = ::aws_smithy_http_server::body::boxed(
   85         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
         110  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
         111  +
        let body =
         112  +
            ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream(
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:142 */
         114  +
                {
   86    115   
                    let error_marshaller =
   87    116   
                        crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   88         -
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
         117  +
                    let marshaller =
         118  +
                        crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   89    119   
                    let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   90    120   
                    output
   91    121   
                        .events
   92    122   
                        .into_body_stream(marshaller, error_marshaller, signer)
   93         -
            }),
   94         -
        );
         123  +
                }, /* ServerHttpBoundProtocolGenerator.kt:575 */
         124  +
            ));
         125  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   95    126   
        builder.body(body)?
         127  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   96    128   
    })
         129  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   97    130   
}
   98    131   
         132  +
/* RustType.kt:534 */
   99    133   
#[allow(clippy::unnecessary_wraps)]
         134  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
  100    135   
pub fn ser_capture_pokemon_http_error(
  101    136   
    error: &crate::error::CapturePokemonError,
  102    137   
) -> std::result::Result<
  103    138   
    ::aws_smithy_http_server::response::Response,
  104    139   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  105    140   
> {
         141  +
    /* ServerHttpBoundProtocolGenerator.kt:476 */
  106    142   
    Ok({
         143  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
  107    144   
        match error {
         145  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  108    146   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  109    148   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
         149  +
                /* RustType.kt:534 */
  110    150   
                #[allow(unused_mut)]
  111         -
                let mut builder = ::http::Response::builder();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         152  +
                let mut builder = ::http_1x::Response::builder();
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  112    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    155   
                    builder,
  114         -
                    ::http::header::CONTENT_TYPE,
         156  +
                    ::http_1x::header::CONTENT_TYPE,
  115    157   
                    "application/vnd.amazon.eventstream",
  116    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  117    160   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    161   
                    builder,
  119         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         162  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  120    163   
                    "UnsupportedRegionError",
  121    164   
                );
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  122    166   
                let content_length = payload.len();
  123    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    168   
                    builder,
  125         -
                    ::http::header::CONTENT_LENGTH,
         169  +
                    ::http_1x::header::CONTENT_LENGTH,
  126    170   
                    content_length,
  127    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  128    173   
                builder
  129    174   
                    .status(500)
  130    175   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  131    177   
            }
         178  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  132    179   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  133    181   
                let payload =
  134    182   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  135    183   
                        output,
  136    184   
                    )?;
         185  +
                /* RustType.kt:534 */
  137    186   
                #[allow(unused_mut)]
  138         -
                let mut builder = ::http::Response::builder();
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         188  +
                let mut builder = ::http_1x::Response::builder();
         189  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  139    190   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  140    191   
                    builder,
  141         -
                    ::http::header::CONTENT_TYPE,
         192  +
                    ::http_1x::header::CONTENT_TYPE,
  142    193   
                    "application/vnd.amazon.eventstream",
  143    194   
                );
         195  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  144    196   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  145    197   
                    builder,
  146         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         198  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  147    199   
                    "ThrottlingError",
  148    200   
                );
         201  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  149    202   
                let content_length = payload.len();
  150    203   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  151    204   
                    builder,
  152         -
                    ::http::header::CONTENT_LENGTH,
         205  +
                    ::http_1x::header::CONTENT_LENGTH,
  153    206   
                    content_length,
  154    207   
                );
         208  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  155    209   
                builder
  156    210   
                    .status(400)
  157    211   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  158    213   
            }
         214  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  159    215   
            crate::error::CapturePokemonError::ValidationException(output) => {
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  160    217   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         218  +
                /* RustType.kt:534 */
  161    219   
                #[allow(unused_mut)]
  162         -
                let mut builder = ::http::Response::builder();
         220  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         221  +
                let mut builder = ::http_1x::Response::builder();
         222  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  163    223   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  164    224   
                    builder,
  165         -
                    ::http::header::CONTENT_TYPE,
         225  +
                    ::http_1x::header::CONTENT_TYPE,
  166    226   
                    "application/vnd.amazon.eventstream",
  167    227   
                );
         228  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  168    229   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  169    230   
                    builder,
  170         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         231  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  171    232   
                    "ValidationException",
  172    233   
                );
         234  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  173    235   
                let content_length = payload.len();
  174    236   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  175    237   
                    builder,
  176         -
                    ::http::header::CONTENT_LENGTH,
         238  +
                    ::http_1x::header::CONTENT_LENGTH,
  177    239   
                    content_length,
  178    240   
                );
         241  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  179    242   
                builder
  180    243   
                    .status(400)
  181    244   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         245  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  182    246   
            }
         247  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  183    248   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
         249  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  184    250   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
         251  +
                /* RustType.kt:534 */
  185    252   
                #[allow(unused_mut)]
  186         -
                let mut builder = ::http::Response::builder();
         253  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         254  +
                let mut builder = ::http_1x::Response::builder();
         255  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  187    256   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  188    257   
                    builder,
  189         -
                    ::http::header::CONTENT_TYPE,
         258  +
                    ::http_1x::header::CONTENT_TYPE,
  190    259   
                    "application/vnd.amazon.eventstream",
  191    260   
                );
         261  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  192    262   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  193    263   
                    builder,
  194         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         264  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  195    265   
                    "MasterBallUnsuccessful",
  196    266   
                );
         267  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  197    268   
                let content_length = payload.len();
  198    269   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  199    270   
                    builder,
  200         -
                    ::http::header::CONTENT_LENGTH,
         271  +
                    ::http_1x::header::CONTENT_LENGTH,
  201    272   
                    content_length,
  202    273   
                );
         274  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  203    275   
                builder
  204    276   
                    .status(500)
  205    277   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         278  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  206    279   
            }
         280  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  207    281   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
         282  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  208    283   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
         284  +
                /* RustType.kt:534 */
  209    285   
                #[allow(unused_mut)]
  210         -
                let mut builder = ::http::Response::builder();
         286  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         287  +
                let mut builder = ::http_1x::Response::builder();
         288  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  211    289   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  212    290   
                    builder,
  213         -
                    ::http::header::CONTENT_TYPE,
         291  +
                    ::http_1x::header::CONTENT_TYPE,
  214    292   
                    "application/vnd.amazon.eventstream",
  215    293   
                );
         294  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  216    295   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  217    296   
                    builder,
  218         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         297  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  219    298   
                    "InvalidPokeballError",
  220    299   
                );
         300  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  221    301   
                let content_length = payload.len();
  222    302   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  223    303   
                    builder,
  224         -
                    ::http::header::CONTENT_LENGTH,
         304  +
                    ::http_1x::header::CONTENT_LENGTH,
  225    305   
                    content_length,
  226    306   
                );
         307  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  227    308   
                builder
  228    309   
                    .status(400)
  229    310   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         311  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         312  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
  230    313   
        }
  231         -
        }
         314  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
  232    315   
    })
         316  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
  233    317   
}

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

@@ -1,1 +27,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:236 */
    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:278 */
   11     13   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
          14  +
    /* HttpBindingGenerator.kt:296 */
   12     15   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13     16   
    let receiver = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
   14     17   
    Ok(receiver)
          18  +
    /* HttpBindingGenerator.kt:236 */
   15     19   
}
   16     20   
          21  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   17     22   
pub fn de_region(
   18     23   
    value: &str,
   19     24   
) -> std::result::Result<
   20     25   
    ::std::string::String,
   21     26   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   22     27   
> {
          28  +
    /* ServerHttpBoundProtocolGenerator.kt:1463 */
   23     29   
    let value = ::percent_encoding::percent_decode_str(value)
   24     30   
        .decode_utf8()?
   25     31   
        .into_owned();
          32  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   26     33   
    Ok(value)
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   27     35   
}

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:534 */
   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:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_check_health_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::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:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::check_health_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:873 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:534 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   28     41   
pub fn ser_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:457 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:534 */
   35     50   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          52  +
        let mut builder = ::http_1x::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          56  +
            ::http_1x::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
   44         -
        let payload = "";
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          63  +
        let payload =
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:233 */""
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   45     67   
        let content_length = payload.len();
   46     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     69   
            builder,
   48         -
            ::http::header::CONTENT_LENGTH,
          70  +
            ::http_1x::header::CONTENT_LENGTH,
   49     71   
            content_length,
   50     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   51     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   52     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   53     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   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:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_do_nothing_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::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:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::do_nothing_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:534 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   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:457 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:534 */
   34     48   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          50  +
        let mut builder = ::http_1x::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          54  +
            ::http_1x::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(
   45         -
                &output,
   46         -
            )?;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   47     65   
        let content_length = payload.len();
   48     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     67   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          68  +
            ::http_1x::header::CONTENT_LENGTH,
   51     69   
            content_length,
   52     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   53     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   54     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   55     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   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:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_get_pokemon_species_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::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:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::get_pokemon_species_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:1134 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1146 */
   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:1157 */
   40     50   
        input =
   41     51   
            input.set_name(crate::protocol_serde::shape_get_pokemon_species_input::de_name(m1)?);
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   42     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   43     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   44     57   
}
   45     58   
          59  +
/* RustType.kt:534 */
   46     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   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:457 */
   53     69   
    Ok({
          70  +
        /* RustType.kt:534 */
   54     71   
        #[allow(unused_mut)]
   55         -
        let mut builder = ::http::Response::builder();
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          73  +
        let mut builder = ::http_1x::Response::builder();
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   56     75   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     76   
            builder,
   58         -
            ::http::header::CONTENT_TYPE,
          77  +
            ::http_1x::header::CONTENT_TYPE,
   59     78   
            "application/json",
   60     79   
        );
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   61     81   
        let http_status: u16 = 200;
   62     82   
        builder = builder.status(http_status);
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   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:235 */crate::protocol_serde::shape_get_pokemon_species_output::ser_get_pokemon_species_output_output_output(&output)?
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   66     88   
        let content_length = payload.len();
   67     89   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   68     90   
            builder,
   69         -
            ::http::header::CONTENT_LENGTH,
          91  +
            ::http_1x::header::CONTENT_LENGTH,
   70     92   
            content_length,
   71     93   
        );
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   72     95   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   73     97   
        builder.body(body)?
          98  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   74     99   
    })
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   75    101   
}
   76    102   
         103  +
/* RustType.kt:534 */
   77    104   
#[allow(clippy::unnecessary_wraps)]
         105  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
   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:476 */
   84    113   
    Ok({
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
   85    115   
        match error {
         116  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
   86    117   
            crate::error::GetPokemonSpeciesError::ResourceNotFoundException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
   87    119   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         120  +
                /* RustType.kt:534 */
   88    121   
                #[allow(unused_mut)]
   89         -
                let mut builder = ::http::Response::builder();
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         123  +
                let mut builder = ::http_1x::Response::builder();
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   90    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    126   
                    builder,
   92         -
                    ::http::header::CONTENT_TYPE,
         127  +
                    ::http_1x::header::CONTENT_TYPE,
   93    128   
                    "application/json",
   94    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   95    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    132   
                    builder,
   97         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         133  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   98    134   
                    "ResourceNotFoundException",
   99    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  100    137   
                let content_length = payload.len();
  101    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    139   
                    builder,
  103         -
                    ::http::header::CONTENT_LENGTH,
         140  +
                    ::http_1x::header::CONTENT_LENGTH,
  104    141   
                    content_length,
  105    142   
                );
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  106    144   
                builder
  107    145   
                    .status(404)
  108    146   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
  109    148   
            }
         149  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  110    150   
            crate::error::GetPokemonSpeciesError::ValidationException(output) => {
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  111    152   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         153  +
                /* RustType.kt:534 */
  112    154   
                #[allow(unused_mut)]
  113         -
                let mut builder = ::http::Response::builder();
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         156  +
                let mut builder = ::http_1x::Response::builder();
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  114    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    159   
                    builder,
  116         -
                    ::http::header::CONTENT_TYPE,
         160  +
                    ::http_1x::header::CONTENT_TYPE,
  117    161   
                    "application/json",
  118    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  119    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  120    165   
                    builder,
  121         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         166  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  122    167   
                    "ValidationException",
  123    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  124    170   
                let content_length = payload.len();
  125    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  126    172   
                    builder,
  127         -
                    ::http::header::CONTENT_LENGTH,
         173  +
                    ::http_1x::header::CONTENT_LENGTH,
  128    174   
                    content_length,
  129    175   
                );
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  130    177   
                builder
  131    178   
                    .status(400)
  132    179   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         181  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
  133    182   
        }
  134         -
        }
         183  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
  135    184   
    })
         185  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
  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:1453 */
    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:1463 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   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:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_get_server_statistics_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::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:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::get_server_statistics_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:534 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   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:457 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:534 */
   34     48   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          50  +
        let mut builder = ::http_1x::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          54  +
            ::http_1x::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   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:235 */crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          68  +
            ::http_1x::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   55     78   
}