Server Test

Server Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5

Files changed:

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

@@ -0,1 +0,13 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_types::body::SdkBody;
           3  +
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
           4  +
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
           5  +
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
#[cfg(feature = "rt-tokio")]
           7  +
pub use ::aws_smithy_types::byte_stream::FsBuilder;
           8  +
#[cfg(feature = "rt-tokio")]
           9  +
pub use ::aws_smithy_types::byte_stream::Length;
          10  +
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
          11  +
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
          12  +
pub use ::aws_smithy_types::Blob;
          13  +
pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/unconstrained.rs

@@ -0,1 +0,40 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
pub(crate) mod tags_unconstrained {
           4  +
           5  +
    #[derive(Debug, Clone)]
           6  +
    pub(crate) struct TagsUnconstrained(pub(crate) std::vec::Vec<crate::model::tag::Builder>);
           7  +
           8  +
    impl From<TagsUnconstrained>
           9  +
        for crate::constrained::MaybeConstrained<
          10  +
            crate::constrained::tags_constrained::TagsConstrained,
          11  +
        >
          12  +
    {
          13  +
        fn from(value: TagsUnconstrained) -> Self {
          14  +
            Self::Unconstrained(value)
          15  +
        }
          16  +
    }
          17  +
    impl std::convert::TryFrom<TagsUnconstrained>
          18  +
        for crate::constrained::tags_constrained::TagsConstrained
          19  +
    {
          20  +
        type Error = crate::model::tags::ConstraintViolation;
          21  +
        fn try_from(value: TagsUnconstrained) -> std::result::Result<Self, Self::Error> {
          22  +
            let res: ::std::result::Result<
          23  +
                ::std::vec::Vec<crate::model::Tag>,
          24  +
                (usize, crate::model::tag::ConstraintViolation),
          25  +
            > = value
          26  +
                .0
          27  +
                .into_iter()
          28  +
                .enumerate()
          29  +
                .map(|(idx, inner)| {
          30  +
                    inner
          31  +
                        .try_into()
          32  +
                        .map_err(|inner_violation| (idx, inner_violation))
          33  +
                })
          34  +
                .collect();
          35  +
            let inner =
          36  +
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
          37  +
            Ok(Self(inner))
          38  +
        }
          39  +
    }
          40  +
}

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

@@ -1,1 +54,62 @@
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#restJson1"
   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-json]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   18     18   
[dependencies.aws-smithy-runtime-api]
   19     19   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          20  +
features = ["http-1x"]
   20     21   
[dependencies.aws-smithy-types]
   21     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          23  +
features = ["http-body-1-x"]
          24  +
[dependencies.bytes]
          25  +
version = "1.4.0"
   22     26   
[dependencies.form_urlencoded]
   23     27   
version = "1"
   24     28   
[dependencies.futures-util]
   25     29   
version = "0.3"
   26         -
[dependencies.http]
   27         -
version = "0.2.9"
   28         -
[dependencies.hyper]
   29         -
version = "0.14.26"
          30  +
[dependencies.http-1x]
          31  +
version = "1"
          32  +
package = "http"
          33  +
[dependencies.http-body-1x]
          34  +
version = "1"
          35  +
package = "http-body"
          36  +
[dependencies.http-body-util]
          37  +
version = "0.1.3"
   30     38   
[dependencies.mime]
   31     39   
version = "0.3"
   32     40   
[dependencies.nom]
   33     41   
version = "7"
   34     42   
[dependencies.percent-encoding]
   35     43   
version = "2.0.0"
   36     44   
[dependencies.pin-project-lite]
   37     45   
version = "0.2"
   38     46   
[dependencies.regex]
   39     47   
version = "1.5.5"
   40     48   
[dependencies.tower]
   41     49   
version = "0.4"
   42     50   
[dependencies.tracing]
   43     51   
version = "0.1"
   44     52   
[dev-dependencies.hyper]
   45         -
version = "0.14.12"
          53  +
version = "1"
   46     54   
[dev-dependencies.tokio]
   47     55   
version = "1.23.1"
   48     56   
[features]
   49     57   
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   50     58   
request-id = ["aws-smithy-http-server/request-id"]
   51         -
rt-tokio = ["aws-smithy-types/rt-tokio"]
          59  +
rt-tokio = ["aws-smithy-types/http-body-1-x", "aws-smithy-types/rt-tokio"]
   52     60   
default = ["request-id", "rt-tokio"]
   53     61   
   54     62   

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

@@ -38,38 +147,150 @@
   58     58   
)]
   59     59   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   60     60   
//! modules provide the types used in each operation.
   61     61   
//!
   62     62   
//! ### Running on Hyper
   63     63   
//!
   64     64   
//! ```rust,no_run
   65     65   
//! # use std::net::SocketAddr;
   66     66   
//! # async fn dummy() {
   67     67   
//! use ebs::{Ebs, EbsConfig};
          68  +
//! use ebs::serve;
          69  +
//! use ::tokio::net::TcpListener;
   68     70   
//!
   69     71   
//! # let app = Ebs::builder(
   70     72   
//! #     EbsConfig::builder()
   71     73   
//! #         .build()
   72     74   
//! # ).build_unchecked();
   73         -
//! let server = app.into_make_service();
   74     75   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   75     76   
//!     .expect("unable to parse the server bind address and port");
   76         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          77  +
//! let listener = TcpListener::bind(bind).await
          78  +
//!     .expect("failed to bind TCP listener");
          79  +
//! serve(listener, app.into_make_service()).await.unwrap();
   77     80   
//! # }
   78     81   
//! ```
   79     82   
//!
   80     83   
//! ### Running on Lambda
   81     84   
//!
   82     85   
//! ```rust,ignore
   83     86   
//! use ebs::server::routing::LambdaHandler;
   84     87   
//! use ebs::Ebs;
   85     88   
//!
   86     89   
//! # async fn dummy() {
   87     90   
//! # let app = Ebs::builder(
   88     91   
//! #     EbsConfig::builder()
   89     92   
//! #         .build()
   90     93   
//! # ).build_unchecked();
   91     94   
//! let handler = LambdaHandler::new(app);
   92     95   
//! lambda_http::run(handler).await.unwrap();
   93     96   
//! # }
   94     97   
//! ```
   95     98   
//!
   96     99   
//! # Building the Ebs
   97    100   
//!
   98    101   
//! To construct [`Ebs`] we use [`EbsBuilder`] returned by [`Ebs::builder`].
   99    102   
//!
  100    103   
//! ## Plugins
  101    104   
//!
  102    105   
//! The [`Ebs::builder`] method, returning [`EbsBuilder`],
  103    106   
//! accepts a config object on which plugins can be registered.
  104    107   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
  105    108   
//!
  106    109   
//! ```rust,no_run
  107    110   
//! # use ebs::server::plugin::IdentityPlugin as LoggingPlugin;
  108    111   
//! # use ebs::server::plugin::IdentityPlugin as MetricsPlugin;
  109         -
//! # use ::hyper::Body;
         112  +
//! # use ::hyper::body::Incoming;
  110    113   
//! use ebs::server::plugin::HttpPlugins;
  111    114   
//! use ebs::{Ebs, EbsConfig, EbsBuilder};
  112    115   
//!
  113    116   
//! let http_plugins = HttpPlugins::new()
  114    117   
//!         .push(LoggingPlugin)
  115    118   
//!         .push(MetricsPlugin);
  116    119   
//! let config = EbsConfig::builder().build();
  117         -
//! let builder: EbsBuilder<Body, _, _, _> = Ebs::builder(config);
         120  +
//! let builder: EbsBuilder<::hyper::body::Incoming, _, _, _> = Ebs::builder(config);
  118    121   
//! ```
  119    122   
//!
  120    123   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  121    124   
//!
  122    125   
//! ## Handlers
  123    126   
//!
  124    127   
//! [`EbsBuilder`] 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.
  125    128   
//! We call these async functions **handlers**. This is where your application business logic lives.
  126    129   
//!
  127    130   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -154,157 +272,279 @@
  174    177   
//! [`EbsBuilder::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.
  175    178   
//!
  176    179   
//! [`EbsBuilder::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.
  177    180   
//! [`EbsBuilder::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!).
  178    181   
//!
  179    182   
//! # Example
  180    183   
//!
  181    184   
//! ```rust,no_run
  182    185   
//! # use std::net::SocketAddr;
  183    186   
//! use ebs::{Ebs, EbsConfig};
         187  +
//! use ebs::serve;
         188  +
//! use ::tokio::net::TcpListener;
  184    189   
//!
  185    190   
//! #[::tokio::main]
  186    191   
//! pub async fn main() {
  187    192   
//!    let config = EbsConfig::builder().build();
  188    193   
//!    let app = Ebs::builder(config)
  189    194   
//!        .complete_snapshot(complete_snapshot)
  190    195   
//!        .get_snapshot_block(get_snapshot_block)
  191    196   
//!        .list_changed_blocks(list_changed_blocks)
  192    197   
//!        .list_snapshot_blocks(list_snapshot_blocks)
  193    198   
//!        .put_snapshot_block(put_snapshot_block)
  194    199   
//!        .start_snapshot(start_snapshot)
  195    200   
//!        .build()
  196    201   
//!        .expect("failed to build an instance of Ebs");
  197    202   
//!
  198    203   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  199    204   
//!        .expect("unable to parse the server bind address and port");
  200         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         205  +
//!    let listener = TcpListener::bind(bind).await
         206  +
//!        .expect("failed to bind TCP listener");
  201    207   
//!    # let server = async { Ok::<_, ()>(()) };
  202    208   
//!
  203    209   
//!    // Run your service!
  204         -
//!    if let Err(err) = server.await {
         210  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  205    211   
//!        eprintln!("server error: {:?}", err);
  206    212   
//!    }
  207    213   
//! }
  208    214   
//!
  209    215   
//! use ebs::{input, output, error};
  210    216   
//!
  211    217   
//! async fn complete_snapshot(input: input::CompleteSnapshotInput) -> Result<output::CompleteSnapshotOutput, error::CompleteSnapshotError> {
  212    218   
//!     todo!()
  213    219   
//! }
  214    220   
//!
  215    221   
//! async fn get_snapshot_block(input: input::GetSnapshotBlockInput) -> Result<output::GetSnapshotBlockOutput, error::GetSnapshotBlockError> {
  216    222   
//!     todo!()
  217    223   
//! }
  218    224   
//!
  219    225   
//! async fn list_changed_blocks(input: input::ListChangedBlocksInput) -> Result<output::ListChangedBlocksOutput, error::ListChangedBlocksError> {
  220    226   
//!     todo!()
  221    227   
//! }
  222    228   
//!
  223    229   
//! async fn list_snapshot_blocks(input: input::ListSnapshotBlocksInput) -> Result<output::ListSnapshotBlocksOutput, error::ListSnapshotBlocksError> {
  224    230   
//!     todo!()
  225    231   
//! }
  226    232   
//!
  227    233   
//! async fn put_snapshot_block(input: input::PutSnapshotBlockInput) -> Result<output::PutSnapshotBlockOutput, error::PutSnapshotBlockError> {
  228    234   
//!     todo!()
  229    235   
//! }
  230    236   
//!
  231    237   
//! async fn start_snapshot(input: input::StartSnapshotInput) -> Result<output::StartSnapshotOutput, error::StartSnapshotError> {
  232    238   
//!     todo!()
  233    239   
//! }
  234    240   
//!
  235    241   
//! ```
  236    242   
//!
  237         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         243  +
//! [`serve`]: crate::serve
         244  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  238    245   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  239    246   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  240    247   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  241         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  242    248   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         249  +
pub use crate::server::serve::serve;
  243    250   
pub use crate::service::{Ebs, EbsBuilder, EbsConfig, EbsConfigBuilder, MissingOperationsError};
  244    251   
  245    252   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  246    253   
pub mod server {
  247    254   
    // Re-export all types from the `aws-smithy-http-server` crate.
  248    255   
    pub use ::aws_smithy_http_server::*;
  249    256   
}
  250    257   
  251    258   
/// Crate version number.
  252    259   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

tmp-codegen-diff/codegen-server-test/ebs/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_json_1::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_json_1::runtime_error::RuntimeError;
   39     39   
    type Future = StartSnapshotInputFuture;
   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   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   44     44   
                request.headers(),
   45     45   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
   46     46   
            ) {
   47     47   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   48     48   
            }
   49     49   
            crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_request(request)
   50     50   
                .await
   51     51   
        };
@@ -104,104 +172,177 @@
  124    124   
  125    125   
impl<B>
  126    126   
    ::aws_smithy_http_server::request::FromRequest<
  127    127   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  128    128   
        B,
  129    129   
    > for crate::input::PutSnapshotBlockInput
  130    130   
where
  131    131   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  132    132   
    B: 'static,
  133    133   
  134         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
         134  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
         135  +
        + ::std::marker::Send
         136  +
        + ::std::marker::Sync
         137  +
        + 'static,
         138  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
         139  +
  135    140   
    B::Data: Send,
  136    141   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  137    142   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  138    143   
{
  139    144   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  140    145   
    type Future = PutSnapshotBlockInputFuture;
  141    146   
  142         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         147  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  143    148   
        let fut = async move {
  144    149   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  145    150   
                request.headers(),
  146    151   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  147    152   
            ) {
  148    153   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  149    154   
            }
  150    155   
            crate::protocol_serde::shape_put_snapshot_block::de_put_snapshot_block_http_request(
  151    156   
                request,
  152    157   
            )
@@ -218,223 +278,283 @@
  238    243   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  239    244   
    B: 'static,
  240    245   
  241    246   
    B::Data: Send,
  242    247   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  243    248   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  244    249   
{
  245    250   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  246    251   
    type Future = ListSnapshotBlocksInputFuture;
  247    252   
  248         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         253  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  249    254   
        let fut = async move {
  250    255   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  251    256   
                request.headers(),
  252    257   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  253    258   
            ) {
  254    259   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  255    260   
            }
  256    261   
            crate::protocol_serde::shape_list_snapshot_blocks::de_list_snapshot_blocks_http_request(
  257    262   
                request,
  258    263   
            )
@@ -322,327 +382,387 @@
  342    347   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  343    348   
    B: 'static,
  344    349   
  345    350   
    B::Data: Send,
  346    351   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  347    352   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  348    353   
{
  349    354   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  350    355   
    type Future = ListChangedBlocksInputFuture;
  351    356   
  352         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         357  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  353    358   
        let fut = async move {
  354    359   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  355    360   
                request.headers(),
  356    361   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  357    362   
            ) {
  358    363   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  359    364   
            }
  360    365   
            crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks_http_request(
  361    366   
                request,
  362    367   
            )
@@ -426,431 +486,491 @@
  446    451   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  447    452   
    B: 'static,
  448    453   
  449    454   
    B::Data: Send,
  450    455   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  451    456   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  452    457   
{
  453    458   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  454    459   
    type Future = GetSnapshotBlockInputFuture;
  455    460   
  456         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         461  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  457    462   
        let fut = async move {
  458    463   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  459    464   
                request.headers(),
  460    465   
                &crate::mimes::CONTENT_TYPE_APPLICATION_OCTET_STREAM,
  461    466   
            ) {
  462    467   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  463    468   
            }
  464    469   
            crate::protocol_serde::shape_get_snapshot_block::de_get_snapshot_block_http_request(
  465    470   
                request,
  466    471   
            )
@@ -532,537 +592,597 @@
  552    557   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  553    558   
    B: 'static,
  554    559   
  555    560   
    B::Data: Send,
  556    561   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  557    562   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  558    563   
{
  559    564   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  560    565   
    type Future = CompleteSnapshotInputFuture;
  561    566   
  562         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         567  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  563    568   
        let fut = async move {
  564    569   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  565    570   
                request.headers(),
  566    571   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  567    572   
            ) {
  568    573   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  569    574   
            }
  570    575   
            crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot_http_request(
  571    576   
                request,
  572    577   
            )

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_complete_snapshot.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_complete_snapshot_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::CompleteSnapshotInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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_json_1::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -50,50 +257,257 @@
   70     70   
   71     71   
#[allow(clippy::unnecessary_wraps)]
   72     72   
pub fn ser_complete_snapshot_http_response(
   73     73   
    #[allow(unused_variables)] output: crate::output::CompleteSnapshotOutput,
   74     74   
) -> std::result::Result<
   75     75   
    ::aws_smithy_http_server::response::Response,
   76     76   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   77     77   
> {
   78     78   
    Ok({
   79     79   
        #[allow(unused_mut)]
   80         -
        let mut builder = ::http::Response::builder();
          80  +
        let mut builder = ::http_1x::Response::builder();
   81     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     82   
            builder,
   83         -
            ::http::header::CONTENT_TYPE,
          83  +
            ::http_1x::header::CONTENT_TYPE,
   84     84   
            "application/json",
   85     85   
        );
   86     86   
        let http_status: u16 = 202;
   87     87   
        builder = builder.status(http_status);
   88     88   
        let payload =
   89     89   
            crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output_output(&output)?
   90     90   
        ;
   91     91   
        let content_length = payload.len();
   92     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     93   
            builder,
   94         -
            ::http::header::CONTENT_LENGTH,
          94  +
            ::http_1x::header::CONTENT_LENGTH,
   95     95   
            content_length,
   96     96   
        );
   97     97   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   98     98   
        builder.body(body)?
   99     99   
    })
  100    100   
}
  101    101   
  102    102   
#[allow(clippy::unnecessary_wraps)]
  103    103   
pub fn ser_complete_snapshot_http_error(
  104    104   
    error: &crate::error::CompleteSnapshotError,
  105    105   
) -> std::result::Result<
  106    106   
    ::aws_smithy_http_server::response::Response,
  107    107   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  108    108   
> {
  109    109   
    Ok({
  110    110   
        match error {
  111    111   
            crate::error::CompleteSnapshotError::InternalServerException(output) => {
  112    112   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
  113    113   
                #[allow(unused_mut)]
  114         -
                let mut builder = ::http::Response::builder();
         114  +
                let mut builder = ::http_1x::Response::builder();
  115    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    116   
                    builder,
  117         -
                    ::http::header::CONTENT_TYPE,
         117  +
                    ::http_1x::header::CONTENT_TYPE,
  118    118   
                    "application/json",
  119    119   
                );
  120    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  121    121   
                    builder,
  122         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         122  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  123    123   
                    "InternalServerException",
  124    124   
                );
  125    125   
                let content_length = payload.len();
  126    126   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    127   
                    builder,
  128         -
                    ::http::header::CONTENT_LENGTH,
         128  +
                    ::http_1x::header::CONTENT_LENGTH,
  129    129   
                    content_length,
  130    130   
                );
  131    131   
                builder
  132    132   
                    .status(500)
  133    133   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  134    134   
            }
  135    135   
            crate::error::CompleteSnapshotError::ResourceNotFoundException(output) => {
  136    136   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  137    137   
                #[allow(unused_mut)]
  138         -
                let mut builder = ::http::Response::builder();
         138  +
                let mut builder = ::http_1x::Response::builder();
  139    139   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  140    140   
                    builder,
  141         -
                    ::http::header::CONTENT_TYPE,
         141  +
                    ::http_1x::header::CONTENT_TYPE,
  142    142   
                    "application/json",
  143    143   
                );
  144    144   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  145    145   
                    builder,
  146         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         146  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  147    147   
                    "ResourceNotFoundException",
  148    148   
                );
  149    149   
                let content_length = payload.len();
  150    150   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  151    151   
                    builder,
  152         -
                    ::http::header::CONTENT_LENGTH,
         152  +
                    ::http_1x::header::CONTENT_LENGTH,
  153    153   
                    content_length,
  154    154   
                );
  155    155   
                builder
  156    156   
                    .status(404)
  157    157   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  158    158   
            }
  159    159   
            crate::error::CompleteSnapshotError::AccessDeniedException(output) => {
  160    160   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  161    161   
                #[allow(unused_mut)]
  162         -
                let mut builder = ::http::Response::builder();
         162  +
                let mut builder = ::http_1x::Response::builder();
  163    163   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  164    164   
                    builder,
  165         -
                    ::http::header::CONTENT_TYPE,
         165  +
                    ::http_1x::header::CONTENT_TYPE,
  166    166   
                    "application/json",
  167    167   
                );
  168    168   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  169    169   
                    builder,
  170         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         170  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  171    171   
                    "AccessDeniedException",
  172    172   
                );
  173    173   
                let content_length = payload.len();
  174    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  175    175   
                    builder,
  176         -
                    ::http::header::CONTENT_LENGTH,
         176  +
                    ::http_1x::header::CONTENT_LENGTH,
  177    177   
                    content_length,
  178    178   
                );
  179    179   
                builder
  180    180   
                    .status(403)
  181    181   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  182    182   
            }
  183    183   
            crate::error::CompleteSnapshotError::RequestThrottledException(output) => {
  184    184   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  185    185   
                #[allow(unused_mut)]
  186         -
                let mut builder = ::http::Response::builder();
         186  +
                let mut builder = ::http_1x::Response::builder();
  187    187   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  188    188   
                    builder,
  189         -
                    ::http::header::CONTENT_TYPE,
         189  +
                    ::http_1x::header::CONTENT_TYPE,
  190    190   
                    "application/json",
  191    191   
                );
  192    192   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  193    193   
                    builder,
  194         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         194  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  195    195   
                    "RequestThrottledException",
  196    196   
                );
  197    197   
                let content_length = payload.len();
  198    198   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  199    199   
                    builder,
  200         -
                    ::http::header::CONTENT_LENGTH,
         200  +
                    ::http_1x::header::CONTENT_LENGTH,
  201    201   
                    content_length,
  202    202   
                );
  203    203   
                builder
  204    204   
                    .status(400)
  205    205   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  206    206   
            }
  207    207   
            crate::error::CompleteSnapshotError::ServiceQuotaExceededException(output) => {
  208    208   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  209    209   
                #[allow(unused_mut)]
  210         -
                let mut builder = ::http::Response::builder();
         210  +
                let mut builder = ::http_1x::Response::builder();
  211    211   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  212    212   
                    builder,
  213         -
                    ::http::header::CONTENT_TYPE,
         213  +
                    ::http_1x::header::CONTENT_TYPE,
  214    214   
                    "application/json",
  215    215   
                );
  216    216   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  217    217   
                    builder,
  218         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         218  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  219    219   
                    "ServiceQuotaExceededException",
  220    220   
                );
  221    221   
                let content_length = payload.len();
  222    222   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  223    223   
                    builder,
  224         -
                    ::http::header::CONTENT_LENGTH,
         224  +
                    ::http_1x::header::CONTENT_LENGTH,
  225    225   
                    content_length,
  226    226   
                );
  227    227   
                builder
  228    228   
                    .status(402)
  229    229   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  230    230   
            }
  231    231   
            crate::error::CompleteSnapshotError::ValidationException(output) => {
  232    232   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  233    233   
                #[allow(unused_mut)]
  234         -
                let mut builder = ::http::Response::builder();
         234  +
                let mut builder = ::http_1x::Response::builder();
  235    235   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  236    236   
                    builder,
  237         -
                    ::http::header::CONTENT_TYPE,
         237  +
                    ::http_1x::header::CONTENT_TYPE,
  238    238   
                    "application/json",
  239    239   
                );
  240    240   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  241    241   
                    builder,
  242         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         242  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  243    243   
                    "ValidationException",
  244    244   
                );
  245    245   
                let content_length = payload.len();
  246    246   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  247    247   
                    builder,
  248         -
                    ::http::header::CONTENT_LENGTH,
         248  +
                    ::http_1x::header::CONTENT_LENGTH,
  249    249   
                    content_length,
  250    250   
                );
  251    251   
                builder
  252    252   
                    .status(400)
  253    253   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  254    254   
            }
  255    255   
        }
  256    256   
    })
  257    257   
}

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_get_snapshot_block.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_get_snapshot_block_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::GetSnapshotBlockInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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_json_1::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -49,49 +311,313 @@
   69     69   
   70     70   
#[allow(clippy::unnecessary_wraps)]
   71     71   
pub fn ser_get_snapshot_block_http_response(
   72     72   
    #[allow(unused_variables)] output: crate::output::GetSnapshotBlockOutput,
   73     73   
) -> std::result::Result<
   74     74   
    ::aws_smithy_http_server::response::Response,
   75     75   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76     76   
> {
   77     77   
    Ok({
   78     78   
        #[allow(unused_mut)]
   79         -
        let mut builder = ::http::Response::builder();
          79  +
        let mut builder = ::http_1x::Response::builder();
   80     80   
        builder = crate::protocol_serde::shape_get_snapshot_block::ser_get_snapshot_block_headers(
   81     81   
            &output, builder,
   82     82   
        )?;
   83     83   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84     84   
            builder,
   85         -
            ::http::header::CONTENT_TYPE,
          85  +
            ::http_1x::header::CONTENT_TYPE,
   86     86   
            "application/octet-stream",
   87     87   
        );
   88     88   
        let http_status: u16 = 200;
   89     89   
        builder = builder.status(http_status);
   90         -
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
          90  +
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream(
   91     91   
            ::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
   92     92   
                crate::protocol_serde::shape_get_snapshot_block_output::ser_block_data_http_payload( output.block_data)?
   93     93   
            )
   94     94   
        ));
   95     95   
        builder.body(body)?
   96     96   
    })
   97     97   
}
   98     98   
   99     99   
#[allow(clippy::unnecessary_wraps)]
  100    100   
pub fn ser_get_snapshot_block_http_error(
  101    101   
    error: &crate::error::GetSnapshotBlockError,
  102    102   
) -> std::result::Result<
  103    103   
    ::aws_smithy_http_server::response::Response,
  104    104   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  105    105   
> {
  106    106   
    Ok({
  107    107   
        match error {
  108    108   
            crate::error::GetSnapshotBlockError::InternalServerException(output) => {
  109    109   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
  110    110   
                #[allow(unused_mut)]
  111         -
                let mut builder = ::http::Response::builder();
         111  +
                let mut builder = ::http_1x::Response::builder();
  112    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    113   
                    builder,
  114         -
                    ::http::header::CONTENT_TYPE,
         114  +
                    ::http_1x::header::CONTENT_TYPE,
  115    115   
                    "application/octet-stream",
  116    116   
                );
  117    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         119  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  120    120   
                    "InternalServerException",
  121    121   
                );
  122    122   
                let content_length = payload.len();
  123    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125         -
                    ::http::header::CONTENT_LENGTH,
         125  +
                    ::http_1x::header::CONTENT_LENGTH,
  126    126   
                    content_length,
  127    127   
                );
  128    128   
                builder
  129    129   
                    .status(500)
  130    130   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  131    131   
            }
  132    132   
            crate::error::GetSnapshotBlockError::ResourceNotFoundException(output) => {
  133    133   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  134    134   
                #[allow(unused_mut)]
  135         -
                let mut builder = ::http::Response::builder();
         135  +
                let mut builder = ::http_1x::Response::builder();
  136    136   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  137    137   
                    builder,
  138         -
                    ::http::header::CONTENT_TYPE,
         138  +
                    ::http_1x::header::CONTENT_TYPE,
  139    139   
                    "application/octet-stream",
  140    140   
                );
  141    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    142   
                    builder,
  143         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         143  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  144    144   
                    "ResourceNotFoundException",
  145    145   
                );
  146    146   
                let content_length = payload.len();
  147    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  148    148   
                    builder,
  149         -
                    ::http::header::CONTENT_LENGTH,
         149  +
                    ::http_1x::header::CONTENT_LENGTH,
  150    150   
                    content_length,
  151    151   
                );
  152    152   
                builder
  153    153   
                    .status(404)
  154    154   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  155    155   
            }
  156    156   
            crate::error::GetSnapshotBlockError::AccessDeniedException(output) => {
  157    157   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  158    158   
                #[allow(unused_mut)]
  159         -
                let mut builder = ::http::Response::builder();
         159  +
                let mut builder = ::http_1x::Response::builder();
  160    160   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  161    161   
                    builder,
  162         -
                    ::http::header::CONTENT_TYPE,
         162  +
                    ::http_1x::header::CONTENT_TYPE,
  163    163   
                    "application/octet-stream",
  164    164   
                );
  165    165   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  166    166   
                    builder,
  167         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         167  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  168    168   
                    "AccessDeniedException",
  169    169   
                );
  170    170   
                let content_length = payload.len();
  171    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  172    172   
                    builder,
  173         -
                    ::http::header::CONTENT_LENGTH,
         173  +
                    ::http_1x::header::CONTENT_LENGTH,
  174    174   
                    content_length,
  175    175   
                );
  176    176   
                builder
  177    177   
                    .status(403)
  178    178   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  179    179   
            }
  180    180   
            crate::error::GetSnapshotBlockError::RequestThrottledException(output) => {
  181    181   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  182    182   
                #[allow(unused_mut)]
  183         -
                let mut builder = ::http::Response::builder();
         183  +
                let mut builder = ::http_1x::Response::builder();
  184    184   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  185    185   
                    builder,
  186         -
                    ::http::header::CONTENT_TYPE,
         186  +
                    ::http_1x::header::CONTENT_TYPE,
  187    187   
                    "application/octet-stream",
  188    188   
                );
  189    189   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  190    190   
                    builder,
  191         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         191  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  192    192   
                    "RequestThrottledException",
  193    193   
                );
  194    194   
                let content_length = payload.len();
  195    195   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  196    196   
                    builder,
  197         -
                    ::http::header::CONTENT_LENGTH,
         197  +
                    ::http_1x::header::CONTENT_LENGTH,
  198    198   
                    content_length,
  199    199   
                );
  200    200   
                builder
  201    201   
                    .status(400)
  202    202   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  203    203   
            }
  204    204   
            crate::error::GetSnapshotBlockError::ServiceQuotaExceededException(output) => {
  205    205   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  206    206   
                #[allow(unused_mut)]
  207         -
                let mut builder = ::http::Response::builder();
         207  +
                let mut builder = ::http_1x::Response::builder();
  208    208   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  209    209   
                    builder,
  210         -
                    ::http::header::CONTENT_TYPE,
         210  +
                    ::http_1x::header::CONTENT_TYPE,
  211    211   
                    "application/octet-stream",
  212    212   
                );
  213    213   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  214    214   
                    builder,
  215         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         215  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  216    216   
                    "ServiceQuotaExceededException",
  217    217   
                );
  218    218   
                let content_length = payload.len();
  219    219   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  220    220   
                    builder,
  221         -
                    ::http::header::CONTENT_LENGTH,
         221  +
                    ::http_1x::header::CONTENT_LENGTH,
  222    222   
                    content_length,
  223    223   
                );
  224    224   
                builder
  225    225   
                    .status(402)
  226    226   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  227    227   
            }
  228    228   
            crate::error::GetSnapshotBlockError::ValidationException(output) => {
  229    229   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  230    230   
                #[allow(unused_mut)]
  231         -
                let mut builder = ::http::Response::builder();
         231  +
                let mut builder = ::http_1x::Response::builder();
  232    232   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  233    233   
                    builder,
  234         -
                    ::http::header::CONTENT_TYPE,
         234  +
                    ::http_1x::header::CONTENT_TYPE,
  235    235   
                    "application/octet-stream",
  236    236   
                );
  237    237   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  238    238   
                    builder,
  239         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         239  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  240    240   
                    "ValidationException",
  241    241   
                );
  242    242   
                let content_length = payload.len();
  243    243   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  244    244   
                    builder,
  245         -
                    ::http::header::CONTENT_LENGTH,
         245  +
                    ::http_1x::header::CONTENT_LENGTH,
  246    246   
                    content_length,
  247    247   
                );
  248    248   
                builder
  249    249   
                    .status(400)
  250    250   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  251    251   
            }
  252    252   
        }
  253    253   
    })
  254    254   
}
  255    255   
  256    256   
pub fn ser_get_snapshot_block_headers(
  257    257   
    input: &crate::output::GetSnapshotBlockOutput,
  258         -
    mut builder: ::http::response::Builder,
  259         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  260         -
{
         258  +
    mut builder: ::http_1x::response::Builder,
         259  +
) -> std::result::Result<
         260  +
    ::http_1x::response::Builder,
         261  +
    ::aws_smithy_types::error::operation::BuildError,
         262  +
> {
  261    263   
    if let ::std::option::Option::Some(inner_1) = &input.data_length {
  262    264   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
  263    265   
        let formatted_2 = encoder.encode();
  264    266   
        if !formatted_2.is_empty() {
  265    267   
            let header_value = formatted_2;
  266         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         268  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  267    269   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  268    270   
                    "data_length",
  269    271   
                    format!(
  270    272   
                        "`{}` cannot be used as a header value: {}",
  271    273   
                        &header_value, err
  272    274   
                    ),
  273    275   
                )
  274    276   
            })?;
  275    277   
            builder = builder.header("x-amz-Data-Length", header_value);
  276    278   
        }
  277    279   
    }
  278    280   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
  279    281   
        let formatted_4 = inner_3.as_str();
  280    282   
        if !formatted_4.is_empty() {
  281    283   
            let header_value = formatted_4;
  282         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         284  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  283    285   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  284    286   
                    "checksum_algorithm",
  285    287   
                    format!(
  286    288   
                        "`{}` cannot be used as a header value: {}",
  287    289   
                        &header_value, err
  288    290   
                    ),
  289    291   
                )
  290    292   
            })?;
  291    293   
            builder = builder.header("x-amz-Checksum-Algorithm", header_value);
  292    294   
        }
  293    295   
    }
  294    296   
    if let ::std::option::Option::Some(inner_5) = &input.checksum {
  295    297   
        let formatted_6 = inner_5.as_str();
  296    298   
        if !formatted_6.is_empty() {
  297    299   
            let header_value = formatted_6;
  298         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         300  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  299    301   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  300    302   
                    "checksum",
  301    303   
                    format!(
  302    304   
                        "`{}` cannot be used as a header value: {}",
  303    305   
                        &header_value, err
  304    306   
                    ),
  305    307   
                )
  306    308   
            })?;
  307    309   
            builder = builder.header("x-amz-Checksum", header_value);
  308    310   
        }

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_list_changed_blocks.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_changed_blocks_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::ListChangedBlocksInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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_json_1::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -62,62 +269,269 @@
   82     82   
   83     83   
#[allow(clippy::unnecessary_wraps)]
   84     84   
pub fn ser_list_changed_blocks_http_response(
   85     85   
    #[allow(unused_variables)] output: crate::output::ListChangedBlocksOutput,
   86     86   
) -> std::result::Result<
   87     87   
    ::aws_smithy_http_server::response::Response,
   88     88   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   89     89   
> {
   90     90   
    Ok({
   91     91   
        #[allow(unused_mut)]
   92         -
        let mut builder = ::http::Response::builder();
          92  +
        let mut builder = ::http_1x::Response::builder();
   93     93   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94     94   
            builder,
   95         -
            ::http::header::CONTENT_TYPE,
          95  +
            ::http_1x::header::CONTENT_TYPE,
   96     96   
            "application/json",
   97     97   
        );
   98     98   
        let http_status: u16 = 200;
   99     99   
        builder = builder.status(http_status);
  100    100   
        let payload =
  101    101   
            crate::protocol_serde::shape_list_changed_blocks_output::ser_list_changed_blocks_output_output_output(&output)?
  102    102   
        ;
  103    103   
        let content_length = payload.len();
  104    104   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    105   
            builder,
  106         -
            ::http::header::CONTENT_LENGTH,
         106  +
            ::http_1x::header::CONTENT_LENGTH,
  107    107   
            content_length,
  108    108   
        );
  109    109   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
  110    110   
        builder.body(body)?
  111    111   
    })
  112    112   
}
  113    113   
  114    114   
#[allow(clippy::unnecessary_wraps)]
  115    115   
pub fn ser_list_changed_blocks_http_error(
  116    116   
    error: &crate::error::ListChangedBlocksError,
  117    117   
) -> std::result::Result<
  118    118   
    ::aws_smithy_http_server::response::Response,
  119    119   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  120    120   
> {
  121    121   
    Ok({
  122    122   
        match error {
  123    123   
            crate::error::ListChangedBlocksError::InternalServerException(output) => {
  124    124   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
  125    125   
                #[allow(unused_mut)]
  126         -
                let mut builder = ::http::Response::builder();
         126  +
                let mut builder = ::http_1x::Response::builder();
  127    127   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  128    128   
                    builder,
  129         -
                    ::http::header::CONTENT_TYPE,
         129  +
                    ::http_1x::header::CONTENT_TYPE,
  130    130   
                    "application/json",
  131    131   
                );
  132    132   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  133    133   
                    builder,
  134         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         134  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  135    135   
                    "InternalServerException",
  136    136   
                );
  137    137   
                let content_length = payload.len();
  138    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  139    139   
                    builder,
  140         -
                    ::http::header::CONTENT_LENGTH,
         140  +
                    ::http_1x::header::CONTENT_LENGTH,
  141    141   
                    content_length,
  142    142   
                );
  143    143   
                builder
  144    144   
                    .status(500)
  145    145   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  146    146   
            }
  147    147   
            crate::error::ListChangedBlocksError::ResourceNotFoundException(output) => {
  148    148   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  149    149   
                #[allow(unused_mut)]
  150         -
                let mut builder = ::http::Response::builder();
         150  +
                let mut builder = ::http_1x::Response::builder();
  151    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  152    152   
                    builder,
  153         -
                    ::http::header::CONTENT_TYPE,
         153  +
                    ::http_1x::header::CONTENT_TYPE,
  154    154   
                    "application/json",
  155    155   
                );
  156    156   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  157    157   
                    builder,
  158         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         158  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  159    159   
                    "ResourceNotFoundException",
  160    160   
                );
  161    161   
                let content_length = payload.len();
  162    162   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  163    163   
                    builder,
  164         -
                    ::http::header::CONTENT_LENGTH,
         164  +
                    ::http_1x::header::CONTENT_LENGTH,
  165    165   
                    content_length,
  166    166   
                );
  167    167   
                builder
  168    168   
                    .status(404)
  169    169   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  170    170   
            }
  171    171   
            crate::error::ListChangedBlocksError::AccessDeniedException(output) => {
  172    172   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  173    173   
                #[allow(unused_mut)]
  174         -
                let mut builder = ::http::Response::builder();
         174  +
                let mut builder = ::http_1x::Response::builder();
  175    175   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  176    176   
                    builder,
  177         -
                    ::http::header::CONTENT_TYPE,
         177  +
                    ::http_1x::header::CONTENT_TYPE,
  178    178   
                    "application/json",
  179    179   
                );
  180    180   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  181    181   
                    builder,
  182         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         182  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  183    183   
                    "AccessDeniedException",
  184    184   
                );
  185    185   
                let content_length = payload.len();
  186    186   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  187    187   
                    builder,
  188         -
                    ::http::header::CONTENT_LENGTH,
         188  +
                    ::http_1x::header::CONTENT_LENGTH,
  189    189   
                    content_length,
  190    190   
                );
  191    191   
                builder
  192    192   
                    .status(403)
  193    193   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  194    194   
            }
  195    195   
            crate::error::ListChangedBlocksError::RequestThrottledException(output) => {
  196    196   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  197    197   
                #[allow(unused_mut)]
  198         -
                let mut builder = ::http::Response::builder();
         198  +
                let mut builder = ::http_1x::Response::builder();
  199    199   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  200    200   
                    builder,
  201         -
                    ::http::header::CONTENT_TYPE,
         201  +
                    ::http_1x::header::CONTENT_TYPE,
  202    202   
                    "application/json",
  203    203   
                );
  204    204   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  205    205   
                    builder,
  206         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         206  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  207    207   
                    "RequestThrottledException",
  208    208   
                );
  209    209   
                let content_length = payload.len();
  210    210   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  211    211   
                    builder,
  212         -
                    ::http::header::CONTENT_LENGTH,
         212  +
                    ::http_1x::header::CONTENT_LENGTH,
  213    213   
                    content_length,
  214    214   
                );
  215    215   
                builder
  216    216   
                    .status(400)
  217    217   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  218    218   
            }
  219    219   
            crate::error::ListChangedBlocksError::ServiceQuotaExceededException(output) => {
  220    220   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  221    221   
                #[allow(unused_mut)]
  222         -
                let mut builder = ::http::Response::builder();
         222  +
                let mut builder = ::http_1x::Response::builder();
  223    223   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  224    224   
                    builder,
  225         -
                    ::http::header::CONTENT_TYPE,
         225  +
                    ::http_1x::header::CONTENT_TYPE,
  226    226   
                    "application/json",
  227    227   
                );
  228    228   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  229    229   
                    builder,
  230         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         230  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  231    231   
                    "ServiceQuotaExceededException",
  232    232   
                );
  233    233   
                let content_length = payload.len();
  234    234   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  235    235   
                    builder,
  236         -
                    ::http::header::CONTENT_LENGTH,
         236  +
                    ::http_1x::header::CONTENT_LENGTH,
  237    237   
                    content_length,
  238    238   
                );
  239    239   
                builder
  240    240   
                    .status(402)
  241    241   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  242    242   
            }
  243    243   
            crate::error::ListChangedBlocksError::ValidationException(output) => {
  244    244   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  245    245   
                #[allow(unused_mut)]
  246         -
                let mut builder = ::http::Response::builder();
         246  +
                let mut builder = ::http_1x::Response::builder();
  247    247   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  248    248   
                    builder,
  249         -
                    ::http::header::CONTENT_TYPE,
         249  +
                    ::http_1x::header::CONTENT_TYPE,
  250    250   
                    "application/json",
  251    251   
                );
  252    252   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  253    253   
                    builder,
  254         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         254  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  255    255   
                    "ValidationException",
  256    256   
                );
  257    257   
                let content_length = payload.len();
  258    258   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  259    259   
                    builder,
  260         -
                    ::http::header::CONTENT_LENGTH,
         260  +
                    ::http_1x::header::CONTENT_LENGTH,
  261    261   
                    content_length,
  262    262   
                );
  263    263   
                builder
  264    264   
                    .status(400)
  265    265   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  266    266   
            }
  267    267   
        }
  268    268   
    })
  269    269   
}

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_list_snapshot_blocks.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_snapshot_blocks_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::ListSnapshotBlocksInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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_json_1::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
@@ -53,53 +260,260 @@
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_list_snapshot_blocks_http_response(
   76     76   
    #[allow(unused_variables)] output: crate::output::ListSnapshotBlocksOutput,
   77     77   
) -> std::result::Result<
   78     78   
    ::aws_smithy_http_server::response::Response,
   79     79   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        #[allow(unused_mut)]
   83         -
        let mut builder = ::http::Response::builder();
          83  +
        let mut builder = ::http_1x::Response::builder();
   84     84   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     85   
            builder,
   86         -
            ::http::header::CONTENT_TYPE,
          86  +
            ::http_1x::header::CONTENT_TYPE,
   87     87   
            "application/json",
   88     88   
        );
   89     89   
        let http_status: u16 = 200;
   90     90   
        builder = builder.status(http_status);
   91     91   
        let payload =
   92     92   
            crate::protocol_serde::shape_list_snapshot_blocks_output::ser_list_snapshot_blocks_output_output_output(&output)?
   93     93   
        ;
   94     94   
        let content_length = payload.len();
   95     95   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96     96   
            builder,
   97         -
            ::http::header::CONTENT_LENGTH,
          97  +
            ::http_1x::header::CONTENT_LENGTH,
   98     98   
            content_length,
   99     99   
        );
  100    100   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
  101    101   
        builder.body(body)?
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
#[allow(clippy::unnecessary_wraps)]
  106    106   
pub fn ser_list_snapshot_blocks_http_error(
  107    107   
    error: &crate::error::ListSnapshotBlocksError,
  108    108   
) -> std::result::Result<
  109    109   
    ::aws_smithy_http_server::response::Response,
  110    110   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  111    111   
> {
  112    112   
    Ok({
  113    113   
        match error {
  114    114   
            crate::error::ListSnapshotBlocksError::InternalServerException(output) => {
  115    115   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
  116    116   
                #[allow(unused_mut)]
  117         -
                let mut builder = ::http::Response::builder();
         117  +
                let mut builder = ::http_1x::Response::builder();
  118    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  119    119   
                    builder,
  120         -
                    ::http::header::CONTENT_TYPE,
         120  +
                    ::http_1x::header::CONTENT_TYPE,
  121    121   
                    "application/json",
  122    122   
                );
  123    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         125  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  126    126   
                    "InternalServerException",
  127    127   
                );
  128    128   
                let content_length = payload.len();
  129    129   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  130    130   
                    builder,
  131         -
                    ::http::header::CONTENT_LENGTH,
         131  +
                    ::http_1x::header::CONTENT_LENGTH,
  132    132   
                    content_length,
  133    133   
                );
  134    134   
                builder
  135    135   
                    .status(500)
  136    136   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  137    137   
            }
  138    138   
            crate::error::ListSnapshotBlocksError::ResourceNotFoundException(output) => {
  139    139   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  140    140   
                #[allow(unused_mut)]
  141         -
                let mut builder = ::http::Response::builder();
         141  +
                let mut builder = ::http_1x::Response::builder();
  142    142   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  143    143   
                    builder,
  144         -
                    ::http::header::CONTENT_TYPE,
         144  +
                    ::http_1x::header::CONTENT_TYPE,
  145    145   
                    "application/json",
  146    146   
                );
  147    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  148    148   
                    builder,
  149         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         149  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  150    150   
                    "ResourceNotFoundException",
  151    151   
                );
  152    152   
                let content_length = payload.len();
  153    153   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  154    154   
                    builder,
  155         -
                    ::http::header::CONTENT_LENGTH,
         155  +
                    ::http_1x::header::CONTENT_LENGTH,
  156    156   
                    content_length,
  157    157   
                );
  158    158   
                builder
  159    159   
                    .status(404)
  160    160   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  161    161   
            }
  162    162   
            crate::error::ListSnapshotBlocksError::AccessDeniedException(output) => {
  163    163   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  164    164   
                #[allow(unused_mut)]
  165         -
                let mut builder = ::http::Response::builder();
         165  +
                let mut builder = ::http_1x::Response::builder();
  166    166   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  167    167   
                    builder,
  168         -
                    ::http::header::CONTENT_TYPE,
         168  +
                    ::http_1x::header::CONTENT_TYPE,
  169    169   
                    "application/json",
  170    170   
                );
  171    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  172    172   
                    builder,
  173         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         173  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  174    174   
                    "AccessDeniedException",
  175    175   
                );
  176    176   
                let content_length = payload.len();
  177    177   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  178    178   
                    builder,
  179         -
                    ::http::header::CONTENT_LENGTH,
         179  +
                    ::http_1x::header::CONTENT_LENGTH,
  180    180   
                    content_length,
  181    181   
                );
  182    182   
                builder
  183    183   
                    .status(403)
  184    184   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  185    185   
            }
  186    186   
            crate::error::ListSnapshotBlocksError::RequestThrottledException(output) => {
  187    187   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  188    188   
                #[allow(unused_mut)]
  189         -
                let mut builder = ::http::Response::builder();
         189  +
                let mut builder = ::http_1x::Response::builder();
  190    190   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  191    191   
                    builder,
  192         -
                    ::http::header::CONTENT_TYPE,
         192  +
                    ::http_1x::header::CONTENT_TYPE,
  193    193   
                    "application/json",
  194    194   
                );
  195    195   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  196    196   
                    builder,
  197         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         197  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  198    198   
                    "RequestThrottledException",
  199    199   
                );
  200    200   
                let content_length = payload.len();
  201    201   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  202    202   
                    builder,
  203         -
                    ::http::header::CONTENT_LENGTH,
         203  +
                    ::http_1x::header::CONTENT_LENGTH,
  204    204   
                    content_length,
  205    205   
                );
  206    206   
                builder
  207    207   
                    .status(400)
  208    208   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  209    209   
            }
  210    210   
            crate::error::ListSnapshotBlocksError::ServiceQuotaExceededException(output) => {
  211    211   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  212    212   
                #[allow(unused_mut)]
  213         -
                let mut builder = ::http::Response::builder();
         213  +
                let mut builder = ::http_1x::Response::builder();
  214    214   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  215    215   
                    builder,
  216         -
                    ::http::header::CONTENT_TYPE,
         216  +
                    ::http_1x::header::CONTENT_TYPE,
  217    217   
                    "application/json",
  218    218   
                );
  219    219   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  220    220   
                    builder,
  221         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         221  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  222    222   
                    "ServiceQuotaExceededException",
  223    223   
                );
  224    224   
                let content_length = payload.len();
  225    225   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  226    226   
                    builder,
  227         -
                    ::http::header::CONTENT_LENGTH,
         227  +
                    ::http_1x::header::CONTENT_LENGTH,
  228    228   
                    content_length,
  229    229   
                );
  230    230   
                builder
  231    231   
                    .status(402)
  232    232   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  233    233   
            }
  234    234   
            crate::error::ListSnapshotBlocksError::ValidationException(output) => {
  235    235   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  236    236   
                #[allow(unused_mut)]
  237         -
                let mut builder = ::http::Response::builder();
         237  +
                let mut builder = ::http_1x::Response::builder();
  238    238   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  239    239   
                    builder,
  240         -
                    ::http::header::CONTENT_TYPE,
         240  +
                    ::http_1x::header::CONTENT_TYPE,
  241    241   
                    "application/json",
  242    242   
                );
  243    243   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  244    244   
                    builder,
  245         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         245  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  246    246   
                    "ValidationException",
  247    247   
                );
  248    248   
                let content_length = payload.len();
  249    249   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  250    250   
                    builder,
  251         -
                    ::http::header::CONTENT_LENGTH,
         251  +
                    ::http_1x::header::CONTENT_LENGTH,
  252    252   
                    content_length,
  253    253   
                );
  254    254   
                builder
  255    255   
                    .status(400)
  256    256   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  257    257   
            }
  258    258   
        }
  259    259   
    })
  260    260   
}

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_put_snapshot_block.rs

@@ -1,1 +56,61 @@
    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_put_snapshot_block_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::PutSnapshotBlockInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
          11  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
          12  +
        + ::std::marker::Send
          13  +
        + ::std::marker::Sync
          14  +
        + 'static,
          15  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
          16  +
   12     17   
    B::Data: Send,
   13     18   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14     19   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     20   
{
   16     21   
    Ok({
   17     22   
        #[allow(unused_mut)]
   18     23   
        let mut input = crate::input::put_snapshot_block_input::Builder::default();
   19     24   
        #[allow(unused_variables)]
   20     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     26   
            uri, headers, body, ..
   22     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     28   
        if let Some(value) = {
   24     29   
            Some(
   25     30   
                crate::protocol_serde::shape_put_snapshot_block_input::de_block_data_payload(
   26         -
                    &mut body.into().into_inner(),
          31  +
                    &mut ::aws_smithy_types::body::SdkBody::from_body_1_x(body),
   27     32   
                )?,
   28     33   
            )
   29     34   
        } {
   30     35   
            input = input.set_block_data(value)
   31     36   
        }
   32     37   
        if let Some(value) =
   33     38   
            crate::protocol_serde::shape_put_snapshot_block_input::de_checksum_header(&headers)?
   34     39   
        {
   35     40   
            input = input.set_checksum(value)
   36     41   
        }
@@ -70,75 +320,327 @@
   90     95   
   91     96   
#[allow(clippy::unnecessary_wraps)]
   92     97   
pub fn ser_put_snapshot_block_http_response(
   93     98   
    #[allow(unused_variables)] output: crate::output::PutSnapshotBlockOutput,
   94     99   
) -> std::result::Result<
   95    100   
    ::aws_smithy_http_server::response::Response,
   96    101   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   97    102   
> {
   98    103   
    Ok({
   99    104   
        #[allow(unused_mut)]
  100         -
        let mut builder = ::http::Response::builder();
         105  +
        let mut builder = ::http_1x::Response::builder();
  101    106   
        builder = crate::protocol_serde::shape_put_snapshot_block::ser_put_snapshot_block_headers(
  102    107   
            &output, builder,
  103    108   
        )?;
  104    109   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    110   
            builder,
  106         -
            ::http::header::CONTENT_TYPE,
         111  +
            ::http_1x::header::CONTENT_TYPE,
  107    112   
            "application/json",
  108    113   
        );
  109    114   
        let http_status: u16 = 201;
  110    115   
        builder = builder.status(http_status);
  111    116   
        let payload =
  112    117   
            crate::protocol_serde::shape_put_snapshot_block_output::ser_put_snapshot_block_output_output_output(&output)?
  113    118   
        ;
  114    119   
        let content_length = payload.len();
  115    120   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    121   
            builder,
  117         -
            ::http::header::CONTENT_LENGTH,
         122  +
            ::http_1x::header::CONTENT_LENGTH,
  118    123   
            content_length,
  119    124   
        );
  120    125   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
  121    126   
        builder.body(body)?
  122    127   
    })
  123    128   
}
  124    129   
  125    130   
#[allow(clippy::unnecessary_wraps)]
  126    131   
pub fn ser_put_snapshot_block_http_error(
  127    132   
    error: &crate::error::PutSnapshotBlockError,
  128    133   
) -> std::result::Result<
  129    134   
    ::aws_smithy_http_server::response::Response,
  130    135   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  131    136   
> {
  132    137   
    Ok({
  133    138   
        match error {
  134    139   
            crate::error::PutSnapshotBlockError::InternalServerException(output) => {
  135    140   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
  136    141   
                #[allow(unused_mut)]
  137         -
                let mut builder = ::http::Response::builder();
         142  +
                let mut builder = ::http_1x::Response::builder();
  138    143   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  139    144   
                    builder,
  140         -
                    ::http::header::CONTENT_TYPE,
         145  +
                    ::http_1x::header::CONTENT_TYPE,
  141    146   
                    "application/json",
  142    147   
                );
  143    148   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  144    149   
                    builder,
  145         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         150  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  146    151   
                    "InternalServerException",
  147    152   
                );
  148    153   
                let content_length = payload.len();
  149    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  150    155   
                    builder,
  151         -
                    ::http::header::CONTENT_LENGTH,
         156  +
                    ::http_1x::header::CONTENT_LENGTH,
  152    157   
                    content_length,
  153    158   
                );
  154    159   
                builder
  155    160   
                    .status(500)
  156    161   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  157    162   
            }
  158    163   
            crate::error::PutSnapshotBlockError::ResourceNotFoundException(output) => {
  159    164   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  160    165   
                #[allow(unused_mut)]
  161         -
                let mut builder = ::http::Response::builder();
         166  +
                let mut builder = ::http_1x::Response::builder();
  162    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  163    168   
                    builder,
  164         -
                    ::http::header::CONTENT_TYPE,
         169  +
                    ::http_1x::header::CONTENT_TYPE,
  165    170   
                    "application/json",
  166    171   
                );
  167    172   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  168    173   
                    builder,
  169         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         174  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  170    175   
                    "ResourceNotFoundException",
  171    176   
                );
  172    177   
                let content_length = payload.len();
  173    178   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  174    179   
                    builder,
  175         -
                    ::http::header::CONTENT_LENGTH,
         180  +
                    ::http_1x::header::CONTENT_LENGTH,
  176    181   
                    content_length,
  177    182   
                );
  178    183   
                builder
  179    184   
                    .status(404)
  180    185   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  181    186   
            }
  182    187   
            crate::error::PutSnapshotBlockError::AccessDeniedException(output) => {
  183    188   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  184    189   
                #[allow(unused_mut)]
  185         -
                let mut builder = ::http::Response::builder();
         190  +
                let mut builder = ::http_1x::Response::builder();
  186    191   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  187    192   
                    builder,
  188         -
                    ::http::header::CONTENT_TYPE,
         193  +
                    ::http_1x::header::CONTENT_TYPE,
  189    194   
                    "application/json",
  190    195   
                );
  191    196   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  192    197   
                    builder,
  193         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         198  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  194    199   
                    "AccessDeniedException",
  195    200   
                );
  196    201   
                let content_length = payload.len();
  197    202   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  198    203   
                    builder,
  199         -
                    ::http::header::CONTENT_LENGTH,
         204  +
                    ::http_1x::header::CONTENT_LENGTH,
  200    205   
                    content_length,
  201    206   
                );
  202    207   
                builder
  203    208   
                    .status(403)
  204    209   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  205    210   
            }
  206    211   
            crate::error::PutSnapshotBlockError::RequestThrottledException(output) => {
  207    212   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  208    213   
                #[allow(unused_mut)]
  209         -
                let mut builder = ::http::Response::builder();
         214  +
                let mut builder = ::http_1x::Response::builder();
  210    215   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  211    216   
                    builder,
  212         -
                    ::http::header::CONTENT_TYPE,
         217  +
                    ::http_1x::header::CONTENT_TYPE,
  213    218   
                    "application/json",
  214    219   
                );
  215    220   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  216    221   
                    builder,
  217         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         222  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  218    223   
                    "RequestThrottledException",
  219    224   
                );
  220    225   
                let content_length = payload.len();
  221    226   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  222    227   
                    builder,
  223         -
                    ::http::header::CONTENT_LENGTH,
         228  +
                    ::http_1x::header::CONTENT_LENGTH,
  224    229   
                    content_length,
  225    230   
                );
  226    231   
                builder
  227    232   
                    .status(400)
  228    233   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  229    234   
            }
  230    235   
            crate::error::PutSnapshotBlockError::ServiceQuotaExceededException(output) => {
  231    236   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  232    237   
                #[allow(unused_mut)]
  233         -
                let mut builder = ::http::Response::builder();
         238  +
                let mut builder = ::http_1x::Response::builder();
  234    239   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  235    240   
                    builder,
  236         -
                    ::http::header::CONTENT_TYPE,
         241  +
                    ::http_1x::header::CONTENT_TYPE,
  237    242   
                    "application/json",
  238    243   
                );
  239    244   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  240    245   
                    builder,
  241         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         246  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  242    247   
                    "ServiceQuotaExceededException",
  243    248   
                );
  244    249   
                let content_length = payload.len();
  245    250   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  246    251   
                    builder,
  247         -
                    ::http::header::CONTENT_LENGTH,
         252  +
                    ::http_1x::header::CONTENT_LENGTH,
  248    253   
                    content_length,
  249    254   
                );
  250    255   
                builder
  251    256   
                    .status(402)
  252    257   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  253    258   
            }
  254    259   
            crate::error::PutSnapshotBlockError::ValidationException(output) => {
  255    260   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  256    261   
                #[allow(unused_mut)]
  257         -
                let mut builder = ::http::Response::builder();
         262  +
                let mut builder = ::http_1x::Response::builder();
  258    263   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  259    264   
                    builder,
  260         -
                    ::http::header::CONTENT_TYPE,
         265  +
                    ::http_1x::header::CONTENT_TYPE,
  261    266   
                    "application/json",
  262    267   
                );
  263    268   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  264    269   
                    builder,
  265         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         270  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  266    271   
                    "ValidationException",
  267    272   
                );
  268    273   
                let content_length = payload.len();
  269    274   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  270    275   
                    builder,
  271         -
                    ::http::header::CONTENT_LENGTH,
         276  +
                    ::http_1x::header::CONTENT_LENGTH,
  272    277   
                    content_length,
  273    278   
                );
  274    279   
                builder
  275    280   
                    .status(400)
  276    281   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  277    282   
            }
  278    283   
        }
  279    284   
    })
  280    285   
}
  281    286   
  282    287   
pub fn ser_put_snapshot_block_headers(
  283    288   
    input: &crate::output::PutSnapshotBlockOutput,
  284         -
    mut builder: ::http::response::Builder,
  285         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  286         -
{
         289  +
    mut builder: ::http_1x::response::Builder,
         290  +
) -> std::result::Result<
         291  +
    ::http_1x::response::Builder,
         292  +
    ::aws_smithy_types::error::operation::BuildError,
         293  +
> {
  287    294   
    if let ::std::option::Option::Some(inner_1) = &input.checksum_algorithm {
  288    295   
        let formatted_2 = inner_1.as_str();
  289    296   
        if !formatted_2.is_empty() {
  290    297   
            let header_value = formatted_2;
  291         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         298  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  292    299   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  293    300   
                    "checksum_algorithm",
  294    301   
                    format!(
  295    302   
                        "`{}` cannot be used as a header value: {}",
  296    303   
                        &header_value, err
  297    304   
                    ),
  298    305   
                )
  299    306   
            })?;
  300    307   
            builder = builder.header("x-amz-Checksum-Algorithm", header_value);
  301    308   
        }
  302    309   
    }
  303    310   
    if let ::std::option::Option::Some(inner_3) = &input.checksum {
  304    311   
        let formatted_4 = inner_3.as_str();
  305    312   
        if !formatted_4.is_empty() {
  306    313   
            let header_value = formatted_4;
  307         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         314  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  308    315   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  309    316   
                    "checksum",
  310    317   
                    format!(
  311    318   
                        "`{}` cannot be used as a header value: {}",
  312    319   
                        &header_value, err
  313    320   
                    ),
  314    321   
                )
  315    322   
            })?;
  316    323   
            builder = builder.header("x-amz-Checksum", header_value);
  317    324   
        }

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_start_snapshot.rs

@@ -1,1 +295,298 @@
    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_start_snapshot_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::StartSnapshotInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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_json_1::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::start_snapshot_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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/json"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_start_snapshot::de_start_snapshot(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()?
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_start_snapshot_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::StartSnapshotOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/json",
   51     54   
        );
   52     55   
        let http_status: u16 = 201;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload =
   55     58   
            crate::protocol_serde::shape_start_snapshot_output::ser_start_snapshot_output_output_output(&output)?
   56     59   
        ;
   57     60   
        let content_length = payload.len();
   58     61   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     62   
            builder,
   60         -
            ::http::header::CONTENT_LENGTH,
          63  +
            ::http_1x::header::CONTENT_LENGTH,
   61     64   
            content_length,
   62     65   
        );
   63     66   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   64     67   
        builder.body(body)?
   65     68   
    })
   66     69   
}
   67     70   
   68     71   
#[allow(clippy::unnecessary_wraps)]
   69     72   
pub fn ser_start_snapshot_http_error(
   70     73   
    error: &crate::error::StartSnapshotError,
   71     74   
) -> std::result::Result<
   72     75   
    ::aws_smithy_http_server::response::Response,
   73     76   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     77   
> {
   75     78   
    Ok({
   76     79   
        match error {
   77     80   
            crate::error::StartSnapshotError::InternalServerException(output) => {
   78     81   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
   79     82   
                #[allow(unused_mut)]
   80         -
                let mut builder = ::http::Response::builder();
          83  +
                let mut builder = ::http_1x::Response::builder();
   81     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     85   
                    builder,
   83         -
                    ::http::header::CONTENT_TYPE,
          86  +
                    ::http_1x::header::CONTENT_TYPE,
   84     87   
                    "application/json",
   85     88   
                );
   86     89   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     90   
                    builder,
   88         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          91  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   89     92   
                    "InternalServerException",
   90     93   
                );
   91     94   
                let content_length = payload.len();
   92     95   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     96   
                    builder,
   94         -
                    ::http::header::CONTENT_LENGTH,
          97  +
                    ::http_1x::header::CONTENT_LENGTH,
   95     98   
                    content_length,
   96     99   
                );
   97    100   
                builder
   98    101   
                    .status(500)
   99    102   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  100    103   
            }
  101    104   
            crate::error::StartSnapshotError::ResourceNotFoundException(output) => {
  102    105   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
  103    106   
                #[allow(unused_mut)]
  104         -
                let mut builder = ::http::Response::builder();
         107  +
                let mut builder = ::http_1x::Response::builder();
  105    108   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  106    109   
                    builder,
  107         -
                    ::http::header::CONTENT_TYPE,
         110  +
                    ::http_1x::header::CONTENT_TYPE,
  108    111   
                    "application/json",
  109    112   
                );
  110    113   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  111    114   
                    builder,
  112         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         115  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  113    116   
                    "ResourceNotFoundException",
  114    117   
                );
  115    118   
                let content_length = payload.len();
  116    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  117    120   
                    builder,
  118         -
                    ::http::header::CONTENT_LENGTH,
         121  +
                    ::http_1x::header::CONTENT_LENGTH,
  119    122   
                    content_length,
  120    123   
                );
  121    124   
                builder
  122    125   
                    .status(404)
  123    126   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  124    127   
            }
  125    128   
            crate::error::StartSnapshotError::AccessDeniedException(output) => {
  126    129   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
  127    130   
                #[allow(unused_mut)]
  128         -
                let mut builder = ::http::Response::builder();
         131  +
                let mut builder = ::http_1x::Response::builder();
  129    132   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  130    133   
                    builder,
  131         -
                    ::http::header::CONTENT_TYPE,
         134  +
                    ::http_1x::header::CONTENT_TYPE,
  132    135   
                    "application/json",
  133    136   
                );
  134    137   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  135    138   
                    builder,
  136         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         139  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  137    140   
                    "AccessDeniedException",
  138    141   
                );
  139    142   
                let content_length = payload.len();
  140    143   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  141    144   
                    builder,
  142         -
                    ::http::header::CONTENT_LENGTH,
         145  +
                    ::http_1x::header::CONTENT_LENGTH,
  143    146   
                    content_length,
  144    147   
                );
  145    148   
                builder
  146    149   
                    .status(403)
  147    150   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  148    151   
            }
  149    152   
            crate::error::StartSnapshotError::ConflictException(output) => {
  150    153   
                let payload =
  151    154   
                    crate::protocol_serde::shape_conflict_exception::ser_conflict_exception_error(
  152    155   
                        output,
  153    156   
                    )?;
  154    157   
                #[allow(unused_mut)]
  155         -
                let mut builder = ::http::Response::builder();
         158  +
                let mut builder = ::http_1x::Response::builder();
  156    159   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  157    160   
                    builder,
  158         -
                    ::http::header::CONTENT_TYPE,
         161  +
                    ::http_1x::header::CONTENT_TYPE,
  159    162   
                    "application/json",
  160    163   
                );
  161    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  162    165   
                    builder,
  163         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         166  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  164    167   
                    "ConflictException",
  165    168   
                );
  166    169   
                let content_length = payload.len();
  167    170   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  168    171   
                    builder,
  169         -
                    ::http::header::CONTENT_LENGTH,
         172  +
                    ::http_1x::header::CONTENT_LENGTH,
  170    173   
                    content_length,
  171    174   
                );
  172    175   
                builder
  173    176   
                    .status(503)
  174    177   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  175    178   
            }
  176    179   
            crate::error::StartSnapshotError::RequestThrottledException(output) => {
  177    180   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
  178    181   
                #[allow(unused_mut)]
  179         -
                let mut builder = ::http::Response::builder();
         182  +
                let mut builder = ::http_1x::Response::builder();
  180    183   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  181    184   
                    builder,
  182         -
                    ::http::header::CONTENT_TYPE,
         185  +
                    ::http_1x::header::CONTENT_TYPE,
  183    186   
                    "application/json",
  184    187   
                );
  185    188   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  186    189   
                    builder,
  187         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         190  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  188    191   
                    "RequestThrottledException",
  189    192   
                );
  190    193   
                let content_length = payload.len();
  191    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  192    195   
                    builder,
  193         -
                    ::http::header::CONTENT_LENGTH,
         196  +
                    ::http_1x::header::CONTENT_LENGTH,
  194    197   
                    content_length,
  195    198   
                );
  196    199   
                builder
  197    200   
                    .status(400)
  198    201   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  199    202   
            }
  200    203   
            crate::error::StartSnapshotError::ServiceQuotaExceededException(output) => {
  201    204   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
  202    205   
                #[allow(unused_mut)]
  203         -
                let mut builder = ::http::Response::builder();
         206  +
                let mut builder = ::http_1x::Response::builder();
  204    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  205    208   
                    builder,
  206         -
                    ::http::header::CONTENT_TYPE,
         209  +
                    ::http_1x::header::CONTENT_TYPE,
  207    210   
                    "application/json",
  208    211   
                );
  209    212   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  210    213   
                    builder,
  211         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         214  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  212    215   
                    "ServiceQuotaExceededException",
  213    216   
                );
  214    217   
                let content_length = payload.len();
  215    218   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  216    219   
                    builder,
  217         -
                    ::http::header::CONTENT_LENGTH,
         220  +
                    ::http_1x::header::CONTENT_LENGTH,
  218    221   
                    content_length,
  219    222   
                );
  220    223   
                builder
  221    224   
                    .status(402)
  222    225   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  223    226   
            }
  224    227   
            crate::error::StartSnapshotError::ConcurrentLimitExceededException(output) => {
  225    228   
                let payload = crate::protocol_serde::shape_concurrent_limit_exceeded_exception::ser_concurrent_limit_exceeded_exception_error(output)?;
  226    229   
                #[allow(unused_mut)]
  227         -
                let mut builder = ::http::Response::builder();
         230  +
                let mut builder = ::http_1x::Response::builder();
  228    231   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  229    232   
                    builder,
  230         -
                    ::http::header::CONTENT_TYPE,
         233  +
                    ::http_1x::header::CONTENT_TYPE,
  231    234   
                    "application/json",
  232    235   
                );
  233    236   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  234    237   
                    builder,
  235         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         238  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  236    239   
                    "ConcurrentLimitExceededException",
  237    240   
                );
  238    241   
                let content_length = payload.len();
  239    242   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  240    243   
                    builder,
  241         -
                    ::http::header::CONTENT_LENGTH,
         244  +
                    ::http_1x::header::CONTENT_LENGTH,
  242    245   
                    content_length,
  243    246   
                );
  244    247   
                builder
  245    248   
                    .status(400)
  246    249   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  247    250   
            }
  248    251   
            crate::error::StartSnapshotError::ValidationException(output) => {
  249    252   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  250    253   
                #[allow(unused_mut)]
  251         -
                let mut builder = ::http::Response::builder();
         254  +
                let mut builder = ::http_1x::Response::builder();
  252    255   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  253    256   
                    builder,
  254         -
                    ::http::header::CONTENT_TYPE,
         257  +
                    ::http_1x::header::CONTENT_TYPE,
  255    258   
                    "application/json",
  256    259   
                );
  257    260   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  258    261   
                    builder,
  259         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         262  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  260    263   
                    "ValidationException",
  261    264   
                );
  262    265   
                let content_length = payload.len();
  263    266   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  264    267   
                    builder,
  265         -
                    ::http::header::CONTENT_LENGTH,
         268  +
                    ::http_1x::header::CONTENT_LENGTH,
  266    269   
                    content_length,
  267    270   
                );
  268    271   
                builder
  269    272   
                    .status(400)
  270    273   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  271    274   
            }
  272    275   
        }
  273    276   
    })
  274    277   
}
  275    278   

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

@@ -40,40 +101,101 @@
   60     60   
                            <
   61     61   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   62     62   
                                as ::aws_smithy_http_server::plugin::Plugin<
   63     63   
                                    Ebs<L>,
   64     64   
                                    crate::operation_shape::CompleteSnapshot,
   65     65   
                                    ModelPl::Output
   66     66   
                                >
   67     67   
                            >::Output
   68     68   
                        >,
   69     69   
   70         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   71         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          70  +
                        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,
          71  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   72     72   
   73     73   
                    {
   74     74   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   75     75   
        use ::aws_smithy_http_server::plugin::Plugin;
   76     76   
        let svc = crate::operation_shape::CompleteSnapshot::from_handler(handler);
   77     77   
        let svc = self.model_plugin.apply(svc);
   78     78   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   79     79   
            .apply(svc);
   80     80   
        let svc = self.http_plugin.apply(svc);
   81     81   
        self.complete_snapshot_custom(svc)
@@ -107,107 +187,187 @@
  127    127   
                            <
  128    128   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  129    129   
                                as ::aws_smithy_http_server::plugin::Plugin<
  130    130   
                                    Ebs<L>,
  131    131   
                                    crate::operation_shape::CompleteSnapshot,
  132    132   
                                    ModelPl::Output
  133    133   
                                >
  134    134   
                            >::Output
  135    135   
                        >,
  136    136   
  137         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  138         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         137  +
                        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,
         138  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  139    139   
  140    140   
                    {
  141    141   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  142    142   
        use ::aws_smithy_http_server::plugin::Plugin;
  143    143   
        let svc = crate::operation_shape::CompleteSnapshot::from_service(service);
  144    144   
        let svc = self.model_plugin.apply(svc);
  145    145   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  146    146   
            .apply(svc);
  147    147   
        let svc = self.http_plugin.apply(svc);
  148    148   
        self.complete_snapshot_custom(svc)
  149    149   
    }
  150    150   
  151    151   
    /// Sets the [`CompleteSnapshot`](crate::operation_shape::CompleteSnapshot) to a custom [`Service`](tower::Service).
  152    152   
    /// not constrained by the Smithy contract.
  153    153   
    fn complete_snapshot_custom<S>(mut self, svc: S) -> Self
  154    154   
    where
  155    155   
        S: ::tower::Service<
  156         -
                ::http::Request<Body>,
  157         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         156  +
                ::http_1x::Request<Body>,
         157  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  158    158   
                Error = ::std::convert::Infallible,
  159    159   
            > + Clone
  160    160   
            + Send
  161    161   
            + 'static,
  162    162   
        S::Future: Send + 'static,
  163    163   
    {
  164    164   
        self.complete_snapshot = Some(::aws_smithy_http_server::routing::Route::new(svc));
  165    165   
        self
  166    166   
    }
  167    167   
@@ -190,190 +251,251 @@
  210    210   
                            <
  211    211   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  212    212   
                                as ::aws_smithy_http_server::plugin::Plugin<
  213    213   
                                    Ebs<L>,
  214    214   
                                    crate::operation_shape::GetSnapshotBlock,
  215    215   
                                    ModelPl::Output
  216    216   
                                >
  217    217   
                            >::Output
  218    218   
                        >,
  219    219   
  220         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  221         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         220  +
                        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,
         221  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  222    222   
  223    223   
                    {
  224    224   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  225    225   
        use ::aws_smithy_http_server::plugin::Plugin;
  226    226   
        let svc = crate::operation_shape::GetSnapshotBlock::from_handler(handler);
  227    227   
        let svc = self.model_plugin.apply(svc);
  228    228   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  229    229   
            .apply(svc);
  230    230   
        let svc = self.http_plugin.apply(svc);
  231    231   
        self.get_snapshot_block_custom(svc)
@@ -257,257 +337,337 @@
  277    277   
                            <
  278    278   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  279    279   
                                as ::aws_smithy_http_server::plugin::Plugin<
  280    280   
                                    Ebs<L>,
  281    281   
                                    crate::operation_shape::GetSnapshotBlock,
  282    282   
                                    ModelPl::Output
  283    283   
                                >
  284    284   
                            >::Output
  285    285   
                        >,
  286    286   
  287         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  288         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         287  +
                        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,
         288  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  289    289   
  290    290   
                    {
  291    291   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  292    292   
        use ::aws_smithy_http_server::plugin::Plugin;
  293    293   
        let svc = crate::operation_shape::GetSnapshotBlock::from_service(service);
  294    294   
        let svc = self.model_plugin.apply(svc);
  295    295   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  296    296   
            .apply(svc);
  297    297   
        let svc = self.http_plugin.apply(svc);
  298    298   
        self.get_snapshot_block_custom(svc)
  299    299   
    }
  300    300   
  301    301   
    /// Sets the [`GetSnapshotBlock`](crate::operation_shape::GetSnapshotBlock) to a custom [`Service`](tower::Service).
  302    302   
    /// not constrained by the Smithy contract.
  303    303   
    fn get_snapshot_block_custom<S>(mut self, svc: S) -> Self
  304    304   
    where
  305    305   
        S: ::tower::Service<
  306         -
                ::http::Request<Body>,
  307         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         306  +
                ::http_1x::Request<Body>,
         307  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  308    308   
                Error = ::std::convert::Infallible,
  309    309   
            > + Clone
  310    310   
            + Send
  311    311   
            + 'static,
  312    312   
        S::Future: Send + 'static,
  313    313   
    {
  314    314   
        self.get_snapshot_block = Some(::aws_smithy_http_server::routing::Route::new(svc));
  315    315   
        self
  316    316   
    }
  317    317   
@@ -340,340 +401,401 @@
  360    360   
                            <
  361    361   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  362    362   
                                as ::aws_smithy_http_server::plugin::Plugin<
  363    363   
                                    Ebs<L>,
  364    364   
                                    crate::operation_shape::ListChangedBlocks,
  365    365   
                                    ModelPl::Output
  366    366   
                                >
  367    367   
                            >::Output
  368    368   
                        >,
  369    369   
  370         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  371         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         370  +
                        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,
         371  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  372    372   
  373    373   
                    {
  374    374   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  375    375   
        use ::aws_smithy_http_server::plugin::Plugin;
  376    376   
        let svc = crate::operation_shape::ListChangedBlocks::from_handler(handler);
  377    377   
        let svc = self.model_plugin.apply(svc);
  378    378   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  379    379   
            .apply(svc);
  380    380   
        let svc = self.http_plugin.apply(svc);
  381    381   
        self.list_changed_blocks_custom(svc)
@@ -407,407 +487,487 @@
  427    427   
                            <
  428    428   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  429    429   
                                as ::aws_smithy_http_server::plugin::Plugin<
  430    430   
                                    Ebs<L>,
  431    431   
                                    crate::operation_shape::ListChangedBlocks,
  432    432   
                                    ModelPl::Output
  433    433   
                                >
  434    434   
                            >::Output
  435    435   
                        >,
  436    436   
  437         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  438         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         437  +
                        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,
         438  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  439    439   
  440    440   
                    {
  441    441   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  442    442   
        use ::aws_smithy_http_server::plugin::Plugin;
  443    443   
        let svc = crate::operation_shape::ListChangedBlocks::from_service(service);
  444    444   
        let svc = self.model_plugin.apply(svc);
  445    445   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  446    446   
            .apply(svc);
  447    447   
        let svc = self.http_plugin.apply(svc);
  448    448   
        self.list_changed_blocks_custom(svc)
  449    449   
    }
  450    450   
  451    451   
    /// Sets the [`ListChangedBlocks`](crate::operation_shape::ListChangedBlocks) to a custom [`Service`](tower::Service).
  452    452   
    /// not constrained by the Smithy contract.
  453    453   
    fn list_changed_blocks_custom<S>(mut self, svc: S) -> Self
  454    454   
    where
  455    455   
        S: ::tower::Service<
  456         -
                ::http::Request<Body>,
  457         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         456  +
                ::http_1x::Request<Body>,
         457  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  458    458   
                Error = ::std::convert::Infallible,
  459    459   
            > + Clone
  460    460   
            + Send
  461    461   
            + 'static,
  462    462   
        S::Future: Send + 'static,
  463    463   
    {
  464    464   
        self.list_changed_blocks = Some(::aws_smithy_http_server::routing::Route::new(svc));
  465    465   
        self
  466    466   
    }
  467    467   
@@ -490,490 +551,551 @@
  510    510   
                            <
  511    511   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  512    512   
                                as ::aws_smithy_http_server::plugin::Plugin<
  513    513   
                                    Ebs<L>,
  514    514   
                                    crate::operation_shape::ListSnapshotBlocks,
  515    515   
                                    ModelPl::Output
  516    516   
                                >
  517    517   
                            >::Output
  518    518   
                        >,
  519    519   
  520         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  521         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         520  +
                        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,
         521  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  522    522   
  523    523   
                    {
  524    524   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  525    525   
        use ::aws_smithy_http_server::plugin::Plugin;
  526    526   
        let svc = crate::operation_shape::ListSnapshotBlocks::from_handler(handler);
  527    527   
        let svc = self.model_plugin.apply(svc);
  528    528   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  529    529   
            .apply(svc);
  530    530   
        let svc = self.http_plugin.apply(svc);
  531    531   
        self.list_snapshot_blocks_custom(svc)
@@ -557,557 +637,637 @@
  577    577   
                            <
  578    578   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  579    579   
                                as ::aws_smithy_http_server::plugin::Plugin<
  580    580   
                                    Ebs<L>,
  581    581   
                                    crate::operation_shape::ListSnapshotBlocks,
  582    582   
                                    ModelPl::Output
  583    583   
                                >
  584    584   
                            >::Output
  585    585   
                        >,
  586    586   
  587         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  588         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         587  +
                        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,
         588  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  589    589   
  590    590   
                    {
  591    591   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  592    592   
        use ::aws_smithy_http_server::plugin::Plugin;
  593    593   
        let svc = crate::operation_shape::ListSnapshotBlocks::from_service(service);
  594    594   
        let svc = self.model_plugin.apply(svc);
  595    595   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  596    596   
            .apply(svc);
  597    597   
        let svc = self.http_plugin.apply(svc);
  598    598   
        self.list_snapshot_blocks_custom(svc)
  599    599   
    }
  600    600   
  601    601   
    /// Sets the [`ListSnapshotBlocks`](crate::operation_shape::ListSnapshotBlocks) to a custom [`Service`](tower::Service).
  602    602   
    /// not constrained by the Smithy contract.
  603    603   
    fn list_snapshot_blocks_custom<S>(mut self, svc: S) -> Self
  604    604   
    where
  605    605   
        S: ::tower::Service<
  606         -
                ::http::Request<Body>,
  607         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         606  +
                ::http_1x::Request<Body>,
         607  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  608    608   
                Error = ::std::convert::Infallible,
  609    609   
            > + Clone
  610    610   
            + Send
  611    611   
            + 'static,
  612    612   
        S::Future: Send + 'static,
  613    613   
    {
  614    614   
        self.list_snapshot_blocks = Some(::aws_smithy_http_server::routing::Route::new(svc));
  615    615   
        self
  616    616   
    }
  617    617   
@@ -640,640 +701,701 @@
  660    660   
                            <
  661    661   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  662    662   
                                as ::aws_smithy_http_server::plugin::Plugin<
  663    663   
                                    Ebs<L>,
  664    664   
                                    crate::operation_shape::PutSnapshotBlock,
  665    665   
                                    ModelPl::Output
  666    666   
                                >
  667    667   
                            >::Output
  668    668   
                        >,
  669    669   
  670         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  671         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         670  +
                        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,
         671  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  672    672   
  673    673   
                    {
  674    674   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  675    675   
        use ::aws_smithy_http_server::plugin::Plugin;
  676    676   
        let svc = crate::operation_shape::PutSnapshotBlock::from_handler(handler);
  677    677   
        let svc = self.model_plugin.apply(svc);
  678    678   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  679    679   
            .apply(svc);
  680    680   
        let svc = self.http_plugin.apply(svc);
  681    681   
        self.put_snapshot_block_custom(svc)
@@ -707,707 +787,787 @@
  727    727   
                            <
  728    728   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  729    729   
                                as ::aws_smithy_http_server::plugin::Plugin<
  730    730   
                                    Ebs<L>,
  731    731   
                                    crate::operation_shape::PutSnapshotBlock,
  732    732   
                                    ModelPl::Output
  733    733   
                                >
  734    734   
                            >::Output
  735    735   
                        >,
  736    736   
  737         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  738         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         737  +
                        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,
         738  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  739    739   
  740    740   
                    {
  741    741   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  742    742   
        use ::aws_smithy_http_server::plugin::Plugin;
  743    743   
        let svc = crate::operation_shape::PutSnapshotBlock::from_service(service);
  744    744   
        let svc = self.model_plugin.apply(svc);
  745    745   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  746    746   
            .apply(svc);
  747    747   
        let svc = self.http_plugin.apply(svc);
  748    748   
        self.put_snapshot_block_custom(svc)
  749    749   
    }
  750    750   
  751    751   
    /// Sets the [`PutSnapshotBlock`](crate::operation_shape::PutSnapshotBlock) to a custom [`Service`](tower::Service).
  752    752   
    /// not constrained by the Smithy contract.
  753    753   
    fn put_snapshot_block_custom<S>(mut self, svc: S) -> Self
  754    754   
    where
  755    755   
        S: ::tower::Service<
  756         -
                ::http::Request<Body>,
  757         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         756  +
                ::http_1x::Request<Body>,
         757  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  758    758   
                Error = ::std::convert::Infallible,
  759    759   
            > + Clone
  760    760   
            + Send
  761    761   
            + 'static,
  762    762   
        S::Future: Send + 'static,
  763    763   
    {
  764    764   
        self.put_snapshot_block = Some(::aws_smithy_http_server::routing::Route::new(svc));
  765    765   
        self
  766    766   
    }
  767    767   
@@ -790,790 +851,851 @@
  810    810   
                            <
  811    811   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  812    812   
                                as ::aws_smithy_http_server::plugin::Plugin<
  813    813   
                                    Ebs<L>,
  814    814   
                                    crate::operation_shape::StartSnapshot,
  815    815   
                                    ModelPl::Output
  816    816   
                                >
  817    817   
                            >::Output
  818    818   
                        >,
  819    819   
  820         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  821         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         820  +
                        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,
         821  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  822    822   
  823    823   
                    {
  824    824   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  825    825   
        use ::aws_smithy_http_server::plugin::Plugin;
  826    826   
        let svc = crate::operation_shape::StartSnapshot::from_handler(handler);
  827    827   
        let svc = self.model_plugin.apply(svc);
  828    828   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  829    829   
            .apply(svc);
  830    830   
        let svc = self.http_plugin.apply(svc);
  831    831   
        self.start_snapshot_custom(svc)
@@ -857,857 +937,937 @@
  877    877   
                            <
  878    878   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  879    879   
                                as ::aws_smithy_http_server::plugin::Plugin<
  880    880   
                                    Ebs<L>,
  881    881   
                                    crate::operation_shape::StartSnapshot,
  882    882   
                                    ModelPl::Output
  883    883   
                                >
  884    884   
                            >::Output
  885    885   
                        >,
  886    886   
  887         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  888         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         887  +
                        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,
         888  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  889    889   
  890    890   
                    {
  891    891   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  892    892   
        use ::aws_smithy_http_server::plugin::Plugin;
  893    893   
        let svc = crate::operation_shape::StartSnapshot::from_service(service);
  894    894   
        let svc = self.model_plugin.apply(svc);
  895    895   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  896    896   
            .apply(svc);
  897    897   
        let svc = self.http_plugin.apply(svc);
  898    898   
        self.start_snapshot_custom(svc)
  899    899   
    }
  900    900   
  901    901   
    /// Sets the [`StartSnapshot`](crate::operation_shape::StartSnapshot) to a custom [`Service`](tower::Service).
  902    902   
    /// not constrained by the Smithy contract.
  903    903   
    fn start_snapshot_custom<S>(mut self, svc: S) -> Self
  904    904   
    where
  905    905   
        S: ::tower::Service<
  906         -
                ::http::Request<Body>,
  907         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         906  +
                ::http_1x::Request<Body>,
         907  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  908    908   
                Error = ::std::convert::Infallible,
  909    909   
            > + Clone
  910    910   
            + Send
  911    911   
            + 'static,
  912    912   
        S::Future: Send + 'static,
  913    913   
    {
  914    914   
        self.start_snapshot = Some(::aws_smithy_http_server::routing::Route::new(svc));
  915    915   
        self
  916    916   
    }
  917    917   
}
@@ -1117,1117 +1263,1263 @@
 1137   1137   
        Ok(())
 1138   1138   
    }
 1139   1139   
}
 1140   1140   
 1141   1141   
impl std::error::Error for MissingOperationsError {}
 1142   1142   
 1143   1143   
mod request_specs {
 1144   1144   
    pub(super) fn complete_snapshot() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec
 1145   1145   
    {
 1146   1146   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1147         -
                    ::http::Method::POST,
        1147  +
                    ::http_1x::Method::POST,
 1148   1148   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1149   1149   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1150   1150   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1151   1151   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1152   1152   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("completion")),
 1153   1153   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1154   1154   
]),
 1155   1155   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1156   1156   
])
 1157   1157   
                        )
 1158   1158   
                    ),
 1159   1159   
                )
 1160   1160   
    }
 1161   1161   
    pub(super) fn get_snapshot_block(
 1162   1162   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1163   1163   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1164         -
                    ::http::Method::GET,
        1164  +
                    ::http_1x::Method::GET,
 1165   1165   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1166   1166   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1167   1167   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1168   1168   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1169   1169   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1170   1170   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("blocks")),
 1171   1171   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1172   1172   
]),
 1173   1173   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1174   1174   
])
 1175   1175   
                        )
 1176   1176   
                    ),
 1177   1177   
                )
 1178   1178   
    }
 1179   1179   
    pub(super) fn list_changed_blocks(
 1180   1180   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1181   1181   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1182         -
                    ::http::Method::GET,
        1182  +
                    ::http_1x::Method::GET,
 1183   1183   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1184   1184   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1185   1185   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1186   1186   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1187   1187   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1188   1188   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("changedblocks")),
 1189   1189   
]),
 1190   1190   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1191   1191   
])
 1192   1192   
                        )
 1193   1193   
                    ),
 1194   1194   
                )
 1195   1195   
    }
 1196   1196   
    pub(super) fn list_snapshot_blocks(
 1197   1197   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1198   1198   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1199         -
                    ::http::Method::GET,
        1199  +
                    ::http_1x::Method::GET,
 1200   1200   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1201   1201   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1202   1202   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1203   1203   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1204   1204   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1205   1205   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("blocks")),
 1206   1206   
]),
 1207   1207   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1208   1208   
])
 1209   1209   
                        )
 1210   1210   
                    ),
 1211   1211   
                )
 1212   1212   
    }
 1213   1213   
    pub(super) fn put_snapshot_block(
 1214   1214   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1215   1215   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1216         -
                    ::http::Method::PUT,
        1216  +
                    ::http_1x::Method::PUT,
 1217   1217   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1218   1218   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1219   1219   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1220   1220   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1221   1221   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1222   1222   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("blocks")),
 1223   1223   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Label,
 1224   1224   
]),
 1225   1225   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1226   1226   
])
 1227   1227   
                        )
 1228   1228   
                    ),
 1229   1229   
                )
 1230   1230   
    }
 1231   1231   
    pub(super) fn start_snapshot() -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1232   1232   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1233         -
                    ::http::Method::POST,
        1233  +
                    ::http_1x::Method::POST,
 1234   1234   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1235   1235   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1236   1236   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1237   1237   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("snapshots")),
 1238   1238   
]),
 1239   1239   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1240   1240   
])
 1241   1241   
                        )
 1242   1242   
                    ),
 1243   1243   
                )
@@ -1372,1372 +1433,1433 @@
 1392   1392   
    ) -> Ebs<
 1393   1393   
        ::aws_smithy_http_server::routing::RoutingService<
 1394   1394   
            ::aws_smithy_http_server::protocol::rest::router::RestRouter<
 1395   1395   
                ::aws_smithy_http_server::routing::Route<B>,
 1396   1396   
            >,
 1397   1397   
            ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1398   1398   
        >,
 1399   1399   
    >
 1400   1400   
    where
 1401   1401   
        S: ::tower::Service<
 1402         -
            ::http::Request<B>,
 1403         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1402  +
            ::http_1x::Request<B>,
        1403  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1404   1404   
            Error = std::convert::Infallible,
 1405   1405   
        >,
 1406   1406   
        S: Clone + Send + 'static,
 1407   1407   
        S::Future: Send + 'static,
 1408   1408   
    {
 1409   1409   
        self.layer(&::tower::layer::layer_fn(
 1410   1410   
            ::aws_smithy_http_server::routing::Route::new,
 1411   1411   
        ))
 1412   1412   
    }
 1413   1413   
}

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

@@ -0,1 +0,56 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "json_rpc10-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#awsJson1_0"
          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.aws-smithy-protocol-test]
          39  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          40  +
[dev-dependencies.bytes]
          41  +
version = "1.4.0"
          42  +
[dev-dependencies.pretty_assertions]
          43  +
version = "1.3.0"
          44  +
[dev-dependencies.tokio]
          45  +
version = "1.23.1"
          46  +
features = ["macros", "test-util", "rt-multi-thread"]
          47  +
[dev-dependencies.tracing-test]
          48  +
version = "0.2.5"
          49  +
features = ["no-env-filter"]
          50  +
[features]
          51  +
rt-tokio = ["aws-smithy-types/rt-tokio"]
          52  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          53  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          54  +
default = ["rt-tokio", "request-id"]
          55  +
          56  +

tmp-codegen-diff/codegen-server-test/json_rpc10-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/json_rpc10-http0x/rust-server-codegen/src/error.rs

@@ -0,1 +0,547 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// Error type for the `OperationWithNestedStructure` operation.
           4  +
/// Each variant represents an error that can occur for the `OperationWithNestedStructure` operation.
           5  +
#[derive(::std::fmt::Debug)]
           6  +
pub enum OperationWithNestedStructureError {
           7  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           8  +
    ValidationException(crate::error::ValidationException),
           9  +
}
          10  +
impl ::std::fmt::Display for OperationWithNestedStructureError {
          11  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          12  +
        match &self {
          13  +
            OperationWithNestedStructureError::ValidationException(_inner) => _inner.fmt(f),
          14  +
        }
          15  +
    }
          16  +
}
          17  +
impl OperationWithNestedStructureError {
          18  +
    /// Returns `true` if the error kind is `OperationWithNestedStructureError::ValidationException`.
          19  +
    pub fn is_validation_exception(&self) -> bool {
          20  +
        matches!(
          21  +
            &self,
          22  +
            OperationWithNestedStructureError::ValidationException(_)
          23  +
        )
          24  +
    }
          25  +
    /// Returns the error name string by matching the correct variant.
          26  +
    pub fn name(&self) -> &'static str {
          27  +
        match &self {
          28  +
            OperationWithNestedStructureError::ValidationException(_inner) => _inner.name(),
          29  +
        }
          30  +
    }
          31  +
}
          32  +
impl ::std::error::Error for OperationWithNestedStructureError {
          33  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          34  +
        match &self {
          35  +
            OperationWithNestedStructureError::ValidationException(_inner) => Some(_inner),
          36  +
        }
          37  +
    }
          38  +
}
          39  +
impl ::std::convert::From<crate::error::ValidationException>
          40  +
    for crate::error::OperationWithNestedStructureError
          41  +
{
          42  +
    fn from(
          43  +
        variant: crate::error::ValidationException,
          44  +
    ) -> crate::error::OperationWithNestedStructureError {
          45  +
        Self::ValidationException(variant)
          46  +
    }
          47  +
}
          48  +
          49  +
/// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          50  +
#[derive(
          51  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          52  +
)]
          53  +
pub struct ValidationException {
          54  +
    /// A summary of the validation failure.
          55  +
    pub message: ::std::string::String,
          56  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          57  +
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
          58  +
}
          59  +
impl ValidationException {
          60  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          61  +
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
          62  +
        self.field_list.as_deref()
          63  +
    }
          64  +
}
          65  +
impl ValidationException {
          66  +
    /// Returns the error message.
          67  +
    pub fn message(&self) -> &str {
          68  +
        &self.message
          69  +
    }
          70  +
    #[doc(hidden)]
          71  +
    /// Returns the error name.
          72  +
    pub fn name(&self) -> &'static str {
          73  +
        "ValidationException"
          74  +
    }
          75  +
}
          76  +
impl ::std::fmt::Display for ValidationException {
          77  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          78  +
        ::std::write!(f, "ValidationException")?;
          79  +
        {
          80  +
            ::std::write!(f, ": {}", &self.message)?;
          81  +
        }
          82  +
        Ok(())
          83  +
    }
          84  +
}
          85  +
impl ::std::error::Error for ValidationException {}
          86  +
impl ValidationException {
          87  +
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
          88  +
    pub fn builder() -> crate::error::validation_exception::Builder {
          89  +
        crate::error::validation_exception::Builder::default()
          90  +
    }
          91  +
}
          92  +
          93  +
/// Error type for the `OperationWithDefaults` operation.
          94  +
/// Each variant represents an error that can occur for the `OperationWithDefaults` operation.
          95  +
#[derive(::std::fmt::Debug)]
          96  +
pub enum OperationWithDefaultsError {
          97  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          98  +
    ValidationException(crate::error::ValidationException),
          99  +
}
         100  +
impl ::std::fmt::Display for OperationWithDefaultsError {
         101  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         102  +
        match &self {
         103  +
            OperationWithDefaultsError::ValidationException(_inner) => _inner.fmt(f),
         104  +
        }
         105  +
    }
         106  +
}
         107  +
impl OperationWithDefaultsError {
         108  +
    /// Returns `true` if the error kind is `OperationWithDefaultsError::ValidationException`.
         109  +
    pub fn is_validation_exception(&self) -> bool {
         110  +
        matches!(&self, OperationWithDefaultsError::ValidationException(_))
         111  +
    }
         112  +
    /// Returns the error name string by matching the correct variant.
         113  +
    pub fn name(&self) -> &'static str {
         114  +
        match &self {
         115  +
            OperationWithDefaultsError::ValidationException(_inner) => _inner.name(),
         116  +
        }
         117  +
    }
         118  +
}
         119  +
impl ::std::error::Error for OperationWithDefaultsError {
         120  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         121  +
        match &self {
         122  +
            OperationWithDefaultsError::ValidationException(_inner) => Some(_inner),
         123  +
        }
         124  +
    }
         125  +
}
         126  +
impl ::std::convert::From<crate::error::ValidationException>
         127  +
    for crate::error::OperationWithDefaultsError
         128  +
{
         129  +
    fn from(
         130  +
        variant: crate::error::ValidationException,
         131  +
    ) -> crate::error::OperationWithDefaultsError {
         132  +
        Self::ValidationException(variant)
         133  +
    }
         134  +
}
         135  +
         136  +
/// Error type for the `EndpointWithHostLabelOperation` operation.
         137  +
/// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
         138  +
#[derive(::std::fmt::Debug)]
         139  +
pub enum EndpointWithHostLabelOperationError {
         140  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         141  +
    ValidationException(crate::error::ValidationException),
         142  +
}
         143  +
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
         144  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         145  +
        match &self {
         146  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
         147  +
        }
         148  +
    }
         149  +
}
         150  +
impl EndpointWithHostLabelOperationError {
         151  +
    /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
         152  +
    pub fn is_validation_exception(&self) -> bool {
         153  +
        matches!(
         154  +
            &self,
         155  +
            EndpointWithHostLabelOperationError::ValidationException(_)
         156  +
        )
         157  +
    }
         158  +
    /// Returns the error name string by matching the correct variant.
         159  +
    pub fn name(&self) -> &'static str {
         160  +
        match &self {
         161  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
         162  +
        }
         163  +
    }
         164  +
}
         165  +
impl ::std::error::Error for EndpointWithHostLabelOperationError {
         166  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         167  +
        match &self {
         168  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
         169  +
        }
         170  +
    }
         171  +
}
         172  +
impl ::std::convert::From<crate::error::ValidationException>
         173  +
    for crate::error::EndpointWithHostLabelOperationError
         174  +
{
         175  +
    fn from(
         176  +
        variant: crate::error::ValidationException,
         177  +
    ) -> crate::error::EndpointWithHostLabelOperationError {
         178  +
        Self::ValidationException(variant)
         179  +
    }
         180  +
}
         181  +
         182  +
/// Error type for the `JsonUnions` operation.
         183  +
/// Each variant represents an error that can occur for the `JsonUnions` operation.
         184  +
#[derive(::std::fmt::Debug)]
         185  +
pub enum JsonUnionsError {
         186  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         187  +
    ValidationException(crate::error::ValidationException),
         188  +
}
         189  +
impl ::std::fmt::Display for JsonUnionsError {
         190  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         191  +
        match &self {
         192  +
            JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
         193  +
        }
         194  +
    }
         195  +
}
         196  +
impl JsonUnionsError {
         197  +
    /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
         198  +
    pub fn is_validation_exception(&self) -> bool {
         199  +
        matches!(&self, JsonUnionsError::ValidationException(_))
         200  +
    }
         201  +
    /// Returns the error name string by matching the correct variant.
         202  +
    pub fn name(&self) -> &'static str {
         203  +
        match &self {
         204  +
            JsonUnionsError::ValidationException(_inner) => _inner.name(),
         205  +
        }
         206  +
    }
         207  +
}
         208  +
impl ::std::error::Error for JsonUnionsError {
         209  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         210  +
        match &self {
         211  +
            JsonUnionsError::ValidationException(_inner) => Some(_inner),
         212  +
        }
         213  +
    }
         214  +
}
         215  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
         216  +
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
         217  +
        Self::ValidationException(variant)
         218  +
    }
         219  +
}
         220  +
         221  +
/// Error type for the `GreetingWithErrors` operation.
         222  +
/// Each variant represents an error that can occur for the `GreetingWithErrors` operation.
         223  +
#[derive(::std::fmt::Debug)]
         224  +
pub enum GreetingWithErrorsError {
         225  +
    /// This error is thrown when an invalid greeting value is provided.
         226  +
    InvalidGreeting(crate::error::InvalidGreeting),
         227  +
    /// This error is thrown when a request is invalid.
         228  +
    ComplexError(crate::error::ComplexError),
         229  +
    /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         230  +
    FooError(crate::error::FooError),
         231  +
}
         232  +
impl ::std::fmt::Display for GreetingWithErrorsError {
         233  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         234  +
        match &self {
         235  +
            GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.fmt(f),
         236  +
            GreetingWithErrorsError::ComplexError(_inner) => _inner.fmt(f),
         237  +
            GreetingWithErrorsError::FooError(_inner) => _inner.fmt(f),
         238  +
        }
         239  +
    }
         240  +
}
         241  +
impl GreetingWithErrorsError {
         242  +
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         243  +
    pub fn is_invalid_greeting(&self) -> bool {
         244  +
        matches!(&self, GreetingWithErrorsError::InvalidGreeting(_))
         245  +
    }
         246  +
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         247  +
    pub fn is_complex_error(&self) -> bool {
         248  +
        matches!(&self, GreetingWithErrorsError::ComplexError(_))
         249  +
    }
         250  +
    /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
         251  +
    pub fn is_foo_error(&self) -> bool {
         252  +
        matches!(&self, GreetingWithErrorsError::FooError(_))
         253  +
    }
         254  +
    /// Returns the error name string by matching the correct variant.
         255  +
    pub fn name(&self) -> &'static str {
         256  +
        match &self {
         257  +
            GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.name(),
         258  +
            GreetingWithErrorsError::ComplexError(_inner) => _inner.name(),
         259  +
            GreetingWithErrorsError::FooError(_inner) => _inner.name(),
         260  +
        }
         261  +
    }
         262  +
}
         263  +
impl ::std::error::Error for GreetingWithErrorsError {
         264  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         265  +
        match &self {
         266  +
            GreetingWithErrorsError::InvalidGreeting(_inner) => Some(_inner),
         267  +
            GreetingWithErrorsError::ComplexError(_inner) => Some(_inner),
         268  +
            GreetingWithErrorsError::FooError(_inner) => Some(_inner),
         269  +
        }
         270  +
    }
         271  +
}
         272  +
impl ::std::convert::From<crate::error::InvalidGreeting> for crate::error::GreetingWithErrorsError {
         273  +
    fn from(variant: crate::error::InvalidGreeting) -> crate::error::GreetingWithErrorsError {
         274  +
        Self::InvalidGreeting(variant)
         275  +
    }
         276  +
}
         277  +
impl ::std::convert::From<crate::error::ComplexError> for crate::error::GreetingWithErrorsError {
         278  +
    fn from(variant: crate::error::ComplexError) -> crate::error::GreetingWithErrorsError {
         279  +
        Self::ComplexError(variant)
         280  +
    }
         281  +
}
         282  +
impl ::std::convert::From<crate::error::FooError> for crate::error::GreetingWithErrorsError {
         283  +
    fn from(variant: crate::error::FooError) -> crate::error::GreetingWithErrorsError {
         284  +
        Self::FooError(variant)
         285  +
    }
         286  +
}
         287  +
         288  +
/// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         289  +
#[derive(
         290  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         291  +
)]
         292  +
pub struct FooError {}
         293  +
impl FooError {
         294  +
    #[doc(hidden)]
         295  +
    /// Returns the error name.
         296  +
    pub fn name(&self) -> &'static str {
         297  +
        "FooError"
         298  +
    }
         299  +
}
         300  +
impl ::std::fmt::Display for FooError {
         301  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         302  +
        ::std::write!(f, "FooError")?;
         303  +
        Ok(())
         304  +
    }
         305  +
}
         306  +
impl ::std::error::Error for FooError {}
         307  +
impl FooError {
         308  +
    /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
         309  +
    pub fn builder() -> crate::error::foo_error::Builder {
         310  +
        crate::error::foo_error::Builder::default()
         311  +
    }
         312  +
}
         313  +
         314  +
/// This error is thrown when a request is invalid.
         315  +
#[derive(
         316  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         317  +
)]
         318  +
pub struct ComplexError {
         319  +
    #[allow(missing_docs)] // documentation missing in model
         320  +
    pub top_level: ::std::option::Option<::std::string::String>,
         321  +
    #[allow(missing_docs)] // documentation missing in model
         322  +
    pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
         323  +
}
         324  +
impl ComplexError {
         325  +
    #[allow(missing_docs)] // documentation missing in model
         326  +
    pub fn top_level(&self) -> ::std::option::Option<&str> {
         327  +
        self.top_level.as_deref()
         328  +
    }
         329  +
    #[allow(missing_docs)] // documentation missing in model
         330  +
    pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
         331  +
        self.nested.as_ref()
         332  +
    }
         333  +
}
         334  +
impl ComplexError {
         335  +
    #[doc(hidden)]
         336  +
    /// Returns the error name.
         337  +
    pub fn name(&self) -> &'static str {
         338  +
        "ComplexError"
         339  +
    }
         340  +
}
         341  +
impl ::std::fmt::Display for ComplexError {
         342  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         343  +
        ::std::write!(f, "ComplexError")?;
         344  +
        Ok(())
         345  +
    }
         346  +
}
         347  +
impl ::std::error::Error for ComplexError {}
         348  +
impl ComplexError {
         349  +
    /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
         350  +
    pub fn builder() -> crate::error::complex_error::Builder {
         351  +
        crate::error::complex_error::Builder::default()
         352  +
    }
         353  +
}
         354  +
         355  +
/// This error is thrown when an invalid greeting value is provided.
         356  +
#[derive(
         357  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         358  +
)]
         359  +
pub struct InvalidGreeting {
         360  +
    #[allow(missing_docs)] // documentation missing in model
         361  +
    pub message: ::std::option::Option<::std::string::String>,
         362  +
}
         363  +
impl InvalidGreeting {
         364  +
    /// Returns the error message.
         365  +
    pub fn message(&self) -> ::std::option::Option<&str> {
         366  +
        self.message.as_deref()
         367  +
    }
         368  +
    #[doc(hidden)]
         369  +
    /// Returns the error name.
         370  +
    pub fn name(&self) -> &'static str {
         371  +
        "InvalidGreeting"
         372  +
    }
         373  +
}
         374  +
impl ::std::fmt::Display for InvalidGreeting {
         375  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         376  +
        ::std::write!(f, "InvalidGreeting")?;
         377  +
        if let ::std::option::Option::Some(inner_1) = &self.message {
         378  +
            {
         379  +
                ::std::write!(f, ": {inner_1}")?;
         380  +
            }
         381  +
        }
         382  +
        Ok(())
         383  +
    }
         384  +
}
         385  +
impl ::std::error::Error for InvalidGreeting {}
         386  +
impl InvalidGreeting {
         387  +
    /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
         388  +
    pub fn builder() -> crate::error::invalid_greeting::Builder {
         389  +
        crate::error::invalid_greeting::Builder::default()
         390  +
    }
         391  +
}
         392  +
         393  +
/// See [`ValidationException`](crate::error::ValidationException).
         394  +
pub mod validation_exception {
         395  +
         396  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         397  +
    /// Holds one variant for each of the ways the builder can fail.
         398  +
    #[non_exhaustive]
         399  +
    #[allow(clippy::enum_variant_names)]
         400  +
    pub enum ConstraintViolation {
         401  +
        /// `message` was not provided but it is required when building `ValidationException`.
         402  +
        MissingMessage,
         403  +
    }
         404  +
    impl ::std::fmt::Display for ConstraintViolation {
         405  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         406  +
            match self {
         407  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
         408  +
            }
         409  +
        }
         410  +
    }
         411  +
    impl ::std::error::Error for ConstraintViolation {}
         412  +
    impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
         413  +
        type Error = ConstraintViolation;
         414  +
         415  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         416  +
            builder.build()
         417  +
        }
         418  +
    }
         419  +
    /// A builder for [`ValidationException`](crate::error::ValidationException).
         420  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         421  +
    pub struct Builder {
         422  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         423  +
        pub(crate) field_list:
         424  +
            ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         425  +
    }
         426  +
    impl Builder {
         427  +
        /// A summary of the validation failure.
         428  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         429  +
            self.message = Some(input);
         430  +
            self
         431  +
        }
         432  +
        /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         433  +
        pub fn field_list(
         434  +
            mut self,
         435  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         436  +
        ) -> Self {
         437  +
            self.field_list = input;
         438  +
            self
         439  +
        }
         440  +
        /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
         441  +
        ///
         442  +
        /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
         443  +
        ///
         444  +
        pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
         445  +
            self.build_enforcing_all_constraints()
         446  +
        }
         447  +
        fn build_enforcing_all_constraints(
         448  +
            self,
         449  +
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
         450  +
            Ok(crate::error::ValidationException {
         451  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         452  +
                field_list: self.field_list,
         453  +
            })
         454  +
        }
         455  +
    }
         456  +
}
         457  +
/// See [`FooError`](crate::error::FooError).
         458  +
pub mod foo_error {
         459  +
         460  +
    impl ::std::convert::From<Builder> for crate::error::FooError {
         461  +
        fn from(builder: Builder) -> Self {
         462  +
            builder.build()
         463  +
        }
         464  +
    }
         465  +
    /// A builder for [`FooError`](crate::error::FooError).
         466  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         467  +
    pub struct Builder {}
         468  +
    impl Builder {
         469  +
        /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
         470  +
        pub fn build(self) -> crate::error::FooError {
         471  +
            self.build_enforcing_all_constraints()
         472  +
        }
         473  +
        fn build_enforcing_all_constraints(self) -> crate::error::FooError {
         474  +
            crate::error::FooError {}
         475  +
        }
         476  +
    }
         477  +
}
         478  +
/// See [`ComplexError`](crate::error::ComplexError).
         479  +
pub mod complex_error {
         480  +
         481  +
    impl ::std::convert::From<Builder> for crate::error::ComplexError {
         482  +
        fn from(builder: Builder) -> Self {
         483  +
            builder.build()
         484  +
        }
         485  +
    }
         486  +
    /// A builder for [`ComplexError`](crate::error::ComplexError).
         487  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         488  +
    pub struct Builder {
         489  +
        pub(crate) top_level: ::std::option::Option<::std::string::String>,
         490  +
        pub(crate) nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
         491  +
    }
         492  +
    impl Builder {
         493  +
        #[allow(missing_docs)] // documentation missing in model
         494  +
        pub fn top_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         495  +
            self.top_level = input;
         496  +
            self
         497  +
        }
         498  +
        #[allow(missing_docs)] // documentation missing in model
         499  +
        pub fn nested(
         500  +
            mut self,
         501  +
            input: ::std::option::Option<crate::model::ComplexNestedErrorData>,
         502  +
        ) -> Self {
         503  +
            self.nested = input;
         504  +
            self
         505  +
        }
         506  +
        /// Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
         507  +
        pub fn build(self) -> crate::error::ComplexError {
         508  +
            self.build_enforcing_all_constraints()
         509  +
        }
         510  +
        fn build_enforcing_all_constraints(self) -> crate::error::ComplexError {
         511  +
            crate::error::ComplexError {
         512  +
                top_level: self.top_level,
         513  +
                nested: self.nested,
         514  +
            }
         515  +
        }
         516  +
    }
         517  +
}
         518  +
/// See [`InvalidGreeting`](crate::error::InvalidGreeting).
         519  +
pub mod invalid_greeting {
         520  +
         521  +
    impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
         522  +
        fn from(builder: Builder) -> Self {
         523  +
            builder.build()
         524  +
        }
         525  +
    }
         526  +
    /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
         527  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         528  +
    pub struct Builder {
         529  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         530  +
    }
         531  +
    impl Builder {
         532  +
        #[allow(missing_docs)] // documentation missing in model
         533  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         534  +
            self.message = input;
         535  +
            self
         536  +
        }
         537  +
        /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
         538  +
        pub fn build(self) -> crate::error::InvalidGreeting {
         539  +
            self.build_enforcing_all_constraints()
         540  +
        }
         541  +
        fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
         542  +
            crate::error::InvalidGreeting {
         543  +
                message: self.message,
         544  +
            }
         545  +
        }
         546  +
    }
         547  +
}