Server Test Python

Server Test Python

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

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

@@ -1,1 +188,188 @@
    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_malformed_short_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedShortInput,
    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::malformed_short_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_malformed_short::de_malformed_short(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_malformed_short_input::de_short_in_header_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_short_in_header(Some(value))
   37     37   
        }
   38     38   
        let input_string = uri.path();
   39     39   
        let (input_string, (_, m1)) =
   40     40   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   41     41   
                ::nom::sequence::preceded(
   42     42   
                    ::nom::bytes::complete::tag("/"),
   43     43   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   44     44   
                        "MalformedShort",
   45     45   
                    ),
   46     46   
                ),
   47     47   
                ::nom::sequence::preceded(
   48     48   
                    ::nom::bytes::complete::tag("/"),
   49     49   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   50     50   
                        ::nom::bytes::complete::take_until("/"),
   51     51   
                        ::nom::combinator::rest,
   52     52   
                    )),
   53     53   
                ),
   54     54   
            ))(input_string)?;
   55     55   
        debug_assert_eq!("", input_string);
   56     56   
        input = input.set_short_in_path(
   57     57   
            crate::protocol_serde::shape_malformed_short_input::de_short_in_path(m1)?,
   58     58   
        );
   59     59   
        let query_string = uri.query().unwrap_or("");
   60     60   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   61     61   
        let mut short_in_query_seen = false;
   62     62   
        for (k, v) in pairs {
   63     63   
            if !short_in_query_seen && k == "shortInQuery" {
   64     64   
                input = input.set_short_in_query(
   65     65   
                    crate::protocol_serde::shape_malformed_short_input::de_short_in_query(&v)?,
   66     66   
                );
   67     67   
                short_in_query_seen = true;
   68     68   
            }
   69     69   
        }
   70     70   
        input.build()?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_malformed_short_http_response(
   76     76   
    #[allow(unused_variables)] output: crate::output::MalformedShortOutput,
   77     77   
) -> std::result::Result<
   78         -
    ::aws_smithy_http_server::response::Response,
   79         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   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     89   
        let http_status: u16 = 200;
   90     90   
        builder = builder.status(http_status);
   91     91   
        let payload = "";
   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         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          98  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   99     99   
        builder.body(body)?
  100    100   
    })
  101    101   
}
  102    102   
  103    103   
#[allow(clippy::unnecessary_wraps)]
  104    104   
pub fn ser_malformed_short_http_error(
  105    105   
    error: &crate::error::MalformedShortError,
  106    106   
) -> std::result::Result<
  107         -
    ::aws_smithy_http_server::response::Response,
  108         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         107  +
    ::aws_smithy_legacy_http_server::response::Response,
         108  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  109    109   
> {
  110    110   
    Ok({
  111    111   
        match error {
  112    112   
            crate::error::MalformedShortError::ValidationException(output) => {
  113    113   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  114    114   
                #[allow(unused_mut)]
  115    115   
                let mut builder = ::http::Response::builder();
  116         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         116  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  117    117   
                    builder,
  118    118   
                    ::http::header::CONTENT_TYPE,
  119    119   
                    "application/json",
  120    120   
                );
  121         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         121  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  122    122   
                    builder,
  123    123   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  124    124   
                    "ValidationException",
  125    125   
                );
  126    126   
                let content_length = payload.len();
  127         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         127  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  128    128   
                    builder,
  129    129   
                    ::http::header::CONTENT_LENGTH,
  130    130   
                    content_length,
  131    131   
                );
  132    132   
                builder
  133    133   
                    .status(400)
  134         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  135    135   
            }
  136    136   
            crate::error::MalformedShortError::InternalServerError(output) => {
  137    137   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  138    138   
                #[allow(unused_mut)]
  139    139   
                let mut builder = ::http::Response::builder();
  140         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         140  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  141    141   
                    builder,
  142    142   
                    ::http::header::CONTENT_TYPE,
  143    143   
                    "application/json",
  144    144   
                );
  145         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         145  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  146    146   
                    builder,
  147    147   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  148    148   
                    "InternalServerError",
  149    149   
                );
  150    150   
                let content_length = payload.len();
  151         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         151  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  152    152   
                    builder,
  153    153   
                    ::http::header::CONTENT_LENGTH,
  154    154   
                    content_length,
  155    155   
                );
  156    156   
                builder
  157    157   
                    .status(500)
  158         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         158  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  159    159   
            }
  160    160   
        }
  161    161   
    })
  162    162   
}
  163    163   
  164    164   
pub(crate) fn de_malformed_short(
  165    165   
    value: &[u8],
  166    166   
    mut builder: crate::input::malformed_short_input_internal::Builder,
  167    167   
) -> ::std::result::Result<
  168    168   
    crate::input::malformed_short_input_internal::Builder,

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

@@ -1,1 +36,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_short_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("shortInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i16>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
    7      8   
    if var_1.len() > 1 {
    8         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
    9     10   
            "expected one item but found {}",
   10     11   
            var_1.len()
   11     12   
        )))
   12     13   
    } else {
   13     14   
        let mut var_1 = var_1;
   14     15   
        Ok(var_1.pop())
   15     16   
    }
   16     17   
}
   17     18   
   18     19   
pub fn de_short_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    i16,
   22         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          23  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   23     24   
> {
   24     25   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   25     26   
    Ok(value)
   26     27   
}
   27     28   
   28     29   
pub fn de_short_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<i16>,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          33  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   33     34   
> {
   34     35   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   35     36   
    Ok(Some(value))
   36     37   
}

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

@@ -1,1 +95,95 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_malformed_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedStringInput,
    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::malformed_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   
        if let Some(value) =
   23     23   
            crate::protocol_serde::shape_malformed_string_input::de_blob_header(&headers)?
   24     24   
        {
   25     25   
            input = input.set_blob(Some(value))
   26     26   
        }
   27     27   
        input.build()
   28     28   
    })
   29     29   
}
   30     30   
   31     31   
#[allow(clippy::unnecessary_wraps)]
   32     32   
pub fn ser_malformed_string_http_response(
   33     33   
    #[allow(unused_variables)] output: crate::output::MalformedStringOutput,
   34     34   
) -> std::result::Result<
   35         -
    ::aws_smithy_http_server::response::Response,
   36         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          35  +
    ::aws_smithy_legacy_http_server::response::Response,
          36  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   37     37   
> {
   38     38   
    Ok({
   39     39   
        #[allow(unused_mut)]
   40     40   
        let mut builder = ::http::Response::builder();
   41         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          41  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   42     42   
            builder,
   43     43   
            ::http::header::CONTENT_TYPE,
   44     44   
            "application/json",
   45     45   
        );
   46     46   
        let http_status: u16 = 200;
   47     47   
        builder = builder.status(http_status);
   48     48   
        let payload = "";
   49     49   
        let content_length = payload.len();
   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_LENGTH,
   53     53   
            content_length,
   54     54   
        );
   55         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          55  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   56     56   
        builder.body(body)?
   57     57   
    })
   58     58   
}
   59     59   
   60     60   
#[allow(clippy::unnecessary_wraps)]
   61     61   
pub fn ser_malformed_string_http_error(
   62     62   
    error: &crate::error::MalformedStringError,
   63     63   
) -> std::result::Result<
   64         -
    ::aws_smithy_http_server::response::Response,
   65         -
    ::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,
   66     66   
> {
   67     67   
    Ok({
   68     68   
        match error {
   69     69   
            crate::error::MalformedStringError::InternalServerError(output) => {
   70     70   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   71     71   
                #[allow(unused_mut)]
   72     72   
                let mut builder = ::http::Response::builder();
   73         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          73  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   74     74   
                    builder,
   75     75   
                    ::http::header::CONTENT_TYPE,
   76     76   
                    "application/json",
   77     77   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   81     81   
                    "InternalServerError",
   82     82   
                );
   83     83   
                let content_length = payload.len();
   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_LENGTH,
   87     87   
                    content_length,
   88     88   
                );
   89     89   
                builder
   90     90   
                    .status(500)
   91         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          91  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   92     92   
            }
   93     93   
        }
   94     94   
    })
   95     95   
}

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

@@ -1,1 +34,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_blob_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("amz-media-typed-header");
    9         -
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
           9  +
    let var_1: Vec<::std::string::String> =
          10  +
        ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
   10     11   
    let var_1: std::result::Result<Vec<_>, _> = var_1
   11     12   
        .iter()
   12     13   
        .map(|s| {
   13     14   
            ::aws_smithy_types::base64::decode(s)
   14         -
                .map_err(|_| ::aws_smithy_http::header::ParseError::new("failed to decode base64"))
          15  +
                .map_err(|_| {
          16  +
                    ::aws_smithy_legacy_http::header::ParseError::new("failed to decode base64")
          17  +
                })
   15     18   
                .and_then(|bytes| {
   16     19   
                    String::from_utf8(bytes).map_err(|_| {
   17         -
                        ::aws_smithy_http::header::ParseError::new(
          20  +
                        ::aws_smithy_legacy_http::header::ParseError::new(
   18     21   
                            "base64 encoded data was not valid utf-8",
   19     22   
                        )
   20     23   
                    })
   21     24   
                })
   22     25   
        })
   23     26   
        .collect();
   24     27   
    let var_1 = var_1?;
   25     28   
    if var_1.len() > 1 {
   26         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          29  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   27     30   
            "expected one item but found {}",
   28     31   
            var_1.len()
   29     32   
        )))
   30     33   
    } else {
   31     34   
        let mut var_1 = var_1;
   32     35   
        Ok(var_1.pop())
   33     36   
    }
   34     37   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_timestamp_body_date_time.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_malformed_timestamp_body_date_time_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampBodyDateTimeInput,
    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::malformed_timestamp_body_date_time_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_malformed_timestamp_body_date_time::de_malformed_timestamp_body_date_time(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_malformed_timestamp_body_date_time_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampBodyDateTimeOutput,
   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_malformed_timestamp_body_date_time_http_error(
   66     66   
    error: &crate::error::MalformedTimestampBodyDateTimeError,
   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::MalformedTimestampBodyDateTimeError::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::MalformedTimestampBodyDateTimeError::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_malformed_timestamp_body_date_time(
  126    126   
    value: &[u8],
  127    127   
    mut builder: crate::input::malformed_timestamp_body_date_time_input_internal::Builder,
  128    128   
) -> ::std::result::Result<
  129    129   
    crate::input::malformed_timestamp_body_date_time_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_timestamp_body_default.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_malformed_timestamp_body_default_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampBodyDefaultInput,
    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::malformed_timestamp_body_default_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_malformed_timestamp_body_default::de_malformed_timestamp_body_default(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_malformed_timestamp_body_default_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampBodyDefaultOutput,
   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_malformed_timestamp_body_default_http_error(
   66     66   
    error: &crate::error::MalformedTimestampBodyDefaultError,
   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::MalformedTimestampBodyDefaultError::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::MalformedTimestampBodyDefaultError::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_malformed_timestamp_body_default(
  126    126   
    value: &[u8],
  127    127   
    mut builder: crate::input::malformed_timestamp_body_default_input_internal::Builder,
  128    128   
) -> ::std::result::Result<
  129    129   
    crate::input::malformed_timestamp_body_default_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_timestamp_body_http_date.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_malformed_timestamp_body_http_date_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampBodyHttpDateInput,
    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::malformed_timestamp_body_http_date_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_malformed_timestamp_body_http_date::de_malformed_timestamp_body_http_date(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_malformed_timestamp_body_http_date_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampBodyHttpDateOutput,
   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_malformed_timestamp_body_http_date_http_error(
   66     66   
    error: &crate::error::MalformedTimestampBodyHttpDateError,
   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::MalformedTimestampBodyHttpDateError::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::MalformedTimestampBodyHttpDateError::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_malformed_timestamp_body_http_date(
  126    126   
    value: &[u8],
  127    127   
    mut builder: crate::input::malformed_timestamp_body_http_date_input_internal::Builder,
  128    128   
) -> ::std::result::Result<
  129    129   
    crate::input::malformed_timestamp_body_http_date_input_internal::Builder,

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

@@ -1,1 +118,118 @@
    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_malformed_timestamp_header_date_time_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampHeaderDateTimeInput,
    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::malformed_timestamp_header_date_time_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = crate::protocol_serde::shape_malformed_timestamp_header_date_time_input::de_timestamp_header(&headers)? {
   24     24   
                                input = input.set_timestamp(value)
   25     25   
                            }
   26     26   
        input.build()?
   27     27   
    })
   28     28   
}
   29     29   
   30     30   
#[allow(clippy::unnecessary_wraps)]
   31     31   
pub fn ser_malformed_timestamp_header_date_time_http_response(
   32     32   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampHeaderDateTimeOutput,
   33     33   
) -> std::result::Result<
   34         -
    ::aws_smithy_http_server::response::Response,
   35         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          34  +
    ::aws_smithy_legacy_http_server::response::Response,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   36     36   
> {
   37     37   
    Ok({
   38     38   
        #[allow(unused_mut)]
   39     39   
        let mut builder = ::http::Response::builder();
   40         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          40  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   41     41   
            builder,
   42     42   
            ::http::header::CONTENT_TYPE,
   43     43   
            "application/json",
   44     44   
        );
   45     45   
        let http_status: u16 = 200;
   46     46   
        builder = builder.status(http_status);
   47     47   
        let payload = "";
   48     48   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51     51   
            ::http::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          54  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}
   58     58   
   59     59   
#[allow(clippy::unnecessary_wraps)]
   60     60   
pub fn ser_malformed_timestamp_header_date_time_http_error(
   61     61   
    error: &crate::error::MalformedTimestampHeaderDateTimeError,
   62     62   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          63  +
    ::aws_smithy_legacy_http_server::response::Response,
          64  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     65   
> {
   66     66   
    Ok({
   67     67   
        match error {
   68     68   
            crate::error::MalformedTimestampHeaderDateTimeError::ValidationException(output) => {
   69     69   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   70     70   
                #[allow(unused_mut)]
   71     71   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          72  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     73   
                    builder,
   74     74   
                    ::http::header::CONTENT_TYPE,
   75     75   
                    "application/json",
   76     76   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   80     80   
                    "ValidationException",
   81     81   
                );
   82     82   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_LENGTH,
   86     86   
                    content_length,
   87     87   
                );
   88     88   
                builder
   89     89   
                    .status(400)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          90  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     91   
            }
   92     92   
            crate::error::MalformedTimestampHeaderDateTimeError::InternalServerError(output) => {
   93     93   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   94     94   
                #[allow(unused_mut)]
   95     95   
                let mut builder = ::http::Response::builder();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          96  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98     98   
                    ::http::header::CONTENT_TYPE,
   99     99   
                    "application/json",
  100    100   
                );
  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::HeaderName::from_static("x-amzn-errortype"),
  104    104   
                    "InternalServerError",
  105    105   
                );
  106    106   
                let content_length = payload.len();
  107         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  108    108   
                    builder,
  109    109   
                    ::http::header::CONTENT_LENGTH,
  110    110   
                    content_length,
  111    111   
                );
  112    112   
                builder
  113    113   
                    .status(500)
  114         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         114  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  115    115   
            }
  116    116   
        }
  117    117   
    })
  118    118   
}

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

@@ -1,1 +26,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_timestamp_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("timestamp");
    9      9   
    let var_1: Vec<::aws_smithy_http_server_python::types::DateTime> =
   10         -
        ::aws_smithy_http::header::many_dates(
          10  +
        ::aws_smithy_legacy_http::header::many_dates(
   11     11   
            headers,
   12     12   
            ::aws_smithy_types::date_time::Format::DateTime,
   13     13   
        )?
   14     14   
        .into_iter()
   15     15   
        .map(::aws_smithy_http_server_python::types::DateTime::from)
   16     16   
        .collect();
   17     17   
    if var_1.len() > 1 {
   18         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          18  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   19     19   
            "expected one item but found {}",
   20     20   
            var_1.len()
   21     21   
        )))
   22     22   
    } else {
   23     23   
        let mut var_1 = var_1;
   24     24   
        Ok(var_1.pop())
   25     25   
    }
   26     26   
}

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

@@ -1,1 +118,118 @@
    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_malformed_timestamp_header_default_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampHeaderDefaultInput,
    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::malformed_timestamp_header_default_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = crate::protocol_serde::shape_malformed_timestamp_header_default_input::de_timestamp_header(&headers)? {
   24     24   
                                input = input.set_timestamp(value)
   25     25   
                            }
   26     26   
        input.build()?
   27     27   
    })
   28     28   
}
   29     29   
   30     30   
#[allow(clippy::unnecessary_wraps)]
   31     31   
pub fn ser_malformed_timestamp_header_default_http_response(
   32     32   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampHeaderDefaultOutput,
   33     33   
) -> std::result::Result<
   34         -
    ::aws_smithy_http_server::response::Response,
   35         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          34  +
    ::aws_smithy_legacy_http_server::response::Response,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   36     36   
> {
   37     37   
    Ok({
   38     38   
        #[allow(unused_mut)]
   39     39   
        let mut builder = ::http::Response::builder();
   40         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          40  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   41     41   
            builder,
   42     42   
            ::http::header::CONTENT_TYPE,
   43     43   
            "application/json",
   44     44   
        );
   45     45   
        let http_status: u16 = 200;
   46     46   
        builder = builder.status(http_status);
   47     47   
        let payload = "";
   48     48   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51     51   
            ::http::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          54  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}
   58     58   
   59     59   
#[allow(clippy::unnecessary_wraps)]
   60     60   
pub fn ser_malformed_timestamp_header_default_http_error(
   61     61   
    error: &crate::error::MalformedTimestampHeaderDefaultError,
   62     62   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          63  +
    ::aws_smithy_legacy_http_server::response::Response,
          64  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     65   
> {
   66     66   
    Ok({
   67     67   
        match error {
   68     68   
            crate::error::MalformedTimestampHeaderDefaultError::ValidationException(output) => {
   69     69   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   70     70   
                #[allow(unused_mut)]
   71     71   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          72  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     73   
                    builder,
   74     74   
                    ::http::header::CONTENT_TYPE,
   75     75   
                    "application/json",
   76     76   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   80     80   
                    "ValidationException",
   81     81   
                );
   82     82   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_LENGTH,
   86     86   
                    content_length,
   87     87   
                );
   88     88   
                builder
   89     89   
                    .status(400)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          90  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     91   
            }
   92     92   
            crate::error::MalformedTimestampHeaderDefaultError::InternalServerError(output) => {
   93     93   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   94     94   
                #[allow(unused_mut)]
   95     95   
                let mut builder = ::http::Response::builder();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          96  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98     98   
                    ::http::header::CONTENT_TYPE,
   99     99   
                    "application/json",
  100    100   
                );
  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::HeaderName::from_static("x-amzn-errortype"),
  104    104   
                    "InternalServerError",
  105    105   
                );
  106    106   
                let content_length = payload.len();
  107         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  108    108   
                    builder,
  109    109   
                    ::http::header::CONTENT_LENGTH,
  110    110   
                    content_length,
  111    111   
                );
  112    112   
                builder
  113    113   
                    .status(500)
  114         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         114  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  115    115   
            }
  116    116   
        }
  117    117   
    })
  118    118   
}

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

@@ -1,1 +26,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_timestamp_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("timestamp");
    9      9   
    let var_1: Vec<::aws_smithy_http_server_python::types::DateTime> =
   10         -
        ::aws_smithy_http::header::many_dates(
          10  +
        ::aws_smithy_legacy_http::header::many_dates(
   11     11   
            headers,
   12     12   
            ::aws_smithy_types::date_time::Format::HttpDate,
   13     13   
        )?
   14     14   
        .into_iter()
   15     15   
        .map(::aws_smithy_http_server_python::types::DateTime::from)
   16     16   
        .collect();
   17     17   
    if var_1.len() > 1 {
   18         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          18  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   19     19   
            "expected one item but found {}",
   20     20   
            var_1.len()
   21     21   
        )))
   22     22   
    } else {
   23     23   
        let mut var_1 = var_1;
   24     24   
        Ok(var_1.pop())
   25     25   
    }
   26     26   
}

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

@@ -1,1 +118,118 @@
    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_malformed_timestamp_header_epoch_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedTimestampHeaderEpochInput,
    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::malformed_timestamp_header_epoch_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = crate::protocol_serde::shape_malformed_timestamp_header_epoch_input::de_timestamp_header(&headers)? {
   24     24   
                                input = input.set_timestamp(value)
   25     25   
                            }
   26     26   
        input.build()?
   27     27   
    })
   28     28   
}
   29     29   
   30     30   
#[allow(clippy::unnecessary_wraps)]
   31     31   
pub fn ser_malformed_timestamp_header_epoch_http_response(
   32     32   
    #[allow(unused_variables)] output: crate::output::MalformedTimestampHeaderEpochOutput,
   33     33   
) -> std::result::Result<
   34         -
    ::aws_smithy_http_server::response::Response,
   35         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          34  +
    ::aws_smithy_legacy_http_server::response::Response,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   36     36   
> {
   37     37   
    Ok({
   38     38   
        #[allow(unused_mut)]
   39     39   
        let mut builder = ::http::Response::builder();
   40         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          40  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   41     41   
            builder,
   42     42   
            ::http::header::CONTENT_TYPE,
   43     43   
            "application/json",
   44     44   
        );
   45     45   
        let http_status: u16 = 200;
   46     46   
        builder = builder.status(http_status);
   47     47   
        let payload = "";
   48     48   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51     51   
            ::http::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          54  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}
   58     58   
   59     59   
#[allow(clippy::unnecessary_wraps)]
   60     60   
pub fn ser_malformed_timestamp_header_epoch_http_error(
   61     61   
    error: &crate::error::MalformedTimestampHeaderEpochError,
   62     62   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          63  +
    ::aws_smithy_legacy_http_server::response::Response,
          64  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     65   
> {
   66     66   
    Ok({
   67     67   
        match error {
   68     68   
            crate::error::MalformedTimestampHeaderEpochError::ValidationException(output) => {
   69     69   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   70     70   
                #[allow(unused_mut)]
   71     71   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          72  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     73   
                    builder,
   74     74   
                    ::http::header::CONTENT_TYPE,
   75     75   
                    "application/json",
   76     76   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   80     80   
                    "ValidationException",
   81     81   
                );
   82     82   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_LENGTH,
   86     86   
                    content_length,
   87     87   
                );
   88     88   
                builder
   89     89   
                    .status(400)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          90  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     91   
            }
   92     92   
            crate::error::MalformedTimestampHeaderEpochError::InternalServerError(output) => {
   93     93   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   94     94   
                #[allow(unused_mut)]
   95     95   
                let mut builder = ::http::Response::builder();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          96  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98     98   
                    ::http::header::CONTENT_TYPE,
   99     99   
                    "application/json",
  100    100   
                );
  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::HeaderName::from_static("x-amzn-errortype"),
  104    104   
                    "InternalServerError",
  105    105   
                );
  106    106   
                let content_length = payload.len();
  107         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  108    108   
                    builder,
  109    109   
                    ::http::header::CONTENT_LENGTH,
  110    110   
                    content_length,
  111    111   
                );
  112    112   
                builder
  113    113   
                    .status(500)
  114         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         114  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  115    115   
            }
  116    116   
        }
  117    117   
    })
  118    118   
}

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

@@ -1,1 +26,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_timestamp_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("timestamp");
    9      9   
    let var_1: Vec<::aws_smithy_http_server_python::types::DateTime> =
   10         -
        ::aws_smithy_http::header::many_dates(
          10  +
        ::aws_smithy_legacy_http::header::many_dates(
   11     11   
            headers,
   12     12   
            ::aws_smithy_types::date_time::Format::EpochSeconds,
   13     13   
        )?
   14     14   
        .into_iter()
   15     15   
        .map(::aws_smithy_http_server_python::types::DateTime::from)
   16     16   
        .collect();
   17     17   
    if var_1.len() > 1 {
   18         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          18  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   19     19   
            "expected one item but found {}",
   20     20   
            var_1.len()
   21     21   
        )))
   22     22   
    } else {
   23     23   
        let mut var_1 = var_1;
   24     24   
        Ok(var_1.pop())
   25     25   
    }
   26     26   
}

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

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

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

@@ -1,1 +15,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_timestamp(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http_server_python::types::DateTime,
    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).decode_utf8()?;
    9      9   
    let value = ::aws_smithy_types::DateTime::from_str(
   10     10   
        value.as_ref(),
   11     11   
        ::aws_smithy_types::date_time::Format::DateTime,
   12     12   
    )?
   13     13   
    .into();
   14     14   
    Ok(value)
   15     15   
}

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

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