Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/types.rs

@@ -0,1 +0,5 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           3  +
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
           4  +
pub use ::aws_smithy_types::Blob;
           5  +
pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/Cargo.toml

@@ -1,1 +60,66 @@
    8      8   
    9      9   
[package.metadata.smithy]
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#restXml"
   12     12   
[dependencies.aws-smithy-http]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   14     14   
[dependencies.aws-smithy-http-server]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   16     16   
[dependencies.aws-smithy-runtime-api]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          18  +
features = ["http-1x"]
   18     19   
[dependencies.aws-smithy-types]
   19     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          21  +
features = ["http-body-1-x"]
   20     22   
[dependencies.aws-smithy-xml]
   21     23   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-xml"
   22     24   
[dependencies.form_urlencoded]
   23     25   
version = "1"
   24     26   
[dependencies.futures-util]
   25     27   
version = "0.3"
   26         -
[dependencies.http]
   27         -
version = "0.2.9"
          28  +
[dependencies.http-1x]
          29  +
version = "1"
          30  +
package = "http"
   28     31   
[dependencies.mime]
   29     32   
version = "0.3"
   30     33   
[dependencies.nom]
   31     34   
version = "7"
   32     35   
[dependencies.percent-encoding]
   33     36   
version = "2.0.0"
   34     37   
[dependencies.pin-project-lite]
   35     38   
version = "0.2"
   36     39   
[dependencies.tower]
   37     40   
version = "0.4"
   38     41   
[dependencies.tracing]
   39     42   
version = "0.1"
   40     43   
[dev-dependencies.aws-smithy-protocol-test]
   41     44   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          45  +
features = ["http-1x"]
   42     46   
[dev-dependencies.bytes]
   43     47   
version = "1.4.0"
          48  +
[dev-dependencies.http-body-util]
          49  +
version = "0.1.3"
   44     50   
[dev-dependencies.hyper]
   45         -
version = "0.14.26"
          51  +
version = "1"
   46     52   
[dev-dependencies.pretty_assertions]
   47     53   
version = "1.3.0"
   48     54   
[dev-dependencies.tokio]
   49     55   
version = "1.23.1"
   50     56   
features = ["macros", "test-util", "rt-multi-thread"]
   51     57   
[dev-dependencies.tracing-test]
   52     58   
version = "0.2.5"
   53     59   
features = ["no-env-filter"]
   54     60   
[features]
   55     61   
rt-tokio = ["aws-smithy-types/rt-tokio"]

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/lib.rs

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   41     41   
//! modules provide the types used in each operation.
   42     42   
//!
   43     43   
//! ### Running on Hyper
   44     44   
//!
   45     45   
//! ```rust,no_run
   46     46   
//! # use std::net::SocketAddr;
   47     47   
//! # async fn dummy() {
   48     48   
//! use s3::{AmazonS3, AmazonS3Config};
          49  +
//! use s3::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = AmazonS3::builder(
   51     53   
//! #     AmazonS3Config::builder()
   52     54   
//! #         .build()
   53     55   
//! # ).build_unchecked();
   54         -
//! let server = app.into_make_service();
   55     56   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     57   
//!     .expect("unable to parse the server bind address and port");
   57         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! let listener = TcpListener::bind(bind).await
          59  +
//!     .expect("failed to bind TCP listener");
          60  +
//! serve(listener, app.into_make_service()).await.unwrap();
   58     61   
//! # }
   59     62   
//! ```
   60     63   
//!
   61     64   
//! ### Running on Lambda
   62     65   
//!
   63     66   
//! ```rust,ignore
   64     67   
//! use s3::server::routing::LambdaHandler;
   65     68   
//! use s3::AmazonS3;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = AmazonS3::builder(
   69     72   
//! #     AmazonS3Config::builder()
   70     73   
//! #         .build()
   71     74   
//! # ).build_unchecked();
   72     75   
//! let handler = LambdaHandler::new(app);
   73     76   
//! lambda_http::run(handler).await.unwrap();
   74     77   
//! # }
   75     78   
//! ```
   76     79   
//!
   77     80   
//! # Building the AmazonS3
   78     81   
//!
   79     82   
//! To construct [`AmazonS3`] we use [`AmazonS3Builder`] returned by [`AmazonS3::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`AmazonS3::builder`] method, returning [`AmazonS3Builder`],
   84     87   
//! accepts a config object on which plugins can be registered.
   85     88   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     89   
//!
   87     90   
//! ```rust,no_run
   88     91   
//! # use s3::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use s3::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use s3::server::plugin::HttpPlugins;
   92     95   
//! use s3::{AmazonS3, AmazonS3Config, AmazonS3Builder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = AmazonS3Config::builder().build();
   98         -
//! let builder: AmazonS3Builder<Body, _, _, _> = AmazonS3::builder(config);
         101  +
//! let builder: AmazonS3Builder<::hyper::body::Incoming, _, _, _> = AmazonS3::builder(config);
   99    102   
//! ```
  100    103   
//!
  101    104   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    105   
//!
  103    106   
//! ## Handlers
  104    107   
//!
  105    108   
//! [`AmazonS3Builder`] 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    109   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    110   
//!
  108    111   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -135,138 +243,250 @@
  155    158   
//! [`AmazonS3Builder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
  156    159   
//!
  157    160   
//! [`AmazonS3Builder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
  158    161   
//! [`AmazonS3Builder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
  159    162   
//!
  160    163   
//! # Example
  161    164   
//!
  162    165   
//! ```rust,no_run
  163    166   
//! # use std::net::SocketAddr;
  164    167   
//! use s3::{AmazonS3, AmazonS3Config};
         168  +
//! use s3::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = AmazonS3Config::builder().build();
  169    174   
//!    let app = AmazonS3::builder(config)
  170    175   
//!        .delete_object_tagging(delete_object_tagging)
  171    176   
//!        .get_bucket_location(get_bucket_location)
  172    177   
//!        .get_object(get_object)
  173    178   
//!        .list_objects_v2(list_objects_v2)
  174    179   
//!        .build()
  175    180   
//!        .expect("failed to build an instance of AmazonS3");
  176    181   
//!
  177    182   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  178    183   
//!        .expect("unable to parse the server bind address and port");
  179         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         184  +
//!    let listener = TcpListener::bind(bind).await
         185  +
//!        .expect("failed to bind TCP listener");
  180    186   
//!    # let server = async { Ok::<_, ()>(()) };
  181    187   
//!
  182    188   
//!    // Run your service!
  183         -
//!    if let Err(err) = server.await {
         189  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  184    190   
//!        eprintln!("server error: {:?}", err);
  185    191   
//!    }
  186    192   
//! }
  187    193   
//!
  188    194   
//! use s3::{input, output, error};
  189    195   
//!
  190    196   
//! async fn delete_object_tagging(input: input::DeleteObjectTaggingInput) -> Result<output::DeleteObjectTaggingOutput, error::DeleteObjectTaggingError> {
  191    197   
//!     todo!()
  192    198   
//! }
  193    199   
//!
  194    200   
//! async fn get_bucket_location(input: input::GetBucketLocationInput) -> Result<output::GetBucketLocationOutput, error::GetBucketLocationError> {
  195    201   
//!     todo!()
  196    202   
//! }
  197    203   
//!
  198    204   
//! async fn get_object(input: input::GetObjectInput) -> Result<output::GetObjectOutput, error::GetObjectError> {
  199    205   
//!     todo!()
  200    206   
//! }
  201    207   
//!
  202    208   
//! async fn list_objects_v2(input: input::ListObjectsV2Input) -> Result<output::ListObjectsV2Output, error::ListObjectsV2Error> {
  203    209   
//!     todo!()
  204    210   
//! }
  205    211   
//!
  206    212   
//! ```
  207    213   
//!
  208         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         214  +
//! [`serve`]: crate::serve
         215  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  209    216   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  210    217   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  211    218   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  212         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  213    219   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         220  +
pub use crate::server::serve::serve;
  214    221   
pub use crate::service::{
  215    222   
    AmazonS3, AmazonS3Builder, AmazonS3Config, AmazonS3ConfigBuilder, MissingOperationsError,
  216    223   
};
  217    224   
  218    225   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  219    226   
pub mod server {
  220    227   
    // Re-export all types from the `aws-smithy-http-server` crate.
  221    228   
    pub use ::aws_smithy_http_server::*;
  222    229   
}
  223    230   

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/operation.rs

@@ -11,11 +71,71 @@
   31     31   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection = ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
   39     39   
    type Future = GetObjectInputFuture;
   40     40   
   41         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          41  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
   42     42   
        let fut = async move {
   43     43   
            crate::protocol_serde::shape_get_object::de_get_object_http_request(request).await
   44     44   
        };
   45     45   
        use ::futures_util::future::TryFutureExt;
   46     46   
        let fut = fut.map_err(
   47     47   
            |e: ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection| {
   48     48   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   49     49   
                ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
   50     50   
            },
   51     51   
        );
@@ -114,114 +174,174 @@
  134    134   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  135    135   
    B: 'static,
  136    136   
  137    137   
    B::Data: Send,
  138    138   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
  139    139   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  140    140   
{
  141    141   
    type Rejection = ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  142    142   
    type Future = DeleteObjectTaggingInputFuture;
  143    143   
  144         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         144  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  145    145   
        let fut = async move {
  146    146   
            crate::protocol_serde::shape_delete_object_tagging::de_delete_object_tagging_http_request(request)
  147    147   
                            .await
  148    148   
        };
  149    149   
        use ::futures_util::future::TryFutureExt;
  150    150   
        let fut = fut.map_err(
  151    151   
            |e: ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection| {
  152    152   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  153    153   
                ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
  154    154   
            },
@@ -204,204 +264,264 @@
  224    224   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  225    225   
    B: 'static,
  226    226   
  227    227   
    B::Data: Send,
  228    228   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
  229    229   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  230    230   
{
  231    231   
    type Rejection = ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  232    232   
    type Future = GetBucketLocationInputFuture;
  233    233   
  234         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         234  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  235    235   
        let fut = async move {
  236    236   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  237    237   
                request.headers(),
  238    238   
                &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
  239    239   
            ) {
  240    240   
                return Err(::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
  241    241   
            }
  242    242   
            crate::protocol_serde::shape_get_bucket_location::de_get_bucket_location_http_request(
  243    243   
                request,
  244    244   
            )
@@ -295,295 +406,410 @@
  315    315   
        let output = crate::output::GetBucketLocationOutput {
  316    316   
            location_constraint: ::std::option::Option::Some(
  317    317   
                "us-west-2"
  318    318   
                    .parse::<crate::model::BucketLocationConstraint>()
  319    319   
                    .expect("static value validated to member"),
  320    320   
            ),
  321    321   
        };
  322    322   
        use ::aws_smithy_http_server::response::IntoResponse;
  323    323   
        let http_response = output.into_response();
  324    324   
        ::pretty_assertions::assert_eq!(
  325         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
         325  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  326    326   
            http_response.status()
  327    327   
        );
  328         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         328  +
        use ::http_body_util::BodyExt;
         329  +
        let body = http_response
         330  +
            .into_body()
         331  +
            .collect()
  329    332   
            .await
  330         -
            .expect("unable to extract body to bytes");
         333  +
            .expect("unable to collect body")
         334  +
            .to_bytes();
  331    335   
        ::aws_smithy_protocol_test::assert_ok(
  332    336   
        ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<LocationConstraint xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">us-west-2</LocationConstraint>", ::aws_smithy_protocol_test::MediaType::from("unknown"))
  333    337   
        );
  334    338   
    }
  335    339   
}
  336    340   
  337    341   
::pin_project_lite::pin_project! {
  338    342   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  339    343   
    /// [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) using modelled bindings.
  340    344   
    pub struct ListObjectsV2InputFuture {
  341    345   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ListObjectsV2Input, ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
  342    346   
    }
  343    347   
}
  344    348   
  345    349   
impl std::future::Future for ListObjectsV2InputFuture {
  346    350   
    type Output = Result<
  347    351   
        crate::input::ListObjectsV2Input,
  348    352   
        ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
  349    353   
    >;
  350    354   
  351    355   
    fn poll(
  352    356   
        self: std::pin::Pin<&mut Self>,
  353    357   
        cx: &mut std::task::Context<'_>,
  354    358   
    ) -> std::task::Poll<Self::Output> {
  355    359   
        let this = self.project();
  356    360   
        this.inner.as_mut().poll(cx)
  357    361   
    }
  358    362   
}
  359    363   
  360    364   
impl<B>
  361    365   
    ::aws_smithy_http_server::request::FromRequest<
  362    366   
        ::aws_smithy_http_server::protocol::rest_xml::RestXml,
  363    367   
        B,
  364    368   
    > for crate::input::ListObjectsV2Input
  365    369   
where
  366    370   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  367    371   
    B: 'static,
  368    372   
  369    373   
    B::Data: Send,
  370    374   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
  371    375   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  372    376   
{
  373    377   
    type Rejection = ::aws_smithy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  374    378   
    type Future = ListObjectsV2InputFuture;
  375    379   
  376         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         380  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  377    381   
        let fut = async move {
  378    382   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  379    383   
                request.headers(),
  380    384   
                &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
  381    385   
            ) {
  382    386   
                return Err(::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
  383    387   
            }
  384    388   
            crate::protocol_serde::shape_list_objects_v2::de_list_objects_v2_http_request(request)
  385    389   
                .await
  386    390   
        };
@@ -429,433 +974,1017 @@
  449    453   
#[cfg(test)]
  450    454   
mod list_objects_v2_test {
  451    455   
  452    456   
    /// S3 clients should map the default addressing style to virtual host.
  453    457   
    /// Test ID: S3DefaultAddressing
  454    458   
    #[::tokio::test]
  455    459   
    #[::tracing_test::traced_test]
  456    460   
    #[should_panic]
  457    461   
    async fn s3_default_addressing_request() {
  458    462   
        #[allow(unused_mut)]
  459         -
        let mut http_request = http::Request::builder()
         463  +
        let mut http_request = ::http_1x::Request::builder()
  460    464   
            .uri("/")
  461    465   
            .method("GET")
  462         -
            .body(::aws_smithy_http_server::body::Body::from(
  463         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         466  +
            .body(::aws_smithy_http_server::body::boxed(
         467  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         468  +
                    &::aws_smithy_protocol_test::decode_body_data(
  464    469   
                        "".as_bytes(),
  465    470   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         471  +
                    ),
  466    472   
                )),
  467    473   
            ))
  468    474   
            .unwrap();
  469    475   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  470    476   
        todo!("endpoint trait not supported yet");
  471    477   
        #[allow(unused_mut)]
  472    478   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  473    479   
        let config = crate::service::AmazonS3Config::builder().build();
  474         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         480  +
        let service =
         481  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         482  +
                config,
         483  +
            )
  475    484   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  476    485   
                let sender = sender.clone();
  477    486   
                async move {
  478    487   
                    let result = {
  479    488   
                        let expected = crate::input::ListObjectsV2Input {
  480    489   
                            bucket: "mybucket".to_owned(),
  481    490   
                            delimiter: ::std::option::Option::None,
  482    491   
                            encoding_type: ::std::option::Option::None,
  483    492   
                            max_keys: ::std::option::Option::None,
  484    493   
                            prefix: ::std::option::Option::None,
  485    494   
                            continuation_token: ::std::option::Option::None,
  486    495   
                            fetch_owner: ::std::option::Option::None,
  487    496   
                            start_after: ::std::option::Option::None,
  488    497   
                            request_payer: ::std::option::Option::None,
  489    498   
                            expected_bucket_owner: ::std::option::Option::None,
  490    499   
                        };
  491    500   
                        ::pretty_assertions::assert_eq!(input, expected);
  492    501   
                        let output = crate::output::ListObjectsV2Output {
  493    502   
                            is_truncated: ::std::option::Option::None,
  494    503   
                            contents: ::std::option::Option::None,
  495    504   
                            name: ::std::option::Option::None,
  496    505   
                            prefix: ::std::option::Option::None,
  497    506   
                            delimiter: ::std::option::Option::None,
  498    507   
                            max_keys: ::std::option::Option::None,
  499    508   
                            common_prefixes: ::std::option::Option::None,
  500    509   
                            encoding_type: ::std::option::Option::None,
  501    510   
                            key_count: ::std::option::Option::None,
  502    511   
                            continuation_token: ::std::option::Option::None,
  503    512   
                            next_continuation_token: ::std::option::Option::None,
  504    513   
                            start_after: ::std::option::Option::None,
  505    514   
                        };
  506    515   
                        Ok(output)
  507    516   
                    };
  508    517   
                    sender.send(()).await.expect("receiver dropped early");
  509    518   
                    result
  510    519   
                }
  511    520   
            })
  512    521   
            .build_unchecked();
  513    522   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  514    523   
            .await
  515    524   
            .expect("unable to make an HTTP request");
  516    525   
        assert!(
  517    526   
            receiver.recv().await.is_some(),
  518    527   
            "we expected operation handler to be invoked but it was not entered"
  519    528   
        );
  520    529   
    }
  521    530   
  522    531   
    /// S3 clients should support the explicit virtual host addressing style.
  523    532   
    /// Test ID: S3VirtualHostAddressing
  524    533   
    #[::tokio::test]
  525    534   
    #[::tracing_test::traced_test]
  526    535   
    #[should_panic]
  527    536   
    async fn s3_virtual_host_addressing_request() {
  528    537   
        #[allow(unused_mut)]
  529         -
        let mut http_request = http::Request::builder()
         538  +
        let mut http_request = ::http_1x::Request::builder()
  530    539   
            .uri("/")
  531    540   
            .method("GET")
  532         -
            .body(::aws_smithy_http_server::body::Body::from(
  533         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         541  +
            .body(::aws_smithy_http_server::body::boxed(
         542  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         543  +
                    &::aws_smithy_protocol_test::decode_body_data(
  534    544   
                        "".as_bytes(),
  535    545   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         546  +
                    ),
  536    547   
                )),
  537    548   
            ))
  538    549   
            .unwrap();
  539    550   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  540    551   
        todo!("endpoint trait not supported yet");
  541    552   
        #[allow(unused_mut)]
  542    553   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  543    554   
        let config = crate::service::AmazonS3Config::builder().build();
  544         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         555  +
        let service =
         556  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         557  +
                config,
         558  +
            )
  545    559   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  546    560   
                let sender = sender.clone();
  547    561   
                async move {
  548    562   
                    let result = {
  549    563   
                        let expected = crate::input::ListObjectsV2Input {
  550    564   
                            bucket: "mybucket".to_owned(),
  551    565   
                            delimiter: ::std::option::Option::None,
  552    566   
                            encoding_type: ::std::option::Option::None,
  553    567   
                            max_keys: ::std::option::Option::None,
  554    568   
                            prefix: ::std::option::Option::None,
  555    569   
                            continuation_token: ::std::option::Option::None,
  556    570   
                            fetch_owner: ::std::option::Option::None,
  557    571   
                            start_after: ::std::option::Option::None,
  558    572   
                            request_payer: ::std::option::Option::None,
  559    573   
                            expected_bucket_owner: ::std::option::Option::None,
  560    574   
                        };
  561    575   
                        ::pretty_assertions::assert_eq!(input, expected);
  562    576   
                        let output = crate::output::ListObjectsV2Output {
  563    577   
                            is_truncated: ::std::option::Option::None,
  564    578   
                            contents: ::std::option::Option::None,
  565    579   
                            name: ::std::option::Option::None,
  566    580   
                            prefix: ::std::option::Option::None,
  567    581   
                            delimiter: ::std::option::Option::None,
  568    582   
                            max_keys: ::std::option::Option::None,
  569    583   
                            common_prefixes: ::std::option::Option::None,
  570    584   
                            encoding_type: ::std::option::Option::None,
  571    585   
                            key_count: ::std::option::Option::None,
  572    586   
                            continuation_token: ::std::option::Option::None,
  573    587   
                            next_continuation_token: ::std::option::Option::None,
  574    588   
                            start_after: ::std::option::Option::None,
  575    589   
                        };
  576    590   
                        Ok(output)
  577    591   
                    };
  578    592   
                    sender.send(()).await.expect("receiver dropped early");
  579    593   
                    result
  580    594   
                }
  581    595   
            })
  582    596   
            .build_unchecked();
  583    597   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  584    598   
            .await
  585    599   
            .expect("unable to make an HTTP request");
  586    600   
        assert!(
  587    601   
            receiver.recv().await.is_some(),
  588    602   
            "we expected operation handler to be invoked but it was not entered"
  589    603   
        );
  590    604   
    }
  591    605   
  592    606   
    /// S3 clients should support the explicit path addressing style.
  593    607   
    /// Test ID: S3PathAddressing
  594    608   
    #[::tokio::test]
  595    609   
    #[::tracing_test::traced_test]
  596    610   
    #[should_panic]
  597    611   
    async fn s3_path_addressing_request() {
  598    612   
        #[allow(unused_mut)]
  599         -
        let mut http_request = http::Request::builder()
         613  +
        let mut http_request = ::http_1x::Request::builder()
  600    614   
            .uri("/mybucket")
  601    615   
            .method("GET")
  602         -
            .body(::aws_smithy_http_server::body::Body::from(
  603         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         616  +
            .body(::aws_smithy_http_server::body::boxed(
         617  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         618  +
                    &::aws_smithy_protocol_test::decode_body_data(
  604    619   
                        "".as_bytes(),
  605    620   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         621  +
                    ),
  606    622   
                )),
  607    623   
            ))
  608    624   
            .unwrap();
  609    625   
        *http_request.uri_mut() = "/mybucket?list-type=2".parse().unwrap();
  610    626   
        todo!("endpoint trait not supported yet");
  611    627   
        #[allow(unused_mut)]
  612    628   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  613    629   
        let config = crate::service::AmazonS3Config::builder().build();
  614         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         630  +
        let service =
         631  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         632  +
                config,
         633  +
            )
  615    634   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  616    635   
                let sender = sender.clone();
  617    636   
                async move {
  618    637   
                    let result = {
  619    638   
                        let expected = crate::input::ListObjectsV2Input {
  620    639   
                            bucket: "mybucket".to_owned(),
  621    640   
                            delimiter: ::std::option::Option::None,
  622    641   
                            encoding_type: ::std::option::Option::None,
  623    642   
                            max_keys: ::std::option::Option::None,
  624    643   
                            prefix: ::std::option::Option::None,
  625    644   
                            continuation_token: ::std::option::Option::None,
  626    645   
                            fetch_owner: ::std::option::Option::None,
  627    646   
                            start_after: ::std::option::Option::None,
  628    647   
                            request_payer: ::std::option::Option::None,
  629    648   
                            expected_bucket_owner: ::std::option::Option::None,
  630    649   
                        };
  631    650   
                        ::pretty_assertions::assert_eq!(input, expected);
  632    651   
                        let output = crate::output::ListObjectsV2Output {
  633    652   
                            is_truncated: ::std::option::Option::None,
  634    653   
                            contents: ::std::option::Option::None,
  635    654   
                            name: ::std::option::Option::None,
  636    655   
                            prefix: ::std::option::Option::None,
  637    656   
                            delimiter: ::std::option::Option::None,
  638    657   
                            max_keys: ::std::option::Option::None,
  639    658   
                            common_prefixes: ::std::option::Option::None,
  640    659   
                            encoding_type: ::std::option::Option::None,
  641    660   
                            key_count: ::std::option::Option::None,
  642    661   
                            continuation_token: ::std::option::Option::None,
  643    662   
                            next_continuation_token: ::std::option::Option::None,
  644    663   
                            start_after: ::std::option::Option::None,
  645    664   
                        };
  646    665   
                        Ok(output)
  647    666   
                    };
  648    667   
                    sender.send(()).await.expect("receiver dropped early");
  649    668   
                    result
  650    669   
                }
  651    670   
            })
  652    671   
            .build_unchecked();
  653    672   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  654    673   
            .await
  655    674   
            .expect("unable to make an HTTP request");
  656    675   
        assert!(
  657    676   
            receiver.recv().await.is_some(),
  658    677   
            "we expected operation handler to be invoked but it was not entered"
  659    678   
        );
  660    679   
    }
  661    680   
  662    681   
    /// S3 clients should support the explicit virtual host
  663    682   
    /// addressing style with Dualstack.
  664    683   
    /// Test ID: S3VirtualHostDualstackAddressing
  665    684   
    #[::tokio::test]
  666    685   
    #[::tracing_test::traced_test]
  667    686   
    #[should_panic]
  668    687   
    async fn s3_virtual_host_dualstack_addressing_request() {
  669    688   
        #[allow(unused_mut)]
  670         -
        let mut http_request = http::Request::builder()
         689  +
        let mut http_request = ::http_1x::Request::builder()
  671    690   
            .uri("/")
  672    691   
            .method("GET")
  673         -
            .body(::aws_smithy_http_server::body::Body::from(
  674         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         692  +
            .body(::aws_smithy_http_server::body::boxed(
         693  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         694  +
                    &::aws_smithy_protocol_test::decode_body_data(
  675    695   
                        "".as_bytes(),
  676    696   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         697  +
                    ),
  677    698   
                )),
  678    699   
            ))
  679    700   
            .unwrap();
  680    701   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  681    702   
        todo!("endpoint trait not supported yet");
  682    703   
        #[allow(unused_mut)]
  683    704   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  684    705   
        let config = crate::service::AmazonS3Config::builder().build();
  685         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         706  +
        let service =
         707  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         708  +
                config,
         709  +
            )
  686    710   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  687    711   
                let sender = sender.clone();
  688    712   
                async move {
  689    713   
                    let result = {
  690    714   
                        let expected = crate::input::ListObjectsV2Input {
  691    715   
                            bucket: "mybucket".to_owned(),
  692    716   
                            delimiter: ::std::option::Option::None,
  693    717   
                            encoding_type: ::std::option::Option::None,
  694    718   
                            max_keys: ::std::option::Option::None,
  695    719   
                            prefix: ::std::option::Option::None,
  696    720   
                            continuation_token: ::std::option::Option::None,
  697    721   
                            fetch_owner: ::std::option::Option::None,
  698    722   
                            start_after: ::std::option::Option::None,
  699    723   
                            request_payer: ::std::option::Option::None,
  700    724   
                            expected_bucket_owner: ::std::option::Option::None,
  701    725   
                        };
  702    726   
                        ::pretty_assertions::assert_eq!(input, expected);
  703    727   
                        let output = crate::output::ListObjectsV2Output {
  704    728   
                            is_truncated: ::std::option::Option::None,
  705    729   
                            contents: ::std::option::Option::None,
  706    730   
                            name: ::std::option::Option::None,
  707    731   
                            prefix: ::std::option::Option::None,
  708    732   
                            delimiter: ::std::option::Option::None,
  709    733   
                            max_keys: ::std::option::Option::None,
  710    734   
                            common_prefixes: ::std::option::Option::None,
  711    735   
                            encoding_type: ::std::option::Option::None,
  712    736   
                            key_count: ::std::option::Option::None,
  713    737   
                            continuation_token: ::std::option::Option::None,
  714    738   
                            next_continuation_token: ::std::option::Option::None,
  715    739   
                            start_after: ::std::option::Option::None,
  716    740   
                        };
  717    741   
                        Ok(output)
  718    742   
                    };
  719    743   
                    sender.send(()).await.expect("receiver dropped early");
  720    744   
                    result
  721    745   
                }
  722    746   
            })
  723    747   
            .build_unchecked();
  724    748   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  725    749   
            .await
  726    750   
            .expect("unable to make an HTTP request");
  727    751   
        assert!(
  728    752   
            receiver.recv().await.is_some(),
  729    753   
            "we expected operation handler to be invoked but it was not entered"
  730    754   
        );
  731    755   
    }
  732    756   
  733    757   
    /// S3 clients should support the explicit virtual host
  734    758   
    /// addressing style with S3 Accelerate.
  735    759   
    /// Test ID: S3VirtualHostAccelerateAddressing
  736    760   
    #[::tokio::test]
  737    761   
    #[::tracing_test::traced_test]
  738    762   
    #[should_panic]
  739    763   
    async fn s3_virtual_host_accelerate_addressing_request() {
  740    764   
        #[allow(unused_mut)]
  741         -
        let mut http_request = http::Request::builder()
         765  +
        let mut http_request = ::http_1x::Request::builder()
  742    766   
            .uri("/")
  743    767   
            .method("GET")
  744         -
            .body(::aws_smithy_http_server::body::Body::from(
  745         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         768  +
            .body(::aws_smithy_http_server::body::boxed(
         769  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         770  +
                    &::aws_smithy_protocol_test::decode_body_data(
  746    771   
                        "".as_bytes(),
  747    772   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         773  +
                    ),
  748    774   
                )),
  749    775   
            ))
  750    776   
            .unwrap();
  751    777   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  752    778   
        todo!("endpoint trait not supported yet");
  753    779   
        #[allow(unused_mut)]
  754    780   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  755    781   
        let config = crate::service::AmazonS3Config::builder().build();
  756         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         782  +
        let service =
         783  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         784  +
                config,
         785  +
            )
  757    786   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  758    787   
                let sender = sender.clone();
  759    788   
                async move {
  760    789   
                    let result = {
  761    790   
                        let expected = crate::input::ListObjectsV2Input {
  762    791   
                            bucket: "mybucket".to_owned(),
  763    792   
                            delimiter: ::std::option::Option::None,
  764    793   
                            encoding_type: ::std::option::Option::None,
  765    794   
                            max_keys: ::std::option::Option::None,
  766    795   
                            prefix: ::std::option::Option::None,
  767    796   
                            continuation_token: ::std::option::Option::None,
  768    797   
                            fetch_owner: ::std::option::Option::None,
  769    798   
                            start_after: ::std::option::Option::None,
  770    799   
                            request_payer: ::std::option::Option::None,
  771    800   
                            expected_bucket_owner: ::std::option::Option::None,
  772    801   
                        };
  773    802   
                        ::pretty_assertions::assert_eq!(input, expected);
  774    803   
                        let output = crate::output::ListObjectsV2Output {
  775    804   
                            is_truncated: ::std::option::Option::None,
  776    805   
                            contents: ::std::option::Option::None,
  777    806   
                            name: ::std::option::Option::None,
  778    807   
                            prefix: ::std::option::Option::None,
  779    808   
                            delimiter: ::std::option::Option::None,
  780    809   
                            max_keys: ::std::option::Option::None,
  781    810   
                            common_prefixes: ::std::option::Option::None,
  782    811   
                            encoding_type: ::std::option::Option::None,
  783    812   
                            key_count: ::std::option::Option::None,
  784    813   
                            continuation_token: ::std::option::Option::None,
  785    814   
                            next_continuation_token: ::std::option::Option::None,
  786    815   
                            start_after: ::std::option::Option::None,
  787    816   
                        };
  788    817   
                        Ok(output)
  789    818   
                    };
  790    819   
                    sender.send(()).await.expect("receiver dropped early");
  791    820   
                    result
  792    821   
                }
  793    822   
            })
  794    823   
            .build_unchecked();
  795    824   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  796    825   
            .await
  797    826   
            .expect("unable to make an HTTP request");
  798    827   
        assert!(
  799    828   
            receiver.recv().await.is_some(),
  800    829   
            "we expected operation handler to be invoked but it was not entered"
  801    830   
        );
  802    831   
    }
  803    832   
  804    833   
    /// S3 clients should support the explicit virtual host
  805    834   
    /// addressing style with Dualstack and S3 Accelerate.
  806    835   
    /// Test ID: S3VirtualHostDualstackAccelerateAddressing
  807    836   
    #[::tokio::test]
  808    837   
    #[::tracing_test::traced_test]
  809    838   
    #[should_panic]
  810    839   
    async fn s3_virtual_host_dualstack_accelerate_addressing_request() {
  811    840   
        #[allow(unused_mut)]
  812         -
        let mut http_request = http::Request::builder()
         841  +
        let mut http_request = ::http_1x::Request::builder()
  813    842   
            .uri("/")
  814    843   
            .method("GET")
  815         -
            .body(::aws_smithy_http_server::body::Body::from(
  816         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         844  +
            .body(::aws_smithy_http_server::body::boxed(
         845  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         846  +
                    &::aws_smithy_protocol_test::decode_body_data(
  817    847   
                        "".as_bytes(),
  818    848   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         849  +
                    ),
  819    850   
                )),
  820    851   
            ))
  821    852   
            .unwrap();
  822    853   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  823    854   
        todo!("endpoint trait not supported yet");
  824    855   
        #[allow(unused_mut)]
  825    856   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  826    857   
        let config = crate::service::AmazonS3Config::builder().build();
  827         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         858  +
        let service =
         859  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         860  +
                config,
         861  +
            )
  828    862   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  829    863   
                let sender = sender.clone();
  830    864   
                async move {
  831    865   
                    let result = {
  832    866   
                        let expected = crate::input::ListObjectsV2Input {
  833    867   
                            bucket: "mybucket".to_owned(),
  834    868   
                            delimiter: ::std::option::Option::None,
  835    869   
                            encoding_type: ::std::option::Option::None,
  836    870   
                            max_keys: ::std::option::Option::None,
  837    871   
                            prefix: ::std::option::Option::None,
  838    872   
                            continuation_token: ::std::option::Option::None,
  839    873   
                            fetch_owner: ::std::option::Option::None,
  840    874   
                            start_after: ::std::option::Option::None,
  841    875   
                            request_payer: ::std::option::Option::None,
  842    876   
                            expected_bucket_owner: ::std::option::Option::None,
  843    877   
                        };
  844    878   
                        ::pretty_assertions::assert_eq!(input, expected);
  845    879   
                        let output = crate::output::ListObjectsV2Output {
  846    880   
                            is_truncated: ::std::option::Option::None,
  847    881   
                            contents: ::std::option::Option::None,
  848    882   
                            name: ::std::option::Option::None,
  849    883   
                            prefix: ::std::option::Option::None,
  850    884   
                            delimiter: ::std::option::Option::None,
  851    885   
                            max_keys: ::std::option::Option::None,
  852    886   
                            common_prefixes: ::std::option::Option::None,
  853    887   
                            encoding_type: ::std::option::Option::None,
  854    888   
                            key_count: ::std::option::Option::None,
  855    889   
                            continuation_token: ::std::option::Option::None,
  856    890   
                            next_continuation_token: ::std::option::Option::None,
  857    891   
                            start_after: ::std::option::Option::None,
  858    892   
                        };
  859    893   
                        Ok(output)
  860    894   
                    };
  861    895   
                    sender.send(()).await.expect("receiver dropped early");
  862    896   
                    result
  863    897   
                }
  864    898   
            })
  865    899   
            .build_unchecked();
  866    900   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  867    901   
            .await
  868    902   
            .expect("unable to make an HTTP request");
  869    903   
        assert!(
  870    904   
            receiver.recv().await.is_some(),
  871    905   
            "we expected operation handler to be invoked but it was not entered"
  872    906   
        );
  873    907   
    }
  874    908   
  875    909   
    /// S3 clients should resolve to the addressing style of the
  876    910   
    /// operation if defined on both the client and operation.
  877    911   
    /// Test ID: S3OperationAddressingPreferred
  878    912   
    #[::tokio::test]
  879    913   
    #[::tracing_test::traced_test]
  880    914   
    #[should_panic]
  881    915   
    async fn s3_operation_addressing_preferred_request() {
  882    916   
        #[allow(unused_mut)]
  883         -
        let mut http_request = http::Request::builder()
         917  +
        let mut http_request = ::http_1x::Request::builder()
  884    918   
            .uri("/")
  885    919   
            .method("GET")
  886         -
            .body(::aws_smithy_http_server::body::Body::from(
  887         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         920  +
            .body(::aws_smithy_http_server::body::boxed(
         921  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         922  +
                    &::aws_smithy_protocol_test::decode_body_data(
  888    923   
                        "".as_bytes(),
  889    924   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         925  +
                    ),
  890    926   
                )),
  891    927   
            ))
  892    928   
            .unwrap();
  893    929   
        *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
  894    930   
        todo!("endpoint trait not supported yet");
  895    931   
        #[allow(unused_mut)]
  896    932   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  897    933   
        let config = crate::service::AmazonS3Config::builder().build();
  898         -
        let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
         934  +
        let service =
         935  +
            crate::service::AmazonS3::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         936  +
                config,
         937  +
            )
  899    938   
            .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
  900    939   
                let sender = sender.clone();
  901    940   
                async move {
  902    941   
                    let result = {
  903    942   
                        let expected = crate::input::ListObjectsV2Input {
  904    943   
                            bucket: "mybucket".to_owned(),
  905    944   
                            delimiter: ::std::option::Option::None,
  906    945   
                            encoding_type: ::std::option::Option::None,
  907    946   
                            max_keys: ::std::option::Option::None,
  908    947   
                            prefix: ::std::option::Option::None,
  909    948   
                            continuation_token: ::std::option::Option::None,
  910    949   
                            fetch_owner: ::std::option::Option::None,
  911    950   
                            start_after: ::std::option::Option::None,
  912    951   
                            request_payer: ::std::option::Option::None,
  913    952   
                            expected_bucket_owner: ::std::option::Option::None,
  914    953   
                        };
  915    954   
                        ::pretty_assertions::assert_eq!(input, expected);
  916    955   
                        let output = crate::output::ListObjectsV2Output {
  917    956   
                            is_truncated: ::std::option::Option::None,
  918    957   
                            contents: ::std::option::Option::None,
  919    958   
                            name: ::std::option::Option::None,
  920    959   
                            prefix: ::std::option::Option::None,
  921    960   
                            delimiter: ::std::option::Option::None,
  922    961   
                            max_keys: ::std::option::Option::None,
  923    962   
                            common_prefixes: ::std::option::Option::None,
  924    963   
                            encoding_type: ::std::option::Option::None,
  925    964   
                            key_count: ::std::option::Option::None,
  926    965   
                            continuation_token: ::std::option::Option::None,
  927    966   
                            next_continuation_token: ::std::option::Option::None,
  928    967   
                            start_after: ::std::option::Option::None,
  929    968   
                        };
  930    969   
                        Ok(output)
  931    970   
                    };
  932    971   
                    sender.send(()).await.expect("receiver dropped early");
  933    972   
                    result
  934    973   
                }
  935    974   
            })
  936    975   
            .build_unchecked();
  937    976   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  938    977   
            .await
  939    978   
            .expect("unable to make an HTTP request");
  940    979   
        assert!(
  941    980   
            receiver.recv().await.is_some(),
  942    981   
            "we expected operation handler to be invoked but it was not entered"
  943    982   
        );
  944    983   
    }
  945    984   
  946    985   
    /// S3 operations return Error XML nodes unwrapped by
  947    986   
    /// the ErrorResponse XML node.
  948    987   
    ///
  949    988   
    /// Test ID: S3OperationNoErrorWrappingResponse
  950    989   
    #[::tokio::test]
  951    990   
    #[::tracing_test::traced_test]
  952    991   
    #[should_panic]
  953    992   
    async fn s3_operation_no_error_wrapping_response_response() {
  954    993   
        let output = crate::error::NoSuchBucket {};
  955    994   
        let output = crate::error::ListObjectsV2Error::NoSuchBucket(output);
  956    995   
        use ::aws_smithy_http_server::response::IntoResponse;
  957    996   
        let http_response = output.into_response();
  958    997   
        ::pretty_assertions::assert_eq!(
  959         -
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
         998  +
            ::http_1x::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
  960    999   
            http_response.status()
  961   1000   
        );
  962   1001   
        let expected_headers = [("Content-Type", "application/xml")];
  963   1002   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  964   1003   
            http_response.headers(),
  965   1004   
            expected_headers,
  966   1005   
        ));
  967         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1006  +
        use ::http_body_util::BodyExt;
        1007  +
        let body = http_response
        1008  +
            .into_body()
        1009  +
            .collect()
  968   1010   
            .await
  969         -
            .expect("unable to extract body to bytes");
        1011  +
            .expect("unable to collect body")
        1012  +
            .to_bytes();
  970   1013   
        ::aws_smithy_protocol_test::assert_ok(
  971   1014   
        ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>\n\t<Type>Sender</Type>\n\t<Code>NoSuchBucket</Code>\n</Error>", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  972   1015   
        );
  973   1016   
    }
  974   1017   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_delete_object_tagging.rs

@@ -1,1 +34,34 @@
    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_delete_object_tagging_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::DeleteObjectTaggingInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -39,39 +137,139 @@
   59     59   
   60     60   
#[allow(clippy::unnecessary_wraps)]
   61     61   
pub fn ser_delete_object_tagging_http_response(
   62     62   
    #[allow(unused_variables)] output: crate::output::DeleteObjectTaggingOutput,
   63     63   
) -> std::result::Result<
   64     64   
    ::aws_smithy_http_server::response::Response,
   65     65   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   66     66   
> {
   67     67   
    Ok({
   68     68   
        #[allow(unused_mut)]
   69         -
        let mut builder = ::http::Response::builder();
          69  +
        let mut builder = ::http_1x::Response::builder();
   70     70   
        builder =
   71     71   
            crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_headers(
   72     72   
                &output, builder,
   73     73   
            )?;
   74     74   
        let http_status: u16 = 204;
   75     75   
        builder = builder.status(http_status);
   76     76   
        let payload = "";
   77     77   
        let content_length = payload.len();
   78     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     79   
            builder,
   80         -
            ::http::header::CONTENT_LENGTH,
          80  +
            ::http_1x::header::CONTENT_LENGTH,
   81     81   
            content_length,
   82     82   
        );
   83     83   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   84     84   
        builder.body(body)?
   85     85   
    })
   86     86   
}
   87     87   
   88     88   
#[allow(clippy::unnecessary_wraps)]
   89     89   
pub fn ser_delete_object_tagging_http_error(
   90     90   
    error: &crate::error::DeleteObjectTaggingError,
   91     91   
) -> std::result::Result<
   92     92   
    ::aws_smithy_http_server::response::Response,
   93     93   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   94     94   
> {
   95     95   
    Ok({
   96     96   
        match error {
   97     97   
            crate::error::DeleteObjectTaggingError::ValidationException(output) => {
   98     98   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   99     99   
                #[allow(unused_mut)]
  100         -
                let mut builder = ::http::Response::builder();
         100  +
                let mut builder = ::http_1x::Response::builder();
  101    101   
                let content_length = payload.len();
  102    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    103   
                    builder,
  104         -
                    ::http::header::CONTENT_LENGTH,
         104  +
                    ::http_1x::header::CONTENT_LENGTH,
  105    105   
                    content_length,
  106    106   
                );
  107    107   
                builder
  108    108   
                    .status(400)
  109    109   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  110    110   
            }
  111    111   
        }
  112    112   
    })
  113    113   
}
  114    114   
  115    115   
pub fn ser_delete_object_tagging_headers(
  116    116   
    input: &crate::output::DeleteObjectTaggingOutput,
  117         -
    mut builder: ::http::response::Builder,
  118         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  119         -
{
         117  +
    mut builder: ::http_1x::response::Builder,
         118  +
) -> std::result::Result<
         119  +
    ::http_1x::response::Builder,
         120  +
    ::aws_smithy_types::error::operation::BuildError,
         121  +
> {
  120    122   
    if let ::std::option::Option::Some(inner_1) = &input.version_id {
  121    123   
        let formatted_2 = inner_1.as_str();
  122    124   
        if !formatted_2.is_empty() {
  123    125   
            let header_value = formatted_2;
  124         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         126  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  125    127   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  126    128   
                    "version_id",
  127    129   
                    format!(
  128    130   
                        "`{}` cannot be used as a header value: {}",
  129    131   
                        &header_value, err
  130    132   
                    ),
  131    133   
                )
  132    134   
            })?;
  133    135   
            builder = builder.header("x-amz-version-id", header_value);
  134    136   
        }

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_bucket_location.rs

@@ -1,1 +114,114 @@
    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_get_bucket_location_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::GetBucketLocationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::get_bucket_location_input::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 input_string = uri.path();
   23     23   
        let (input_string, m0) = ::nom::sequence::preceded(
   24     24   
            ::nom::bytes::complete::tag("/"),
   25     25   
            ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   26     26   
                ::nom::bytes::complete::take_until("/"),
   27     27   
                ::nom::combinator::rest,
   28     28   
            )),
   29     29   
        )(input_string)?;
   30     30   
        debug_assert_eq!("", input_string);
   31     31   
        input = input
   32     32   
            .set_bucket(crate::protocol_serde::shape_get_bucket_location_input::de_bucket(m0)?);
   33     33   
        input.build()?
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
#[allow(clippy::unnecessary_wraps)]
   38     38   
pub fn ser_get_bucket_location_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::GetBucketLocationOutput,
   40     40   
) -> std::result::Result<
   41     41   
    ::aws_smithy_http_server::response::Response,
   42     42   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   50     50   
            "application/xml",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_output(
   56     56   
                &output,
   57     57   
            )?;
   58     58   
        let content_length = payload.len();
   59     59   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     60   
            builder,
   61         -
            ::http::header::CONTENT_LENGTH,
          61  +
            ::http_1x::header::CONTENT_LENGTH,
   62     62   
            content_length,
   63     63   
        );
   64     64   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   65     65   
        builder.body(body)?
   66     66   
    })
   67     67   
}
   68     68   
   69     69   
#[allow(clippy::unnecessary_wraps)]
   70     70   
pub fn ser_get_bucket_location_http_error(
   71     71   
    error: &crate::error::GetBucketLocationError,
   72     72   
) -> std::result::Result<
   73     73   
    ::aws_smithy_http_server::response::Response,
   74     74   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   75     75   
> {
   76     76   
    Ok({
   77     77   
        match error {
   78     78   
            crate::error::GetBucketLocationError::ValidationException(output) => {
   79     79   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81         -
                let mut builder = ::http::Response::builder();
          81  +
                let mut builder = ::http_1x::Response::builder();
   82     82   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84         -
                    ::http::header::CONTENT_TYPE,
          84  +
                    ::http_1x::header::CONTENT_TYPE,
   85     85   
                    "application/xml",
   86     86   
                );
   87     87   
                let content_length = payload.len();
   88     88   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90         -
                    ::http::header::CONTENT_LENGTH,
          90  +
                    ::http_1x::header::CONTENT_LENGTH,
   91     91   
                    content_length,
   92     92   
                );
   93     93   
                builder
   94     94   
                    .status(400)
   95     95   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   96     96   
            }
   97     97   
        }
   98     98   
    })
   99     99   
}
  100    100   

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_object.rs

@@ -1,1 +95,95 @@
    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_get_object_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::GetObjectInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::get_object_input::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 input_string = uri.path();
   23     23   
        let (input_string, (m0, m1)) =
   24     24   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     25   
                ::nom::sequence::preceded(
   26     26   
                    ::nom::bytes::complete::tag("/"),
   27     27   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   28     28   
                        ::nom::bytes::complete::take_until("/"),
   29     29   
                        ::nom::combinator::rest,
   30     30   
                    )),
   31     31   
                ),
   32     32   
                ::nom::sequence::preceded(
   33     33   
                    ::nom::bytes::complete::tag("/"),
   34     34   
                    ::nom::combinator::rest::<_, ::nom::error::Error<&str>>,
   35     35   
                ),
   36     36   
            ))(input_string)?;
   37     37   
        debug_assert_eq!("", input_string);
   38     38   
        input = input.set_bucket(crate::protocol_serde::shape_get_object_input::de_bucket(
   39     39   
            m0,
   40     40   
        )?);
   41     41   
        input = input.set_key(crate::protocol_serde::shape_get_object_input::de_key(m1)?);
   42     42   
        input.build()?
   43     43   
    })
   44     44   
}
   45     45   
   46     46   
#[allow(clippy::unnecessary_wraps)]
   47     47   
pub fn ser_get_object_http_response(
   48     48   
    #[allow(unused_variables)] output: crate::output::GetObjectOutput,
   49     49   
) -> std::result::Result<
   50     50   
    ::aws_smithy_http_server::response::Response,
   51     51   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   52     52   
> {
   53     53   
    Ok({
   54     54   
        #[allow(unused_mut)]
   55         -
        let mut builder = ::http::Response::builder();
          55  +
        let mut builder = ::http_1x::Response::builder();
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload = "";
   59     59   
        let content_length = payload.len();
   60     60   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     61   
            builder,
   62         -
            ::http::header::CONTENT_LENGTH,
          62  +
            ::http_1x::header::CONTENT_LENGTH,
   63     63   
            content_length,
   64     64   
        );
   65     65   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   66     66   
        builder.body(body)?
   67     67   
    })
   68     68   
}
   69     69   
   70     70   
#[allow(clippy::unnecessary_wraps)]
   71     71   
pub fn ser_get_object_http_error(
   72     72   
    error: &crate::error::GetObjectError,
   73     73   
) -> std::result::Result<
   74     74   
    ::aws_smithy_http_server::response::Response,
   75     75   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   76     76   
> {
   77     77   
    Ok({
   78     78   
        match error {
   79     79   
            crate::error::GetObjectError::ValidationException(output) => {
   80     80   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   81     81   
                #[allow(unused_mut)]
   82         -
                let mut builder = ::http::Response::builder();
          82  +
                let mut builder = ::http_1x::Response::builder();
   83     83   
                let content_length = payload.len();
   84     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86         -
                    ::http::header::CONTENT_LENGTH,
          86  +
                    ::http_1x::header::CONTENT_LENGTH,
   87     87   
                    content_length,
   88     88   
                );
   89     89   
                builder
   90     90   
                    .status(400)
   91     91   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   92     92   
            }
   93     93   
        }
   94     94   
    })
   95     95   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_list_objects_v2.rs

@@ -1,1 +34,34 @@
    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_list_objects_v2_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ListObjectsV2Input,
    7      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -80,80 +198,198 @@
  100    100   
  101    101   
#[allow(clippy::unnecessary_wraps)]
  102    102   
pub fn ser_list_objects_v2_http_response(
  103    103   
    #[allow(unused_variables)] output: crate::output::ListObjectsV2Output,
  104    104   
) -> std::result::Result<
  105    105   
    ::aws_smithy_http_server::response::Response,
  106    106   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
  107    107   
> {
  108    108   
    Ok({
  109    109   
        #[allow(unused_mut)]
  110         -
        let mut builder = ::http::Response::builder();
         110  +
        let mut builder = ::http_1x::Response::builder();
  111    111   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    112   
            builder,
  113         -
            ::http::header::CONTENT_TYPE,
         113  +
            ::http_1x::header::CONTENT_TYPE,
  114    114   
            "application/xml",
  115    115   
        );
  116    116   
        let http_status: u16 = 200;
  117    117   
        builder = builder.status(http_status);
  118    118   
        let payload =
  119    119   
            crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?;
  120    120   
        let content_length = payload.len();
  121    121   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  122    122   
            builder,
  123         -
            ::http::header::CONTENT_LENGTH,
         123  +
            ::http_1x::header::CONTENT_LENGTH,
  124    124   
            content_length,
  125    125   
        );
  126    126   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
  127    127   
        builder.body(body)?
  128    128   
    })
  129    129   
}
  130    130   
  131    131   
#[allow(clippy::unnecessary_wraps)]
  132    132   
pub fn ser_list_objects_v2_http_error(
  133    133   
    error: &crate::error::ListObjectsV2Error,
  134    134   
) -> std::result::Result<
  135    135   
    ::aws_smithy_http_server::response::Response,
  136    136   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
  137    137   
> {
  138    138   
    Ok({
  139    139   
        match error {
  140    140   
            crate::error::ListObjectsV2Error::NoSuchBucket(output) => {
  141    141   
                let payload =
  142    142   
                    crate::protocol_serde::shape_no_such_bucket::ser_no_such_bucket_error(output)?;
  143    143   
                #[allow(unused_mut)]
  144         -
                let mut builder = ::http::Response::builder();
         144  +
                let mut builder = ::http_1x::Response::builder();
  145    145   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  146    146   
                    builder,
  147         -
                    ::http::header::CONTENT_TYPE,
         147  +
                    ::http_1x::header::CONTENT_TYPE,
  148    148   
                    "application/xml",
  149    149   
                );
  150    150   
                let content_length = payload.len();
  151    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  152    152   
                    builder,
  153         -
                    ::http::header::CONTENT_LENGTH,
         153  +
                    ::http_1x::header::CONTENT_LENGTH,
  154    154   
                    content_length,
  155    155   
                );
  156    156   
                builder
  157    157   
                    .status(400)
  158    158   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  159    159   
            }
  160    160   
            crate::error::ListObjectsV2Error::ValidationException(output) => {
  161    161   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  162    162   
                #[allow(unused_mut)]
  163         -
                let mut builder = ::http::Response::builder();
         163  +
                let mut builder = ::http_1x::Response::builder();
  164    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  165    165   
                    builder,
  166         -
                    ::http::header::CONTENT_TYPE,
         166  +
                    ::http_1x::header::CONTENT_TYPE,
  167    167   
                    "application/xml",
  168    168   
                );
  169    169   
                let content_length = payload.len();
  170    170   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  171    171   
                    builder,
  172         -
                    ::http::header::CONTENT_LENGTH,
         172  +
                    ::http_1x::header::CONTENT_LENGTH,
  173    173   
                    content_length,
  174    174   
                );
  175    175   
                builder
  176    176   
                    .status(400)
  177    177   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  178    178   
            }
  179    179   
        }
  180    180   
    })
  181    181   
}
  182    182   

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

@@ -38,38 +99,99 @@
   58     58   
                            <
   59     59   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   60     60   
                                as ::aws_smithy_http_server::plugin::Plugin<
   61     61   
                                    AmazonS3<L>,
   62     62   
                                    crate::operation_shape::DeleteObjectTagging,
   63     63   
                                    ModelPl::Output
   64     64   
                                >
   65     65   
                            >::Output
   66     66   
                        >,
   67     67   
   68         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   69         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          68  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          69  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   70     70   
   71     71   
                    {
   72     72   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   73     73   
        use ::aws_smithy_http_server::plugin::Plugin;
   74     74   
        let svc = crate::operation_shape::DeleteObjectTagging::from_handler(handler);
   75     75   
        let svc = self.model_plugin.apply(svc);
   76     76   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   77     77   
            .apply(svc);
   78     78   
        let svc = self.http_plugin.apply(svc);
   79     79   
        self.delete_object_tagging_custom(svc)
@@ -105,105 +185,185 @@
  125    125   
                            <
  126    126   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  127    127   
                                as ::aws_smithy_http_server::plugin::Plugin<
  128    128   
                                    AmazonS3<L>,
  129    129   
                                    crate::operation_shape::DeleteObjectTagging,
  130    130   
                                    ModelPl::Output
  131    131   
                                >
  132    132   
                            >::Output
  133    133   
                        >,
  134    134   
  135         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  136         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         135  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         136  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  137    137   
  138    138   
                    {
  139    139   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  140    140   
        use ::aws_smithy_http_server::plugin::Plugin;
  141    141   
        let svc = crate::operation_shape::DeleteObjectTagging::from_service(service);
  142    142   
        let svc = self.model_plugin.apply(svc);
  143    143   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  144    144   
            .apply(svc);
  145    145   
        let svc = self.http_plugin.apply(svc);
  146    146   
        self.delete_object_tagging_custom(svc)
  147    147   
    }
  148    148   
  149    149   
    /// Sets the [`DeleteObjectTagging`](crate::operation_shape::DeleteObjectTagging) to a custom [`Service`](tower::Service).
  150    150   
    /// not constrained by the Smithy contract.
  151    151   
    fn delete_object_tagging_custom<S>(mut self, svc: S) -> Self
  152    152   
    where
  153    153   
        S: ::tower::Service<
  154         -
                ::http::Request<Body>,
  155         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         154  +
                ::http_1x::Request<Body>,
         155  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  156    156   
                Error = ::std::convert::Infallible,
  157    157   
            > + Clone
  158    158   
            + Send
  159    159   
            + 'static,
  160    160   
        S::Future: Send + 'static,
  161    161   
    {
  162    162   
        self.delete_object_tagging = Some(::aws_smithy_http_server::routing::Route::new(svc));
  163    163   
        self
  164    164   
    }
  165    165   
@@ -188,188 +249,249 @@
  208    208   
                            <
  209    209   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  210    210   
                                as ::aws_smithy_http_server::plugin::Plugin<
  211    211   
                                    AmazonS3<L>,
  212    212   
                                    crate::operation_shape::GetBucketLocation,
  213    213   
                                    ModelPl::Output
  214    214   
                                >
  215    215   
                            >::Output
  216    216   
                        >,
  217    217   
  218         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  219         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         218  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         219  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  220    220   
  221    221   
                    {
  222    222   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  223    223   
        use ::aws_smithy_http_server::plugin::Plugin;
  224    224   
        let svc = crate::operation_shape::GetBucketLocation::from_handler(handler);
  225    225   
        let svc = self.model_plugin.apply(svc);
  226    226   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  227    227   
            .apply(svc);
  228    228   
        let svc = self.http_plugin.apply(svc);
  229    229   
        self.get_bucket_location_custom(svc)
@@ -255,255 +335,335 @@
  275    275   
                            <
  276    276   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  277    277   
                                as ::aws_smithy_http_server::plugin::Plugin<
  278    278   
                                    AmazonS3<L>,
  279    279   
                                    crate::operation_shape::GetBucketLocation,
  280    280   
                                    ModelPl::Output
  281    281   
                                >
  282    282   
                            >::Output
  283    283   
                        >,
  284    284   
  285         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  286         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         285  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         286  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  287    287   
  288    288   
                    {
  289    289   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  290    290   
        use ::aws_smithy_http_server::plugin::Plugin;
  291    291   
        let svc = crate::operation_shape::GetBucketLocation::from_service(service);
  292    292   
        let svc = self.model_plugin.apply(svc);
  293    293   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  294    294   
            .apply(svc);
  295    295   
        let svc = self.http_plugin.apply(svc);
  296    296   
        self.get_bucket_location_custom(svc)
  297    297   
    }
  298    298   
  299    299   
    /// Sets the [`GetBucketLocation`](crate::operation_shape::GetBucketLocation) to a custom [`Service`](tower::Service).
  300    300   
    /// not constrained by the Smithy contract.
  301    301   
    fn get_bucket_location_custom<S>(mut self, svc: S) -> Self
  302    302   
    where
  303    303   
        S: ::tower::Service<
  304         -
                ::http::Request<Body>,
  305         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         304  +
                ::http_1x::Request<Body>,
         305  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  306    306   
                Error = ::std::convert::Infallible,
  307    307   
            > + Clone
  308    308   
            + Send
  309    309   
            + 'static,
  310    310   
        S::Future: Send + 'static,
  311    311   
    {
  312    312   
        self.get_bucket_location = Some(::aws_smithy_http_server::routing::Route::new(svc));
  313    313   
        self
  314    314   
    }
  315    315   
@@ -338,338 +399,399 @@
  358    358   
                            <
  359    359   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  360    360   
                                as ::aws_smithy_http_server::plugin::Plugin<
  361    361   
                                    AmazonS3<L>,
  362    362   
                                    crate::operation_shape::GetObject,
  363    363   
                                    ModelPl::Output
  364    364   
                                >
  365    365   
                            >::Output
  366    366   
                        >,
  367    367   
  368         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  369         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         368  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         369  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  370    370   
  371    371   
                    {
  372    372   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  373    373   
        use ::aws_smithy_http_server::plugin::Plugin;
  374    374   
        let svc = crate::operation_shape::GetObject::from_handler(handler);
  375    375   
        let svc = self.model_plugin.apply(svc);
  376    376   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  377    377   
            .apply(svc);
  378    378   
        let svc = self.http_plugin.apply(svc);
  379    379   
        self.get_object_custom(svc)
@@ -405,405 +485,485 @@
  425    425   
                            <
  426    426   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  427    427   
                                as ::aws_smithy_http_server::plugin::Plugin<
  428    428   
                                    AmazonS3<L>,
  429    429   
                                    crate::operation_shape::GetObject,
  430    430   
                                    ModelPl::Output
  431    431   
                                >
  432    432   
                            >::Output
  433    433   
                        >,
  434    434   
  435         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  436         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         435  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         436  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  437    437   
  438    438   
                    {
  439    439   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  440    440   
        use ::aws_smithy_http_server::plugin::Plugin;
  441    441   
        let svc = crate::operation_shape::GetObject::from_service(service);
  442    442   
        let svc = self.model_plugin.apply(svc);
  443    443   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  444    444   
            .apply(svc);
  445    445   
        let svc = self.http_plugin.apply(svc);
  446    446   
        self.get_object_custom(svc)
  447    447   
    }
  448    448   
  449    449   
    /// Sets the [`GetObject`](crate::operation_shape::GetObject) to a custom [`Service`](tower::Service).
  450    450   
    /// not constrained by the Smithy contract.
  451    451   
    fn get_object_custom<S>(mut self, svc: S) -> Self
  452    452   
    where
  453    453   
        S: ::tower::Service<
  454         -
                ::http::Request<Body>,
  455         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         454  +
                ::http_1x::Request<Body>,
         455  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  456    456   
                Error = ::std::convert::Infallible,
  457    457   
            > + Clone
  458    458   
            + Send
  459    459   
            + 'static,
  460    460   
        S::Future: Send + 'static,
  461    461   
    {
  462    462   
        self.get_object = Some(::aws_smithy_http_server::routing::Route::new(svc));
  463    463   
        self
  464    464   
    }
  465    465   
@@ -488,488 +549,549 @@
  508    508   
                            <
  509    509   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  510    510   
                                as ::aws_smithy_http_server::plugin::Plugin<
  511    511   
                                    AmazonS3<L>,
  512    512   
                                    crate::operation_shape::ListObjectsV2,
  513    513   
                                    ModelPl::Output
  514    514   
                                >
  515    515   
                            >::Output
  516    516   
                        >,
  517    517   
  518         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  519         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         518  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         519  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  520    520   
  521    521   
                    {
  522    522   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  523    523   
        use ::aws_smithy_http_server::plugin::Plugin;
  524    524   
        let svc = crate::operation_shape::ListObjectsV2::from_handler(handler);
  525    525   
        let svc = self.model_plugin.apply(svc);
  526    526   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  527    527   
            .apply(svc);
  528    528   
        let svc = self.http_plugin.apply(svc);
  529    529   
        self.list_objects_v2_custom(svc)
@@ -555,555 +635,635 @@
  575    575   
                            <
  576    576   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  577    577   
                                as ::aws_smithy_http_server::plugin::Plugin<
  578    578   
                                    AmazonS3<L>,
  579    579   
                                    crate::operation_shape::ListObjectsV2,
  580    580   
                                    ModelPl::Output
  581    581   
                                >
  582    582   
                            >::Output
  583    583   
                        >,
  584    584   
  585         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  586         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         585  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         586  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  587    587   
  588    588   
                    {
  589    589   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  590    590   
        use ::aws_smithy_http_server::plugin::Plugin;
  591    591   
        let svc = crate::operation_shape::ListObjectsV2::from_service(service);
  592    592   
        let svc = self.model_plugin.apply(svc);
  593    593   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  594    594   
            .apply(svc);
  595    595   
        let svc = self.http_plugin.apply(svc);
  596    596   
        self.list_objects_v2_custom(svc)
  597    597   
    }
  598    598   
  599    599   
    /// Sets the [`ListObjectsV2`](crate::operation_shape::ListObjectsV2) to a custom [`Service`](tower::Service).
  600    600   
    /// not constrained by the Smithy contract.
  601    601   
    fn list_objects_v2_custom<S>(mut self, svc: S) -> Self
  602    602   
    where
  603    603   
        S: ::tower::Service<
  604         -
                ::http::Request<Body>,
  605         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         604  +
                ::http_1x::Request<Body>,
         605  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  606    606   
                Error = ::std::convert::Infallible,
  607    607   
            > + Clone
  608    608   
            + Send
  609    609   
            + 'static,
  610    610   
        S::Future: Send + 'static,
  611    611   
    {
  612    612   
        self.list_objects_v2 = Some(::aws_smithy_http_server::routing::Route::new(svc));
  613    613   
        self
  614    614   
    }
  615    615   
}
@@ -764,764 +872,872 @@
  784    784   
        Ok(())
  785    785   
    }
  786    786   
}
  787    787   
  788    788   
impl std::error::Error for MissingOperationsError {}
  789    789   
  790    790   
mod request_specs {
  791    791   
    pub(super) fn delete_object_tagging(
  792    792   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
  793    793   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
  794         -
                    ::http::Method::DELETE,
         794  +
                    ::http_1x::Method::DELETE,
  795    795   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
  796    796   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
  797    797   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
  798    798   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
  799    799   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Greedy,
  800    800   
]),
  801    801   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
  802    802   
    ::aws_smithy_http_server::routing::request_spec::QuerySegment::Key(String::from("tagging")),
  803    803   
])
  804    804   
                        )
  805    805   
                    ),
  806    806   
                )
  807    807   
    }
  808    808   
    pub(super) fn get_bucket_location(
  809    809   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
  810    810   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
  811         -
                    ::http::Method::GET,
         811  +
                    ::http_1x::Method::GET,
  812    812   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
  813    813   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
  814    814   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
  815    815   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
  816    816   
]),
  817    817   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
  818    818   
    ::aws_smithy_http_server::routing::request_spec::QuerySegment::Key(String::from("location")),
  819    819   
])
  820    820   
                        )
  821    821   
                    ),
  822    822   
                )
  823    823   
    }
  824    824   
    pub(super) fn get_object() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
  825    825   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
  826         -
                    ::http::Method::GET,
         826  +
                    ::http_1x::Method::GET,
  827    827   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
  828    828   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
  829    829   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
  830    830   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
  831    831   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Greedy,
  832    832   
]),
  833    833   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
  834    834   
])
  835    835   
                        )
  836    836   
                    ),
  837    837   
                )
  838    838   
    }
  839    839   
    pub(super) fn list_objects_v2() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec
  840    840   
    {
  841    841   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
  842         -
                    ::http::Method::GET,
         842  +
                    ::http_1x::Method::GET,
  843    843   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
  844    844   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
  845    845   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
  846    846   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
  847    847   
]),
  848    848   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
  849    849   
    ::aws_smithy_http_server::routing::request_spec::QuerySegment::KeyValue(String::from("list-type"), String::from("2")),
  850    850   
])
  851    851   
                        )
  852    852   
                    ),
@@ -976,976 +1037,1037 @@
  996    996   
    ) -> AmazonS3<
  997    997   
        ::aws_smithy_http_server::routing::RoutingService<
  998    998   
            ::aws_smithy_http_server::protocol::rest::router::RestRouter<
  999    999   
                ::aws_smithy_http_server::routing::Route<B>,
 1000   1000   
            >,
 1001   1001   
            ::aws_smithy_http_server::protocol::rest_xml::RestXml,
 1002   1002   
        >,
 1003   1003   
    >
 1004   1004   
    where
 1005   1005   
        S: ::tower::Service<
 1006         -
            ::http::Request<B>,
 1007         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1006  +
            ::http_1x::Request<B>,
        1007  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1008   1008   
            Error = std::convert::Infallible,
 1009   1009   
        >,
 1010   1010   
        S: Clone + Send + 'static,
 1011   1011   
        S::Future: Send + 'static,
 1012   1012   
    {
 1013   1013   
        self.layer(&::tower::layer::layer_fn(
 1014   1014   
            ::aws_smithy_http_server::routing::Route::new,
 1015   1015   
        ))
 1016   1016   
    }
 1017   1017   
}

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/Cargo.toml

@@ -0,1 +0,46 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "simple-http0x"
           4  +
version = "0.0.1"
           5  +
authors = ["protocoltest@example.com"]
           6  +
description = "test"
           7  +
edition = "2021"
           8  +
           9  +
[package.metadata.smithy]
          10  +
codegen-version = "ci"
          11  +
protocol = "aws.protocols#restJson1"
          12  +
[dependencies.aws-smithy-json]
          13  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
          14  +
[dependencies.aws-smithy-legacy-http]
          15  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          16  +
[dependencies.aws-smithy-legacy-http-server]
          17  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
          18  +
[dependencies.aws-smithy-runtime-api]
          19  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          20  +
features = ["http-02x"]
          21  +
[dependencies.aws-smithy-types]
          22  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          23  +
features = ["http-body-0-4-x"]
          24  +
[dependencies.futures-util]
          25  +
version = "0.3"
          26  +
[dependencies.http]
          27  +
version = "0.2.9"
          28  +
[dependencies.hyper]
          29  +
version = "0.14.26"
          30  +
[dependencies.mime]
          31  +
version = "0.3"
          32  +
[dependencies.pin-project-lite]
          33  +
version = "0.2"
          34  +
[dependencies.tower]
          35  +
version = "0.4"
          36  +
[dependencies.tracing]
          37  +
version = "0.1"
          38  +
[dev-dependencies.tokio]
          39  +
version = "1.23.1"
          40  +
[features]
          41  +
rt-tokio = ["aws-smithy-types/rt-tokio"]
          42  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          43  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          44  +
default = ["rt-tokio", "request-id"]
          45  +
          46  +

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

@@ -0,1 +0,16 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
pub(crate) trait Constrained {
           8  +
    type Unconstrained;
           9  +
}
          10  +
          11  +
#[derive(Debug, Clone)]
          12  +
#[allow(dead_code)]
          13  +
pub(crate) enum MaybeConstrained<T: Constrained> {
          14  +
    Constrained(T),
          15  +
    Unconstrained(T::Unconstrained),
          16  +
}

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/src/error.rs

@@ -0,1 +0,1 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/src/input.rs

@@ -0,1 +0,62 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(
           4  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           5  +
)]
           6  +
pub struct OperationInput {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub message: ::std::option::Option<::std::string::String>,
           9  +
}
          10  +
impl OperationInput {
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub fn message(&self) -> ::std::option::Option<&str> {
          13  +
        self.message.as_deref()
          14  +
    }
          15  +
}
          16  +
impl OperationInput {
          17  +
    /// Creates a new builder-style object to manufacture [`OperationInput`](crate::input::OperationInput).
          18  +
    pub fn builder() -> crate::input::operation_input::Builder {
          19  +
        crate::input::operation_input::Builder::default()
          20  +
    }
          21  +
}
          22  +
impl crate::constrained::Constrained for crate::input::OperationInput {
          23  +
    type Unconstrained = crate::input::operation_input::Builder;
          24  +
}
          25  +
/// See [`OperationInput`](crate::input::OperationInput).
          26  +
pub mod operation_input {
          27  +
          28  +
    impl ::std::convert::From<Builder> for crate::input::OperationInput {
          29  +
        fn from(builder: Builder) -> Self {
          30  +
            builder.build()
          31  +
        }
          32  +
    }
          33  +
    /// A builder for [`OperationInput`](crate::input::OperationInput).
          34  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          35  +
    pub struct Builder {
          36  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
          37  +
    }
          38  +
    impl Builder {
          39  +
        #[allow(missing_docs)] // documentation missing in model
          40  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          41  +
            self.message = input;
          42  +
            self
          43  +
        }
          44  +
        #[allow(missing_docs)] // documentation missing in model
          45  +
        pub(crate) fn set_message(
          46  +
            mut self,
          47  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
          48  +
        ) -> Self {
          49  +
            self.message = input.map(|v| v.into());
          50  +
            self
          51  +
        }
          52  +
        /// Consumes the builder and constructs a [`OperationInput`](crate::input::OperationInput).
          53  +
        pub fn build(self) -> crate::input::OperationInput {
          54  +
            self.build_enforcing_all_constraints()
          55  +
        }
          56  +
        fn build_enforcing_all_constraints(self) -> crate::input::OperationInput {
          57  +
            crate::input::OperationInput {
          58  +
                message: self.message,
          59  +
            }
          60  +
        }
          61  +
    }
          62  +
}

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/src/lib.rs

@@ -0,1 +0,245 @@
           1  +
#![allow(deprecated)]
           2  +
#![allow(unknown_lints)]
           3  +
#![allow(clippy::module_inception)]
           4  +
#![allow(clippy::upper_case_acronyms)]
           5  +
#![allow(clippy::large_enum_variant)]
           6  +
#![allow(clippy::wrong_self_convention)]
           7  +
#![allow(clippy::should_implement_trait)]
           8  +
#![allow(clippy::disallowed_names)]
           9  +
#![allow(clippy::vec_init_then_push)]
          10  +
#![allow(clippy::type_complexity)]
          11  +
#![allow(clippy::needless_return)]
          12  +
#![allow(clippy::derive_partial_eq_without_eq)]
          13  +
#![allow(clippy::result_large_err)]
          14  +
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::deprecated_semver)]
          16  +
#![allow(clippy::uninlined_format_args)]
          17  +
#![allow(rustdoc::bare_urls)]
          18  +
#![allow(rustdoc::redundant_explicit_links)]
          19  +
#![allow(rustdoc::invalid_html_tags)]
          20  +
#![forbid(unsafe_code)]
          21  +
#![cfg_attr(docsrs, feature(doc_cfg))]
          22  +
//! simple-http0x
          23  +
          24  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          25  +
//! A fast and customizable Rust implementation of the SimpleService Smithy service.
          26  +
//!
          27  +
//! # Using SimpleService
          28  +
//!
          29  +
//! The primary entrypoint is [`SimpleService`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
          30  +
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`SimpleService::into_make_service`]
          31  +
//! or used in AWS Lambda
          32  +
#![cfg_attr(
          33  +
    feature = "aws-lambda",
          34  +
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
          35  +
)]
          36  +
#![cfg_attr(
          37  +
    not(feature = "aws-lambda"),
          38  +
    doc = " by enabling the `aws-lambda` feature flag and utilizing the `LambdaHandler`."
          39  +
)]
          40  +
//! The [`crate::input`], and [`crate::output`],
          41  +
//! modules provide the types used in each operation.
          42  +
//!
          43  +
//! ### Running on Hyper
          44  +
//!
          45  +
//! ```rust,no_run
          46  +
//! # use std::net::SocketAddr;
          47  +
//! # async fn dummy() {
          48  +
//! use simple_http0x::{SimpleService, SimpleServiceConfig};
          49  +
//!
          50  +
//! # let app = SimpleService::builder(
          51  +
//! #     SimpleServiceConfig::builder()
          52  +
//! #         .build()
          53  +
//! # ).build_unchecked();
          54  +
//! let server = app.into_make_service();
          55  +
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
          56  +
//!     .expect("unable to parse the server bind address and port");
          57  +
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! # }
          59  +
//!
          60  +
//! ```
          61  +
//!
          62  +
//! ### Running on Lambda
          63  +
//!
          64  +
//! ```rust,ignore
          65  +
//! use simple_http0x::server::routing::LambdaHandler;
          66  +
//! use simple_http0x::SimpleService;
          67  +
//!
          68  +
//! # async fn dummy() {
          69  +
//! # let app = SimpleService::builder(
          70  +
//! #     SimpleServiceConfig::builder()
          71  +
//! #         .build()
          72  +
//! # ).build_unchecked();
          73  +
//! let handler = LambdaHandler::new(app);
          74  +
//! lambda_http::run(handler).await.unwrap();
          75  +
//! # }
          76  +
//! ```
          77  +
//!
          78  +
//! # Building the SimpleService
          79  +
//!
          80  +
//! To construct [`SimpleService`] we use [`SimpleServiceBuilder`] returned by [`SimpleService::builder`].
          81  +
//!
          82  +
//! ## Plugins
          83  +
//!
          84  +
//! The [`SimpleService::builder`] method, returning [`SimpleServiceBuilder`],
          85  +
//! accepts a config object on which plugins can be registered.
          86  +
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
          87  +
//!
          88  +
//! ```rust,no_run
          89  +
//! # use simple_http0x::server::plugin::IdentityPlugin as LoggingPlugin;
          90  +
//! # use simple_http0x::server::plugin::IdentityPlugin as MetricsPlugin;
          91  +
//! # use ::hyper::Body;
          92  +
//! use simple_http0x::server::plugin::HttpPlugins;
          93  +
//! use simple_http0x::{SimpleService, SimpleServiceConfig, SimpleServiceBuilder};
          94  +
//!
          95  +
//! let http_plugins = HttpPlugins::new()
          96  +
//!         .push(LoggingPlugin)
          97  +
//!         .push(MetricsPlugin);
          98  +
//! let config = SimpleServiceConfig::builder().build();
          99  +
//! let builder: SimpleServiceBuilder<::hyper::Body, _, _, _> = SimpleService::builder(config);
         100  +
//! ```
         101  +
//!
         102  +
//! Check out [`crate::server::plugin`] to learn more about plugins.
         103  +
//!
         104  +
//! ## Handlers
         105  +
//!
         106  +
//! [`SimpleServiceBuilder`] 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.
         107  +
//! We call these async functions **handlers**. This is where your application business logic lives.
         108  +
//!
         109  +
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
         110  +
//!
         111  +
//! * A `Result<Output, Error>` if your operation has modeled errors, or
         112  +
//! * An `Output` otherwise.
         113  +
//!
         114  +
//! ```rust,no_run
         115  +
//! # struct Input;
         116  +
//! # struct Output;
         117  +
//! # struct Error;
         118  +
//! async fn infallible_handler(input: Input) -> Output { todo!() }
         119  +
//!
         120  +
//! async fn fallible_handler(input: Input) -> Result<Output, Error> { todo!() }
         121  +
//! ```
         122  +
//!
         123  +
//! Handlers can accept up to 8 extractors:
         124  +
//!
         125  +
//! ```rust,no_run
         126  +
//! # struct Input;
         127  +
//! # struct Output;
         128  +
//! # struct Error;
         129  +
//! # struct State;
         130  +
//! # use std::net::SocketAddr;
         131  +
//! use simple_http0x::server::request::{extension::Extension, connect_info::ConnectInfo};
         132  +
//!
         133  +
//! async fn handler_with_no_extensions(input: Input) -> Output {
         134  +
//!     todo!()
         135  +
//! }
         136  +
//!
         137  +
//! async fn handler_with_one_extractor(input: Input, ext: Extension<State>) -> Output {
         138  +
//!     todo!()
         139  +
//! }
         140  +
//!
         141  +
//! async fn handler_with_two_extractors(
         142  +
//!     input: Input,
         143  +
//!     ext0: Extension<State>,
         144  +
//!     ext1: ConnectInfo<SocketAddr>,
         145  +
//! ) -> Output {
         146  +
//!     todo!()
         147  +
//! }
         148  +
//! ```
         149  +
//!
         150  +
//! See the [`operation module`](crate::operation) for information on precisely what constitutes a handler.
         151  +
//!
         152  +
//! ## Build
         153  +
//!
         154  +
//! You can convert [`SimpleServiceBuilder`] into [`SimpleService`] using either [`SimpleServiceBuilder::build`] or [`SimpleServiceBuilder::build_unchecked`].
         155  +
//!
         156  +
//! [`SimpleServiceBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
         157  +
//!
         158  +
//! [`SimpleServiceBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
         159  +
//! [`SimpleServiceBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
         160  +
//!
         161  +
//! # Example
         162  +
//!
         163  +
//! ```rust,no_run
         164  +
//! # use std::net::SocketAddr;
         165  +
//! use simple_http0x::{SimpleService, SimpleServiceConfig};
         166  +
//!
         167  +
//! #[::tokio::main]
         168  +
//! pub async fn main() {
         169  +
//!    let config = SimpleServiceConfig::builder().build();
         170  +
//!    let app = SimpleService::builder(config)
         171  +
//!        .operation(operation)
         172  +
//!        .build()
         173  +
//!        .expect("failed to build an instance of SimpleService");
         174  +
//!
         175  +
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
         176  +
//!        .expect("unable to parse the server bind address and port");
         177  +
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         178  +
//!    # let server = async { Ok::<_, ()>(()) };
         179  +
//!
         180  +
//!    // Run your service!
         181  +
//!    if let Err(err) = server.await {
         182  +
//!        eprintln!("server error: {:?}", err);
         183  +
//!    }
         184  +
//! }
         185  +
//!
         186  +
//! use simple_http0x::{input, output};
         187  +
//!
         188  +
//! async fn operation(input: input::OperationInput) -> output::OperationOutput {
         189  +
//!     todo!()
         190  +
//! }
         191  +
//!
         192  +
//! ```
         193  +
//!
         194  +
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         195  +
//! [hyper server]: https://docs.rs/hyper/0.14.26/hyper/server/index.html
         196  +
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
         197  +
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
         198  +
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
         199  +
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         200  +
pub use crate::service::{
         201  +
    MissingOperationsError, SimpleService, SimpleServiceBuilder, SimpleServiceConfig,
         202  +
    SimpleServiceConfigBuilder,
         203  +
};
         204  +
         205  +
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         206  +
pub mod server {
         207  +
    // Re-export all types from the `aws-smithy-http-server` crate.
         208  +
    pub use ::aws_smithy_legacy_http_server::*;
         209  +
}
         210  +
         211  +
/// Crate version number.
         212  +
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
         213  +
         214  +
/// All error types that operations can return. Documentation on these types is copied from the model.
         215  +
pub mod error;
         216  +
         217  +
/// Input structures for operations. Documentation on these types is copied from the model.
         218  +
pub mod input;
         219  +
         220  +
/// All operations that this crate can perform.
         221  +
pub mod operation;
         222  +
         223  +
/// A collection of types representing each operation defined in the service closure.
         224  +
///
         225  +
/// The [plugin system](::aws_smithy_legacy_http_server::plugin) makes use of these
         226  +
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
         227  +
/// parameterize [`Plugin`](::aws_smithy_legacy_http_server::plugin::Plugin) implementations. Their traits, such as
         228  +
/// [`OperationShape`](::aws_smithy_legacy_http_server::operation::OperationShape), can be used to provide
         229  +
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
         230  +
pub mod operation_shape;
         231  +
         232  +
/// Output structures for operations. Documentation on these types is copied from the model.
         233  +
pub mod output;
         234  +
         235  +
mod service;
         236  +
         237  +
/// Data primitives referenced by other data types.
         238  +
pub mod types;
         239  +
         240  +
/// Constrained types for constrained shapes.
         241  +
mod constrained;
         242  +
         243  +
mod mimes;
         244  +
         245  +
pub(crate) mod protocol_serde;

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/src/mimes.rs

@@ -0,1 +0,7 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) static CONTENT_TYPE_APPLICATION_JSON: std::sync::LazyLock<::mime::Mime> =
           3  +
    std::sync::LazyLock::new(|| {
           4  +
        "application/json"
           5  +
            .parse::<::mime::Mime>()
           6  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
           7  +
    });

tmp-codegen-diff/codegen-server-test/simple-http0x/rust-server-codegen/src/operation.rs

@@ -0,1 +0,76 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
::pin_project_lite::pin_project! {
           3  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
           4  +
    /// [`OperationInput`](crate::input::OperationInput) using modelled bindings.
           5  +
    pub struct OperationInputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
           7  +
    }
           8  +
}
           9  +
          10  +
impl std::future::Future for OperationInputFuture {
          11  +
    type Output = Result<
          12  +
        crate::input::OperationInput,
          13  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
          14  +
    >;
          15  +
          16  +
    fn poll(
          17  +
        self: std::pin::Pin<&mut Self>,
          18  +
        cx: &mut std::task::Context<'_>,
          19  +
    ) -> std::task::Poll<Self::Output> {
          20  +
        let this = self.project();
          21  +
        this.inner.as_mut().poll(cx)
          22  +
    }
          23  +
}
          24  +
          25  +
impl<B>
          26  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
          27  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
          28  +
        B,
          29  +
    > for crate::input::OperationInput
          30  +
where
          31  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          32  +
    B: 'static,
          33  +
          34  +
    B::Data: Send,
          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  +
{
          38  +
    type Rejection =
          39  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
          40  +
    type Future = OperationInputFuture;
          41  +
          42  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          43  +
        let fut = async move {
          44  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
          45  +
                request.headers(),
          46  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
          47  +
            ) {
          48  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
          49  +
            }
          50  +
            crate::protocol_serde::shape_operation::de_operation_http_request(request).await
          51  +
        };
          52  +
        use ::futures_util::future::TryFutureExt;
          53  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
          54  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
          55  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
          56  +
                    });
          57  +
        OperationInputFuture {
          58  +
            inner: Box::pin(fut),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl
          63  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
          64  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
          65  +
    > for crate::output::OperationOutput
          66  +
{
          67  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
          68  +
        match crate::protocol_serde::shape_operation::ser_operation_http_response(self) {
          69  +
            Ok(response) => response,
          70  +
            Err(e) => {
          71  +
                ::tracing::error!(error = %e, "failed to serialize response");
          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))
          73  +
            }
          74  +
        }
          75  +
    }
          76  +
}