Server Test Python

Server Test Python

rev. 03e6e47f15dfd569240d570d98975ebba692c405 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_all_query_string_types.rs

@@ -1,1 +43,43 @@
    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_all_query_string_types_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::AllQueryStringTypesInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::all_query_string_types_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());
@@ -174,174 +288,288 @@
  194    194   
            input = input.set_query_timestamp_list(Some(query_timestamp_list));
  195    195   
        }
  196    196   
        input.build()?
  197    197   
    })
  198    198   
}
  199    199   
  200    200   
#[allow(clippy::unnecessary_wraps)]
  201    201   
pub fn ser_all_query_string_types_http_response(
  202    202   
    #[allow(unused_variables)] output: crate::output::AllQueryStringTypesOutput,
  203    203   
) -> std::result::Result<
  204         -
    ::aws_smithy_http_server::response::Response,
  205         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         204  +
    ::aws_smithy_legacy_http_server::response::Response,
         205  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  206    206   
> {
  207    207   
    Ok({
  208    208   
        #[allow(unused_mut)]
  209    209   
        let mut builder = ::http::Response::builder();
  210         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         210  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  211    211   
            builder,
  212    212   
            ::http::header::CONTENT_TYPE,
  213    213   
            "application/json",
  214    214   
        );
  215    215   
        let http_status: u16 = 200;
  216    216   
        builder = builder.status(http_status);
  217    217   
        let payload = "";
  218    218   
        let content_length = payload.len();
  219         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         219  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  220    220   
            builder,
  221    221   
            ::http::header::CONTENT_LENGTH,
  222    222   
            content_length,
  223    223   
        );
  224         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         224  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  225    225   
        builder.body(body)?
  226    226   
    })
  227    227   
}
  228    228   
  229    229   
#[allow(clippy::unnecessary_wraps)]
  230    230   
pub fn ser_all_query_string_types_http_error(
  231    231   
    error: &crate::error::AllQueryStringTypesError,
  232    232   
) -> std::result::Result<
  233         -
    ::aws_smithy_http_server::response::Response,
  234         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         233  +
    ::aws_smithy_legacy_http_server::response::Response,
         234  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  235    235   
> {
  236    236   
    Ok({
  237    237   
        match error {
  238    238   
            crate::error::AllQueryStringTypesError::ValidationException(output) => {
  239    239   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  240    240   
                #[allow(unused_mut)]
  241    241   
                let mut builder = ::http::Response::builder();
  242         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         242  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  243    243   
                    builder,
  244    244   
                    ::http::header::CONTENT_TYPE,
  245    245   
                    "application/json",
  246    246   
                );
  247         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         247  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  248    248   
                    builder,
  249    249   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  250    250   
                    "ValidationException",
  251    251   
                );
  252    252   
                let content_length = payload.len();
  253         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         253  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  254    254   
                    builder,
  255    255   
                    ::http::header::CONTENT_LENGTH,
  256    256   
                    content_length,
  257    257   
                );
  258    258   
                builder
  259    259   
                    .status(400)
  260         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         260  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  261    261   
            }
  262    262   
            crate::error::AllQueryStringTypesError::InternalServerError(output) => {
  263    263   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  264    264   
                #[allow(unused_mut)]
  265    265   
                let mut builder = ::http::Response::builder();
  266         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         266  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  267    267   
                    builder,
  268    268   
                    ::http::header::CONTENT_TYPE,
  269    269   
                    "application/json",
  270    270   
                );
  271         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         271  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  272    272   
                    builder,
  273    273   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  274    274   
                    "InternalServerError",
  275    275   
                );
  276    276   
                let content_length = payload.len();
  277         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         277  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  278    278   
                    builder,
  279    279   
                    ::http::header::CONTENT_LENGTH,
  280    280   
                    content_length,
  281    281   
                );
  282    282   
                builder
  283    283   
                    .status(500)
  284         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         284  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  285    285   
            }
  286    286   
        }
  287    287   
    })
  288    288   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_all_query_string_types_input.rs

@@ -1,1 +114,114 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_query_boolean(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<bool>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
    9      9   
    Ok(Some(value))
   10     10   
}
   11     11   
   12     12   
pub fn de_query_byte(
   13     13   
    value: &str,
   14     14   
) -> std::result::Result<
   15     15   
    ::std::option::Option<i8>,
   16         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          16  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     17   
> {
   18     18   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   19     19   
    Ok(Some(value))
   20     20   
}
   21     21   
   22     22   
pub fn de_query_double(
   23     23   
    value: &str,
   24     24   
) -> std::result::Result<
   25     25   
    ::std::option::Option<f64>,
   26         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          26  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   27     27   
> {
   28     28   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   29     29   
    Ok(Some(value))
   30     30   
}
   31     31   
   32     32   
pub fn de_query_enum(
   33     33   
    value: &str,
   34     34   
) -> std::result::Result<
   35     35   
    ::std::option::Option<::std::string::String>,
   36         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          36  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   37     37   
> {
   38     38   
    let value = value.to_owned();
   39     39   
    Ok(Some(value))
   40     40   
}
   41     41   
   42     42   
pub fn de_query_float(
   43     43   
    value: &str,
   44     44   
) -> std::result::Result<
   45     45   
    ::std::option::Option<f32>,
   46         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          46  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   47     47   
> {
   48     48   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   49     49   
    Ok(Some(value))
   50     50   
}
   51     51   
   52     52   
pub fn de_query_integer(
   53     53   
    value: &str,
   54     54   
) -> std::result::Result<
   55     55   
    ::std::option::Option<i32>,
   56         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          56  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   57     57   
> {
   58     58   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   59     59   
    Ok(Some(value))
   60     60   
}
   61     61   
   62     62   
pub fn de_query_integer_enum(
   63     63   
    value: &str,
   64     64   
) -> std::result::Result<
   65     65   
    ::std::option::Option<i32>,
   66         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   67     67   
> {
   68     68   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   69     69   
    Ok(Some(value))
   70     70   
}
   71     71   
   72     72   
pub fn de_query_long(
   73     73   
    value: &str,
   74     74   
) -> std::result::Result<
   75     75   
    ::std::option::Option<i64>,
   76         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          76  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   77     77   
> {
   78     78   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   79     79   
    Ok(Some(value))
   80     80   
}
   81     81   
   82     82   
pub fn de_query_short(
   83     83   
    value: &str,
   84     84   
) -> std::result::Result<
   85     85   
    ::std::option::Option<i16>,
   86         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          86  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   87     87   
> {
   88     88   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   89     89   
    Ok(Some(value))
   90     90   
}
   91     91   
   92     92   
pub fn de_query_string(
   93     93   
    value: &str,
   94     94   
) -> std::result::Result<
   95     95   
    ::std::option::Option<::std::string::String>,
   96         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          96  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   97     97   
> {
   98     98   
    let value = value.to_owned();
   99     99   
    Ok(Some(value))
  100    100   
}
  101    101   
  102    102   
pub fn de_query_timestamp(
  103    103   
    value: &str,
  104    104   
) -> std::result::Result<
  105    105   
    ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
  106         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
         106  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
  107    107   
> {
  108    108   
    let value = ::aws_smithy_types::DateTime::from_str(
  109    109   
        value,
  110    110   
        ::aws_smithy_types::date_time::Format::DateTime,
  111    111   
    )?
  112    112   
    .into();
  113    113   
    Ok(Some(value))
  114    114   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_and_variable_query_string.rs

@@ -1,1 +111,111 @@
    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_constant_and_variable_query_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ConstantAndVariableQueryStringInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::constant_and_variable_query_string_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   
        let query_string = uri.query().unwrap_or("");
   24     24   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   25     25   
        let mut baz_seen = false;
   26     26   
        let mut maybe_set_seen = false;
   27     27   
        for (k, v) in pairs {
   28     28   
            if !baz_seen && k == "baz" {
   29     29   
                input = input.set_baz(
   30     30   
                    crate::protocol_serde::shape_constant_and_variable_query_string_input::de_baz(
   31     31   
                        &v,
   32     32   
                    )?,
   33     33   
                );
   34     34   
                baz_seen = true;
   35     35   
            }
   36     36   
            if !maybe_set_seen && k == "maybeSet" {
   37     37   
                input = input.set_maybe_set(
   38     38   
                    crate::protocol_serde::shape_constant_and_variable_query_string_input::de_maybe_set(&v)?
   39     39   
                );
   40     40   
                maybe_set_seen = true;
   41     41   
            }
   42     42   
        }
   43     43   
        input.build()
   44     44   
    })
   45     45   
}
   46     46   
   47     47   
#[allow(clippy::unnecessary_wraps)]
   48     48   
pub fn ser_constant_and_variable_query_string_http_response(
   49     49   
    #[allow(unused_variables)] output: crate::output::ConstantAndVariableQueryStringOutput,
   50     50   
) -> std::result::Result<
   51         -
    ::aws_smithy_http_server::response::Response,
   52         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          51  +
    ::aws_smithy_legacy_http_server::response::Response,
          52  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   53     53   
> {
   54     54   
    Ok({
   55     55   
        #[allow(unused_mut)]
   56     56   
        let mut builder = ::http::Response::builder();
   57         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          57  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   58     58   
            builder,
   59     59   
            ::http::header::CONTENT_TYPE,
   60     60   
            "application/json",
   61     61   
        );
   62     62   
        let http_status: u16 = 200;
   63     63   
        builder = builder.status(http_status);
   64     64   
        let payload = "";
   65     65   
        let content_length = payload.len();
   66         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          66  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   67     67   
            builder,
   68     68   
            ::http::header::CONTENT_LENGTH,
   69     69   
            content_length,
   70     70   
        );
   71         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          71  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   72     72   
        builder.body(body)?
   73     73   
    })
   74     74   
}
   75     75   
   76     76   
#[allow(clippy::unnecessary_wraps)]
   77     77   
pub fn ser_constant_and_variable_query_string_http_error(
   78     78   
    error: &crate::error::ConstantAndVariableQueryStringError,
   79     79   
) -> std::result::Result<
   80         -
    ::aws_smithy_http_server::response::Response,
   81         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          80  +
    ::aws_smithy_legacy_http_server::response::Response,
          81  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   82     82   
> {
   83     83   
    Ok({
   84     84   
        match error {
   85     85   
            crate::error::ConstantAndVariableQueryStringError::InternalServerError(output) => {
   86     86   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   87     87   
                #[allow(unused_mut)]
   88     88   
                let mut builder = ::http::Response::builder();
   89         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          89  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   90     90   
                    builder,
   91     91   
                    ::http::header::CONTENT_TYPE,
   92     92   
                    "application/json",
   93     93   
                );
   94         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          94  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   95     95   
                    builder,
   96     96   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   97     97   
                    "InternalServerError",
   98     98   
                );
   99     99   
                let content_length = payload.len();
  100         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         100  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  101    101   
                    builder,
  102    102   
                    ::http::header::CONTENT_LENGTH,
  103    103   
                    content_length,
  104    104   
                );
  105    105   
                builder
  106    106   
                    .status(500)
  107         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         107  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  108    108   
            }
  109    109   
        }
  110    110   
    })
  111    111   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_and_variable_query_string_input.rs

@@ -1,1 +20,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_baz(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = value.to_owned();
    9      9   
    Ok(Some(value))
   10     10   
}
   11     11   
   12     12   
pub fn de_maybe_set(
   13     13   
    value: &str,
   14     14   
) -> std::result::Result<
   15     15   
    ::std::option::Option<::std::string::String>,
   16         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          16  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     17   
> {
   18     18   
    let value = value.to_owned();
   19     19   
    Ok(Some(value))
   20     20   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_query_string.rs

@@ -1,1 +134,134 @@
    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_constant_query_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ConstantQueryStringInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::constant_query_string_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 input_string = uri.path();
   23     23   
        let (input_string, (_, m1)) =
   24     24   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     25   
                ::nom::sequence::preceded(
   26     26   
                    ::nom::bytes::complete::tag("/"),
   27     27   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   28     28   
                        "ConstantQueryString",
   29     29   
                    ),
   30     30   
                ),
   31     31   
                ::nom::sequence::preceded(
   32     32   
                    ::nom::bytes::complete::tag("/"),
   33     33   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   34     34   
                        ::nom::bytes::complete::take_until("/"),
   35     35   
                        ::nom::combinator::rest,
   36     36   
                    )),
   37     37   
                ),
   38     38   
            ))(input_string)?;
   39     39   
        debug_assert_eq!("", input_string);
   40     40   
        input = input
   41     41   
            .set_hello(crate::protocol_serde::shape_constant_query_string_input::de_hello(m1)?);
   42     42   
        input.build()?
   43     43   
    })
   44     44   
}
   45     45   
   46     46   
#[allow(clippy::unnecessary_wraps)]
   47     47   
pub fn ser_constant_query_string_http_response(
   48     48   
    #[allow(unused_variables)] output: crate::output::ConstantQueryStringOutput,
   49     49   
) -> std::result::Result<
   50         -
    ::aws_smithy_http_server::response::Response,
   51         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          50  +
    ::aws_smithy_legacy_http_server::response::Response,
          51  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   52     52   
> {
   53     53   
    Ok({
   54     54   
        #[allow(unused_mut)]
   55     55   
        let mut builder = ::http::Response::builder();
   56         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          56  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   57     57   
            builder,
   58     58   
            ::http::header::CONTENT_TYPE,
   59     59   
            "application/json",
   60     60   
        );
   61     61   
        let http_status: u16 = 200;
   62     62   
        builder = builder.status(http_status);
   63     63   
        let payload = "";
   64     64   
        let content_length = payload.len();
   65         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          65  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   66     66   
            builder,
   67     67   
            ::http::header::CONTENT_LENGTH,
   68     68   
            content_length,
   69     69   
        );
   70         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          70  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   71     71   
        builder.body(body)?
   72     72   
    })
   73     73   
}
   74     74   
   75     75   
#[allow(clippy::unnecessary_wraps)]
   76     76   
pub fn ser_constant_query_string_http_error(
   77     77   
    error: &crate::error::ConstantQueryStringError,
   78     78   
) -> std::result::Result<
   79         -
    ::aws_smithy_http_server::response::Response,
   80         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          79  +
    ::aws_smithy_legacy_http_server::response::Response,
          80  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   81     81   
> {
   82     82   
    Ok({
   83     83   
        match error {
   84     84   
            crate::error::ConstantQueryStringError::ValidationException(output) => {
   85     85   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   86     86   
                #[allow(unused_mut)]
   87     87   
                let mut builder = ::http::Response::builder();
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90     90   
                    ::http::header::CONTENT_TYPE,
   91     91   
                    "application/json",
   92     92   
                );
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   96     96   
                    "ValidationException",
   97     97   
                );
   98     98   
                let content_length = payload.len();
   99         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          99  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  100    100   
                    builder,
  101    101   
                    ::http::header::CONTENT_LENGTH,
  102    102   
                    content_length,
  103    103   
                );
  104    104   
                builder
  105    105   
                    .status(400)
  106         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         106  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  107    107   
            }
  108    108   
            crate::error::ConstantQueryStringError::InternalServerError(output) => {
  109    109   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  110    110   
                #[allow(unused_mut)]
  111    111   
                let mut builder = ::http::Response::builder();
  112         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         112  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  113    113   
                    builder,
  114    114   
                    ::http::header::CONTENT_TYPE,
  115    115   
                    "application/json",
  116    116   
                );
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  120    120   
                    "InternalServerError",
  121    121   
                );
  122    122   
                let content_length = payload.len();
  123         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         123  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125    125   
                    ::http::header::CONTENT_LENGTH,
  126    126   
                    content_length,
  127    127   
                );
  128    128   
                builder
  129    129   
                    .status(500)
  130         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  131    131   
            }
  132    132   
        }
  133    133   
    })
  134    134   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_query_string_input.rs

@@ -1,1 +12,12 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_hello(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::string::String,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = ::percent_encoding::percent_decode_str(value)
    9      9   
        .decode_utf8()?
   10     10   
        .into_owned();
   11     11   
    Ok(value)
   12     12   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_content_type_parameters.rs

@@ -1,1 +130,130 @@
    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_content_type_parameters_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ContentTypeParametersInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::content_type_parameters_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input =
   29     29   
                crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters(
   30     30   
                    bytes.as_ref(),
   31     31   
                    input,
   32     32   
                )?;
   33     33   
        }
   34     34   
        input.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
#[allow(clippy::unnecessary_wraps)]
   39     39   
pub fn ser_content_type_parameters_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::ContentTypeParametersOutput,
   41     41   
) -> std::result::Result<
   42         -
    ::aws_smithy_http_server::response::Response,
   43         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     44   
> {
   45     45   
    Ok({
   46     46   
        #[allow(unused_mut)]
   47     47   
        let mut builder = ::http::Response::builder();
   48         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50     50   
            ::http::header::CONTENT_TYPE,
   51     51   
            "application/json",
   52     52   
        );
   53     53   
        let http_status: u16 = 200;
   54     54   
        builder = builder.status(http_status);
   55     55   
        let payload =
   56     56   
            crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
   57     57   
        ;
   58     58   
        let content_length = payload.len();
   59         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   60     60   
            builder,
   61     61   
            ::http::header::CONTENT_LENGTH,
   62     62   
            content_length,
   63     63   
        );
   64         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   65     65   
        builder.body(body)?
   66     66   
    })
   67     67   
}
   68     68   
   69     69   
#[allow(clippy::unnecessary_wraps)]
   70     70   
pub fn ser_content_type_parameters_http_error(
   71     71   
    error: &crate::error::ContentTypeParametersError,
   72     72   
) -> std::result::Result<
   73         -
    ::aws_smithy_http_server::response::Response,
   74         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75     75   
> {
   76     76   
    Ok({
   77     77   
        match error {
   78     78   
            crate::error::ContentTypeParametersError::InternalServerError(output) => {
   79     79   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81     81   
                let mut builder = ::http::Response::builder();
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::CONTENT_TYPE,
   85     85   
                    "application/json",
   86     86   
                );
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90     90   
                    "InternalServerError",
   91     91   
                );
   92     92   
                let content_length = payload.len();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::CONTENT_LENGTH,
   96     96   
                    content_length,
   97     97   
                );
   98     98   
                builder
   99     99   
                    .status(500)
  100         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  101    101   
            }
  102    102   
        }
  103    103   
    })
  104    104   
}
  105    105   
  106    106   
pub(crate) fn de_content_type_parameters(
  107    107   
    value: &[u8],
  108    108   
    mut builder: crate::input::content_type_parameters_input_internal::Builder,
  109    109   
) -> ::std::result::Result<
  110    110   
    crate::input::content_type_parameters_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_datetime_offsets.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_document_type.rs

@@ -1,1 +129,129 @@
    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_document_type_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::DocumentTypeInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::document_type_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_document_type::de_document_type(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        input.build()
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
#[allow(clippy::unnecessary_wraps)]
   38     38   
pub fn ser_document_type_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::DocumentTypeOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_document_type_output::ser_document_type_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_document_type_http_error(
   70     70   
    error: &crate::error::DocumentTypeError,
   71     71   
) -> std::result::Result<
   72         -
    ::aws_smithy_http_server::response::Response,
   73         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     74   
> {
   75     75   
    Ok({
   76     76   
        match error {
   77     77   
            crate::error::DocumentTypeError::InternalServerError(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "InternalServerError",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(500)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
        }
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
pub(crate) fn de_document_type(
  106    106   
    value: &[u8],
  107    107   
    mut builder: crate::input::document_type_input_internal::Builder,
  108    108   
) -> ::std::result::Result<
  109    109   
    crate::input::document_type_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_document_type_as_map_value.rs

@@ -1,1 +126,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_document_type_as_map_value_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::DocumentTypeAsMapValueInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::document_type_as_map_value_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value(bytes.as_ref(), input)?;
   29     29   
        }
   30     30   
        input.build()
   31     31   
    })
   32     32   
}
   33     33   
   34     34   
#[allow(clippy::unnecessary_wraps)]
   35     35   
pub fn ser_document_type_as_map_value_http_response(
   36     36   
    #[allow(unused_variables)] output: crate::output::DocumentTypeAsMapValueOutput,
   37     37   
) -> std::result::Result<
   38         -
    ::aws_smithy_http_server::response::Response,
   39         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     40   
> {
   41     41   
    Ok({
   42     42   
        #[allow(unused_mut)]
   43     43   
        let mut builder = ::http::Response::builder();
   44         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   45     45   
            builder,
   46     46   
            ::http::header::CONTENT_TYPE,
   47     47   
            "application/json",
   48     48   
        );
   49     49   
        let http_status: u16 = 200;
   50     50   
        builder = builder.status(http_status);
   51     51   
        let payload =
   52     52   
            crate::protocol_serde::shape_document_type_as_map_value_output::ser_document_type_as_map_value_output_output_output(&output)?
   53     53   
        ;
   54     54   
        let content_length = payload.len();
   55         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57     57   
            ::http::header::CONTENT_LENGTH,
   58     58   
            content_length,
   59     59   
        );
   60         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          60  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   61     61   
        builder.body(body)?
   62     62   
    })
   63     63   
}
   64     64   
   65     65   
#[allow(clippy::unnecessary_wraps)]
   66     66   
pub fn ser_document_type_as_map_value_http_error(
   67     67   
    error: &crate::error::DocumentTypeAsMapValueError,
   68     68   
) -> std::result::Result<
   69         -
    ::aws_smithy_http_server::response::Response,
   70         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          69  +
    ::aws_smithy_legacy_http_server::response::Response,
          70  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     71   
> {
   72     72   
    Ok({
   73     73   
        match error {
   74     74   
            crate::error::DocumentTypeAsMapValueError::InternalServerError(output) => {
   75     75   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   76     76   
                #[allow(unused_mut)]
   77     77   
                let mut builder = ::http::Response::builder();
   78         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          78  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   79     79   
                    builder,
   80     80   
                    ::http::header::CONTENT_TYPE,
   81     81   
                    "application/json",
   82     82   
                );
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86     86   
                    "InternalServerError",
   87     87   
                );
   88     88   
                let content_length = payload.len();
   89         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          89  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   90     90   
                    builder,
   91     91   
                    ::http::header::CONTENT_LENGTH,
   92     92   
                    content_length,
   93     93   
                );
   94     94   
                builder
   95     95   
                    .status(500)
   96         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          96  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   97     97   
            }
   98     98   
        }
   99     99   
    })
  100    100   
}
  101    101   
  102    102   
pub(crate) fn de_document_type_as_map_value(
  103    103   
    value: &[u8],
  104    104   
    mut builder: crate::input::document_type_as_map_value_input_internal::Builder,
  105    105   
) -> ::std::result::Result<
  106    106   
    crate::input::document_type_as_map_value_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_document_type_as_payload.rs

@@ -1,1 +106,106 @@
    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_document_type_as_payload_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::DocumentTypeAsPayloadInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::document_type_as_payload_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     23   
            let bytes = ::hyper::body::to_bytes(body).await?;
   24     24   
            if !bytes.is_empty() {
   25         -
                ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   26     26   
                    &headers,
   27     27   
                    Some("application/json"),
   28     28   
                )?;
   29     29   
            }
   30     30   
            crate::protocol_serde::shape_document_type_as_payload_input::de_document_value_payload(
   31     31   
                &bytes,
   32     32   
            )?
   33     33   
        } {
   34     34   
            input = input.set_document_value(Some(value))
   35     35   
        }
   36     36   
        input.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_document_type_as_payload_http_response(
   42     42   
    #[allow(unused_variables)] output: crate::output::DocumentTypeAsPayloadOutput,
   43     43   
) -> std::result::Result<
   44         -
    ::aws_smithy_http_server::response::Response,
   45         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          44  +
    ::aws_smithy_legacy_http_server::response::Response,
          45  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   46     46   
> {
   47     47   
    Ok({
   48     48   
        #[allow(unused_mut)]
   49     49   
        let mut builder = ::http::Response::builder();
   50         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          50  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   51     51   
            builder,
   52     52   
            ::http::header::CONTENT_TYPE,
   53     53   
            "application/json",
   54     54   
        );
   55     55   
        let http_status: u16 = 200;
   56     56   
        builder = builder.status(http_status);
   57     57   
        let payload =
   58     58   
            crate::protocol_serde::shape_document_type_as_payload_output::ser_document_value_http_payload(& output.document_value)?
   59     59   
        ;
   60     60   
        let content_length = payload.len();
   61         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          61  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   62     62   
            builder,
   63     63   
            ::http::header::CONTENT_LENGTH,
   64     64   
            content_length,
   65     65   
        );
   66         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          66  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   67     67   
        builder.body(body)?
   68     68   
    })
   69     69   
}
   70     70   
   71     71   
#[allow(clippy::unnecessary_wraps)]
   72     72   
pub fn ser_document_type_as_payload_http_error(
   73     73   
    error: &crate::error::DocumentTypeAsPayloadError,
   74     74   
) -> std::result::Result<
   75         -
    ::aws_smithy_http_server::response::Response,
   76         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          75  +
    ::aws_smithy_legacy_http_server::response::Response,
          76  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   77     77   
> {
   78     78   
    Ok({
   79     79   
        match error {
   80     80   
            crate::error::DocumentTypeAsPayloadError::InternalServerError(output) => {
   81     81   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   82     82   
                #[allow(unused_mut)]
   83     83   
                let mut builder = ::http::Response::builder();
   84         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          84  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86     86   
                    ::http::header::CONTENT_TYPE,
   87     87   
                    "application/json",
   88     88   
                );
   89         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          89  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   90     90   
                    builder,
   91     91   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   92     92   
                    "InternalServerError",
   93     93   
                );
   94     94   
                let content_length = payload.len();
   95         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          95  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   96     96   
                    builder,
   97     97   
                    ::http::header::CONTENT_LENGTH,
   98     98   
                    content_length,
   99     99   
                );
  100    100   
                builder
  101    101   
                    .status(500)
  102         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         102  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  103    103   
            }
  104    104   
        }
  105    105   
    })
  106    106   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_empty_input_and_empty_output.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_endpoint_operation.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_endpoint_with_host_label_operation.rs

@@ -1,1 +149,149 @@
    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_endpoint_with_host_label_operation_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EndpointWithHostLabelOperationInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::endpoint_with_host_label_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   
        let bytes = ::hyper::body::to_bytes(body).await?;
   24     24   
        if !bytes.is_empty() {
   25         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   26     26   
                &headers,
   27     27   
                Some("application/json"),
   28     28   
            )?;
   29     29   
            input = crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation(bytes.as_ref(), input)?;
   30     30   
        }
   31     31   
        input.build()?
   32     32   
    })
   33     33   
}
   34     34   
   35     35   
#[allow(clippy::unnecessary_wraps)]
   36     36   
pub fn ser_endpoint_with_host_label_operation_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::EndpointWithHostLabelOperationOutput,
   38     38   
) -> std::result::Result<
   39         -
    ::aws_smithy_http_server::response::Response,
   40         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          39  +
    ::aws_smithy_legacy_http_server::response::Response,
          40  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     41   
> {
   42     42   
    Ok({
   43     43   
        #[allow(unused_mut)]
   44     44   
        let mut builder = ::http::Response::builder();
   45         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47     47   
            ::http::header::CONTENT_TYPE,
   48     48   
            "application/json",
   49     49   
        );
   50     50   
        let http_status: u16 = 200;
   51     51   
        builder = builder.status(http_status);
   52     52   
        let payload = "";
   53     53   
        let content_length = payload.len();
   54         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http::header::CONTENT_LENGTH,
   57     57   
            content_length,
   58     58   
        );
   59         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   60     60   
        builder.body(body)?
   61     61   
    })
   62     62   
}
   63     63   
   64     64   
#[allow(clippy::unnecessary_wraps)]
   65     65   
pub fn ser_endpoint_with_host_label_operation_http_error(
   66     66   
    error: &crate::error::EndpointWithHostLabelOperationError,
   67     67   
) -> std::result::Result<
   68         -
    ::aws_smithy_http_server::response::Response,
   69         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   70     70   
> {
   71     71   
    Ok({
   72     72   
        match error {
   73     73   
            crate::error::EndpointWithHostLabelOperationError::ValidationException(output) => {
   74     74   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   75     75   
                #[allow(unused_mut)]
   76     76   
                let mut builder = ::http::Response::builder();
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     78   
                    builder,
   79     79   
                    ::http::header::CONTENT_TYPE,
   80     80   
                    "application/json",
   81     81   
                );
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   85     85   
                    "ValidationException",
   86     86   
                );
   87     87   
                let content_length = payload.len();
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90     90   
                    ::http::header::CONTENT_LENGTH,
   91     91   
                    content_length,
   92     92   
                );
   93     93   
                builder
   94     94   
                    .status(400)
   95         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          95  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   96     96   
            }
   97     97   
            crate::error::EndpointWithHostLabelOperationError::InternalServerError(output) => {
   98     98   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   99     99   
                #[allow(unused_mut)]
  100    100   
                let mut builder = ::http::Response::builder();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         101  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  102    102   
                    builder,
  103    103   
                    ::http::header::CONTENT_TYPE,
  104    104   
                    "application/json",
  105    105   
                );
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         106  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    107   
                    builder,
  108    108   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  109    109   
                    "InternalServerError",
  110    110   
                );
  111    111   
                let content_length = payload.len();
  112         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         112  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  113    113   
                    builder,
  114    114   
                    ::http::header::CONTENT_LENGTH,
  115    115   
                    content_length,
  116    116   
                );
  117    117   
                builder
  118    118   
                    .status(500)
  119         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         119  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  120    120   
            }
  121    121   
        }
  122    122   
    })
  123    123   
}
  124    124   
  125    125   
pub(crate) fn de_endpoint_with_host_label_operation(
  126    126   
    value: &[u8],
  127    127   
    mut builder: crate::input::endpoint_with_host_label_operation_input_internal::Builder,
  128    128   
) -> ::std::result::Result<
  129    129   
    crate::input::endpoint_with_host_label_operation_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_fractional_seconds.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,1 +200,202 @@
    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_greeting_with_errors_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::GreetingWithErrorsInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::greeting_with_errors_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          22  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
   23     25   
        input.build()
   24     26   
    })
   25     27   
}
   26     28   
   27     29   
#[allow(clippy::unnecessary_wraps)]
   28     30   
pub fn ser_greeting_with_errors_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
   30     32   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     35   
> {
   34     36   
    Ok({
   35     37   
        #[allow(unused_mut)]
   36     38   
        let mut builder = ::http::Response::builder();
   37     39   
        builder =
   38     40   
            crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_headers(
   39     41   
                &output, builder,
   40     42   
            )?;
   41         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          43  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   42     44   
            builder,
   43     45   
            ::http::header::CONTENT_TYPE,
   44     46   
            "application/json",
   45     47   
        );
   46     48   
        let http_status: u16 = 200;
   47     49   
        builder = builder.status(http_status);
   48     50   
        let payload =
   49     51   
            crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
   50     52   
        ;
   51     53   
        let content_length = payload.len();
   52         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   53     55   
            builder,
   54     56   
            ::http::header::CONTENT_LENGTH,
   55     57   
            content_length,
   56     58   
        );
   57         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   58     60   
        builder.body(body)?
   59     61   
    })
   60     62   
}
   61     63   
   62     64   
#[allow(clippy::unnecessary_wraps)]
   63     65   
pub fn ser_greeting_with_errors_http_error(
   64     66   
    error: &crate::error::GreetingWithErrorsError,
   65     67   
) -> std::result::Result<
   66         -
    ::aws_smithy_http_server::response::Response,
   67         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   68     70   
> {
   69     71   
    Ok({
   70     72   
        match error {
   71     73   
            crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
   72     74   
                let payload =
   73     75   
                    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
   74     76   
                        output,
   75     77   
                    )?;
   76     78   
                #[allow(unused_mut)]
   77     79   
                let mut builder = ::http::Response::builder();
   78         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          80  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   79     81   
                    builder,
   80     82   
                    ::http::header::CONTENT_TYPE,
   81     83   
                    "application/json",
   82     84   
                );
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86     88   
                    "InvalidGreeting",
   87     89   
                );
   88     90   
                let content_length = payload.len();
   89         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          91  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   90     92   
                    builder,
   91     93   
                    ::http::header::CONTENT_LENGTH,
   92     94   
                    content_length,
   93     95   
                );
   94     96   
                builder
   95     97   
                    .status(400)
   96         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          98  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   97     99   
            }
   98    100   
            crate::error::GreetingWithErrorsError::ComplexError(output) => {
   99    101   
                let payload =
  100    102   
                    crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
  101    103   
                #[allow(unused_mut)]
  102    104   
                let mut builder = ::http::Response::builder();
  103    105   
                builder = crate::protocol_serde::shape_complex_error::ser_complex_error_headers(
  104    106   
                    output, builder,
  105    107   
                )?;
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    109   
                    builder,
  108    110   
                    ::http::header::CONTENT_TYPE,
  109    111   
                    "application/json",
  110    112   
                );
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         113  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    114   
                    builder,
  113    115   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    116   
                    "ComplexError",
  115    117   
                );
  116    118   
                let content_length = payload.len();
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    120   
                    builder,
  119    121   
                    ::http::header::CONTENT_LENGTH,
  120    122   
                    content_length,
  121    123   
                );
  122    124   
                builder
  123    125   
                    .status(403)
  124         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         126  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  125    127   
            }
  126    128   
            crate::error::GreetingWithErrorsError::FooError(output) => {
  127    129   
                let payload = crate::protocol_serde::shape_foo_error::ser_foo_error_error(output)?;
  128    130   
                #[allow(unused_mut)]
  129    131   
                let mut builder = ::http::Response::builder();
  130         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         132  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  131    133   
                    builder,
  132    134   
                    ::http::header::CONTENT_TYPE,
  133    135   
                    "application/json",
  134    136   
                );
  135         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         137  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  136    138   
                    builder,
  137    139   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  138    140   
                    "FooError",
  139    141   
                );
  140    142   
                let content_length = payload.len();
  141         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         143  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  142    144   
                    builder,
  143    145   
                    ::http::header::CONTENT_LENGTH,
  144    146   
                    content_length,
  145    147   
                );
  146    148   
                builder
  147    149   
                    .status(500)
  148         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         150  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  149    151   
            }
  150    152   
            crate::error::GreetingWithErrorsError::InternalServerError(output) => {
  151    153   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  152    154   
                #[allow(unused_mut)]
  153    155   
                let mut builder = ::http::Response::builder();
  154         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         156  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  155    157   
                    builder,
  156    158   
                    ::http::header::CONTENT_TYPE,
  157    159   
                    "application/json",
  158    160   
                );
  159         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         161  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  160    162   
                    builder,
  161    163   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  162    164   
                    "InternalServerError",
  163    165   
                );
  164    166   
                let content_length = payload.len();
  165         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         167  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  166    168   
                    builder,
  167    169   
                    ::http::header::CONTENT_LENGTH,
  168    170   
                    content_length,
  169    171   
                );
  170    172   
                builder
  171    173   
                    .status(500)
  172         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         174  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  173    175   
            }
  174    176   
        }
  175    177   
    })
  176    178   
}
  177    179   
  178    180   
pub fn ser_greeting_with_errors_headers(
  179    181   
    input: &crate::output::GreetingWithErrorsOutput,
  180    182   
    mut builder: ::http::response::Builder,
  181    183   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  182    184   
{