Server Test Python

Server Test Python

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/operation_shape.rs

@@ -1,1 +29,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
pub struct Structs;
    4      4   
    5         -
impl ::aws_smithy_http_server::operation::OperationShape for Structs {
    6         -
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7         -
        ::aws_smithy_http_server::shape_id::ShapeId::new(
           5  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Structs {
           6  +
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
           7  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
    8      8   
            "naming_obs_structs#Structs",
    9      9   
            "naming_obs_structs",
   10     10   
            "Structs",
   11     11   
        );
   12     12   
   13     13   
    type Input = crate::input::StructsInput;
   14     14   
    type Output = crate::output::StructsOutput;
   15     15   
    type Error = crate::error::StructsError;
   16     16   
}
   17     17   
   18         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Structs {
   19         -
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   20         -
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
          18  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Structs {
          19  +
    type RequestFmt =
          20  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
          21  +
    type ResponseFmt =
          22  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   21     23   
   22     24   
    fn request_fmt() -> Self::RequestFmt {
   23         -
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
          25  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   24     26   
    }
   25     27   
   26     28   
    fn response_fmt() -> Self::ResponseFmt {
   27         -
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
          29  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   28     30   
    }
   29     31   
}

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/protocol_serde/shape_structs.rs

@@ -1,1 +120,120 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_structs_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StructsInput,
    7         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::structs_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/x-amz-json-1.1"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_structs::de_structs(bytes.as_ref(), input)?;
   29     29   
        }
   30     30   
        input.build()
   31     31   
    })
   32     32   
}
   33     33   
   34     34   
#[allow(clippy::unnecessary_wraps)]
   35     35   
pub fn ser_structs_http_response(
   36     36   
    #[allow(unused_variables)] output: crate::output::StructsOutput,
   37     37   
) -> std::result::Result<
   38         -
    ::aws_smithy_http_server::response::Response,
   39         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     40   
> {
   41     41   
    Ok({
   42     42   
        #[allow(unused_mut)]
   43     43   
        let mut builder = ::http::Response::builder();
   44         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   45     45   
            builder,
   46     46   
            ::http::header::CONTENT_TYPE,
   47     47   
            "application/x-amz-json-1.1",
   48     48   
        );
   49     49   
        let http_status: u16 = 200;
   50     50   
        builder = builder.status(http_status);
   51     51   
        let payload =
   52     52   
            crate::protocol_serde::shape_structs_output::ser_structs_output_output_output(&output)?;
   53     53   
        let content_length = payload.len();
   54         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http::header::CONTENT_LENGTH,
   57     57   
            content_length,
   58     58   
        );
   59         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   60     60   
        builder.body(body)?
   61     61   
    })
   62     62   
}
   63     63   
   64     64   
#[allow(clippy::unnecessary_wraps)]
   65     65   
pub fn ser_structs_http_error(
   66     66   
    error: &crate::error::StructsError,
   67     67   
) -> std::result::Result<
   68         -
    ::aws_smithy_http_server::response::Response,
   69         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
   70     70   
> {
   71     71   
    Ok({
   72     72   
        match error {
   73     73   
            crate::error::StructsError::InternalServerError(output) => {
   74     74   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   75     75   
                #[allow(unused_mut)]
   76     76   
                let mut builder = ::http::Response::builder();
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     78   
                    builder,
   79     79   
                    ::http::header::CONTENT_TYPE,
   80     80   
                    "application/x-amz-json-1.1",
   81     81   
                );
   82     82   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_LENGTH,
   86     86   
                    content_length,
   87     87   
                );
   88     88   
                builder
   89     89   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          90  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     91   
            }
   92     92   
        }
   93     93   
    })
   94     94   
}
   95     95   
   96     96   
pub(crate) fn de_structs(
   97     97   
    value: &[u8],
   98     98   
    mut builder: crate::input::structs_input_internal::Builder,
   99     99   
) -> ::std::result::Result<
  100    100   
    crate::input::structs_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/python_operation_adaptor.rs

@@ -1,1 +35,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Python handler for operation `Structs`.
    3      3   
pub(crate) async fn structs(
    4      4   
    input: crate::input::StructsInput,
    5         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
           5  +
    state: ::aws_smithy_legacy_http_server::Extension<
           6  +
        ::aws_smithy_http_server_python::context::PyContext,
           7  +
    >,
    6      8   
    handler: ::aws_smithy_http_server_python::PyHandler,
    7      9   
) -> std::result::Result<crate::output::StructsOutput, crate::error::StructsError> {
    8     10   
    // Async block used to run the handler and catch any Python error.
    9     11   
    let result = if handler.is_coroutine {
   10     12   
        ::tracing::trace!(name = "structs", "executing python handler coroutine");
   11     13   
        let result = ::pyo3::Python::with_gil(|py| {
   12     14   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   13     15   
            let coroutine = if handler.args == 1 {
   14     16   
                pyhandler.call1((input,))?
   15     17   
            } else {

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/python_server_application.rs

@@ -56,56 +146,146 @@
   76     76   
    fn handlers(
   77     77   
        &mut self,
   78     78   
    ) -> &mut ::std::collections::HashMap<String, ::aws_smithy_http_server_python::PyHandler> {
   79     79   
        &mut self.handlers
   80     80   
    }
   81     81   
    fn build_service(
   82     82   
        &mut self,
   83     83   
        event_loop: &::pyo3::PyAny,
   84     84   
    ) -> ::pyo3::PyResult<
   85     85   
        ::tower::util::BoxCloneService<
   86         -
            ::http::Request<::aws_smithy_http_server::body::Body>,
   87         -
            ::http::Response<::aws_smithy_http_server::body::BoxBody>,
          86  +
            ::http::Request<::aws_smithy_legacy_http_server::body::Body>,
          87  +
            ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
   88     88   
            std::convert::Infallible,
   89     89   
        >,
   90     90   
    > {
   91     91   
        let builder = crate::service::NamingObstacleCourseStructs::builder_without_plugins();
   92     92   
        let structs_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
   93     93   
        let handler = self
   94     94   
            .handlers
   95     95   
            .get("structs")
   96     96   
            .expect("Python handler for operation `structs` not found")
   97     97   
            .clone();
   98     98   
        let builder = builder.structs(move |input, state| {
   99     99   
            ::pyo3_asyncio::tokio::scope(
  100    100   
                structs_locals.clone(),
  101    101   
                crate::python_operation_adaptor::structs(input, state, handler.clone()),
  102    102   
            )
  103    103   
        });
  104    104   
        let mut service = ::tower::util::BoxCloneService::new(builder.build().expect("one or more operations do not have a registered handler; this is a bug in the Python code generator, please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"));
  105    105   
  106    106   
        {
  107    107   
            use ::tower::Layer;
  108    108   
            ::tracing::trace!("adding middlewares to rust python router");
  109    109   
            let mut middlewares = self.middlewares.clone();
  110    110   
            // Reverse the middlewares, so they run with same order as they defined
  111    111   
            middlewares.reverse();
  112    112   
            for handler in middlewares {
  113    113   
                ::tracing::trace!(name = &handler.name, "adding python middleware");
  114    114   
                let locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  115    115   
                let layer = ::aws_smithy_http_server_python::PyMiddlewareLayer::<
  116         -
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         116  +
                    ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  117    117   
                >::new(handler, locals);
  118    118   
                service = ::tower::util::BoxCloneService::new(layer.layer(service));
  119    119   
            }
  120    120   
        }
  121    121   
        Ok(service)
  122    122   
    }
  123    123   
}
  124    124   
#[::pyo3::pymethods]
  125    125   
impl App {
  126    126   
    /// Create a new [App].

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/service.rs

@@ -1,1 +631,641 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// The service builder for [`NamingObstacleCourseStructs`].
    3      3   
///
    4      4   
/// Constructed via [`NamingObstacleCourseStructs::builder`].
    5      5   
pub struct NamingObstacleCourseStructsBuilder<Body, L, HttpPl, ModelPl> {
    6         -
    structs: Option<::aws_smithy_http_server::routing::Route<Body>>,
           6  +
    structs: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
    7      7   
    layer: L,
    8      8   
    http_plugin: HttpPl,
    9      9   
    model_plugin: ModelPl,
   10     10   
}
   11     11   
   12     12   
impl<Body, L, HttpPl, ModelPl> NamingObstacleCourseStructsBuilder<Body, L, HttpPl, ModelPl> {
   13     13   
    /// Sets the [`Structs`](crate::operation_shape::Structs) operation.
   14     14   
    ///
   15         -
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
   16         -
    /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
          15  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
          16  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
   17     17   
    ///
   18     18   
    /// # Example
   19     19   
    ///
   20     20   
    /// ```no_run
   21     21   
    /// use naming_test_structs::{NamingObstacleCourseStructs, NamingObstacleCourseStructsConfig};
   22     22   
    ///
   23     23   
    /// use naming_test_structs::{input, output, error};
   24     24   
    ///
   25     25   
    /// async fn handler(input: input::StructsInput) -> Result<output::StructsOutput, error::StructsError> {
   26     26   
    ///     todo!()
   27     27   
    /// }
   28     28   
    ///
   29     29   
    /// let config = NamingObstacleCourseStructsConfig::builder().build();
   30     30   
    /// let app = NamingObstacleCourseStructs::builder(config)
   31     31   
    ///     .structs(handler)
   32     32   
    ///     /* Set other handlers */
   33     33   
    ///     .build()
   34     34   
    ///     .unwrap();
   35         -
    /// # let app: NamingObstacleCourseStructs<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
          35  +
    /// # let app: NamingObstacleCourseStructs<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
   36     36   
    /// ```
   37     37   
    ///
   38     38   
                    pub fn structs<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
   39     39   
                    where
   40         -
                        HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::Structs, HandlerExtractors>,
          40  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::Structs, HandlerExtractors>,
   41     41   
   42         -
                        ModelPl: ::aws_smithy_http_server::plugin::Plugin<
          42  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
   43     43   
                            NamingObstacleCourseStructs<L>,
   44     44   
                            crate::operation_shape::Structs,
   45         -
                            ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::Structs, HandlerType>
          45  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::Structs, HandlerType>
   46     46   
                        >,
   47         -
                        ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
          47  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
   48     48   
                            NamingObstacleCourseStructs<L>,
   49     49   
                            crate::operation_shape::Structs,
   50     50   
                            ModelPl::Output
   51     51   
                        >,
   52         -
                        HttpPl: ::aws_smithy_http_server::plugin::Plugin<
          52  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
   53     53   
                            NamingObstacleCourseStructs<L>,
   54     54   
                            crate::operation_shape::Structs,
   55     55   
                            <
   56         -
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   57         -
                                as ::aws_smithy_http_server::plugin::Plugin<
          56  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
          57  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
   58     58   
                                    NamingObstacleCourseStructs<L>,
   59     59   
                                    crate::operation_shape::Structs,
   60     60   
                                    ModelPl::Output
   61     61   
                                >
   62     62   
                            >::Output
   63     63   
                        >,
   64     64   
   65         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          65  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   66     66   
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
   67     67   
   68     68   
                    {
   69         -
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   70         -
        use ::aws_smithy_http_server::plugin::Plugin;
          69  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
          70  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
   71     71   
        let svc = crate::operation_shape::Structs::from_handler(handler);
   72     72   
        let svc = self.model_plugin.apply(svc);
   73         -
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
          73  +
        let svc =
          74  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   74     75   
                .apply(svc);
   75     76   
        let svc = self.http_plugin.apply(svc);
   76     77   
        self.structs_custom(svc)
   77     78   
    }
   78     79   
   79     80   
    /// Sets the [`Structs`](crate::operation_shape::Structs) operation.
   80     81   
    ///
   81         -
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
   82         -
    /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
          82  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
          83  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
   83     84   
    ///
   84     85   
    /// # Example
   85     86   
    ///
   86     87   
    /// ```no_run
   87     88   
    /// use naming_test_structs::{NamingObstacleCourseStructs, NamingObstacleCourseStructsConfig};
   88     89   
    ///
   89     90   
    /// use naming_test_structs::{input, output, error};
   90     91   
    ///
   91     92   
    /// async fn handler(input: input::StructsInput) -> Result<output::StructsOutput, error::StructsError> {
   92     93   
    ///     todo!()
   93     94   
    /// }
   94     95   
    ///
   95     96   
    /// let config = NamingObstacleCourseStructsConfig::builder().build();
   96     97   
    /// let svc = ::tower::util::service_fn(handler);
   97     98   
    /// let app = NamingObstacleCourseStructs::builder(config)
   98     99   
    ///     .structs_service(svc)
   99    100   
    ///     /* Set other handlers */
  100    101   
    ///     .build()
  101    102   
    ///     .unwrap();
  102         -
    /// # let app: NamingObstacleCourseStructs<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
         103  +
    /// # let app: NamingObstacleCourseStructs<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>> = app;
  103    104   
    /// ```
  104    105   
    ///
  105    106   
                    pub fn structs_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
  106    107   
                    where
  107         -
                        S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::Structs, ServiceExtractors>,
         108  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::Structs, ServiceExtractors>,
  108    109   
  109         -
                        ModelPl: ::aws_smithy_http_server::plugin::Plugin<
         110  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
  110    111   
                            NamingObstacleCourseStructs<L>,
  111    112   
                            crate::operation_shape::Structs,
  112         -
                            ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::Structs, S>
         113  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::Structs, S>
  113    114   
                        >,
  114         -
                        ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
         115  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
  115    116   
                            NamingObstacleCourseStructs<L>,
  116    117   
                            crate::operation_shape::Structs,
  117    118   
                            ModelPl::Output
  118    119   
                        >,
  119         -
                        HttpPl: ::aws_smithy_http_server::plugin::Plugin<
         120  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
  120    121   
                            NamingObstacleCourseStructs<L>,
  121    122   
                            crate::operation_shape::Structs,
  122    123   
                            <
  123         -
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  124         -
                                as ::aws_smithy_http_server::plugin::Plugin<
         124  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         125  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
  125    126   
                                    NamingObstacleCourseStructs<L>,
  126    127   
                                    crate::operation_shape::Structs,
  127    128   
                                    ModelPl::Output
  128    129   
                                >
  129    130   
                            >::Output
  130    131   
                        >,
  131    132   
  132         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         133  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  133    134   
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
  134    135   
  135    136   
                    {
  136         -
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  137         -
        use ::aws_smithy_http_server::plugin::Plugin;
         137  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         138  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
  138    139   
        let svc = crate::operation_shape::Structs::from_service(service);
  139    140   
        let svc = self.model_plugin.apply(svc);
  140         -
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         141  +
        let svc =
         142  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  141    143   
                .apply(svc);
  142    144   
        let svc = self.http_plugin.apply(svc);
  143    145   
        self.structs_custom(svc)
  144    146   
    }
  145    147   
  146    148   
    /// Sets the [`Structs`](crate::operation_shape::Structs) to a custom [`Service`](tower::Service).
  147    149   
    /// not constrained by the Smithy contract.
  148    150   
    fn structs_custom<S>(mut self, svc: S) -> Self
  149    151   
    where
  150    152   
        S: ::tower::Service<
  151    153   
                ::http::Request<Body>,
  152         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         154  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
  153    155   
                Error = ::std::convert::Infallible,
  154    156   
            > + Clone
  155    157   
            + Send
  156    158   
            + 'static,
  157    159   
        S::Future: Send + 'static,
  158    160   
    {
  159         -
        self.structs = Some(::aws_smithy_http_server::routing::Route::new(svc));
         161  +
        self.structs = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
  160    162   
        self
  161    163   
    }
  162    164   
}
  163    165   
  164    166   
impl<Body, L, HttpPl, ModelPl> NamingObstacleCourseStructsBuilder<Body, L, HttpPl, ModelPl> {
  165    167   
    /// Constructs a [`NamingObstacleCourseStructs`] from the arguments provided to the builder.
  166    168   
    ///
  167    169   
    /// Forgetting to register a handler for one or more operations will result in an error.
  168    170   
    ///
  169    171   
    /// Check out [`NamingObstacleCourseStructsBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
  170    172   
    /// unspecified route is requested.
  171    173   
    pub fn build(
  172    174   
        self,
  173    175   
    ) -> ::std::result::Result<
  174    176   
        NamingObstacleCourseStructs<
  175         -
            ::aws_smithy_http_server::routing::RoutingService<
  176         -
                ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<L::Service>,
  177         -
                ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         177  +
            ::aws_smithy_legacy_http_server::routing::RoutingService<
         178  +
                ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
         179  +
                    L::Service,
         180  +
                >,
         181  +
                ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  178    182   
            >,
  179    183   
        >,
  180    184   
        MissingOperationsError,
  181    185   
    >
  182    186   
    where
  183         -
        L: ::tower::Layer<::aws_smithy_http_server::routing::Route<Body>>,
         187  +
        L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
  184    188   
    {
  185    189   
        let router = {
  186         -
            use ::aws_smithy_http_server::operation::OperationShape;
         190  +
            use ::aws_smithy_legacy_http_server::operation::OperationShape;
  187    191   
            let mut missing_operation_names = std::collections::HashMap::new();
  188    192   
            if self.structs.is_none() {
  189    193   
                missing_operation_names.insert(crate::operation_shape::Structs::ID, ".structs()");
  190    194   
            }
  191    195   
            if !missing_operation_names.is_empty() {
  192    196   
                return Err(MissingOperationsError {
  193    197   
                    operation_names2setter_methods: missing_operation_names,
  194    198   
                });
  195    199   
            }
  196    200   
            let unexpected_error_msg = "this should never panic since we are supposed to check beforehand that a handler has been registered for this operation; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues";
  197    201   
  198         -
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter([(
         202  +
            ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter([
         203  +
                (
  199    204   
                    request_specs::structs(),
  200    205   
                    self.structs.expect(unexpected_error_msg),
  201         -
            )])
         206  +
                ),
         207  +
            ])
  202    208   
        };
  203         -
        let svc = ::aws_smithy_http_server::routing::RoutingService::new(router);
         209  +
        let svc = ::aws_smithy_legacy_http_server::routing::RoutingService::new(router);
  204    210   
        let svc = svc.map(|s| s.layer(self.layer));
  205    211   
        Ok(NamingObstacleCourseStructs { svc })
  206    212   
    }
  207    213   
  208    214   
    /// Constructs a [`NamingObstacleCourseStructs`] from the arguments provided to the builder.
  209    215   
    /// Operations without a handler default to returning 500 Internal Server Error to the caller.
  210    216   
    ///
  211    217   
    /// Check out [`NamingObstacleCourseStructsBuilder::build`] if you'd prefer the builder to fail if one or more operations do
  212    218   
    /// not have a registered handler.
  213    219   
    pub fn build_unchecked(self) -> NamingObstacleCourseStructs<L::Service>
  214    220   
    where
  215    221   
        Body: Send + 'static,
  216    222   
        L: ::tower::Layer<
  217         -
            ::aws_smithy_http_server::routing::RoutingService<
  218         -
                ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
  219         -
                    ::aws_smithy_http_server::routing::Route<Body>,
         223  +
            ::aws_smithy_legacy_http_server::routing::RoutingService<
         224  +
                ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
         225  +
                    ::aws_smithy_legacy_http_server::routing::Route<Body>,
  220    226   
                >,
  221         -
                ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         227  +
                ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  222    228   
            >,
  223    229   
        >,
  224    230   
    {
  225    231   
        let router =
  226         -
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter([(
         232  +
            ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter::from_iter(
         233  +
                [(
  227    234   
                    request_specs::structs(),
  228    235   
                    self.structs.unwrap_or_else(|| {
  229         -
                    let svc = ::aws_smithy_http_server::operation::MissingFailure::<
  230         -
                        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         236  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
         237  +
                            ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  231    238   
                        >::default();
  232         -
                    ::aws_smithy_http_server::routing::Route::new(svc)
         239  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
  233    240   
                    }),
  234         -
            )]);
         241  +
                )],
         242  +
            );
  235    243   
        let svc = self
  236    244   
            .layer
  237         -
            .layer(::aws_smithy_http_server::routing::RoutingService::new(
  238         -
                router,
  239         -
            ));
         245  +
            .layer(::aws_smithy_legacy_http_server::routing::RoutingService::new(router));
  240    246   
        NamingObstacleCourseStructs { svc }
  241    247   
    }
  242    248   
}
  243    249   
  244    250   
/// The error encountered when calling the [`NamingObstacleCourseStructsBuilder::build`] method if one or more operation handlers are not
  245    251   
/// specified.
  246    252   
#[derive(Debug)]
  247    253   
pub struct MissingOperationsError {
  248    254   
    operation_names2setter_methods:
  249         -
        std::collections::HashMap<::aws_smithy_http_server::shape_id::ShapeId, &'static str>,
         255  +
        std::collections::HashMap<::aws_smithy_legacy_http_server::shape_id::ShapeId, &'static str>,
  250    256   
}
  251    257   
  252    258   
impl std::fmt::Display for MissingOperationsError {
  253    259   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  254    260   
        write!(
  255    261   
                            f,
  256    262   
                            "You must specify a handler for all operations attached to `NamingObstacleCourseStructs`.\n\
  257    263   
                            We are missing handlers for the following operations:\n",
  258    264   
                        )?;
  259    265   
        for operation_name in self.operation_names2setter_methods.keys() {
  260    266   
            writeln!(f, "- {}", operation_name.absolute())?;
  261    267   
        }
  262    268   
  263    269   
        writeln!(f, "\nUse the dedicated methods on `NamingObstacleCourseStructsBuilder` to register the missing handlers:")?;
  264    270   
        for setter_name in self.operation_names2setter_methods.values() {
  265    271   
            writeln!(f, "- {}", setter_name)?;
  266    272   
        }
  267    273   
        Ok(())
  268    274   
    }
  269    275   
}
  270    276   
  271    277   
impl std::error::Error for MissingOperationsError {}
  272    278   
  273    279   
mod request_specs {
  274    280   
    pub(super) fn structs() -> &'static str {
  275    281   
        "NamingObstacleCourseStructs.Structs"
  276    282   
    }
  277    283   
}
  278    284   
  279    285   
/// Confounds model generation machinery with lots of problematic names
  280    286   
///
  281    287   
/// See the [root](crate) documentation for more information.
  282    288   
#[derive(Clone)]
  283    289   
pub struct NamingObstacleCourseStructs<
  284         -
    S = ::aws_smithy_http_server::routing::RoutingService<
  285         -
        ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
  286         -
            ::aws_smithy_http_server::routing::Route<::aws_smithy_http_server::body::BoxBody>,
         290  +
    S = ::aws_smithy_legacy_http_server::routing::RoutingService<
         291  +
        ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
         292  +
            ::aws_smithy_legacy_http_server::routing::Route<
         293  +
                ::aws_smithy_legacy_http_server::body::BoxBody,
         294  +
            >,
  287    295   
        >,
  288         -
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         296  +
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  289    297   
    >,
  290    298   
> {
  291    299   
    // This is the router wrapped by layers.
  292    300   
    svc: S,
  293    301   
}
  294    302   
  295    303   
impl NamingObstacleCourseStructs<()> {
  296    304   
    /// Constructs a builder for [`NamingObstacleCourseStructs`].
  297    305   
    /// You must specify a configuration object holding any plugins and layers that should be applied
  298    306   
    /// to the operations in this service.
  299    307   
    pub fn builder<
  300    308   
        Body,
  301    309   
        L,
  302         -
        HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
  303         -
        ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
         310  +
        HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
         311  +
        ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
  304    312   
    >(
  305    313   
        config: NamingObstacleCourseStructsConfig<L, HttpPl, ModelPl>,
  306    314   
    ) -> NamingObstacleCourseStructsBuilder<Body, L, HttpPl, ModelPl> {
  307    315   
        NamingObstacleCourseStructsBuilder {
  308    316   
            structs: None,
  309    317   
            layer: config.layers,
  310    318   
            http_plugin: config.http_plugins,
  311    319   
            model_plugin: config.model_plugins,
  312    320   
        }
  313    321   
    }
  314    322   
  315    323   
    /// Constructs a builder for [`NamingObstacleCourseStructs`].
  316    324   
    /// You must specify what plugins should be applied to the operations in this service.
  317    325   
    ///
  318    326   
    /// Use [`NamingObstacleCourseStructs::builder_without_plugins`] if you don't need to apply plugins.
  319    327   
    ///
  320         -
    /// Check out [`HttpPlugins`](::aws_smithy_http_server::plugin::HttpPlugins) and
  321         -
    /// [`ModelPlugins`](::aws_smithy_http_server::plugin::ModelPlugins) if you need to apply
         328  +
    /// Check out [`HttpPlugins`](::aws_smithy_legacy_http_server::plugin::HttpPlugins) and
         329  +
    /// [`ModelPlugins`](::aws_smithy_legacy_http_server::plugin::ModelPlugins) if you need to apply
  322    330   
    /// multiple plugins.
  323    331   
    #[deprecated(
  324    332   
        since = "0.57.0",
  325    333   
        note = "please use the `builder` constructor and register plugins on the `NamingObstacleCourseStructsConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
  326    334   
    )]
  327    335   
    pub fn builder_with_plugins<
  328    336   
        Body,
  329         -
        HttpPl: ::aws_smithy_http_server::plugin::HttpMarker,
  330         -
        ModelPl: ::aws_smithy_http_server::plugin::ModelMarker,
         337  +
        HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
         338  +
        ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
  331    339   
    >(
  332    340   
        http_plugin: HttpPl,
  333    341   
        model_plugin: ModelPl,
  334    342   
    ) -> NamingObstacleCourseStructsBuilder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl>
  335    343   
    {
  336    344   
        NamingObstacleCourseStructsBuilder {
  337    345   
            structs: None,
  338    346   
            layer: ::tower::layer::util::Identity::new(),
  339    347   
            http_plugin,
  340    348   
            model_plugin,
  341    349   
        }
  342    350   
    }
  343    351   
  344    352   
    /// Constructs a builder for [`NamingObstacleCourseStructs`].
  345    353   
    ///
  346    354   
    /// Use [`NamingObstacleCourseStructs::builder_with_plugins`] if you need to specify plugins.
  347    355   
    #[deprecated(
  348    356   
        since = "0.57.0",
  349    357   
        note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
  350    358   
    )]
  351    359   
    pub fn builder_without_plugins<Body>() -> NamingObstacleCourseStructsBuilder<
  352    360   
        Body,
  353    361   
        ::tower::layer::util::Identity,
  354         -
        ::aws_smithy_http_server::plugin::IdentityPlugin,
  355         -
        ::aws_smithy_http_server::plugin::IdentityPlugin,
         362  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
         363  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
  356    364   
    > {
  357    365   
        Self::builder_with_plugins(
  358         -
            ::aws_smithy_http_server::plugin::IdentityPlugin,
  359         -
            ::aws_smithy_http_server::plugin::IdentityPlugin,
         366  +
            ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
         367  +
            ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
  360    368   
        )
  361    369   
    }
  362    370   
}
  363    371   
  364    372   
impl<S> NamingObstacleCourseStructs<S> {
  365    373   
    /// Converts [`NamingObstacleCourseStructs`] into a [`MakeService`](tower::make::MakeService).
  366         -
    pub fn into_make_service(self) -> ::aws_smithy_http_server::routing::IntoMakeService<Self> {
  367         -
        ::aws_smithy_http_server::routing::IntoMakeService::new(self)
         374  +
    pub fn into_make_service(
         375  +
        self,
         376  +
    ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeService<Self> {
         377  +
        ::aws_smithy_legacy_http_server::routing::IntoMakeService::new(self)
  368    378   
    }
  369    379   
  370         -
    /// Converts [`NamingObstacleCourseStructs`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_http_server::request::connect_info::ConnectInfo).
         380  +
    /// Converts [`NamingObstacleCourseStructs`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_legacy_http_server::request::connect_info::ConnectInfo).
  371    381   
    pub fn into_make_service_with_connect_info<C>(
  372    382   
        self,
  373         -
    ) -> ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
  374         -
        ::aws_smithy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
         383  +
    ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
         384  +
        ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
  375    385   
    }
  376    386   
}
  377    387   
  378    388   
impl<S>
  379    389   
    NamingObstacleCourseStructs<
  380         -
        ::aws_smithy_http_server::routing::RoutingService<
  381         -
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<S>,
  382         -
            ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         390  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
         391  +
            ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<S>,
         392  +
            ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  383    393   
        >,
  384    394   
    >
  385    395   
{
  386    396   
    /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
  387    397   
    #[deprecated(
  388    398   
        since = "0.57.0",
  389    399   
        note = "please add layers to the `NamingObstacleCourseStructsConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
  390    400   
    )]
  391    401   
    pub fn layer<L>(
  392    402   
        self,
  393    403   
        layer: &L,
  394    404   
    ) -> NamingObstacleCourseStructs<
  395         -
        ::aws_smithy_http_server::routing::RoutingService<
  396         -
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<L::Service>,
  397         -
            ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         405  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
         406  +
            ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<L::Service>,
         407  +
            ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  398    408   
        >,
  399    409   
    >
  400    410   
    where
  401    411   
        L: ::tower::Layer<S>,
  402    412   
    {
  403    413   
        NamingObstacleCourseStructs {
  404    414   
            svc: self.svc.map(|s| s.layer(layer)),
  405    415   
        }
  406    416   
    }
  407    417   
  408         -
    /// Applies [`Route::new`](::aws_smithy_http_server::routing::Route::new) to all routes.
         418  +
    /// Applies [`Route::new`](::aws_smithy_legacy_http_server::routing::Route::new) to all routes.
  409    419   
    ///
  410    420   
    /// This has the effect of erasing all types accumulated via layers.
  411    421   
    pub fn boxed<B>(
  412    422   
        self,
  413    423   
    ) -> NamingObstacleCourseStructs<
  414         -
        ::aws_smithy_http_server::routing::RoutingService<
  415         -
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
  416         -
                ::aws_smithy_http_server::routing::Route<B>,
         424  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
         425  +
            ::aws_smithy_legacy_http_server::protocol::aws_json::router::AwsJsonRouter<
         426  +
                ::aws_smithy_legacy_http_server::routing::Route<B>,
  417    427   
            >,
  418         -
            ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
         428  +
            ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  419    429   
        >,
  420    430   
    >
  421    431   
    where
  422    432   
        S: ::tower::Service<
  423    433   
            ::http::Request<B>,
  424         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         434  +
            Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
  425    435   
            Error = std::convert::Infallible,
  426    436   
        >,
  427    437   
        S: Clone + Send + 'static,
  428    438   
        S::Future: Send + 'static,
  429    439   
    {
  430    440   
        self.layer(&::tower::layer::layer_fn(
  431         -
            ::aws_smithy_http_server::routing::Route::new,
         441  +
            ::aws_smithy_legacy_http_server::routing::Route::new,
  432    442   
        ))
  433    443   
    }
  434    444   
}
  435    445   
  436    446   
impl<S, R> ::tower::Service<R> for NamingObstacleCourseStructs<S>
  437    447   
where
  438    448   
    S: ::tower::Service<R>,
  439    449   
{
  440    450   
    type Response = S::Response;
  441    451   
    type Error = S::Error;
  442    452   
    type Future = S::Future;
  443    453   
  444    454   
    fn poll_ready(
  445    455   
        &mut self,
  446    456   
        cx: &mut std::task::Context,
  447    457   
    ) -> std::task::Poll<::std::result::Result<(), Self::Error>> {
  448    458   
        self.svc.poll_ready(cx)
  449    459   
    }
  450    460   
  451    461   
    fn call(&mut self, request: R) -> Self::Future {
  452    462   
        self.svc.call(request)
  453    463   
    }
  454    464   
}
  455    465   
  456    466   
/// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in NamingObstacleCourseStructs.
  457    467   
#[allow(clippy::enum_variant_names)]
  458    468   
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
  459    469   
pub enum Operation {
  460    470   
    Structs,
  461    471   
}
  462    472   
  463    473   
impl Operation {
  464         -
    /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_http_server::shape_id::ShapeId).
  465         -
    pub fn shape_id(&self) -> ::aws_smithy_http_server::shape_id::ShapeId {
         474  +
    /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_legacy_http_server::shape_id::ShapeId).
         475  +
    pub fn shape_id(&self) -> ::aws_smithy_legacy_http_server::shape_id::ShapeId {
  466    476   
        match self {
  467         -
            Operation::Structs => ::aws_smithy_http_server::shape_id::ShapeId::new(
         477  +
            Operation::Structs => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  468    478   
                "naming_obs_structs#Structs",
  469    479   
                "naming_obs_structs",
  470    480   
                "Structs",
  471    481   
            ),
  472    482   
        }
  473    483   
    }
  474    484   
}
  475         -
impl<L> ::aws_smithy_http_server::service::ContainsOperation<crate::operation_shape::Structs>
         485  +
impl<L> ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::Structs>
  476    486   
    for NamingObstacleCourseStructs<L>
  477    487   
{
  478    488   
    const VALUE: Operation = Operation::Structs;
  479    489   
}
  480    490   
  481         -
impl<S> ::aws_smithy_http_server::service::ServiceShape for NamingObstacleCourseStructs<S> {
  482         -
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  483         -
        ::aws_smithy_http_server::shape_id::ShapeId::new(
         491  +
impl<S> ::aws_smithy_legacy_http_server::service::ServiceShape for NamingObstacleCourseStructs<S> {
         492  +
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
         493  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  484    494   
            "naming_obs_structs#NamingObstacleCourseStructs",
  485    495   
            "naming_obs_structs",
  486    496   
            "NamingObstacleCourseStructs",
  487    497   
        );
  488    498   
  489    499   
    const VERSION: Option<&'static str> = Some("2006-03-01");
  490    500   
  491         -
    type Protocol = ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1;
         501  +
    type Protocol = ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1;
  492    502   
  493    503   
    type Operations = Operation;
  494    504   
}
  495    505   
/// Configuration for the [`NamingObstacleCourseStructs`]. This is the central place where to register and
  496    506   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
  497    507   
///
  498    508   
/// ```rust,no_run
  499    509   
/// # use naming_test_structs::NamingObstacleCourseStructsConfig;
  500         -
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
         510  +
/// # use ::aws_smithy_legacy_http_server::plugin::IdentityPlugin;
  501    511   
/// # use ::tower::layer::util::Identity;
  502    512   
/// # let authentication_plugin = IdentityPlugin;
  503    513   
/// # let authorization_plugin = IdentityPlugin;
  504    514   
/// # let server_request_id_provider_layer = Identity::new();
  505    515   
/// let config = NamingObstacleCourseStructsConfig::builder()
  506    516   
///     // Layers get executed first...
  507    517   
///     .layer(server_request_id_provider_layer)
  508    518   
///     // ...then HTTP plugins...
  509    519   
///     .http_plugin(authentication_plugin)
  510    520   
///     // ...and right after deserialization, model plugins.
  511    521   
///     .model_plugin(authorization_plugin)
  512    522   
///     .build();
  513    523   
/// ```
  514    524   
///
  515    525   
/// See the [`plugin`] system for details.
  516    526   
///
  517         -
/// [`plugin`]: ::aws_smithy_http_server::plugin
         527  +
/// [`plugin`]: ::aws_smithy_legacy_http_server::plugin
  518    528   
#[derive(::std::fmt::Debug)]
  519    529   
pub struct NamingObstacleCourseStructsConfig<L, H, M> {
  520    530   
    layers: L,
  521    531   
    http_plugins: H,
  522    532   
    model_plugins: M,
  523    533   
}
  524    534   
  525    535   
impl NamingObstacleCourseStructsConfig<(), (), ()> {
  526    536   
    /// Returns a builder to construct the configuration.
  527    537   
    pub fn builder() -> NamingObstacleCourseStructsConfigBuilder<
  528    538   
        ::tower::layer::util::Identity,
  529         -
        ::aws_smithy_http_server::plugin::IdentityPlugin,
  530         -
        ::aws_smithy_http_server::plugin::IdentityPlugin,
         539  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
         540  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
  531    541   
    > {
  532    542   
        NamingObstacleCourseStructsConfigBuilder {
  533    543   
            layers: ::tower::layer::util::Identity::new(),
  534         -
            http_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
  535         -
            model_plugins: ::aws_smithy_http_server::plugin::IdentityPlugin,
         544  +
            http_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
         545  +
            model_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
  536    546   
        }
  537    547   
    }
  538    548   
}
  539    549   
  540    550   
/// Builder returned by [`NamingObstacleCourseStructsConfig::builder()`].
  541    551   
#[derive(::std::fmt::Debug)]
  542    552   
pub struct NamingObstacleCourseStructsConfigBuilder<L, H, M> {
  543    553   
    pub(crate) layers: L,
  544    554   
    pub(crate) http_plugins: H,
  545    555   
    pub(crate) model_plugins: M,
  546    556   
}
  547    557   
  548    558   
impl<L, H, M> NamingObstacleCourseStructsConfigBuilder<L, H, M> {
  549    559   
    /// Add a [`::tower::Layer`] to the service.
  550    560   
    pub fn layer<NewLayer>(
  551    561   
        self,
  552    562   
        layer: NewLayer,
  553    563   
    ) -> NamingObstacleCourseStructsConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M>
  554    564   
    {
  555    565   
        NamingObstacleCourseStructsConfigBuilder {
  556    566   
            layers: ::tower::layer::util::Stack::new(layer, self.layers),
  557    567   
            http_plugins: self.http_plugins,
  558    568   
            model_plugins: self.model_plugins,
  559    569   
        }
  560    570   
    }
  561    571   
  562    572   
    /// Add a HTTP [plugin] to the service.
  563    573   
    ///
  564         -
    /// [plugin]: ::aws_smithy_http_server::plugin
         574  +
    /// [plugin]: ::aws_smithy_legacy_http_server::plugin
  565    575   
    // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
  566    576   
    // errors get _substantially_ better if the user makes a mistake.
  567         -
    pub fn http_plugin<NewPlugin: ::aws_smithy_http_server::plugin::HttpMarker>(
         577  +
    pub fn http_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::HttpMarker>(
  568    578   
        self,
  569    579   
        http_plugin: NewPlugin,
  570    580   
    ) -> NamingObstacleCourseStructsConfigBuilder<
  571    581   
        L,
  572         -
        ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, H>,
         582  +
        ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, H>,
  573    583   
        M,
  574    584   
    > {
  575    585   
        NamingObstacleCourseStructsConfigBuilder {
  576    586   
            layers: self.layers,
  577         -
            http_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
         587  +
            http_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
  578    588   
                http_plugin,
  579    589   
                self.http_plugins,
  580    590   
            ),
  581    591   
            model_plugins: self.model_plugins,
  582    592   
        }
  583    593   
    }
  584    594   
  585    595   
    /// Add a model [plugin] to the service.
  586    596   
    ///
  587         -
    /// [plugin]: ::aws_smithy_http_server::plugin
         597  +
    /// [plugin]: ::aws_smithy_legacy_http_server::plugin
  588    598   
    // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
  589    599   
    // errors get _substantially_ better if the user makes a mistake.
  590         -
    pub fn model_plugin<NewPlugin: ::aws_smithy_http_server::plugin::ModelMarker>(
         600  +
    pub fn model_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::ModelMarker>(
  591    601   
        self,
  592    602   
        model_plugin: NewPlugin,
  593    603   
    ) -> NamingObstacleCourseStructsConfigBuilder<
  594    604   
        L,
  595    605   
        H,
  596         -
        ::aws_smithy_http_server::plugin::PluginStack<NewPlugin, M>,
         606  +
        ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, M>,
  597    607   
    > {
  598    608   
        NamingObstacleCourseStructsConfigBuilder {
  599    609   
            layers: self.layers,
  600    610   
            http_plugins: self.http_plugins,
  601         -
            model_plugins: ::aws_smithy_http_server::plugin::PluginStack::new(
         611  +
            model_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
  602    612   
                model_plugin,
  603    613   
                self.model_plugins,
  604    614   
            ),
  605    615   
        }
  606    616   
    }
  607    617   
  608    618   
    /// Build the configuration.
  609    619   
    pub fn build(self) -> super::NamingObstacleCourseStructsConfig<L, H, M> {
  610    620   
        super::NamingObstacleCourseStructsConfig {
  611    621   
            layers: self.layers,

tmp-codegen-diff/codegen-server-test-python/pokemon-service-server-sdk/rust-server-codegen-python/Cargo.toml

@@ -1,1 +70,71 @@
    4      4   
version = "0.0.1"
    5      5   
authors = ["protocoltest@example.com"]
    6      6   
description = "test"
    7      7   
edition = "2021"
    8      8   
    9      9   
[package.metadata.smithy]
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#restJson1"
   12     12   
[dependencies.aws-smithy-eventstream]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-eventstream"
   14         -
[dependencies.aws-smithy-http]
   15         -
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   16         -
features = ["event-stream"]
   17         -
[dependencies.aws-smithy-http-server]
   18         -
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   19     14   
[dependencies.aws-smithy-http-server-python]
   20     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server-python"
   21     16   
[dependencies.aws-smithy-json]
   22     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
          18  +
[dependencies.aws-smithy-legacy-http]
          19  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          20  +
features = ["event-stream"]
          21  +
[dependencies.aws-smithy-legacy-http-server]
          22  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
   23     23   
[dependencies.aws-smithy-runtime-api]
   24     24   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   25         -
features = ["client", "http-02x"]
          25  +
features = ["http-02x", "client", "http-1x"]
   26     26   
[dependencies.aws-smithy-types]
   27     27   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          28  +
features = ["http-body-0-4-x"]
   28     29   
[dependencies.futures-util]
   29     30   
version = "0.3"
   30     31   
[dependencies.http]
   31     32   
version = "0.2.9"
   32     33   
[dependencies.mime]
   33     34   
version = "0.3"
   34     35   
[dependencies.nom]
   35     36   
version = "7"
   36     37   
[dependencies.parking_lot]
   37     38   
version = "0.12"
   38     39   
[dependencies.percent-encoding]
   39     40   
version = "2.0.0"
   40     41   
[dependencies.pin-project-lite]
   41     42   
version = "0.2"
   42     43   
[dependencies.pyo3]
   43     44   
version = "0.20"
   44     45   
[dependencies.pyo3-asyncio]
   45     46   
version = "0.20"
   46     47   
features = ["attributes", "tokio-runtime", "unstable-streams"]
   47     48   
[dependencies.tokio]
   48     49   
version = "1.20.1"
   49     50   
features = ["full"]
   50     51   
[dependencies.tokio-stream]
   51     52   
version = "0.1.12"
   52     53   
[dependencies.tower]
   53     54   
version = "0.4"
   54     55   
[dependencies.tracing]
   55     56   
version = "0.1"
   56     57   
[dev-dependencies.hyper]
   57         -
version = "0.14.12"
          58  +
version = "0.14.26"
   58     59   
[dev-dependencies.tokio]
   59     60   
version = "1.23.1"
   60     61   
[features]
   61         -
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   62         -
request-id = ["aws-smithy-http-server/request-id"]
   63         -
rt-tokio = ["aws-smithy-types/rt-tokio"]
          62  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          63  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          64  +
rt-tokio = ["aws-smithy-types/http-body-1-x", "aws-smithy-types/rt-tokio"]
   64     65   
extension-module = ["pyo3/extension-module"]
   65     66   
default = ["request-id", "rt-tokio", "extension-module"]
   66     67   
[lib]
   67     68   
name = "pokemon_service_server_sdk"
   68     69   
crate-type = ["cdylib"]
   69     70   
   70     71   

tmp-codegen-diff/codegen-server-test-python/pokemon-service-server-sdk/rust-server-codegen-python/python/pokemon_service_server_sdk/middleware/__init__.pyi

@@ -1,1 +38,38 @@
    1      1   
import typing
    2      2   
    3      3   
class MiddlewareException(Exception):
    4      4   
    """
    5      5   
    Exception that can be thrown from a Python middleware.
    6      6   
    7      7   
    It allows to specify a message and HTTP status code and implementing protocol specific capabilities
    8         -
    to build a [aws_smithy_http_server::response::Response] from it.
           8  +
    to build a [aws_smithy_legacy_http_server::response::Response] from it.
    9      9   
    """
   10     10   
   11     11   
    message: str
   12     12   
   13     13   
    status_code: int
   14     14   
   15     15   
    def __init__(self, message: str, status_code: typing.Optional[int] = ...) -> None:
   16     16   
        ...
   17     17   
   18     18   

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

@@ -377,377 +437,437 @@
  397    397   
                                                path: path + "/user",
  398    398   
                                            },
  399    399   
            ConstraintViolation::MissingPasscode => crate::model::ValidationExceptionField {
  400    400   
                                                message: format!("Value at '{}/passcode' failed to satisfy constraint: Member must not be null", path),
  401    401   
                                                path: path + "/passcode",
  402    402   
                                            },
  403    403   
        }
  404    404   
        }
  405    405   
    }
  406    406   
    impl ::std::convert::From<ConstraintViolation>
  407         -
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
         407  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
  408    408   
    {
  409    409   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  410    410   
            let first_validation_exception_field =
  411    411   
                constraint_violation.as_validation_exception_field("".to_owned());
  412    412   
            let validation_exception = crate::error::ValidationException {
  413    413   
                message: format!(
  414    414   
                    "1 validation error detected. {}",
  415    415   
                    &first_validation_exception_field.message
  416    416   
                ),
  417    417   
                field_list: Some(vec![first_validation_exception_field]),
@@ -556,556 +616,616 @@
  576    576   
                    message: format!(
  577    577   
                        "Value at '{}/name' failed to satisfy constraint: Member must not be null",
  578    578   
                        path
  579    579   
                    ),
  580    580   
                    path: path + "/name",
  581    581   
                },
  582    582   
            }
  583    583   
        }
  584    584   
    }
  585    585   
    impl ::std::convert::From<ConstraintViolation>
  586         -
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
         586  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
  587    587   
    {
  588    588   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  589    589   
            let first_validation_exception_field =
  590    590   
                constraint_violation.as_validation_exception_field("".to_owned());
  591    591   
            let validation_exception = crate::error::ValidationException {
  592    592   
                message: format!(
  593    593   
                    "1 validation error detected. {}",
  594    594   
                    &first_validation_exception_field.message
  595    595   
                ),
  596    596   
                field_list: Some(vec![first_validation_exception_field]),
@@ -794,794 +854,854 @@
  814    814   
                                                path: path + "/events",
  815    815   
                                            },
  816    816   
            ConstraintViolation::MissingRegion => crate::model::ValidationExceptionField {
  817    817   
                                                message: format!("Value at '{}/region' failed to satisfy constraint: Member must not be null", path),
  818    818   
                                                path: path + "/region",
  819    819   
                                            },
  820    820   
        }
  821    821   
        }
  822    822   
    }
  823    823   
    impl ::std::convert::From<ConstraintViolation>
  824         -
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
         824  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
  825    825   
    {
  826    826   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  827    827   
            let first_validation_exception_field =
  828    828   
                constraint_violation.as_validation_exception_field("".to_owned());
  829    829   
            let validation_exception = crate::error::ValidationException {
  830    830   
                message: format!(
  831    831   
                    "1 validation error detected. {}",
  832    832   
                    &first_validation_exception_field.message
  833    833   
                ),
  834    834   
                field_list: Some(vec![first_validation_exception_field]),

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

@@ -29,29 +128,129 @@
   49     49   
//!
   50     50   
//! # let app = PokemonService::builder(
   51     51   
//! #     PokemonServiceConfig::builder()
   52     52   
//! #         .build()
   53     53   
//! # ).build_unchecked();
   54     54   
//! let server = app.into_make_service();
   55     55   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     56   
//!     .expect("unable to parse the server bind address and port");
   57     57   
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
   58     58   
//! # }
          59  +
//!
   59     60   
//! ```
   60     61   
//!
   61     62   
//! ### Running on Lambda
   62     63   
//!
   63     64   
//! ```rust,ignore
   64     65   
//! use pokemon_service_server_sdk::server::routing::LambdaHandler;
   65     66   
//! use pokemon_service_server_sdk::PokemonService;
   66     67   
//!
   67     68   
//! # async fn dummy() {
   68     69   
//! # let app = PokemonService::builder(
   69     70   
//! #     PokemonServiceConfig::builder()
   70     71   
//! #         .build()
   71     72   
//! # ).build_unchecked();
   72     73   
//! let handler = LambdaHandler::new(app);
   73     74   
//! lambda_http::run(handler).await.unwrap();
   74     75   
//! # }
   75     76   
//! ```
   76     77   
//!
   77     78   
//! # Building the PokemonService
   78     79   
//!
   79     80   
//! To construct [`PokemonService`] we use [`PokemonServiceBuilder`] returned by [`PokemonService::builder`].
   80     81   
//!
   81     82   
//! ## Plugins
   82     83   
//!
   83     84   
//! The [`PokemonService::builder`] method, returning [`PokemonServiceBuilder`],
   84     85   
//! accepts a config object on which plugins can be registered.
   85     86   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     87   
//!
   87     88   
//! ```rust,no_run
   88     89   
//! # use pokemon_service_server_sdk::server::plugin::IdentityPlugin as LoggingPlugin;
   89     90   
//! # use pokemon_service_server_sdk::server::plugin::IdentityPlugin as MetricsPlugin;
   90     91   
//! # use ::hyper::Body;
   91     92   
//! use pokemon_service_server_sdk::server::plugin::HttpPlugins;
   92     93   
//! use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig, PokemonServiceBuilder};
   93     94   
//!
   94     95   
//! let http_plugins = HttpPlugins::new()
   95     96   
//!         .push(LoggingPlugin)
   96     97   
//!         .push(MetricsPlugin);
   97     98   
//! let config = PokemonServiceConfig::builder().build();
   98         -
//! let builder: PokemonServiceBuilder<Body, _, _, _> = PokemonService::builder(config);
          99  +
//! let builder: PokemonServiceBuilder<::hyper::Body, _, _, _> = PokemonService::builder(config);
   99    100   
//! ```
  100    101   
//!
  101    102   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    103   
//!
  103    104   
//! ## Handlers
  104    105   
//!
  105    106   
//! [`PokemonServiceBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
  106    107   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    108   
//!
  108    109   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -194,195 +290,291 @@
  214    215   
//!     todo!()
  215    216   
//! }
  216    217   
//!
  217    218   
//! async fn stream_pokemon_radio(input: input::StreamPokemonRadioInput) -> Result<output::StreamPokemonRadioOutput, error::StreamPokemonRadioError> {
  218    219   
//!     todo!()
  219    220   
//! }
  220    221   
//!
  221    222   
//! ```
  222    223   
//!
  223    224   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         225  +
//! [hyper server]: https://docs.rs/hyper/0.14.26/hyper/server/index.html
  224    226   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  225    227   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  226    228   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  227         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  228    229   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
  229    230   
pub use crate::service::{
  230    231   
    MissingOperationsError, PokemonService, PokemonServiceBuilder, PokemonServiceConfig,
  231    232   
    PokemonServiceConfigBuilder,
  232    233   
};
  233    234   
  234    235   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  235    236   
pub mod server {
  236    237   
    // Re-export all types from the `aws-smithy-http-server` crate.
  237         -
    pub use ::aws_smithy_http_server::*;
         238  +
    pub use ::aws_smithy_legacy_http_server::*;
  238    239   
}
  239    240   
  240    241   
/// Crate version number.
  241    242   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  242    243   
  243    244   
/// All error types that operations can return. Documentation on these types is copied from the model.
  244    245   
pub mod error;
  245    246   
  246    247   
/// Input structures for operations. Documentation on these types is copied from the model.
  247    248   
pub mod input;
  248    249   
  249    250   
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
  250    251   
pub mod model;
  251    252   
  252    253   
/// All operations that this crate can perform.
  253    254   
pub mod operation;
  254    255   
  255    256   
/// A collection of types representing each operation defined in the service closure.
  256    257   
///
  257         -
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
         258  +
/// The [plugin system](::aws_smithy_legacy_http_server::plugin) makes use of these
  258    259   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  259         -
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  260         -
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
         260  +
/// parameterize [`Plugin`](::aws_smithy_legacy_http_server::plugin::Plugin) implementations. Their traits, such as
         261  +
/// [`OperationShape`](::aws_smithy_legacy_http_server::operation::OperationShape), can be used to provide
  261    262   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  262    263   
pub mod operation_shape;
  263    264   
  264    265   
/// Output structures for operations. Documentation on these types is copied from the model.
  265    266   
pub mod output;
  266    267   
  267    268   
/// Python wrapper types for event streams.
  268    269   
pub mod python_event_stream;
  269    270   
  270    271   
/// Export PyO3 symbols in the shared library

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

@@ -1,1 +705,696 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
::pin_project_lite::pin_project! {
    3      3   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4      4   
    /// [`GetStorageInput`](crate::input::GetStorageInput) using modelled bindings.
    5      5   
    pub struct GetStorageInputFuture {
    6         -
        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>>
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetStorageInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
    7      7   
    }
    8      8   
}
    9      9   
   10     10   
impl std::future::Future for GetStorageInputFuture {
   11     11   
    type Output = Result<
   12     12   
        crate::input::GetStorageInput,
   13         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
          13  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
   14     14   
    >;
   15     15   
   16     16   
    fn poll(
   17     17   
        self: std::pin::Pin<&mut Self>,
   18     18   
        cx: &mut std::task::Context<'_>,
   19     19   
    ) -> std::task::Poll<Self::Output> {
   20     20   
        let this = self.project();
   21     21   
        this.inner.as_mut().poll(cx)
   22     22   
    }
   23     23   
}
   24     24   
   25     25   
impl<B>
   26         -
    ::aws_smithy_http_server::request::FromRequest<
   27         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
          26  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
          27  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
   28     28   
        B,
   29     29   
    > for crate::input::GetStorageInput
   30     30   
where
   31         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          31  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   36         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          36  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
          38  +
    type Rejection =
          39  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
   39     40   
    type Future = GetStorageInputFuture;
   40     41   
   41     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   42     43   
        let fut = async move {
   43         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
          44  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
   44     45   
                request.headers(),
   45     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
   46     47   
            ) {
   47         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
          48  +
                return Err(::aws_smithy_legacy_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         -
        let fut = fut.map_err(
   53         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
          53  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   54     54   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   55         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   56         -
                    e,
   57         -
                )
   58         -
            },
   59         -
        );
          55  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
          56  +
                    });
   60     57   
        GetStorageInputFuture {
   61     58   
            inner: Box::pin(fut),
   62     59   
        }
   63     60   
    }
   64     61   
}
   65     62   
impl
   66         -
    ::aws_smithy_http_server::response::IntoResponse<
   67         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
          63  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
          64  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
   68     65   
    > for crate::output::GetStorageOutput
   69     66   
{
   70         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
          67  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   71     68   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_response(self) {
   72     69   
            Ok(response) => response,
   73     70   
            Err(e) => {
   74     71   
                ::tracing::error!(error = %e, "failed to serialize response");
   75         -
                ::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))
          72  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   76     73   
            }
   77     74   
        }
   78     75   
    }
   79     76   
}
   80     77   
impl
   81         -
    ::aws_smithy_http_server::response::IntoResponse<
   82         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
          78  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
          79  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
   83     80   
    > for crate::error::GetStorageError
   84     81   
{
   85         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
          82  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   86     83   
        match crate::protocol_serde::shape_get_storage::ser_get_storage_http_error(&self) {
   87     84   
            Ok(mut response) => {
   88     85   
                response.extensions_mut().insert(
   89         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
          86  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
          87  +
                        self.name(),
          88  +
                    ),
   90     89   
                );
   91     90   
                response
   92     91   
            }
   93     92   
            Err(e) => {
   94     93   
                ::tracing::error!(error = %e, "failed to serialize response");
   95         -
                ::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))
          94  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   96     95   
            }
   97     96   
        }
   98     97   
    }
   99     98   
}
  100     99   
  101    100   
::pin_project_lite::pin_project! {
  102    101   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  103    102   
    /// [`GetPokemonSpeciesInput`](crate::input::GetPokemonSpeciesInput) using modelled bindings.
  104    103   
    pub struct GetPokemonSpeciesInputFuture {
  105         -
        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>>
         104  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetPokemonSpeciesInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  106    105   
    }
  107    106   
}
  108    107   
  109    108   
impl std::future::Future for GetPokemonSpeciesInputFuture {
  110    109   
    type Output = Result<
  111    110   
        crate::input::GetPokemonSpeciesInput,
  112         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         111  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  113    112   
    >;
  114    113   
  115    114   
    fn poll(
  116    115   
        self: std::pin::Pin<&mut Self>,
  117    116   
        cx: &mut std::task::Context<'_>,
  118    117   
    ) -> std::task::Poll<Self::Output> {
  119    118   
        let this = self.project();
  120    119   
        this.inner.as_mut().poll(cx)
  121    120   
    }
  122    121   
}
  123    122   
  124    123   
impl<B>
  125         -
    ::aws_smithy_http_server::request::FromRequest<
  126         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         124  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         125  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  127    126   
        B,
  128    127   
    > for crate::input::GetPokemonSpeciesInput
  129    128   
where
  130         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         129  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  131    130   
    B: 'static,
  132    131   
  133    132   
    B::Data: Send,
  134         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  135         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         133  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         134  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  136    135   
{
  137         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         136  +
    type Rejection =
         137  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  138    138   
    type Future = GetPokemonSpeciesInputFuture;
  139    139   
  140    140   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  141    141   
        let fut = async move {
  142         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         142  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  143    143   
                request.headers(),
  144    144   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  145    145   
            ) {
  146         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         146  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  147    147   
            }
  148    148   
            crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_request(
  149    149   
                request,
  150    150   
            )
  151    151   
            .await
  152    152   
        };
  153    153   
        use ::futures_util::future::TryFutureExt;
  154         -
        let fut = fut.map_err(
  155         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         154  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  156    155   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  157         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  158         -
                    e,
  159         -
                )
  160         -
            },
  161         -
        );
         156  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         157  +
                    });
  162    158   
        GetPokemonSpeciesInputFuture {
  163    159   
            inner: Box::pin(fut),
  164    160   
        }
  165    161   
    }
  166    162   
}
  167    163   
impl
  168         -
    ::aws_smithy_http_server::response::IntoResponse<
  169         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         164  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         165  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  170    166   
    > for crate::output::GetPokemonSpeciesOutput
  171    167   
{
  172         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         168  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  173    169   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_response(self) {
  174    170   
                        Ok(response) => response,
  175    171   
                        Err(e) => {
  176    172   
                            ::tracing::error!(error = %e, "failed to serialize response");
  177         -
                            ::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))
         173  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  178    174   
                        }
  179    175   
                    }
  180    176   
    }
  181    177   
}
  182    178   
impl
  183         -
    ::aws_smithy_http_server::response::IntoResponse<
  184         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         179  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         180  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  185    181   
    > for crate::error::GetPokemonSpeciesError
  186    182   
{
  187         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         183  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  188    184   
        match crate::protocol_serde::shape_get_pokemon_species::ser_get_pokemon_species_http_error(
  189    185   
            &self,
  190    186   
        ) {
  191    187   
            Ok(mut response) => {
  192    188   
                response.extensions_mut().insert(
  193         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
         189  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         190  +
                        self.name(),
         191  +
                    ),
  194    192   
                );
  195    193   
                response
  196    194   
            }
  197    195   
            Err(e) => {
  198    196   
                ::tracing::error!(error = %e, "failed to serialize response");
  199         -
                ::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))
         197  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  200    198   
            }
  201    199   
        }
  202    200   
    }
  203    201   
}
  204    202   
  205    203   
::pin_project_lite::pin_project! {
  206    204   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  207    205   
    /// [`StreamPokemonRadioInput`](crate::input::StreamPokemonRadioInput) using modelled bindings.
  208    206   
    pub struct StreamPokemonRadioInputFuture {
  209         -
        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>>
         207  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamPokemonRadioInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  210    208   
    }
  211    209   
}
  212    210   
  213    211   
impl std::future::Future for StreamPokemonRadioInputFuture {
  214    212   
    type Output = Result<
  215    213   
        crate::input::StreamPokemonRadioInput,
  216         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         214  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  217    215   
    >;
  218    216   
  219    217   
    fn poll(
  220    218   
        self: std::pin::Pin<&mut Self>,
  221    219   
        cx: &mut std::task::Context<'_>,
  222    220   
    ) -> std::task::Poll<Self::Output> {
  223    221   
        let this = self.project();
  224    222   
        this.inner.as_mut().poll(cx)
  225    223   
    }
  226    224   
}
  227    225   
  228    226   
impl<B>
  229         -
    ::aws_smithy_http_server::request::FromRequest<
  230         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         227  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         228  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  231    229   
        B,
  232    230   
    > for crate::input::StreamPokemonRadioInput
  233    231   
where
  234         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         232  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  235    233   
    B: 'static,
  236    234   
  237    235   
    B::Data: Send,
  238         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  239         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         236  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         237  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  240    238   
{
  241         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         239  +
    type Rejection =
         240  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  242    241   
    type Future = StreamPokemonRadioInputFuture;
  243    242   
  244    243   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  245    244   
        let fut = async move {
  246         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         245  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  247    246   
                request.headers(),
  248    247   
                &crate::mimes::CONTENT_TYPE_APPLICATION_OCTET_STREAM,
  249    248   
            ) {
  250         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         249  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  251    250   
            }
  252    251   
            crate::protocol_serde::shape_stream_pokemon_radio::de_stream_pokemon_radio_http_request(
  253    252   
                request,
  254    253   
            )
  255    254   
            .await
  256    255   
        };
  257    256   
        use ::futures_util::future::TryFutureExt;
  258         -
        let fut = fut.map_err(
  259         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         257  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  260    258   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  261         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  262         -
                    e,
  263         -
                )
  264         -
            },
  265         -
        );
         259  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         260  +
                    });
  266    261   
        StreamPokemonRadioInputFuture {
  267    262   
            inner: Box::pin(fut),
  268    263   
        }
  269    264   
    }
  270    265   
}
  271    266   
impl
  272         -
    ::aws_smithy_http_server::response::IntoResponse<
  273         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         267  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         268  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  274    269   
    > for crate::output::StreamPokemonRadioOutput
  275    270   
{
  276         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         271  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  277    272   
        match crate::protocol_serde::shape_stream_pokemon_radio::ser_stream_pokemon_radio_http_response(self) {
  278    273   
                        Ok(response) => response,
  279    274   
                        Err(e) => {
  280    275   
                            ::tracing::error!(error = %e, "failed to serialize response");
  281         -
                            ::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))
         276  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  282    277   
                        }
  283    278   
                    }
  284    279   
    }
  285    280   
}
  286    281   
impl
  287         -
    ::aws_smithy_http_server::response::IntoResponse<
  288         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         282  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         283  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  289    284   
    > for crate::error::StreamPokemonRadioError
  290    285   
{
  291         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         286  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  292    287   
        match crate::protocol_serde::shape_stream_pokemon_radio::ser_stream_pokemon_radio_http_error(
  293    288   
            &self,
  294    289   
        ) {
  295    290   
            Ok(mut response) => {
  296    291   
                response.extensions_mut().insert(
  297         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
         292  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         293  +
                        self.name(),
         294  +
                    ),
  298    295   
                );
  299    296   
                response
  300    297   
            }
  301    298   
            Err(e) => {
  302    299   
                ::tracing::error!(error = %e, "failed to serialize response");
  303         -
                ::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))
         300  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  304    301   
            }
  305    302   
        }
  306    303   
    }
  307    304   
}
  308    305   
  309    306   
::pin_project_lite::pin_project! {
  310    307   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  311    308   
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
  312    309   
    pub struct CheckHealthInputFuture {
  313         -
        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>>
         310  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CheckHealthInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  314    311   
    }
  315    312   
}
  316    313   
  317    314   
impl std::future::Future for CheckHealthInputFuture {
  318    315   
    type Output = Result<
  319    316   
        crate::input::CheckHealthInput,
  320         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         317  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  321    318   
    >;
  322    319   
  323    320   
    fn poll(
  324    321   
        self: std::pin::Pin<&mut Self>,
  325    322   
        cx: &mut std::task::Context<'_>,
  326    323   
    ) -> std::task::Poll<Self::Output> {
  327    324   
        let this = self.project();
  328    325   
        this.inner.as_mut().poll(cx)
  329    326   
    }
  330    327   
}
  331    328   
  332    329   
impl<B>
  333         -
    ::aws_smithy_http_server::request::FromRequest<
  334         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         330  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         331  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  335    332   
        B,
  336    333   
    > for crate::input::CheckHealthInput
  337    334   
where
  338         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         335  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  339    336   
    B: 'static,
  340    337   
  341    338   
    B::Data: Send,
  342         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  343         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         339  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         340  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  344    341   
{
  345         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         342  +
    type Rejection =
         343  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  346    344   
    type Future = CheckHealthInputFuture;
  347    345   
  348    346   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  349    347   
        let fut = async move {
  350         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         348  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  351    349   
                request.headers(),
  352    350   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  353    351   
            ) {
  354         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         352  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  355    353   
            }
  356    354   
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
  357    355   
        };
  358    356   
        use ::futures_util::future::TryFutureExt;
  359         -
        let fut = fut.map_err(
  360         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         357  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  361    358   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  362         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  363         -
                    e,
  364         -
                )
  365         -
            },
  366         -
        );
         359  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         360  +
                    });
  367    361   
        CheckHealthInputFuture {
  368    362   
            inner: Box::pin(fut),
  369    363   
        }
  370    364   
    }
  371    365   
}
  372    366   
impl
  373         -
    ::aws_smithy_http_server::response::IntoResponse<
  374         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         367  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         368  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  375    369   
    > for crate::output::CheckHealthOutput
  376    370   
{
  377         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         371  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  378    372   
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
  379    373   
            Ok(response) => response,
  380    374   
            Err(e) => {
  381    375   
                ::tracing::error!(error = %e, "failed to serialize response");
  382         -
                ::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))
         376  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  383    377   
            }
  384    378   
        }
  385    379   
    }
  386    380   
}
  387    381   
impl
  388         -
    ::aws_smithy_http_server::response::IntoResponse<
  389         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         382  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         383  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  390    384   
    > for crate::error::CheckHealthError
  391    385   
{
  392         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         386  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  393    387   
        match crate::protocol_serde::shape_check_health::ser_check_health_http_error(&self) {
  394    388   
            Ok(mut response) => {
  395    389   
                response.extensions_mut().insert(
  396         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
         390  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         391  +
                        self.name(),
         392  +
                    ),
  397    393   
                );
  398    394   
                response
  399    395   
            }
  400    396   
            Err(e) => {
  401    397   
                ::tracing::error!(error = %e, "failed to serialize response");
  402         -
                ::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))
         398  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  403    399   
            }
  404    400   
        }
  405    401   
    }
  406    402   
}
  407    403   
  408    404   
::pin_project_lite::pin_project! {
  409    405   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  410    406   
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
  411    407   
    pub struct CapturePokemonInputFuture {
  412         -
        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>>
         408  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CapturePokemonInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  413    409   
    }
  414    410   
}
  415    411   
  416    412   
impl std::future::Future for CapturePokemonInputFuture {
  417    413   
    type Output = Result<
  418    414   
        crate::input::CapturePokemonInput,
  419         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         415  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  420    416   
    >;
  421    417   
  422    418   
    fn poll(
  423    419   
        self: std::pin::Pin<&mut Self>,
  424    420   
        cx: &mut std::task::Context<'_>,
  425    421   
    ) -> std::task::Poll<Self::Output> {
  426    422   
        let this = self.project();
  427    423   
        this.inner.as_mut().poll(cx)
  428    424   
    }
  429    425   
}
  430    426   
  431    427   
impl<B>
  432         -
    ::aws_smithy_http_server::request::FromRequest<
  433         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         428  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         429  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  434    430   
        B,
  435    431   
    > for crate::input::CapturePokemonInput
  436    432   
where
  437         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         433  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  438    434   
    B: 'static,
  439    435   
  440    436   
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
  441    437   
    B::Data: Send,
  442         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  443         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         438  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         439  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  444    440   
{
  445         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         441  +
    type Rejection =
         442  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  446    443   
    type Future = CapturePokemonInputFuture;
  447    444   
  448    445   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  449    446   
        let fut = async move {
  450         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         447  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  451    448   
                request.headers(),
  452    449   
                &crate::mimes::CONTENT_TYPE_APPLICATION_VND_AMAZON_EVENTSTREAM,
  453    450   
            ) {
  454         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         451  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  455    452   
            }
  456    453   
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_request(request)
  457    454   
                .await
  458    455   
        };
  459    456   
        use ::futures_util::future::TryFutureExt;
  460         -
        let fut = fut.map_err(
  461         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         457  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  462    458   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  463         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  464         -
                    e,
  465         -
                )
  466         -
            },
  467         -
        );
         459  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         460  +
                    });
  468    461   
        CapturePokemonInputFuture {
  469    462   
            inner: Box::pin(fut),
  470    463   
        }
  471    464   
    }
  472    465   
}
  473    466   
impl
  474         -
    ::aws_smithy_http_server::response::IntoResponse<
  475         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         467  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         468  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  476    469   
    > for crate::output::CapturePokemonOutput
  477    470   
{
  478         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         471  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  479    472   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
  480    473   
        {
  481    474   
            Ok(response) => response,
  482    475   
            Err(e) => {
  483    476   
                ::tracing::error!(error = %e, "failed to serialize response");
  484         -
                ::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))
         477  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  485    478   
            }
  486    479   
        }
  487    480   
    }
  488    481   
}
  489    482   
impl
  490         -
    ::aws_smithy_http_server::response::IntoResponse<
  491         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         483  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         484  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  492    485   
    > for crate::error::CapturePokemonError
  493    486   
{
  494         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         487  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  495    488   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
  496    489   
            Ok(mut response) => {
  497    490   
                response.extensions_mut().insert(
  498         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
         491  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         492  +
                        self.name(),
         493  +
                    ),
  499    494   
                );
  500    495   
                response
  501    496   
            }
  502    497   
            Err(e) => {
  503    498   
                ::tracing::error!(error = %e, "failed to serialize response");
  504         -
                ::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))
         499  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  505    500   
            }
  506    501   
        }
  507    502   
    }
  508    503   
}
  509    504   
  510    505   
::pin_project_lite::pin_project! {
  511    506   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  512    507   
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
  513    508   
    pub struct DoNothingInputFuture {
  514         -
        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>>
         509  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DoNothingInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  515    510   
    }
  516    511   
}
  517    512   
  518    513   
impl std::future::Future for DoNothingInputFuture {
  519    514   
    type Output = Result<
  520    515   
        crate::input::DoNothingInput,
  521         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         516  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  522    517   
    >;
  523    518   
  524    519   
    fn poll(
  525    520   
        self: std::pin::Pin<&mut Self>,
  526    521   
        cx: &mut std::task::Context<'_>,
  527    522   
    ) -> std::task::Poll<Self::Output> {
  528    523   
        let this = self.project();
  529    524   
        this.inner.as_mut().poll(cx)
  530    525   
    }
  531    526   
}
  532    527   
  533    528   
impl<B>
  534         -
    ::aws_smithy_http_server::request::FromRequest<
  535         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         529  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         530  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  536    531   
        B,
  537    532   
    > for crate::input::DoNothingInput
  538    533   
where
  539         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         534  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  540    535   
    B: 'static,
  541    536   
  542    537   
    B::Data: Send,
  543         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  544         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         538  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         539  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  545    540   
{
  546         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         541  +
    type Rejection =
         542  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  547    543   
    type Future = DoNothingInputFuture;
  548    544   
  549    545   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  550    546   
        let fut = async move {
  551         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         547  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  552    548   
                request.headers(),
  553    549   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  554    550   
            ) {
  555         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         551  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  556    552   
            }
  557    553   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
  558    554   
        };
  559    555   
        use ::futures_util::future::TryFutureExt;
  560         -
        let fut = fut.map_err(
  561         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         556  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  562    557   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  563         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  564         -
                    e,
  565         -
                )
  566         -
            },
  567         -
        );
         558  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         559  +
                    });
  568    560   
        DoNothingInputFuture {
  569    561   
            inner: Box::pin(fut),
  570    562   
        }
  571    563   
    }
  572    564   
}
  573    565   
impl
  574         -
    ::aws_smithy_http_server::response::IntoResponse<
  575         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         566  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         567  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  576    568   
    > for crate::output::DoNothingOutput
  577    569   
{
  578         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         570  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  579    571   
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
  580    572   
            Ok(response) => response,
  581    573   
            Err(e) => {
  582    574   
                ::tracing::error!(error = %e, "failed to serialize response");
  583         -
                ::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))
         575  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  584    576   
            }
  585    577   
        }
  586    578   
    }
  587    579   
}
  588    580   
impl
  589         -
    ::aws_smithy_http_server::response::IntoResponse<
  590         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         581  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         582  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  591    583   
    > for crate::error::DoNothingError
  592    584   
{
  593         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         585  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  594    586   
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_error(&self) {
  595    587   
            Ok(mut response) => {
  596    588   
                response.extensions_mut().insert(
  597         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
         589  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         590  +
                        self.name(),
         591  +
                    ),
  598    592   
                );
  599    593   
                response
  600    594   
            }
  601    595   
            Err(e) => {
  602    596   
                ::tracing::error!(error = %e, "failed to serialize response");
  603         -
                ::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))
         597  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  604    598   
            }
  605    599   
        }
  606    600   
    }
  607    601   
}
  608    602   
  609    603   
::pin_project_lite::pin_project! {
  610    604   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  611    605   
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
  612    606   
    pub struct GetServerStatisticsInputFuture {
  613         -
        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>>
         607  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetServerStatisticsInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  614    608   
    }
  615    609   
}
  616    610   
  617    611   
impl std::future::Future for GetServerStatisticsInputFuture {
  618    612   
    type Output = Result<
  619    613   
        crate::input::GetServerStatisticsInput,
  620         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         614  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  621    615   
    >;
  622    616   
  623    617   
    fn poll(
  624    618   
        self: std::pin::Pin<&mut Self>,
  625    619   
        cx: &mut std::task::Context<'_>,
  626    620   
    ) -> std::task::Poll<Self::Output> {
  627    621   
        let this = self.project();
  628    622   
        this.inner.as_mut().poll(cx)
  629    623   
    }
  630    624   
}
  631    625   
  632    626   
impl<B>
  633         -
    ::aws_smithy_http_server::request::FromRequest<
  634         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         627  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         628  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  635    629   
        B,
  636    630   
    > for crate::input::GetServerStatisticsInput
  637    631   
where
  638         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         632  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  639    633   
    B: 'static,
  640    634   
  641    635   
    B::Data: Send,
  642         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  643         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         636  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         637  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  644    638   
{
  645         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         639  +
    type Rejection =
         640  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  646    641   
    type Future = GetServerStatisticsInputFuture;
  647    642   
  648    643   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  649    644   
        let fut = async move {
  650         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         645  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  651    646   
                request.headers(),
  652    647   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  653    648   
            ) {
  654         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         649  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  655    650   
            }
  656    651   
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
  657    652   
                            .await
  658    653   
        };
  659    654   
        use ::futures_util::future::TryFutureExt;
  660         -
        let fut = fut.map_err(
  661         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         655  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  662    656   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  663         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  664         -
                    e,
  665         -
                )
  666         -
            },
  667         -
        );
         657  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         658  +
                    });
  668    659   
        GetServerStatisticsInputFuture {
  669    660   
            inner: Box::pin(fut),
  670    661   
        }
  671    662   
    }
  672    663   
}
  673    664   
impl
  674         -
    ::aws_smithy_http_server::response::IntoResponse<
  675         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         665  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         666  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  676    667   
    > for crate::output::GetServerStatisticsOutput
  677    668   
{
  678         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         669  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  679    670   
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
  680    671   
                        Ok(response) => response,
  681    672   
                        Err(e) => {
  682    673   
                            ::tracing::error!(error = %e, "failed to serialize response");
  683         -
                            ::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))
         674  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  684    675   
                        }
  685    676   
                    }
  686    677   
    }
  687    678   
}
  688    679   
impl
  689         -
    ::aws_smithy_http_server::response::IntoResponse<
  690         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         680  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         681  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  691    682   
    > for crate::error::GetServerStatisticsError
  692    683   
{
  693         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         684  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  694    685   
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_error(&self) {
  695    686   
            Ok(mut response) => {
  696         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
         687  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
  697    688   
                response
  698    689   
            },
  699    690   
            Err(e) => {
  700    691   
                ::tracing::error!(error = %e, "failed to serialize response");
  701         -
                ::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))
         692  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  702    693   
            }
  703    694   
        }
  704    695   
    }
  705    696   
}

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

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

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

@@ -1,1 +257,257 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_capture_pokemon_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::CapturePokemonInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     12   
    B::Data: Send,
   13         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          13  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          14  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   15     15   
{
   16     16   
    Ok({
   17     17   
        #[allow(unused_mut)]
   18     18   
        let mut input = crate::input::capture_pokemon_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = {
   24     24   
            let mut receiver =
   25     25   
                crate::protocol_serde::shape_capture_pokemon_input::de_events_payload(
   26     26   
                    &mut body.into().into_inner(),
   27     27   
                )?;
   28     28   
            if let Some(_initial_event) = receiver
   29         -
                                                .try_recv_initial(::aws_smithy_http::event_stream::InitialMessageType::Request)
          29  +
                                                .try_recv_initial(::aws_smithy_legacy_http::event_stream::InitialMessageType::Request)
   30     30   
                                                .await
   31     31   
                                                .map_err(
   32         -
                                                    |ev_error| ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::ConstraintViolation(
          32  +
                                                    |ev_error| ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::ConstraintViolation(
   33     33   
                                                        #[allow(clippy::useless_conversion)]
   34     34   
                                                        format!("{ev_error}").into()
   35     35   
                                                    )
   36     36   
                                                )? {
   37     37   
                                                
   38     38   
                                            }
   39     39   
            Some(receiver)
   40     40   
        } {
   41     41   
            input = input.set_events(value)
   42     42   
        }
   43     43   
        let input_string = uri.path();
   44     44   
        let (input_string, (_, m1)) =
   45     45   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   46     46   
                ::nom::sequence::preceded(
   47     47   
                    ::nom::bytes::complete::tag("/"),
   48     48   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   49     49   
                        "capture-pokemon-event",
   50     50   
                    ),
   51     51   
                ),
   52     52   
                ::nom::sequence::preceded(
   53     53   
                    ::nom::bytes::complete::tag("/"),
   54     54   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   55     55   
                        ::nom::bytes::complete::take_until("/"),
   56     56   
                        ::nom::combinator::rest,
   57     57   
                    )),
   58     58   
                ),
   59     59   
            ))(input_string)?;
   60     60   
        debug_assert_eq!("", input_string);
   61     61   
        input =
   62     62   
            input.set_region(crate::protocol_serde::shape_capture_pokemon_input::de_region(m1)?);
   63     63   
        input.build()?
   64     64   
    })
   65     65   
}
   66     66   
   67     67   
#[allow(clippy::unnecessary_wraps)]
   68     68   
pub fn ser_capture_pokemon_http_response(
   69     69   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   70     70   
) -> std::result::Result<
   71         -
    ::aws_smithy_http_server::response::Response,
   72         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          71  +
    ::aws_smithy_legacy_http_server::response::Response,
          72  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     73   
> {
   74     74   
    Ok({
   75     75   
        #[allow(unused_mut)]
   76     76   
        let mut builder = ::http::Response::builder();
   77         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     78   
            builder,
   79     79   
            ::http::header::CONTENT_TYPE,
   80     80   
            "application/vnd.amazon.eventstream",
   81     81   
        );
   82     82   
        let http_status: u16 = 200;
   83     83   
        builder = builder.status(http_status);
   84         -
        let body = ::aws_smithy_http_server::body::boxed(
   85         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
          84  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(
          85  +
            ::aws_smithy_legacy_http_server::body::Body::wrap_stream({
   86     86   
                let error_marshaller =
   87     87   
                    crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   88     88   
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   89     89   
                let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   90     90   
                output
   91     91   
                    .events
   92     92   
                    .into_body_stream(marshaller, error_marshaller, signer)
   93     93   
            }),
   94     94   
        );
   95     95   
        builder.body(body)?
   96     96   
    })
   97     97   
}
   98     98   
   99     99   
#[allow(clippy::unnecessary_wraps)]
  100    100   
pub fn ser_capture_pokemon_http_error(
  101    101   
    error: &crate::error::CapturePokemonError,
  102    102   
) -> std::result::Result<
  103         -
    ::aws_smithy_http_server::response::Response,
  104         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         103  +
    ::aws_smithy_legacy_http_server::response::Response,
         104  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  105    105   
> {
  106    106   
    Ok({
  107    107   
        match error {
  108    108   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
  109    109   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
  110    110   
                #[allow(unused_mut)]
  111    111   
                let mut builder = ::http::Response::builder();
  112         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         112  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  113    113   
                    builder,
  114    114   
                    ::http::header::CONTENT_TYPE,
  115    115   
                    "application/vnd.amazon.eventstream",
  116    116   
                );
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  120    120   
                    "UnsupportedRegionError",
  121    121   
                );
  122    122   
                let content_length = payload.len();
  123         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         123  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125    125   
                    ::http::header::CONTENT_LENGTH,
  126    126   
                    content_length,
  127    127   
                );
  128    128   
                builder
  129    129   
                    .status(500)
  130         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  131    131   
            }
  132    132   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
  133    133   
                let payload =
  134    134   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  135    135   
                        output,
  136    136   
                    )?;
  137    137   
                #[allow(unused_mut)]
  138    138   
                let mut builder = ::http::Response::builder();
  139         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         139  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  140    140   
                    builder,
  141    141   
                    ::http::header::CONTENT_TYPE,
  142    142   
                    "application/vnd.amazon.eventstream",
  143    143   
                );
  144         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         144  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  145    145   
                    builder,
  146    146   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  147    147   
                    "ThrottlingError",
  148    148   
                );
  149    149   
                let content_length = payload.len();
  150         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         150  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  151    151   
                    builder,
  152    152   
                    ::http::header::CONTENT_LENGTH,
  153    153   
                    content_length,
  154    154   
                );
  155    155   
                builder
  156    156   
                    .status(400)
  157         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         157  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  158    158   
            }
  159    159   
            crate::error::CapturePokemonError::ValidationException(output) => {
  160    160   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  161    161   
                #[allow(unused_mut)]
  162    162   
                let mut builder = ::http::Response::builder();
  163         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         163  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  164    164   
                    builder,
  165    165   
                    ::http::header::CONTENT_TYPE,
  166    166   
                    "application/vnd.amazon.eventstream",
  167    167   
                );
  168         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         168  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  169    169   
                    builder,
  170    170   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  171    171   
                    "ValidationException",
  172    172   
                );
  173    173   
                let content_length = payload.len();
  174         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         174  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  175    175   
                    builder,
  176    176   
                    ::http::header::CONTENT_LENGTH,
  177    177   
                    content_length,
  178    178   
                );
  179    179   
                builder
  180    180   
                    .status(400)
  181         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         181  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  182    182   
            }
  183    183   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
  184    184   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
  185    185   
                #[allow(unused_mut)]
  186    186   
                let mut builder = ::http::Response::builder();
  187         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         187  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  188    188   
                    builder,
  189    189   
                    ::http::header::CONTENT_TYPE,
  190    190   
                    "application/vnd.amazon.eventstream",
  191    191   
                );
  192         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         192  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  193    193   
                    builder,
  194    194   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  195    195   
                    "MasterBallUnsuccessful",
  196    196   
                );
  197    197   
                let content_length = payload.len();
  198         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         198  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  199    199   
                    builder,
  200    200   
                    ::http::header::CONTENT_LENGTH,
  201    201   
                    content_length,
  202    202   
                );
  203    203   
                builder
  204    204   
                    .status(500)
  205         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         205  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  206    206   
            }
  207    207   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
  208    208   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
  209    209   
                #[allow(unused_mut)]
  210    210   
                let mut builder = ::http::Response::builder();
  211         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         211  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  212    212   
                    builder,
  213    213   
                    ::http::header::CONTENT_TYPE,
  214    214   
                    "application/vnd.amazon.eventstream",
  215    215   
                );
  216         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         216  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  217    217   
                    builder,
  218    218   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  219    219   
                    "InvalidPokeballError",
  220    220   
                );
  221    221   
                let content_length = payload.len();
  222         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         222  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  223    223   
                    builder,
  224    224   
                    ::http::header::CONTENT_LENGTH,
  225    225   
                    content_length,
  226    226   
                );
  227    227   
                builder
  228    228   
                    .status(400)
  229         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         229  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  230    230   
            }
  231    231   
            crate::error::CapturePokemonError::InternalServerError(output) => {
  232    232   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  233    233   
                #[allow(unused_mut)]
  234    234   
                let mut builder = ::http::Response::builder();
  235         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         235  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  236    236   
                    builder,
  237    237   
                    ::http::header::CONTENT_TYPE,
  238    238   
                    "application/vnd.amazon.eventstream",
  239    239   
                );
  240         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         240  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  241    241   
                    builder,
  242    242   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  243    243   
                    "InternalServerError",
  244    244   
                );
  245    245   
                let content_length = payload.len();
  246         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         246  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  247    247   
                    builder,
  248    248   
                    ::http::header::CONTENT_LENGTH,
  249    249   
                    content_length,
  250    250   
                );
  251    251   
                builder
  252    252   
                    .status(500)
  253         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         253  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  254    254   
            }
  255    255   
        }
  256    256   
    })
  257    257   
}

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

@@ -1,1 +25,25 @@
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     10   
    let receiver =
   11     11   
        crate::python_event_stream::CapturePokemonInputEventsReceiver::new(unmarshaller, body);
   12     12   
    Ok(receiver)
   13     13   
}
   14     14   
   15     15   
pub fn de_region(
   16     16   
    value: &str,
   17     17   
) -> std::result::Result<
   18     18   
    ::std::string::String,
   19         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          19  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   20     20   
> {
   21     21   
    let value = ::percent_encoding::percent_decode_str(value)
   22     22   
        .decode_utf8()?
   23     23   
        .into_owned();
   24     24   
    Ok(value)
   25     25   
}

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

@@ -1,1 +91,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_check_health_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::CheckHealthInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::check_health_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          22  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
   23     25   
        input.build()
   24     26   
    })
   25     27   
}
   26     28   
   27     29   
#[allow(clippy::unnecessary_wraps)]
   28     30   
pub fn ser_check_health_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
   30     32   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     35   
> {
   34     36   
    Ok({
   35     37   
        #[allow(unused_mut)]
   36     38   
        let mut builder = ::http::Response::builder();
   37         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   38     40   
            builder,
   39     41   
            ::http::header::CONTENT_TYPE,
   40     42   
            "application/json",
   41     43   
        );
   42     44   
        let http_status: u16 = 200;
   43     45   
        builder = builder.status(http_status);
   44     46   
        let payload = "";
   45     47   
        let content_length = payload.len();
   46         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   47     49   
            builder,
   48     50   
            ::http::header::CONTENT_LENGTH,
   49     51   
            content_length,
   50     52   
        );
   51         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          53  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   52     54   
        builder.body(body)?
   53     55   
    })
   54     56   
}
   55     57   
   56     58   
#[allow(clippy::unnecessary_wraps)]
   57     59   
pub fn ser_check_health_http_error(
   58     60   
    error: &crate::error::CheckHealthError,
   59     61   
) -> std::result::Result<
   60         -
    ::aws_smithy_http_server::response::Response,
   61         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          62  +
    ::aws_smithy_legacy_http_server::response::Response,
          63  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     64   
> {
   63     65   
    Ok({
   64     66   
        match error {
   65     67   
            crate::error::CheckHealthError::InternalServerError(output) => {
   66     68   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   67     69   
                #[allow(unused_mut)]
   68     70   
                let mut builder = ::http::Response::builder();
   69         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          71  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   70     72   
                    builder,
   71     73   
                    ::http::header::CONTENT_TYPE,
   72     74   
                    "application/json",
   73     75   
                );
   74         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          76  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   75     77   
                    builder,
   76     78   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   77     79   
                    "InternalServerError",
   78     80   
                );
   79     81   
                let content_length = payload.len();
   80         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   81     83   
                    builder,
   82     84   
                    ::http::header::CONTENT_LENGTH,
   83     85   
                    content_length,
   84     86   
                );
   85     87   
                builder
   86     88   
                    .status(500)
   87         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          89  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   88     90   
            }
   89     91   
        }
   90     92   
    })
   91     93   
}