Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9 (ignoring whitespace)

Files changed:

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

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

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

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   41     41   
//! modules provide the types used in each operation.
   42     42   
//!
   43     43   
//! ### Running on Hyper
   44     44   
//!
   45     45   
//! ```rust,no_run
   46     46   
//! # use std::net::SocketAddr;
   47     47   
//! # async fn dummy() {
   48     48   
//! use constraints_without_public_constrained_types::{ConstraintsService, ConstraintsServiceConfig};
          49  +
//! use constraints_without_public_constrained_types::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = ConstraintsService::builder(
   51     53   
//! #     ConstraintsServiceConfig::builder()
   52     54   
//! #         .build()
   53     55   
//! # ).build_unchecked();
   54         -
//! let server = app.into_make_service();
   55     56   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     57   
//!     .expect("unable to parse the server bind address and port");
   57         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! let listener = TcpListener::bind(bind).await
          59  +
//!     .expect("failed to bind TCP listener");
          60  +
//! serve(listener, app.into_make_service()).await.unwrap();
   58     61   
//! # }
   59     62   
//! ```
   60     63   
//!
   61     64   
//! ### Running on Lambda
   62     65   
//!
   63     66   
//! ```rust,ignore
   64     67   
//! use constraints_without_public_constrained_types::server::routing::LambdaHandler;
   65     68   
//! use constraints_without_public_constrained_types::ConstraintsService;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = ConstraintsService::builder(
   69     72   
//! #     ConstraintsServiceConfig::builder()
   70     73   
//! #         .build()
   71     74   
//! # ).build_unchecked();
   72     75   
//! let handler = LambdaHandler::new(app);
   73     76   
//! lambda_http::run(handler).await.unwrap();
   74     77   
//! # }
   75     78   
//! ```
   76     79   
//!
   77     80   
//! # Building the ConstraintsService
   78     81   
//!
   79     82   
//! To construct [`ConstraintsService`] we use [`ConstraintsServiceBuilder`] returned by [`ConstraintsService::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`ConstraintsService::builder`] method, returning [`ConstraintsServiceBuilder`],
   84     87   
//! accepts a config object on which plugins can be registered.
   85     88   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     89   
//!
   87     90   
//! ```rust,no_run
   88     91   
//! # use constraints_without_public_constrained_types::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use constraints_without_public_constrained_types::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use constraints_without_public_constrained_types::server::plugin::HttpPlugins;
   92     95   
//! use constraints_without_public_constrained_types::{ConstraintsService, ConstraintsServiceConfig, ConstraintsServiceBuilder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = ConstraintsServiceConfig::builder().build();
   98         -
//! let builder: ConstraintsServiceBuilder<Body, _, _, _> = ConstraintsService::builder(config);
         101  +
//! let builder: ConstraintsServiceBuilder<::hyper::body::Incoming, _, _, _> = ConstraintsService::builder(config);
   99    102   
//! ```
  100    103   
//!
  101    104   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    105   
//!
  103    106   
//! ## Handlers
  104    107   
//!
  105    108   
//! [`ConstraintsServiceBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
  106    109   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    110   
//!
  108    111   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -135,138 +229,235 @@
  155    158   
//! [`ConstraintsServiceBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
  156    159   
//!
  157    160   
//! [`ConstraintsServiceBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
  158    161   
//! [`ConstraintsServiceBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
  159    162   
//!
  160    163   
//! # Example
  161    164   
//!
  162    165   
//! ```rust,no_run
  163    166   
//! # use std::net::SocketAddr;
  164    167   
//! use constraints_without_public_constrained_types::{ConstraintsService, ConstraintsServiceConfig};
         168  +
//! use constraints_without_public_constrained_types::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = ConstraintsServiceConfig::builder().build();
  169    174   
//!    let app = ConstraintsService::builder(config)
  170    175   
//!        .constrained_http_bound_shapes_operation(constrained_http_bound_shapes_operation)
  171    176   
//!        .constrained_http_payload_bound_shape_operation(constrained_http_payload_bound_shape_operation)
  172    177   
//!        .constrained_recursive_shapes_operation(constrained_recursive_shapes_operation)
  173    178   
//!        .constrained_shapes_only_in_output_operation(constrained_shapes_only_in_output_operation)
  174    179   
//!        .constrained_shapes_operation(constrained_shapes_operation)
  175    180   
//!        .event_streams_operation(event_streams_operation)
  176    181   
//!        .http_prefix_headers_targeting_length_map_operation(http_prefix_headers_targeting_length_map_operation)
  177    182   
//!        .non_streaming_blob_operation(non_streaming_blob_operation)
  178    183   
//!        .query_params_targeting_length_map_operation(query_params_targeting_length_map_operation)
  179    184   
//!        .query_params_targeting_map_of_enum_string_operation(query_params_targeting_map_of_enum_string_operation)
  180    185   
//!        .query_params_targeting_map_of_length_list_of_pattern_string_operation(query_params_targeting_map_of_length_list_of_pattern_string_operation)
  181    186   
//!        .query_params_targeting_map_of_length_pattern_string_operation(query_params_targeting_map_of_length_pattern_string_operation)
  182    187   
//!        .query_params_targeting_map_of_length_string_operation(query_params_targeting_map_of_length_string_operation)
  183    188   
//!        .query_params_targeting_map_of_list_of_enum_string_operation(query_params_targeting_map_of_list_of_enum_string_operation)
  184    189   
//!        .query_params_targeting_map_of_list_of_length_pattern_string_operation(query_params_targeting_map_of_list_of_length_pattern_string_operation)
  185    190   
//!        .query_params_targeting_map_of_list_of_length_string_operation(query_params_targeting_map_of_list_of_length_string_operation)
  186    191   
//!        .query_params_targeting_map_of_list_of_pattern_string_operation(query_params_targeting_map_of_list_of_pattern_string_operation)
  187    192   
//!        .query_params_targeting_map_of_pattern_string_operation(query_params_targeting_map_of_pattern_string_operation)
  188    193   
//!        .query_params_targeting_map_of_set_of_length_string_operation(query_params_targeting_map_of_set_of_length_string_operation)
  189    194   
//!        .streaming_blob_operation(streaming_blob_operation)
  190    195   
//!        .build()
  191    196   
//!        .expect("failed to build an instance of ConstraintsService");
  192    197   
//!
  193    198   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  194    199   
//!        .expect("unable to parse the server bind address and port");
  195         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         200  +
//!    let listener = TcpListener::bind(bind).await
         201  +
//!        .expect("failed to bind TCP listener");
  196    202   
//!    # let server = async { Ok::<_, ()>(()) };
  197    203   
//!
  198    204   
//!    // Run your service!
  199         -
//!    if let Err(err) = server.await {
         205  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  200    206   
//!        eprintln!("server error: {:?}", err);
  201    207   
//!    }
  202    208   
//! }
  203    209   
//!
  204    210   
//! use constraints_without_public_constrained_types::{input, output, error};
  205    211   
//!
  206    212   
//! async fn constrained_http_bound_shapes_operation(input: input::ConstrainedHttpBoundShapesOperationInput) -> Result<output::ConstrainedHttpBoundShapesOperationOutput, error::ConstrainedHttpBoundShapesOperationError> {
  207    213   
//!     todo!()
  208    214   
//! }
  209    215   
//!
@@ -258,264 +323,330 @@
  278    284   
//! async fn query_params_targeting_map_of_set_of_length_string_operation(input: input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput) -> Result<output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput, error::QueryParamsTargetingMapOfSetOfLengthStringOperationError> {
  279    285   
//!     todo!()
  280    286   
//! }
  281    287   
//!
  282    288   
//! async fn streaming_blob_operation(input: input::StreamingBlobOperationInput) -> output::StreamingBlobOperationOutput {
  283    289   
//!     todo!()
  284    290   
//! }
  285    291   
//!
  286    292   
//! ```
  287    293   
//!
  288         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         294  +
//! [`serve`]: crate::serve
         295  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  289    296   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  290    297   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  291    298   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  292         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  293    299   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         300  +
pub use crate::server::serve::serve;
  294    301   
pub use crate::service::{
  295    302   
    ConstraintsService, ConstraintsServiceBuilder, ConstraintsServiceConfig,
  296    303   
    ConstraintsServiceConfigBuilder, MissingOperationsError,
  297    304   
};
  298    305   
  299    306   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  300    307   
pub mod server {
  301    308   
    // Re-export all types from the `aws-smithy-http-server` crate.
  302    309   
    pub use ::aws_smithy_http_server::*;
  303    310   
}

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

@@ -4,4 +72,77 @@
   24     24   
   25     25   
impl<B>
   26     26   
    ::aws_smithy_http_server::request::FromRequest<
   27     27   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   28     28   
        B,
   29     29   
    > for crate::input::EventStreamsOperationInput
   30     30   
where
   31     31   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
          34  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
          35  +
        + ::std::marker::Send
          36  +
        + ::std::marker::Sync
          37  +
        + 'static,
          38  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
          39  +
   35     40   
    B::Data: Send,
   36     41   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   37     42   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   38     43   
{
   39     44   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
   40     45   
    type Future = EventStreamsOperationInputFuture;
   41     46   
   42         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          47  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
   43     48   
        let fut = async move {
   44     49   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     50   
                request.headers(),
   46     51   
                &crate::mimes::CONTENT_TYPE_APPLICATION_VND_AMAZON_EVENTSTREAM,
   47     52   
            ) {
   48     53   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     54   
            }
   50     55   
            crate::protocol_serde::shape_event_streams_operation::de_event_streams_operation_http_request(request)
   51     56   
                            .await
   52     57   
        };
@@ -103,108 +171,181 @@
  123    128   
  124    129   
impl<B>
  125    130   
    ::aws_smithy_http_server::request::FromRequest<
  126    131   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  127    132   
        B,
  128    133   
    > for crate::input::StreamingBlobOperationInput
  129    134   
where
  130    135   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  131    136   
    B: 'static,
  132    137   
  133         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
         138  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
         139  +
        + ::std::marker::Send
         140  +
        + ::std::marker::Sync
         141  +
        + 'static,
         142  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
         143  +
  134    144   
    B::Data: Send,
  135    145   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  136    146   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  137    147   
{
  138    148   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  139    149   
    type Future = StreamingBlobOperationInputFuture;
  140    150   
  141         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         151  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  142    152   
        let fut = async move {
  143    153   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  144    154   
                request.headers(),
  145    155   
                &crate::mimes::CONTENT_TYPE_APPLICATION_OCTET_STREAM,
  146    156   
            ) {
  147    157   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  148    158   
            }
  149    159   
            crate::protocol_serde::shape_streaming_blob_operation::de_streaming_blob_operation_http_request(request)
  150    160   
                            .await
  151    161   
        };
@@ -191,201 +251,261 @@
  211    221   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  212    222   
    B: 'static,
  213    223   
  214    224   
    B::Data: Send,
  215    225   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  216    226   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  217    227   
{
  218    228   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  219    229   
    type Future = NonStreamingBlobOperationInputFuture;
  220    230   
  221         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         231  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  222    232   
        let fut = async move {
  223    233   
            crate::protocol_serde::shape_non_streaming_blob_operation::de_non_streaming_blob_operation_http_request(request)
  224    234   
                            .await
  225    235   
        };
  226    236   
        use ::futures_util::future::TryFutureExt;
  227    237   
        let fut = fut.map_err(
  228    238   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  229    239   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  230    240   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  231    241   
                    e,
@@ -265,275 +325,335 @@
  285    295   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  286    296   
    B: 'static,
  287    297   
  288    298   
    B::Data: Send,
  289    299   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  290    300   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  291    301   
{
  292    302   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  293    303   
    type Future = QueryParamsTargetingMapOfEnumStringOperationInputFuture;
  294    304   
  295         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         305  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  296    306   
        let fut = async move {
  297    307   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  298    308   
                request.headers(),
  299    309   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  300    310   
            ) {
  301    311   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  302    312   
            }
  303    313   
            crate::protocol_serde::shape_query_params_targeting_map_of_enum_string_operation::de_query_params_targeting_map_of_enum_string_operation_http_request(request)
  304    314   
                            .await
  305    315   
        };
@@ -363,373 +423,433 @@
  383    393   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  384    394   
    B: 'static,
  385    395   
  386    396   
    B::Data: Send,
  387    397   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  388    398   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  389    399   
{
  390    400   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  391    401   
    type Future = HttpPrefixHeadersTargetingLengthMapOperationInputFuture;
  392    402   
  393         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         403  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  394    404   
        let fut = async move {
  395    405   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  396    406   
                request.headers(),
  397    407   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  398    408   
            ) {
  399    409   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  400    410   
            }
  401    411   
            crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation::de_http_prefix_headers_targeting_length_map_operation_http_request(request)
  402    412   
                            .await
  403    413   
        };
@@ -463,473 +523,533 @@
  483    493   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  484    494   
    B: 'static,
  485    495   
  486    496   
    B::Data: Send,
  487    497   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  488    498   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  489    499   
{
  490    500   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  491    501   
    type Future = QueryParamsTargetingMapOfListOfLengthPatternStringOperationInputFuture;
  492    502   
  493         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         503  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  494    504   
        let fut = async move {
  495    505   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  496    506   
                request.headers(),
  497    507   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  498    508   
            ) {
  499    509   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  500    510   
            }
  501    511   
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_pattern_string_operation::de_query_params_targeting_map_of_list_of_length_pattern_string_operation_http_request(request)
  502    512   
                            .await
  503    513   
        };
@@ -561,571 +621,631 @@
  581    591   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  582    592   
    B: 'static,
  583    593   
  584    594   
    B::Data: Send,
  585    595   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  586    596   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  587    597   
{
  588    598   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  589    599   
    type Future = QueryParamsTargetingMapOfLengthPatternStringOperationInputFuture;
  590    600   
  591         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         601  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  592    602   
        let fut = async move {
  593    603   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  594    604   
                request.headers(),
  595    605   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  596    606   
            ) {
  597    607   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  598    608   
            }
  599    609   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_pattern_string_operation::de_query_params_targeting_map_of_length_pattern_string_operation_http_request(request)
  600    610   
                            .await
  601    611   
        };
@@ -659,669 +719,729 @@
  679    689   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  680    690   
    B: 'static,
  681    691   
  682    692   
    B::Data: Send,
  683    693   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  684    694   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  685    695   
{
  686    696   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  687    697   
    type Future = QueryParamsTargetingMapOfListOfPatternStringOperationInputFuture;
  688    698   
  689         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         699  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  690    700   
        let fut = async move {
  691    701   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  692    702   
                request.headers(),
  693    703   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  694    704   
            ) {
  695    705   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  696    706   
            }
  697    707   
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_pattern_string_operation::de_query_params_targeting_map_of_list_of_pattern_string_operation_http_request(request)
  698    708   
                            .await
  699    709   
        };
@@ -757,767 +817,827 @@
  777    787   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  778    788   
    B: 'static,
  779    789   
  780    790   
    B::Data: Send,
  781    791   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  782    792   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  783    793   
{
  784    794   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  785    795   
    type Future = QueryParamsTargetingMapOfPatternStringOperationInputFuture;
  786    796   
  787         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         797  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  788    798   
        let fut = async move {
  789    799   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  790    800   
                request.headers(),
  791    801   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  792    802   
            ) {
  793    803   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  794    804   
            }
  795    805   
            crate::protocol_serde::shape_query_params_targeting_map_of_pattern_string_operation::de_query_params_targeting_map_of_pattern_string_operation_http_request(request)
  796    806   
                            .await
  797    807   
        };
@@ -855,865 +915,925 @@
  875    885   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  876    886   
    B: 'static,
  877    887   
  878    888   
    B::Data: Send,
  879    889   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  880    890   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  881    891   
{
  882    892   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  883    893   
    type Future = QueryParamsTargetingMapOfListOfEnumStringOperationInputFuture;
  884    894   
  885         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         895  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  886    896   
        let fut = async move {
  887    897   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  888    898   
                request.headers(),
  889    899   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  890    900   
            ) {
  891    901   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  892    902   
            }
  893    903   
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_enum_string_operation::de_query_params_targeting_map_of_list_of_enum_string_operation_http_request(request)
  894    904   
                            .await
  895    905   
        };
@@ -955,965 +1015,1025 @@
  975    985   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  976    986   
    B: 'static,
  977    987   
  978    988   
    B::Data: Send,
  979    989   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  980    990   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  981    991   
{
  982    992   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  983    993   
    type Future = QueryParamsTargetingMapOfLengthListOfPatternStringOperationInputFuture;
  984    994   
  985         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         995  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  986    996   
        let fut = async move {
  987    997   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  988    998   
                request.headers(),
  989    999   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  990   1000   
            ) {
  991   1001   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  992   1002   
            }
  993   1003   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_list_of_pattern_string_operation::de_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_request(request)
  994   1004   
                            .await
  995   1005   
        };
@@ -1053,1063 +1113,1123 @@
 1073   1083   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1074   1084   
    B: 'static,
 1075   1085   
 1076   1086   
    B::Data: Send,
 1077   1087   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1078   1088   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1079   1089   
{
 1080   1090   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1081   1091   
    type Future = QueryParamsTargetingMapOfSetOfLengthStringOperationInputFuture;
 1082   1092   
 1083         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1093  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1084   1094   
        let fut = async move {
 1085   1095   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1086   1096   
                request.headers(),
 1087   1097   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1088   1098   
            ) {
 1089   1099   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1090   1100   
            }
 1091   1101   
            crate::protocol_serde::shape_query_params_targeting_map_of_set_of_length_string_operation::de_query_params_targeting_map_of_set_of_length_string_operation_http_request(request)
 1092   1102   
                            .await
 1093   1103   
        };
@@ -1151,1161 +1211,1221 @@
 1171   1181   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1172   1182   
    B: 'static,
 1173   1183   
 1174   1184   
    B::Data: Send,
 1175   1185   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1176   1186   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1177   1187   
{
 1178   1188   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1179   1189   
    type Future = QueryParamsTargetingMapOfListOfLengthStringOperationInputFuture;
 1180   1190   
 1181         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1191  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1182   1192   
        let fut = async move {
 1183   1193   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1184   1194   
                request.headers(),
 1185   1195   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1186   1196   
            ) {
 1187   1197   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1188   1198   
            }
 1189   1199   
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_string_operation::de_query_params_targeting_map_of_list_of_length_string_operation_http_request(request)
 1190   1200   
                            .await
 1191   1201   
        };
@@ -1249,1259 +1309,1319 @@
 1269   1279   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1270   1280   
    B: 'static,
 1271   1281   
 1272   1282   
    B::Data: Send,
 1273   1283   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1274   1284   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1275   1285   
{
 1276   1286   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1277   1287   
    type Future = QueryParamsTargetingMapOfLengthStringOperationInputFuture;
 1278   1288   
 1279         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1289  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1280   1290   
        let fut = async move {
 1281   1291   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1282   1292   
                request.headers(),
 1283   1293   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1284   1294   
            ) {
 1285   1295   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1286   1296   
            }
 1287   1297   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_string_operation::de_query_params_targeting_map_of_length_string_operation_http_request(request)
 1288   1298   
                            .await
 1289   1299   
        };
@@ -1347,1357 +1407,1417 @@
 1367   1377   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1368   1378   
    B: 'static,
 1369   1379   
 1370   1380   
    B::Data: Send,
 1371   1381   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1372   1382   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1373   1383   
{
 1374   1384   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1375   1385   
    type Future = QueryParamsTargetingLengthMapOperationInputFuture;
 1376   1386   
 1377         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1387  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1378   1388   
        let fut = async move {
 1379   1389   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1380   1390   
                request.headers(),
 1381   1391   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1382   1392   
            ) {
 1383   1393   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1384   1394   
            }
 1385   1395   
            crate::protocol_serde::shape_query_params_targeting_length_map_operation::de_query_params_targeting_length_map_operation_http_request(request)
 1386   1396   
                            .await
 1387   1397   
        };
@@ -1445,1455 +1505,1515 @@
 1465   1475   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1466   1476   
    B: 'static,
 1467   1477   
 1468   1478   
    B::Data: Send,
 1469   1479   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1470   1480   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1471   1481   
{
 1472   1482   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1473   1483   
    type Future = ConstrainedRecursiveShapesOperationInputFuture;
 1474   1484   
 1475         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1485  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1476   1486   
        let fut = async move {
 1477   1487   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1478   1488   
                request.headers(),
 1479   1489   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1480   1490   
            ) {
 1481   1491   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1482   1492   
            }
 1483   1493   
            crate::protocol_serde::shape_constrained_recursive_shapes_operation::de_constrained_recursive_shapes_operation_http_request(request)
 1484   1494   
                            .await
 1485   1495   
        };
@@ -1543,1553 +1603,1613 @@
 1563   1573   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1564   1574   
    B: 'static,
 1565   1575   
 1566   1576   
    B::Data: Send,
 1567   1577   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1568   1578   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1569   1579   
{
 1570   1580   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1571   1581   
    type Future = ConstrainedHttpPayloadBoundShapeOperationInputFuture;
 1572   1582   
 1573         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1583  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1574   1584   
        let fut = async move {
 1575   1585   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1576   1586   
                request.headers(),
 1577   1587   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1578   1588   
            ) {
 1579   1589   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1580   1590   
            }
 1581   1591   
            crate::protocol_serde::shape_constrained_http_payload_bound_shape_operation::de_constrained_http_payload_bound_shape_operation_http_request(request)
 1582   1592   
                            .await
 1583   1593   
        };
@@ -1641,1651 +1701,1711 @@
 1661   1671   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1662   1672   
    B: 'static,
 1663   1673   
 1664   1674   
    B::Data: Send,
 1665   1675   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1666   1676   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1667   1677   
{
 1668   1678   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1669   1679   
    type Future = ConstrainedHttpBoundShapesOperationInputFuture;
 1670   1680   
 1671         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1681  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1672   1682   
        let fut = async move {
 1673   1683   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1674   1684   
                request.headers(),
 1675   1685   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1676   1686   
            ) {
 1677   1687   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1678   1688   
            }
 1679   1689   
            crate::protocol_serde::shape_constrained_http_bound_shapes_operation::de_constrained_http_bound_shapes_operation_http_request(request)
 1680   1690   
                            .await
 1681   1691   
        };
@@ -1739,1749 +1799,1809 @@
 1759   1769   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1760   1770   
    B: 'static,
 1761   1771   
 1762   1772   
    B::Data: Send,
 1763   1773   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1764   1774   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1765   1775   
{
 1766   1776   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1767   1777   
    type Future = ConstrainedShapesOnlyInOutputOperationInputFuture;
 1768   1778   
 1769         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1779  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1770   1780   
        let fut = async move {
 1771   1781   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1772   1782   
                request.headers(),
 1773   1783   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1774   1784   
            ) {
 1775   1785   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1776   1786   
            }
 1777   1787   
            crate::protocol_serde::shape_constrained_shapes_only_in_output_operation::de_constrained_shapes_only_in_output_operation_http_request(request)
 1778   1788   
                            .await
 1779   1789   
        };
@@ -1819,1829 +1879,1889 @@
 1839   1849   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1840   1850   
    B: 'static,
 1841   1851   
 1842   1852   
    B::Data: Send,
 1843   1853   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1844   1854   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1845   1855   
{
 1846   1856   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1847   1857   
    type Future = ConstrainedShapesOperationInputFuture;
 1848   1858   
 1849         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1859  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1850   1860   
        let fut = async move {
 1851   1861   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1852   1862   
                request.headers(),
 1853   1863   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1854   1864   
            ) {
 1855   1865   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1856   1866   
            }
 1857   1867   
            crate::protocol_serde::shape_constrained_shapes_operation::de_constrained_shapes_operation_http_request(request)
 1858   1868   
                            .await
 1859   1869   
        };

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_constrained_http_bound_shapes_operation.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_constrained_http_bound_shapes_operation_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::ConstrainedHttpBoundShapesOperationInput,
    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   
{
@@ -331,331 +758,760 @@
  351    351   
  352    352   
#[allow(clippy::unnecessary_wraps)]
  353    353   
pub fn ser_constrained_http_bound_shapes_operation_http_response(
  354    354   
    #[allow(unused_variables)] output: crate::output::ConstrainedHttpBoundShapesOperationOutput,
  355    355   
) -> std::result::Result<
  356    356   
    ::aws_smithy_http_server::response::Response,
  357    357   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  358    358   
> {
  359    359   
    Ok({
  360    360   
        #[allow(unused_mut)]
  361         -
        let mut builder = ::http::Response::builder();
         361  +
        let mut builder = ::http_1x::Response::builder();
  362    362   
        builder = crate::protocol_serde::shape_constrained_http_bound_shapes_operation::ser_constrained_http_bound_shapes_operation_headers(&output, builder)?;
  363    363   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  364    364   
            builder,
  365         -
            ::http::header::CONTENT_TYPE,
         365  +
            ::http_1x::header::CONTENT_TYPE,
  366    366   
            "application/json",
  367    367   
        );
  368    368   
        let http_status: u16 = 200;
  369    369   
        builder = builder.status(http_status);
  370    370   
        let payload =
  371    371   
            crate::protocol_serde::shape_constrained_http_bound_shapes_operation_output::ser_constrained_http_bound_shapes_operation_output_output_output(&output)?
  372    372   
        ;
  373    373   
        let content_length = payload.len();
  374    374   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  375    375   
            builder,
  376         -
            ::http::header::CONTENT_LENGTH,
         376  +
            ::http_1x::header::CONTENT_LENGTH,
  377    377   
            content_length,
  378    378   
        );
  379    379   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
  380    380   
        builder.body(body)?
  381    381   
    })
  382    382   
}
  383    383   
  384    384   
#[allow(clippy::unnecessary_wraps)]
  385    385   
pub fn ser_constrained_http_bound_shapes_operation_http_error(
  386    386   
    error: &crate::error::ConstrainedHttpBoundShapesOperationError,
  387    387   
) -> std::result::Result<
  388    388   
    ::aws_smithy_http_server::response::Response,
  389    389   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  390    390   
> {
  391    391   
    Ok({
  392    392   
        match error {
  393    393   
            crate::error::ConstrainedHttpBoundShapesOperationError::ValidationException(output) => {
  394    394   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  395    395   
                #[allow(unused_mut)]
  396         -
                let mut builder = ::http::Response::builder();
         396  +
                let mut builder = ::http_1x::Response::builder();
  397    397   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  398    398   
                    builder,
  399         -
                    ::http::header::CONTENT_TYPE,
         399  +
                    ::http_1x::header::CONTENT_TYPE,
  400    400   
                    "application/json",
  401    401   
                );
  402    402   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  403    403   
                    builder,
  404         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         404  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  405    405   
                    "ValidationException",
  406    406   
                );
  407    407   
                let content_length = payload.len();
  408    408   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  409    409   
                    builder,
  410         -
                    ::http::header::CONTENT_LENGTH,
         410  +
                    ::http_1x::header::CONTENT_LENGTH,
  411    411   
                    content_length,
  412    412   
                );
  413    413   
                builder
  414    414   
                    .status(400)
  415    415   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  416    416   
            }
  417    417   
        }
  418    418   
    })
  419    419   
}
  420    420   
  421    421   
pub fn ser_constrained_http_bound_shapes_operation_headers(
  422    422   
    input: &crate::output::ConstrainedHttpBoundShapesOperationOutput,
  423         -
    mut builder: ::http::response::Builder,
  424         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  425         -
{
         423  +
    mut builder: ::http_1x::response::Builder,
         424  +
) -> std::result::Result<
         425  +
    ::http_1x::response::Builder,
         426  +
    ::aws_smithy_types::error::operation::BuildError,
         427  +
> {
  426    428   
    if let ::std::option::Option::Some(inner_1) = &input.length_string_header {
  427    429   
        let formatted_2 = inner_1.as_str();
  428    430   
        if !formatted_2.is_empty() {
  429    431   
            let header_value = formatted_2;
  430         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         432  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  431    433   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  432    434   
                    "length_string_header",
  433    435   
                    format!(
  434    436   
                        "`{}` cannot be used as a header value: {}",
  435    437   
                        &header_value, err
  436    438   
                    ),
  437    439   
                )
  438    440   
            })?;
  439    441   
            builder = builder.header("X-Length", header_value);
  440    442   
        }
  441    443   
    }
  442    444   
    if input.range_integer_header != 0 {
  443    445   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.range_integer_header);
  444    446   
        let formatted_3 = encoder.encode();
  445    447   
        if !formatted_3.is_empty() {
  446    448   
            let header_value = formatted_3;
  447         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         449  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  448    450   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  449    451   
                    "range_integer_header",
  450    452   
                    format!(
  451    453   
                        "`{}` cannot be used as a header value: {}",
  452    454   
                        &header_value, err
  453    455   
                    ),
  454    456   
                )
  455    457   
            })?;
  456    458   
            builder = builder.header("X-Range-Integer", header_value);
  457    459   
        }
  458    460   
    }
  459    461   
    if input.range_short_header != 0 {
  460    462   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.range_short_header);
  461    463   
        let formatted_4 = encoder.encode();
  462    464   
        if !formatted_4.is_empty() {
  463    465   
            let header_value = formatted_4;
  464         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         466  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  465    467   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  466    468   
                    "range_short_header",
  467    469   
                    format!(
  468    470   
                        "`{}` cannot be used as a header value: {}",
  469    471   
                        &header_value, err
  470    472   
                    ),
  471    473   
                )
  472    474   
            })?;
  473    475   
            builder = builder.header("X-Range-Short", header_value);
  474    476   
        }
  475    477   
    }
  476    478   
    if input.range_long_header != 0 {
  477    479   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.range_long_header);
  478    480   
        let formatted_5 = encoder.encode();
  479    481   
        if !formatted_5.is_empty() {
  480    482   
            let header_value = formatted_5;
  481         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         483  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  482    484   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  483    485   
                    "range_long_header",
  484    486   
                    format!(
  485    487   
                        "`{}` cannot be used as a header value: {}",
  486    488   
                        &header_value, err
  487    489   
                    ),
  488    490   
                )
  489    491   
            })?;
  490    492   
            builder = builder.header("X-Range-Long", header_value);
  491    493   
        }
  492    494   
    }
  493    495   
    if input.range_byte_header != 0 {
  494    496   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.range_byte_header);
  495    497   
        let formatted_6 = encoder.encode();
  496    498   
        if !formatted_6.is_empty() {
  497    499   
            let header_value = formatted_6;
  498         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         500  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  499    501   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  500    502   
                    "range_byte_header",
  501    503   
                    format!(
  502    504   
                        "`{}` cannot be used as a header value: {}",
  503    505   
                        &header_value, err
  504    506   
                    ),
  505    507   
                )
  506    508   
            })?;
  507    509   
            builder = builder.header("X-Range-Byte", header_value);
  508    510   
        }
  509    511   
    }
  510    512   
    if let ::std::option::Option::Some(inner_7) = &input.length_string_set_header {
  511    513   
        for inner_8 in inner_7 {
  512    514   
            let formatted_9 = ::aws_smithy_http::header::quote_header_value(inner_8.as_str());
  513    515   
            if !formatted_9.is_empty() {
  514    516   
                let header_value = formatted_9;
  515         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         517  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  516    518   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  517    519   
                        "length_string_set_header",
  518    520   
                        format!(
  519    521   
                            "`{}` cannot be used as a header value: {}",
  520    522   
                            &header_value, err
  521    523   
                        ),
  522    524   
                    )
  523    525   
                })?;
  524    526   
                builder = builder.header("X-Length-Set", header_value);
  525    527   
            }
  526    528   
        }
  527    529   
    }
  528    530   
    if let ::std::option::Option::Some(inner_10) = &input.list_length_string_header {
  529    531   
        for inner_11 in inner_10 {
  530    532   
            let formatted_12 = ::aws_smithy_http::header::quote_header_value(inner_11.as_str());
  531    533   
            if !formatted_12.is_empty() {
  532    534   
                let header_value = formatted_12;
  533         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         535  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  534    536   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  535    537   
                        "list_length_string_header",
  536    538   
                        format!(
  537    539   
                            "`{}` cannot be used as a header value: {}",
  538    540   
                            &header_value, err
  539    541   
                        ),
  540    542   
                    )
  541    543   
                })?;
  542    544   
                builder = builder.header("X-List-Length-String", header_value);
  543    545   
            }
  544    546   
        }
  545    547   
    }
  546    548   
    if let ::std::option::Option::Some(inner_13) = &input.length_list_pattern_string_header {
  547    549   
        for inner_14 in inner_13 {
  548    550   
            let formatted_15 = ::aws_smithy_http::header::quote_header_value(inner_14.as_str());
  549    551   
            if !formatted_15.is_empty() {
  550    552   
                let header_value = formatted_15;
  551         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         553  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  552    554   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  553    555   
                        "length_list_pattern_string_header",
  554    556   
                        format!(
  555    557   
                            "`{}` cannot be used as a header value: {}",
  556    558   
                            &header_value, err
  557    559   
                        ),
  558    560   
                    )
  559    561   
                })?;
  560    562   
                builder = builder.header("X-Length-List-Pattern-String", header_value);
  561    563   
            }
  562    564   
        }
  563    565   
    }
  564    566   
    if let ::std::option::Option::Some(inner_16) = &input.length_set_pattern_string_header {
  565    567   
        for inner_17 in inner_16 {
  566    568   
            let formatted_18 = ::aws_smithy_http::header::quote_header_value(inner_17.as_str());
  567    569   
            if !formatted_18.is_empty() {
  568    570   
                let header_value = formatted_18;
  569         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         571  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  570    572   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  571    573   
                        "length_set_pattern_string_header",
  572    574   
                        format!(
  573    575   
                            "`{}` cannot be used as a header value: {}",
  574    576   
                            &header_value, err
  575    577   
                        ),
  576    578   
                    )
  577    579   
                })?;
  578    580   
                builder = builder.header("X-Length-Set-Pattern-String", header_value);
  579    581   
            }
  580    582   
        }
  581    583   
    }
  582    584   
    if let ::std::option::Option::Some(inner_19) = &input.range_byte_set_header {
  583    585   
        for inner_20 in inner_19 {
  584    586   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_20);
  585    587   
            let formatted_21 = encoder.encode();
  586    588   
            if !formatted_21.is_empty() {
  587    589   
                let header_value = formatted_21;
  588         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         590  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  589    591   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  590    592   
                        "range_byte_set_header",
  591    593   
                        format!(
  592    594   
                            "`{}` cannot be used as a header value: {}",
  593    595   
                            &header_value, err
  594    596   
                        ),
  595    597   
                    )
  596    598   
                })?;
  597    599   
                builder = builder.header("X-Range-Byte-Set", header_value);
  598    600   
            }
  599    601   
        }
  600    602   
    }
  601    603   
    if let ::std::option::Option::Some(inner_22) = &input.range_short_set_header {
  602    604   
        for inner_23 in inner_22 {
  603    605   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_23);
  604    606   
            let formatted_24 = encoder.encode();
  605    607   
            if !formatted_24.is_empty() {
  606    608   
                let header_value = formatted_24;
  607         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         609  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  608    610   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  609    611   
                        "range_short_set_header",
  610    612   
                        format!(
  611    613   
                            "`{}` cannot be used as a header value: {}",
  612    614   
                            &header_value, err
  613    615   
                        ),
  614    616   
                    )
  615    617   
                })?;
  616    618   
                builder = builder.header("X-Range-Short-Set", header_value);
  617    619   
            }
  618    620   
        }
  619    621   
    }
  620    622   
    if let ::std::option::Option::Some(inner_25) = &input.range_integer_set_header {
  621    623   
        for inner_26 in inner_25 {
  622    624   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_26);
  623    625   
            let formatted_27 = encoder.encode();
  624    626   
            if !formatted_27.is_empty() {
  625    627   
                let header_value = formatted_27;
  626         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         628  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  627    629   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  628    630   
                        "range_integer_set_header",
  629    631   
                        format!(
  630    632   
                            "`{}` cannot be used as a header value: {}",
  631    633   
                            &header_value, err
  632    634   
                        ),
  633    635   
                    )
  634    636   
                })?;
  635    637   
                builder = builder.header("X-Range-Integer-Set", header_value);
  636    638   
            }
  637    639   
        }
  638    640   
    }
  639    641   
    if let ::std::option::Option::Some(inner_28) = &input.range_long_set_header {
  640    642   
        for inner_29 in inner_28 {
  641    643   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_29);
  642    644   
            let formatted_30 = encoder.encode();
  643    645   
            if !formatted_30.is_empty() {
  644    646   
                let header_value = formatted_30;
  645         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         647  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  646    648   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  647    649   
                        "range_long_set_header",
  648    650   
                        format!(
  649    651   
                            "`{}` cannot be used as a header value: {}",
  650    652   
                            &header_value, err
  651    653   
                        ),
  652    654   
                    )
  653    655   
                })?;
  654    656   
                builder = builder.header("X-Range-Long-Set", header_value);
  655    657   
            }
  656    658   
        }
  657    659   
    }
  658    660   
    if let ::std::option::Option::Some(inner_31) = &input.range_byte_list_header {
  659    661   
        for inner_32 in inner_31 {
  660    662   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_32);
  661    663   
            let formatted_33 = encoder.encode();
  662    664   
            if !formatted_33.is_empty() {
  663    665   
                let header_value = formatted_33;
  664         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         666  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  665    667   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  666    668   
                        "range_byte_list_header",
  667    669   
                        format!(
  668    670   
                            "`{}` cannot be used as a header value: {}",
  669    671   
                            &header_value, err
  670    672   
                        ),
  671    673   
                    )
  672    674   
                })?;
  673    675   
                builder = builder.header("X-Range-Byte-List", header_value);
  674    676   
            }
  675    677   
        }
  676    678   
    }
  677    679   
    if let ::std::option::Option::Some(inner_34) = &input.range_short_list_header {
  678    680   
        for inner_35 in inner_34 {
  679    681   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_35);
  680    682   
            let formatted_36 = encoder.encode();
  681    683   
            if !formatted_36.is_empty() {
  682    684   
                let header_value = formatted_36;
  683         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         685  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  684    686   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  685    687   
                        "range_short_list_header",
  686    688   
                        format!(
  687    689   
                            "`{}` cannot be used as a header value: {}",
  688    690   
                            &header_value, err
  689    691   
                        ),
  690    692   
                    )
  691    693   
                })?;
  692    694   
                builder = builder.header("X-Range-Short-List", header_value);
  693    695   
            }
  694    696   
        }
  695    697   
    }
  696    698   
    if let ::std::option::Option::Some(inner_37) = &input.range_integer_list_header {
  697    699   
        for inner_38 in inner_37 {
  698    700   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_38);
  699    701   
            let formatted_39 = encoder.encode();
  700    702   
            if !formatted_39.is_empty() {
  701    703   
                let header_value = formatted_39;
  702         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         704  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  703    705   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  704    706   
                        "range_integer_list_header",
  705    707   
                        format!(
  706    708   
                            "`{}` cannot be used as a header value: {}",
  707    709   
                            &header_value, err
  708    710   
                        ),
  709    711   
                    )
  710    712   
                })?;
  711    713   
                builder = builder.header("X-Range-Integer-List", header_value);
  712    714   
            }
  713    715   
        }
  714    716   
    }
  715    717   
    if let ::std::option::Option::Some(inner_40) = &input.range_long_list_header {
  716    718   
        for inner_41 in inner_40 {
  717    719   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_41);
  718    720   
            let formatted_42 = encoder.encode();
  719    721   
            if !formatted_42.is_empty() {
  720    722   
                let header_value = formatted_42;
  721         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         723  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  722    724   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  723    725   
                        "range_long_list_header",
  724    726   
                        format!(
  725    727   
                            "`{}` cannot be used as a header value: {}",
  726    728   
                            &header_value, err
  727    729   
                        ),
  728    730   
                    )
  729    731   
                })?;
  730    732   
                builder = builder.header("X-Range-Long-List", header_value);
  731    733   
            }
  732    734   
        }
  733    735   
    }
  734    736   
    {
  735    737   
        for (k, v) in &input.length_string_header_map {
  736    738   
            use std::str::FromStr;
  737         -
            let header_name = http::header::HeaderName::from_str(&format!(
         739  +
            let header_name = ::http_1x::HeaderName::from_str(&format!(
  738    740   
                "{}{}",
  739    741   
                "X-Length-String-Prefix-Headers-", &k
  740    742   
            ))
  741    743   
            .map_err(|err| {
  742    744   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  743    745   
                    "length_string_header_map",
  744    746   
                    format!("`{k}` cannot be used as a header name: {err}"),
  745    747   
                )
  746    748   
            })?;
  747    749   
            let header_value = v.as_str();
  748         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         750  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  749    751   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  750    752   
                    "length_string_header_map",
  751    753   
                    format!("`{v}` cannot be used as a header value: {err}"),
  752    754   
                )
  753    755   
            })?;
  754    756   
            builder = builder.header(header_name, header_value);
  755    757   
        }
  756    758   
    }
  757    759   
    Ok(builder)
  758    760   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_constrained_http_payload_bound_shape_operation.rs

@@ -1,1 +107,110 @@
    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_constrained_http_payload_bound_shape_operation_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::ConstrainedHttpPayloadBoundShapeOperationInput,
    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::constrained_http_payload_bound_shape_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        if let Some(value) = {
   23         -
            let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
            let bytes = {
          24  +
                use ::http_body_util::BodyExt;
          25  +
                body.collect().await?.to_bytes()
          26  +
            };
   24     27   
            if !bytes.is_empty() {
   25     28   
                ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     29   
                    &headers,
   27     30   
                    Some("application/json"),
   28     31   
                )?;
   29     32   
            }
   30     33   
            crate::protocol_serde::shape_constrained_http_payload_bound_shape_operation_input::de_http_payload_bound_constrained_shape_payload(&bytes)?
   31     34   
        } {
   32     35   
            input = input.set_http_payload_bound_constrained_shape(value)
   33     36   
        }
   34     37   
        input.build()?
   35     38   
    })
   36     39   
}
   37     40   
   38     41   
#[allow(clippy::unnecessary_wraps)]
   39     42   
pub fn ser_constrained_http_payload_bound_shape_operation_http_response(
   40     43   
    #[allow(unused_variables)]
   41     44   
    output: crate::output::ConstrainedHttpPayloadBoundShapeOperationOutput,
   42     45   
) -> std::result::Result<
   43     46   
    ::aws_smithy_http_server::response::Response,
   44     47   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     48   
> {
   46     49   
    Ok({
   47     50   
        #[allow(unused_mut)]
   48         -
        let mut builder = ::http::Response::builder();
          51  +
        let mut builder = ::http_1x::Response::builder();
   49     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     53   
            builder,
   51         -
            ::http::header::CONTENT_TYPE,
          54  +
            ::http_1x::header::CONTENT_TYPE,
   52     55   
            "application/json",
   53     56   
        );
   54     57   
        let http_status: u16 = 200;
   55     58   
        builder = builder.status(http_status);
   56     59   
        let payload =
   57     60   
            crate::protocol_serde::shape_constrained_http_payload_bound_shape_operation_output::ser_http_payload_bound_constrained_shape_http_payload(& output.http_payload_bound_constrained_shape)?
   58     61   
        ;
   59     62   
        let content_length = payload.len();
   60     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     64   
            builder,
   62         -
            ::http::header::CONTENT_LENGTH,
          65  +
            ::http_1x::header::CONTENT_LENGTH,
   63     66   
            content_length,
   64     67   
        );
   65     68   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   66     69   
        builder.body(body)?
   67     70   
    })
   68     71   
}
   69     72   
   70     73   
#[allow(clippy::unnecessary_wraps)]
   71     74   
pub fn ser_constrained_http_payload_bound_shape_operation_http_error(
   72     75   
    error: &crate::error::ConstrainedHttpPayloadBoundShapeOperationError,
   73     76   
) -> std::result::Result<
   74     77   
    ::aws_smithy_http_server::response::Response,
   75     78   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76     79   
> {
   77     80   
    Ok({
   78     81   
        match error {
   79     82   
            crate::error::ConstrainedHttpPayloadBoundShapeOperationError::ValidationException(
   80     83   
                output,
   81     84   
            ) => {
   82     85   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     86   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          87  +
                let mut builder = ::http_1x::Response::builder();
   85     88   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     89   
                    builder,
   87         -
                    ::http::header::CONTENT_TYPE,
          90  +
                    ::http_1x::header::CONTENT_TYPE,
   88     91   
                    "application/json",
   89     92   
                );
   90     93   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     94   
                    builder,
   92         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          95  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     96   
                    "ValidationException",
   94     97   
                );
   95     98   
                let content_length = payload.len();
   96     99   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    100   
                    builder,
   98         -
                    ::http::header::CONTENT_LENGTH,
         101  +
                    ::http_1x::header::CONTENT_LENGTH,
   99    102   
                    content_length,
  100    103   
                );
  101    104   
                builder
  102    105   
                    .status(400)
  103    106   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  104    107   
            }
  105    108   
        }
  106    109   
    })
  107    110   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_constrained_recursive_shapes_operation.rs

@@ -1,1 +122,125 @@
    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_constrained_recursive_shapes_operation_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::ConstrainedRecursiveShapesOperationInput,
    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 =
   18     18   
            crate::input::constrained_recursive_shapes_operation_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        let bytes = {
          24  +
            use ::http_body_util::BodyExt;
          25  +
            body.collect().await?.to_bytes()
          26  +
        };
   24     27   
        if !bytes.is_empty() {
   25     28   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     29   
                &headers,
   27     30   
                Some("application/json"),
   28     31   
            )?;
   29     32   
            input = crate::protocol_serde::shape_constrained_recursive_shapes_operation::de_constrained_recursive_shapes_operation(bytes.as_ref(), input)?;
   30     33   
        }
   31     34   
        input.build()?
   32     35   
    })
   33     36   
}
   34     37   
   35     38   
#[allow(clippy::unnecessary_wraps)]
   36     39   
pub fn ser_constrained_recursive_shapes_operation_http_response(
   37     40   
    #[allow(unused_variables)] output: crate::output::ConstrainedRecursiveShapesOperationOutput,
   38     41   
) -> std::result::Result<
   39     42   
    ::aws_smithy_http_server::response::Response,
   40     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     44   
> {
   42     45   
    Ok({
   43     46   
        #[allow(unused_mut)]
   44         -
        let mut builder = ::http::Response::builder();
          47  +
        let mut builder = ::http_1x::Response::builder();
   45     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     49   
            builder,
   47         -
            ::http::header::CONTENT_TYPE,
          50  +
            ::http_1x::header::CONTENT_TYPE,
   48     51   
            "application/json",
   49     52   
        );
   50     53   
        let http_status: u16 = 200;
   51     54   
        builder = builder.status(http_status);
   52     55   
        let payload =
   53     56   
            crate::protocol_serde::shape_constrained_recursive_shapes_operation_output::ser_constrained_recursive_shapes_operation_output_output_output(&output)?
   54     57   
        ;
   55     58   
        let content_length = payload.len();
   56     59   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     60   
            builder,
   58         -
            ::http::header::CONTENT_LENGTH,
          61  +
            ::http_1x::header::CONTENT_LENGTH,
   59     62   
            content_length,
   60     63   
        );
   61     64   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   62     65   
        builder.body(body)?
   63     66   
    })
   64     67   
}
   65     68   
   66     69   
#[allow(clippy::unnecessary_wraps)]
   67     70   
pub fn ser_constrained_recursive_shapes_operation_http_error(
   68     71   
    error: &crate::error::ConstrainedRecursiveShapesOperationError,
   69     72   
) -> std::result::Result<
   70     73   
    ::aws_smithy_http_server::response::Response,
   71     74   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   72     75   
> {
   73     76   
    Ok({
   74     77   
        match error {
   75     78   
            crate::error::ConstrainedRecursiveShapesOperationError::ValidationException(output) => {
   76     79   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   77     80   
                #[allow(unused_mut)]
   78         -
                let mut builder = ::http::Response::builder();
          81  +
                let mut builder = ::http_1x::Response::builder();
   79     82   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80     83   
                    builder,
   81         -
                    ::http::header::CONTENT_TYPE,
          84  +
                    ::http_1x::header::CONTENT_TYPE,
   82     85   
                    "application/json",
   83     86   
                );
   84     87   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     88   
                    builder,
   86         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          89  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   87     90   
                    "ValidationException",
   88     91   
                );
   89     92   
                let content_length = payload.len();
   90     93   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     94   
                    builder,
   92         -
                    ::http::header::CONTENT_LENGTH,
          95  +
                    ::http_1x::header::CONTENT_LENGTH,
   93     96   
                    content_length,
   94     97   
                );
   95     98   
                builder
   96     99   
                    .status(400)
   97    100   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   98    101   
            }
   99    102   
        }
  100    103   
    })
  101    104   
}
  102    105   

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_constrained_shapes_only_in_output_operation.rs

@@ -1,1 +56,56 @@
    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_constrained_shapes_only_in_output_operation_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::ConstrainedShapesOnlyInOutputOperationInput,
    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::constrained_shapes_only_in_output_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_constrained_shapes_only_in_output_operation_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::ConstrainedShapesOnlyInOutputOperationOutput,
   30     30   
) -> std::result::Result<
   31     31   
    ::aws_smithy_http_server::response::Response,
   32     32   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     33   
> {
   34     34   
    Ok({
   35     35   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          36  +
        let mut builder = ::http_1x::Response::builder();
   37     37   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     38   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          39  +
            ::http_1x::header::CONTENT_TYPE,
   40     40   
            "application/json",
   41     41   
        );
   42     42   
        let http_status: u16 = 200;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload =
   45     45   
            crate::protocol_serde::shape_constrained_shapes_only_in_output_operation_output::ser_constrained_shapes_only_in_output_operation_output_output_output(&output)?
   46     46   
        ;
   47     47   
        let content_length = payload.len();
   48     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          50  +
            ::http_1x::header::CONTENT_LENGTH,
   51     51   
            content_length,
   52     52   
        );
   53     53   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   54     54   
        builder.body(body)?
   55     55   
    })
   56     56   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_constrained_shapes_operation.rs

@@ -1,1 +122,125 @@
    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_constrained_shapes_operation_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::ConstrainedShapesOperationInput,
    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 =
   18     18   
            crate::input::constrained_shapes_operation_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        let bytes = {
          24  +
            use ::http_body_util::BodyExt;
          25  +
            body.collect().await?.to_bytes()
          26  +
        };
   24     27   
        if !bytes.is_empty() {
   25     28   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     29   
                &headers,
   27     30   
                Some("application/json"),
   28     31   
            )?;
   29     32   
            input = crate::protocol_serde::shape_constrained_shapes_operation::de_constrained_shapes_operation(bytes.as_ref(), input)?;
   30     33   
        }
   31     34   
        input.build()?
   32     35   
    })
   33     36   
}
   34     37   
   35     38   
#[allow(clippy::unnecessary_wraps)]
   36     39   
pub fn ser_constrained_shapes_operation_http_response(
   37     40   
    #[allow(unused_variables)] output: crate::output::ConstrainedShapesOperationOutput,
   38     41   
) -> std::result::Result<
   39     42   
    ::aws_smithy_http_server::response::Response,
   40     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     44   
> {
   42     45   
    Ok({
   43     46   
        #[allow(unused_mut)]
   44         -
        let mut builder = ::http::Response::builder();
          47  +
        let mut builder = ::http_1x::Response::builder();
   45     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     49   
            builder,
   47         -
            ::http::header::CONTENT_TYPE,
          50  +
            ::http_1x::header::CONTENT_TYPE,
   48     51   
            "application/json",
   49     52   
        );
   50     53   
        let http_status: u16 = 200;
   51     54   
        builder = builder.status(http_status);
   52     55   
        let payload =
   53     56   
            crate::protocol_serde::shape_constrained_shapes_operation_output::ser_constrained_shapes_operation_output_output_output(&output)?
   54     57   
        ;
   55     58   
        let content_length = payload.len();
   56     59   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     60   
            builder,
   58         -
            ::http::header::CONTENT_LENGTH,
          61  +
            ::http_1x::header::CONTENT_LENGTH,
   59     62   
            content_length,
   60     63   
        );
   61     64   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   62     65   
        builder.body(body)?
   63     66   
    })
   64     67   
}
   65     68   
   66     69   
#[allow(clippy::unnecessary_wraps)]
   67     70   
pub fn ser_constrained_shapes_operation_http_error(
   68     71   
    error: &crate::error::ConstrainedShapesOperationError,
   69     72   
) -> std::result::Result<
   70     73   
    ::aws_smithy_http_server::response::Response,
   71     74   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   72     75   
> {
   73     76   
    Ok({
   74     77   
        match error {
   75     78   
            crate::error::ConstrainedShapesOperationError::ValidationException(output) => {
   76     79   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   77     80   
                #[allow(unused_mut)]
   78         -
                let mut builder = ::http::Response::builder();
          81  +
                let mut builder = ::http_1x::Response::builder();
   79     82   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80     83   
                    builder,
   81         -
                    ::http::header::CONTENT_TYPE,
          84  +
                    ::http_1x::header::CONTENT_TYPE,
   82     85   
                    "application/json",
   83     86   
                );
   84     87   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     88   
                    builder,
   86         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          89  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   87     90   
                    "ValidationException",
   88     91   
                );
   89     92   
                let content_length = payload.len();
   90     93   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     94   
                    builder,
   92         -
                    ::http::header::CONTENT_LENGTH,
          95  +
                    ::http_1x::header::CONTENT_LENGTH,
   93     96   
                    content_length,
   94     97   
                );
   95     98   
                builder
   96     99   
                    .status(400)
   97    100   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   98    101   
            }
   99    102   
        }
  100    103   
    })
  101    104   
}
  102    105   

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_event_streams_operation.rs

@@ -1,1 +137,141 @@
    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_event_streams_operation_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::EventStreamsOperationInput,
    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::event_streams_operation_input_internal::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   
            let mut receiver =
   25     30   
                crate::protocol_serde::shape_event_streams_operation_input::de_events_payload(
   26         -
                    &mut body.into().into_inner(),
          31  +
                    &mut ::aws_smithy_types::body::SdkBody::from_body_1_x(body),
   27     32   
                )?;
   28     33   
            if let Some(_initial_event) = receiver
   29     34   
                                                .try_recv_initial(::aws_smithy_http::event_stream::InitialMessageType::Request)
   30     35   
                                                .await
   31     36   
                                                .map_err(
   32     37   
                                                    |ev_error| ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::ConstraintViolation(
   33     38   
                                                        #[allow(clippy::useless_conversion)]
   34     39   
                                                        format!("{ev_error}").into()
   35     40   
                                                    )
   36     41   
                                                )? {
   37     42   
                                                
   38     43   
                                            }
   39     44   
            Some(receiver)
   40     45   
        } {
   41     46   
            input = input.set_events(value)
   42     47   
        }
   43     48   
        input.build()?
   44     49   
    })
   45     50   
}
   46     51   
   47     52   
#[allow(clippy::unnecessary_wraps)]
   48     53   
pub fn ser_event_streams_operation_http_response(
   49     54   
    #[allow(unused_variables)] output: crate::output::EventStreamsOperationOutput,
   50     55   
) -> std::result::Result<
   51     56   
    ::aws_smithy_http_server::response::Response,
   52     57   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   53     58   
> {
   54     59   
    Ok({
   55     60   
        #[allow(unused_mut)]
   56         -
        let mut builder = ::http::Response::builder();
          61  +
        let mut builder = ::http_1x::Response::builder();
   57     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     63   
            builder,
   59         -
            ::http::header::CONTENT_TYPE,
          64  +
            ::http_1x::header::CONTENT_TYPE,
   60     65   
            "application/vnd.amazon.eventstream",
   61     66   
        );
   62     67   
        let http_status: u16 = 200;
   63     68   
        builder = builder.status(http_status);
   64         -
        let body = ::aws_smithy_http_server::body::boxed(
   65         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
          69  +
        let body =
          70  +
            ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream({
   66     71   
                let error_marshaller = crate::event_stream_serde::EventErrorMarshaller::new();
   67     72   
                let marshaller = crate::event_stream_serde::EventMarshaller::new();
   68     73   
                let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   69     74   
                output
   70     75   
                    .events
   71     76   
                    .into_body_stream(marshaller, error_marshaller, signer)
   72         -
            }),
   73         -
        );
          77  +
            }));
   74     78   
        builder.body(body)?
   75     79   
    })
   76     80   
}
   77     81   
   78     82   
#[allow(clippy::unnecessary_wraps)]
   79     83   
pub fn ser_event_streams_operation_http_error(
   80     84   
    error: &crate::error::EventStreamsOperationError,
   81     85   
) -> std::result::Result<
   82     86   
    ::aws_smithy_http_server::response::Response,
   83     87   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   84     88   
> {
   85     89   
    Ok({
   86     90   
        match error {
   87     91   
            crate::error::EventStreamsOperationError::ValidationException(output) => {
   88     92   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   89     93   
                #[allow(unused_mut)]
   90         -
                let mut builder = ::http::Response::builder();
          94  +
                let mut builder = ::http_1x::Response::builder();
   91     95   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   92     96   
                    builder,
   93         -
                    ::http::header::CONTENT_TYPE,
          97  +
                    ::http_1x::header::CONTENT_TYPE,
   94     98   
                    "application/vnd.amazon.eventstream",
   95     99   
                );
   96    100   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    101   
                    builder,
   98         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         102  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   99    103   
                    "ValidationException",
  100    104   
                );
  101    105   
                let content_length = payload.len();
  102    106   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    107   
                    builder,
  104         -
                    ::http::header::CONTENT_LENGTH,
         108  +
                    ::http_1x::header::CONTENT_LENGTH,
  105    109   
                    content_length,
  106    110   
                );
  107    111   
                builder
  108    112   
                    .status(400)
  109    113   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  110    114   
            }
  111    115   
            crate::error::EventStreamsOperationError::EventStreamErrorMessage(output) => {
  112    116   
                let payload = crate::protocol_serde::shape_event_stream_error_message::ser_event_stream_error_message_error(output)?;
  113    117   
                #[allow(unused_mut)]
  114         -
                let mut builder = ::http::Response::builder();
         118  +
                let mut builder = ::http_1x::Response::builder();
  115    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    120   
                    builder,
  117         -
                    ::http::header::CONTENT_TYPE,
         121  +
                    ::http_1x::header::CONTENT_TYPE,
  118    122   
                    "application/vnd.amazon.eventstream",
  119    123   
                );
  120    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  121    125   
                    builder,
  122         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         126  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  123    127   
                    "EventStreamErrorMessage",
  124    128   
                );
  125    129   
                let content_length = payload.len();
  126    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    131   
                    builder,
  128         -
                    ::http::header::CONTENT_LENGTH,
         132  +
                    ::http_1x::header::CONTENT_LENGTH,
  129    133   
                    content_length,
  130    134   
                );
  131    135   
                builder
  132    136   
                    .status(500)
  133    137   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  134    138   
            }
  135    139   
        }
  136    140   
    })
  137    141   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_http_prefix_headers_targeting_length_map_operation.rs

@@ -1,1 +124,126 @@
    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_http_prefix_headers_targeting_length_map_operation_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::HttpPrefixHeadersTargetingLengthMapOperationInput,
    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::http_prefix_headers_targeting_length_map_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        if let Some(value) = crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_input::de_length_map_prefix_header(&headers)? {
   23     23   
                                input = input.set_length_map(Some(value))
   24     24   
                            }
   25     25   
        input.build()?
   26     26   
    })
   27     27   
}
   28     28   
   29     29   
#[allow(clippy::unnecessary_wraps)]
   30     30   
pub fn ser_http_prefix_headers_targeting_length_map_operation_http_response(
   31     31   
    #[allow(unused_variables)]
   32     32   
    output: crate::output::HttpPrefixHeadersTargetingLengthMapOperationOutput,
   33     33   
) -> std::result::Result<
   34     34   
    ::aws_smithy_http_server::response::Response,
   35     35   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   36     36   
> {
   37     37   
    Ok({
   38     38   
        #[allow(unused_mut)]
   39         -
        let mut builder = ::http::Response::builder();
          39  +
        let mut builder = ::http_1x::Response::builder();
   40     40   
        builder = crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation::ser_http_prefix_headers_targeting_length_map_operation_headers(&output, builder)?;
   41     41   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     42   
            builder,
   43         -
            ::http::header::CONTENT_TYPE,
          43  +
            ::http_1x::header::CONTENT_TYPE,
   44     44   
            "application/json",
   45     45   
        );
   46     46   
        let http_status: u16 = 200;
   47     47   
        builder = builder.status(http_status);
   48     48   
        let payload =
   49     49   
            crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_output::ser_http_prefix_headers_targeting_length_map_operation_output_output_output(&output)?
   50     50   
        ;
   51     51   
        let content_length = payload.len();
   52     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     53   
            builder,
   54         -
            ::http::header::CONTENT_LENGTH,
          54  +
            ::http_1x::header::CONTENT_LENGTH,
   55     55   
            content_length,
   56     56   
        );
   57     57   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   58     58   
        builder.body(body)?
   59     59   
    })
   60     60   
}
   61     61   
   62     62   
#[allow(clippy::unnecessary_wraps)]
   63     63   
pub fn ser_http_prefix_headers_targeting_length_map_operation_http_error(
   64     64   
    error: &crate::error::HttpPrefixHeadersTargetingLengthMapOperationError,
   65     65   
) -> std::result::Result<
   66     66   
    ::aws_smithy_http_server::response::Response,
   67     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   68     68   
> {
   69     69   
    Ok({
   70     70   
        match error {
   71     71   
            crate::error::HttpPrefixHeadersTargetingLengthMapOperationError::ValidationException(output) => {
   72     72   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   73     73   
                #[allow(unused_mut)]
   74         -
                let mut builder = ::http::Response::builder();
          74  +
                let mut builder = ::http_1x::Response::builder();
   75     75   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   76     76   
                                builder,
   77         -
                                ::http::header::CONTENT_TYPE,
          77  +
                                ::http_1x::header::CONTENT_TYPE,
   78     78   
                                "application/json",
   79     79   
                            );
   80     80   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81     81   
                                builder,
   82         -
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
          82  +
                                ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   83     83   
                                "ValidationException",
   84     84   
                            );
   85     85   
                let content_length = payload.len();
   86         -
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
          86  +
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http_1x::header::CONTENT_LENGTH, content_length);
   87     87   
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   88     88   
            }
   89     89   
        }
   90     90   
    })
   91     91   
}
   92     92   
   93     93   
pub fn ser_http_prefix_headers_targeting_length_map_operation_headers(
   94     94   
    input: &crate::output::HttpPrefixHeadersTargetingLengthMapOperationOutput,
   95         -
    mut builder: ::http::response::Builder,
   96         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
   97         -
{
          95  +
    mut builder: ::http_1x::response::Builder,
          96  +
) -> std::result::Result<
          97  +
    ::http_1x::response::Builder,
          98  +
    ::aws_smithy_types::error::operation::BuildError,
          99  +
> {
   98    100   
    if let ::std::option::Option::Some(inner_1) = &input.length_map {
   99    101   
        {
  100    102   
            for (k, v) in inner_1 {
  101    103   
                use std::str::FromStr;
  102         -
                let header_name = http::header::HeaderName::from_str(&format!(
         104  +
                let header_name = ::http_1x::HeaderName::from_str(&format!(
  103    105   
                    "{}{}",
  104    106   
                    "X-Prefix-Headers-LengthMap-", &k
  105    107   
                ))
  106    108   
                .map_err(|err| {
  107    109   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  108    110   
                        "length_map",
  109    111   
                        format!("`{k}` cannot be used as a header name: {err}"),
  110    112   
                    )
  111    113   
                })?;
  112    114   
                let header_value = v.as_str();
  113         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         115  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  114    116   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  115    117   
                        "length_map",
  116    118   
                        format!("`{v}` cannot be used as a header value: {err}"),
  117    119   
                    )
  118    120   
                })?;
  119    121   
                builder = builder.header(header_name, header_value);
  120    122   
            }
  121    123   
        }
  122    124   
    }
  123    125   
    Ok(builder)

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_non_streaming_blob_operation.rs

@@ -1,1 +58,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_non_streaming_blob_operation_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::NonStreamingBlobOperationInput,
    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 =
   18     18   
            crate::input::non_streaming_blob_operation_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = {
   24         -
            let bytes = ::hyper::body::to_bytes(body).await?;
          24  +
            let bytes = {
          25  +
                use ::http_body_util::BodyExt;
          26  +
                body.collect().await?.to_bytes()
          27  +
            };
   25     28   
   26     29   
            crate::protocol_serde::shape_non_streaming_blob_operation_input::de_non_streaming_blob_payload(&bytes)?
   27     30   
        } {
   28     31   
            input = input.set_non_streaming_blob(Some(value))
   29     32   
        }
   30     33   
        input.build()
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_non_streaming_blob_operation_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::NonStreamingBlobOperationOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        let http_status: u16 = 200;
   45     48   
        builder = builder.status(http_status);
   46     49   
        let payload =
   47     50   
            crate::protocol_serde::shape_non_streaming_blob_operation_output::ser_non_streaming_blob_http_payload( output.non_streaming_blob)?
   48     51   
        ;
   49     52   
        let content_length = payload.len();
   50     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   51     54   
            builder,
   52         -
            ::http::header::CONTENT_LENGTH,
          55  +
            ::http_1x::header::CONTENT_LENGTH,
   53     56   
            content_length,
   54     57   
        );
   55     58   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   56     59   
        builder.body(body)?
   57     60   
    })
   58     61   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_query_params_targeting_length_map_operation.rs

@@ -1,1 +107,107 @@
    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_query_params_targeting_length_map_operation_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::QueryParamsTargetingLengthMapOperationInput,
    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::query_params_targeting_length_map_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained =
   25     25   
            crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained(
   26     26   
                ::std::collections::HashMap::new(),
   27     27   
            );
   28     28   
        for (k, v) in pairs {
   29     29   
            query_params
   30     30   
                .0
   31     31   
                .entry(String::from(k))
   32     32   
                .or_insert_with(|| String::from(v));
   33     33   
        }
   34     34   
        input = input.set_length_map(Some(query_params));
   35     35   
        input.build()?
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
#[allow(clippy::unnecessary_wraps)]
   40     40   
pub fn ser_query_params_targeting_length_map_operation_http_response(
   41     41   
    #[allow(unused_variables)] output: crate::output::QueryParamsTargetingLengthMapOperationOutput,
   42     42   
) -> std::result::Result<
   43     43   
    ::aws_smithy_http_server::response::Response,
   44     44   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     45   
> {
   46     46   
    Ok({
   47     47   
        #[allow(unused_mut)]
   48         -
        let mut builder = ::http::Response::builder();
          48  +
        let mut builder = ::http_1x::Response::builder();
   49     49   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51         -
            ::http::header::CONTENT_TYPE,
          51  +
            ::http_1x::header::CONTENT_TYPE,
   52     52   
            "application/json",
   53     53   
        );
   54     54   
        let http_status: u16 = 200;
   55     55   
        builder = builder.status(http_status);
   56     56   
        let payload =
   57     57   
            crate::protocol_serde::shape_query_params_targeting_length_map_operation_output::ser_query_params_targeting_length_map_operation_output_output_output(&output)?
   58     58   
        ;
   59     59   
        let content_length = payload.len();
   60     60   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     61   
            builder,
   62         -
            ::http::header::CONTENT_LENGTH,
          62  +
            ::http_1x::header::CONTENT_LENGTH,
   63     63   
            content_length,
   64     64   
        );
   65     65   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   66     66   
        builder.body(body)?
   67     67   
    })
   68     68   
}
   69     69   
   70     70   
#[allow(clippy::unnecessary_wraps)]
   71     71   
pub fn ser_query_params_targeting_length_map_operation_http_error(
   72     72   
    error: &crate::error::QueryParamsTargetingLengthMapOperationError,
   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   
        match error {
   79     79   
            crate::error::QueryParamsTargetingLengthMapOperationError::ValidationException(
   80     80   
                output,
   81     81   
            ) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                    builder,
   87         -
                    ::http::header::CONTENT_TYPE,
          87  +
                    ::http_1x::header::CONTENT_TYPE,
   88     88   
                    "application/json",
   89     89   
                );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                    "ValidationException",
   94     94   
                );
   95     95   
                let content_length = payload.len();
   96     96   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98         -
                    ::http::header::CONTENT_LENGTH,
          98  +
                    ::http_1x::header::CONTENT_LENGTH,
   99     99   
                    content_length,
  100    100   
                );
  101    101   
                builder
  102    102   
                    .status(400)
  103    103   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  104    104   
            }
  105    105   
        }
  106    106   
    })
  107    107   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_query_params_targeting_map_of_enum_string_operation.rs

@@ -1,1 +101,101 @@
    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_query_params_targeting_map_of_enum_string_operation_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::QueryParamsTargetingMapOfEnumStringOperationInput,
    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::query_params_targeting_map_of_enum_string_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: crate::unconstrained::map_of_enum_string_unconstrained::MapOfEnumStringUnconstrained =
   25     25   
            crate::unconstrained::map_of_enum_string_unconstrained::MapOfEnumStringUnconstrained(
   26     26   
                ::std::collections::HashMap::new()
   27     27   
            )
   28     28   
        ;
   29     29   
        for (k, v) in pairs {
   30     30   
            query_params
   31     31   
                .0
   32     32   
                .entry(String::from(k))
   33     33   
                .or_insert_with(|| String::from(v));
   34     34   
        }
   35     35   
        input = input.set_map_of_enum_string(Some(query_params));
   36     36   
        input.build()?
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_query_params_targeting_map_of_enum_string_operation_http_response(
   42     42   
    #[allow(unused_variables)]
   43     43   
    output: crate::output::QueryParamsTargetingMapOfEnumStringOperationOutput,
   44     44   
) -> std::result::Result<
   45     45   
    ::aws_smithy_http_server::response::Response,
   46     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     47   
> {
   48     48   
    Ok({
   49     49   
        #[allow(unused_mut)]
   50         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   51     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     52   
            builder,
   53         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   54     54   
            "application/json",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload =
   59     59   
            crate::protocol_serde::shape_query_params_targeting_map_of_enum_string_operation_output::ser_query_params_targeting_map_of_enum_string_operation_output_output_output(&output)?
   60     60   
        ;
   61     61   
        let content_length = payload.len();
   62     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_query_params_targeting_map_of_enum_string_operation_http_error(
   74     74   
    error: &crate::error::QueryParamsTargetingMapOfEnumStringOperationError,
   75     75   
) -> std::result::Result<
   76     76   
    ::aws_smithy_http_server::response::Response,
   77     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::QueryParamsTargetingMapOfEnumStringOperationError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                                builder,
   87         -
                                ::http::header::CONTENT_TYPE,
          87  +
                                ::http_1x::header::CONTENT_TYPE,
   88     88   
                                "application/json",
   89     89   
                            );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                                builder,
   92         -
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                                ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                                "ValidationException",
   94     94   
                            );
   95     95   
                let content_length = payload.len();
   96         -
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
          96  +
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http_1x::header::CONTENT_LENGTH, content_length);
   97     97   
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
        }
  100    100   
    })
  101    101   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_query_params_targeting_map_of_length_list_of_pattern_string_operation.rs

@@ -1,1 +101,101 @@
    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_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_request<
    4      4   
    B,
    5      5   
>(
    6         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    7      7   
) -> std::result::Result<
    8      8   
    crate::input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput,
    9      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   10     10   
>
   11     11   
where
   12     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   13     13   
    B::Data: Send,
   14     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   15     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   16     16   
{
   17     17   
    Ok({
   18     18   
        #[allow(unused_mut)]
   19     19   
        let mut input = crate::input::query_params_targeting_map_of_length_list_of_pattern_string_operation_input_internal::Builder::default();
   20     20   
        #[allow(unused_variables)]
   21     21   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     22   
            uri, headers, body, ..
   23     23   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   24     24   
        let query_string = uri.query().unwrap_or("");
   25     25   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   26     26   
        let mut query_params: crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained =
   27     27   
            crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained(
   28     28   
                ::std::collections::HashMap::new()
   29     29   
            )
   30     30   
        ;
   31     31   
        for (k, v) in pairs {
   32     32   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained(std::vec::Vec::new()));
   33     33   
            entry.0.push(String::from(v));
   34     34   
        }
   35     35   
        input = input.set_map_of_length_list_of_pattern_string(Some(query_params));
   36     36   
        input.build()?
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_response(
   42     42   
    #[allow(unused_variables)]
   43     43   
    output: crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
   44     44   
) -> std::result::Result<
   45     45   
    ::aws_smithy_http_server::response::Response,
   46     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     47   
> {
   48     48   
    Ok({
   49     49   
        #[allow(unused_mut)]
   50         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   51     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     52   
            builder,
   53         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   54     54   
            "application/json",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload =
   59     59   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output_output(&output)?
   60     60   
        ;
   61     61   
        let content_length = payload.len();
   62     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_error(
   74     74   
    error: &crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError,
   75     75   
) -> std::result::Result<
   76     76   
    ::aws_smithy_http_server::response::Response,
   77     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                                builder,
   87         -
                                ::http::header::CONTENT_TYPE,
          87  +
                                ::http_1x::header::CONTENT_TYPE,
   88     88   
                                "application/json",
   89     89   
                            );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                                builder,
   92         -
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                                ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                                "ValidationException",
   94     94   
                            );
   95     95   
                let content_length = payload.len();
   96         -
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
          96  +
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http_1x::header::CONTENT_LENGTH, content_length);
   97     97   
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
        }
  100    100   
    })
  101    101   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_query_params_targeting_map_of_length_pattern_string_operation.rs

@@ -1,1 +101,101 @@
    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_query_params_targeting_map_of_length_pattern_string_operation_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::QueryParamsTargetingMapOfLengthPatternStringOperationInput,
    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::query_params_targeting_map_of_length_pattern_string_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: crate::unconstrained::map_of_length_pattern_string_unconstrained::MapOfLengthPatternStringUnconstrained =
   25     25   
            crate::unconstrained::map_of_length_pattern_string_unconstrained::MapOfLengthPatternStringUnconstrained(
   26     26   
                ::std::collections::HashMap::new()
   27     27   
            )
   28     28   
        ;
   29     29   
        for (k, v) in pairs {
   30     30   
            query_params
   31     31   
                .0
   32     32   
                .entry(String::from(k))
   33     33   
                .or_insert_with(|| String::from(v));
   34     34   
        }
   35     35   
        input = input.set_map_of_length_pattern_string(Some(query_params));
   36     36   
        input.build()?
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_query_params_targeting_map_of_length_pattern_string_operation_http_response(
   42     42   
    #[allow(unused_variables)]
   43     43   
    output: crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput,
   44     44   
) -> std::result::Result<
   45     45   
    ::aws_smithy_http_server::response::Response,
   46     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     47   
> {
   48     48   
    Ok({
   49     49   
        #[allow(unused_mut)]
   50         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   51     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     52   
            builder,
   53         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   54     54   
            "application/json",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload =
   59     59   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_length_pattern_string_operation_output_output_output(&output)?
   60     60   
        ;
   61     61   
        let content_length = payload.len();
   62     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_query_params_targeting_map_of_length_pattern_string_operation_http_error(
   74     74   
    error: &crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError,
   75     75   
) -> std::result::Result<
   76     76   
    ::aws_smithy_http_server::response::Response,
   77     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                                builder,
   87         -
                                ::http::header::CONTENT_TYPE,
          87  +
                                ::http_1x::header::CONTENT_TYPE,
   88     88   
                                "application/json",
   89     89   
                            );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                                builder,
   92         -
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                                ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                                "ValidationException",
   94     94   
                            );
   95     95   
                let content_length = payload.len();
   96         -
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
          96  +
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http_1x::header::CONTENT_LENGTH, content_length);
   97     97   
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
        }
  100    100   
    })
  101    101   
}

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/rust-server-codegen/src/protocol_serde/shape_query_params_targeting_map_of_length_string_operation.rs

@@ -1,1 +101,101 @@
    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_query_params_targeting_map_of_length_string_operation_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::QueryParamsTargetingMapOfLengthStringOperationInput,
    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::query_params_targeting_map_of_length_string_operation_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained =
   25     25   
            crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained(
   26     26   
                ::std::collections::HashMap::new()
   27     27   
            )
   28     28   
        ;
   29     29   
        for (k, v) in pairs {
   30     30   
            query_params
   31     31   
                .0
   32     32   
                .entry(String::from(k))
   33     33   
                .or_insert_with(|| String::from(v));
   34     34   
        }
   35     35   
        input = input.set_map_of_length_string(Some(query_params));
   36     36   
        input.build()?
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_query_params_targeting_map_of_length_string_operation_http_response(
   42     42   
    #[allow(unused_variables)]
   43     43   
    output: crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput,
   44     44   
) -> std::result::Result<
   45     45   
    ::aws_smithy_http_server::response::Response,
   46     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     47   
> {
   48     48   
    Ok({
   49     49   
        #[allow(unused_mut)]
   50         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   51     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     52   
            builder,
   53         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   54     54   
            "application/json",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload =
   59     59   
            crate::protocol_serde::shape_query_params_targeting_map_of_length_string_operation_output::ser_query_params_targeting_map_of_length_string_operation_output_output_output(&output)?
   60     60   
        ;
   61     61   
        let content_length = payload.len();
   62     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_query_params_targeting_map_of_length_string_operation_http_error(
   74     74   
    error: &crate::error::QueryParamsTargetingMapOfLengthStringOperationError,
   75     75   
) -> std::result::Result<
   76     76   
    ::aws_smithy_http_server::response::Response,
   77     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::QueryParamsTargetingMapOfLengthStringOperationError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                                builder,
   87         -
                                ::http::header::CONTENT_TYPE,
          87  +
                                ::http_1x::header::CONTENT_TYPE,
   88     88   
                                "application/json",
   89     89   
                            );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                                builder,
   92         -
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                                ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                                "ValidationException",
   94     94   
                            );
   95     95   
                let content_length = payload.len();
   96         -
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
          96  +
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http_1x::header::CONTENT_LENGTH, content_length);
   97     97   
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
        }
  100    100   
    })
  101    101   
}