Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb (ignoring whitespace)

Files changed:

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

@@ -1,1 +86,116 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
    2      3   
pub fn de_string(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1463 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   12     16   
}
   13     17   
          18  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   14     19   
pub fn de_short(
   15     20   
    value: &str,
   16     21   
) -> std::result::Result<
   17     22   
    i16,
   18     23   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   19     24   
> {
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   20     26   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   21     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   22     30   
}
   23     31   
          32  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   24     33   
pub fn de_integer(
   25     34   
    value: &str,
   26     35   
) -> std::result::Result<
   27     36   
    i32,
   28     37   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   29     38   
> {
          39  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   30     40   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          41  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   31     42   
    Ok(value)
          43  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   32     44   
}
   33     45   
          46  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   34     47   
pub fn de_long(
   35     48   
    value: &str,
   36     49   
) -> std::result::Result<
   37     50   
    i64,
   38     51   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   39     52   
> {
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   40     54   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   41     56   
    Ok(value)
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   42     58   
}
   43     59   
          60  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   44     61   
pub fn de_float(
   45     62   
    value: &str,
   46     63   
) -> std::result::Result<
   47     64   
    f32,
   48     65   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   49     66   
> {
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   50     68   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   51     70   
    Ok(value)
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   52     72   
}
   53     73   
          74  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   54     75   
pub fn de_double(
   55     76   
    value: &str,
   56     77   
) -> std::result::Result<
   57     78   
    f64,
   58     79   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   59     80   
> {
          81  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   60     82   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   61     84   
    Ok(value)
          85  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   62     86   
}
   63     87   
          88  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   64     89   
pub fn de_boolean(
   65     90   
    value: &str,
   66     91   
) -> std::result::Result<
   67     92   
    bool,
   68     93   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   69     94   
> {
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:1515 */
   70     96   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   71     98   
    Ok(value)
          99  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   72    100   
}
   73    101   
         102  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
   74    103   
pub fn de_timestamp(
   75    104   
    value: &str,
   76    105   
) -> std::result::Result<
   77    106   
    ::aws_smithy_types::DateTime,
   78    107   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   79    108   
> {
         109  +
    /* ServerHttpBoundProtocolGenerator.kt:1486 */
   80    110   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   81         -
    let value = ::aws_smithy_types::DateTime::from_str(
   82         -
        value.as_ref(),
   83         -
        ::aws_smithy_types::date_time::Format::DateTime,
   84         -
    )?;
         111  +
    let value = ::aws_smithy_types::DateTime::from_str(value.as_ref(), ::aws_smithy_types::date_time::Format::DateTime)?
         112  +
    /* ServerHttpBoundProtocolGenerator.kt:1510 */;
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
   85    114   
    Ok(value)
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
   86    116   
}

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

@@ -1,1 +113,156 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_http_request_with_regex_literal_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HttpRequestWithRegexLiteralInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::http_request_with_regex_literal_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:1134 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1146 */
   23     32   
        let (input_string, (_, m1, _)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("ReDosLiteral"),
   28     37   
                ),
   29     38   
                ::nom::sequence::preceded(
   30     39   
                    ::nom::bytes::complete::tag("/"),
   31     40   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     41   
                        ::nom::bytes::complete::take_until("/"),
   33     42   
                        ::nom::combinator::rest,
   34     43   
                    )),
   35     44   
                ),
   36     45   
                ::nom::sequence::preceded(
   37     46   
                    ::nom::bytes::complete::tag("/"),
   38     47   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("(a+)+"),
   39     48   
                ),
   40     49   
            ))(input_string)?;
   41     50   
        debug_assert_eq!("", input_string);
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:1157 */
   42     52   
        input = input.set_str(
   43     53   
            crate::protocol_serde::shape_http_request_with_regex_literal_input::de_str(m1)?,
   44     54   
        );
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   45     56   
        input.build()?
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   46     58   
    })
          59  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   47     60   
}
   48     61   
          62  +
/* RustType.kt:534 */
   49     63   
#[allow(clippy::unnecessary_wraps)]
          64  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   50     65   
pub fn ser_http_request_with_regex_literal_http_response(
   51     66   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithRegexLiteralOutput,
   52     67   
) -> std::result::Result<
   53     68   
    ::aws_smithy_http_server::response::Response,
   54     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   55     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   56     72   
    Ok({
          73  +
        /* RustType.kt:534 */
   57     74   
        #[allow(unused_mut)]
   58         -
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          76  +
        let mut builder = ::http_1x::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   59     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     79   
            builder,
   61         -
            ::http::header::CONTENT_TYPE,
          80  +
            ::http_1x::header::CONTENT_TYPE,
   62     81   
            "application/json",
   63     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   64     84   
        let http_status: u16 = 200;
   65     85   
        builder = builder.status(http_status);
   66         -
        let payload = "";
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          87  +
        let payload =
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:233 */""
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   67     91   
        let content_length = payload.len();
   68     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   69     93   
            builder,
   70         -
            ::http::header::CONTENT_LENGTH,
          94  +
            ::http_1x::header::CONTENT_LENGTH,
   71     95   
            content_length,
   72     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   73     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   74    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   75    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   76    104   
}
   77    105   
         106  +
/* RustType.kt:534 */
   78    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
   79    109   
pub fn ser_http_request_with_regex_literal_http_error(
   80    110   
    error: &crate::error::HttpRequestWithRegexLiteralError,
   81    111   
) -> std::result::Result<
   82    112   
    ::aws_smithy_http_server::response::Response,
   83    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   84    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:476 */
   85    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
   86    118   
        match error {
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
   87    120   
            crate::error::HttpRequestWithRegexLiteralError::ValidationException(output) => {
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
   88    122   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         123  +
                /* RustType.kt:534 */
   89    124   
                #[allow(unused_mut)]
   90         -
                let mut builder = ::http::Response::builder();
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         126  +
                let mut builder = ::http_1x::Response::builder();
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   91    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   92    129   
                    builder,
   93         -
                    ::http::header::CONTENT_TYPE,
         130  +
                    ::http_1x::header::CONTENT_TYPE,
   94    131   
                    "application/json",
   95    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
   96    134   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    135   
                    builder,
   98         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         136  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   99    137   
                    "ValidationException",
  100    138   
                );
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  101    140   
                let content_length = payload.len();
  102    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    142   
                    builder,
  104         -
                    ::http::header::CONTENT_LENGTH,
         143  +
                    ::http_1x::header::CONTENT_LENGTH,
  105    144   
                    content_length,
  106    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  107    147   
                builder
  108    148   
                    .status(400)
  109    149   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         151  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
  110    152   
        }
  111         -
        }
         153  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
  112    154   
    })
         155  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
  113    156   
}

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

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

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

@@ -1,1 +57,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_http_response_code_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HttpResponseCodeInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::http_response_code_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:873 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:534 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   28     41   
pub fn ser_http_response_code_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::HttpResponseCodeOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:534 */
   35     50   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          52  +
        let mut builder = ::http_1x::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          56  +
            ::http_1x::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
   42         -
        let status = output.status.unwrap_or(200);
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:737 */
          60  +
        let status = output.status
          61  +
            /* ServerHttpBoundProtocolGenerator.kt:739 */.unwrap_or(200)
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:737 */;
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:742 */
   43     64   
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   44     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   45     67   
        let payload =
   46         -
            crate::protocol_serde::shape_http_response_code_output::ser_http_response_code_output_output_output(&output)?
   47         -
        ;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_http_response_code_output::ser_http_response_code_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   48     71   
        let content_length = payload.len();
   49     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     73   
            builder,
   51         -
            ::http::header::CONTENT_LENGTH,
          74  +
            ::http_1x::header::CONTENT_LENGTH,
   52     75   
            content_length,
   53     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   54     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   55     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   56     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   57     84   
}

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

@@ -1,1 +20,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_http_response_code_output_output_output(
    3      4   
    value: &crate::output::HttpResponseCodeOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_http_response_code_output::ser_http_response_code_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_http_response_code_output_output(
   16     22   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    #[allow(unused_variables)] input: &crate::output::HttpResponseCodeOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:372 */
   19     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   20     28   
}

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

@@ -1,1 +68,94 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_http_string_payload_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HttpStringPayloadInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::http_string_payload_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   22     30   
        if let Some(value) = {
   23         -
            let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
            let bytes = {
          32  +
                use ::http_body_util::BodyExt;
          33  +
                body.collect().await?.to_bytes()
          34  +
            };
   24     35   
            if !bytes.is_empty() {
   25     36   
                ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     37   
                    &headers,
   27     38   
                    Some("text/plain"),
   28     39   
                )?;
   29     40   
            }
   30     41   
            crate::protocol_serde::shape_http_string_payload_input::de_payload_payload(&bytes)?
   31     42   
        } {
   32     43   
            input = input.set_payload(Some(value))
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   34     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:534 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   39     55   
pub fn ser_http_string_payload_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::HttpStringPayloadOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:534 */
   46     64   
        #[allow(unused_mut)]
   47         -
        let mut builder = ::http::Response::builder();
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          66  +
        let mut builder = ::http_1x::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50         -
            ::http::header::CONTENT_TYPE,
          70  +
            ::http_1x::header::CONTENT_TYPE,
   51     71   
            "text/plain",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   53     74   
        let http_status: u16 = 200;
   54     75   
        builder = builder.status(http_status);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   55     77   
        let payload =
   56         -
            crate::protocol_serde::shape_http_string_payload_output::ser_payload_http_payload(
   57         -
                output.payload,
   58         -
            )?;
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_http_string_payload_output::ser_payload_http_payload( output.payload)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   59     81   
        let content_length = payload.len();
   60     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     83   
            builder,
   62         -
            ::http::header::CONTENT_LENGTH,
          84  +
            ::http_1x::header::CONTENT_LENGTH,
   63     85   
            content_length,
   64     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   65     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   66     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   67     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   68     94   
}

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

@@ -1,1 +14,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:254 */
    2      3   
pub(crate) fn de_payload_payload(
    3      4   
    body: &[u8],
    4      5   
) -> std::result::Result<
    5      6   
    ::std::option::Option<::std::string::String>,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:342 */
    8     10   
    (!body.is_empty())
    9     11   
        .then(|| {
          12  +
            /* HttpBindingGenerator.kt:355 */
   10     13   
            let body_str = std::str::from_utf8(body)?;
          14  +
            /* HttpBindingGenerator.kt:367 */
   11     15   
            Ok(body_str.to_string())
          16  +
            /* HttpBindingGenerator.kt:342 */
   12     17   
        })
   13     18   
        .transpose()
          19  +
    /* HttpBindingGenerator.kt:254 */
   14     20   
}

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

@@ -1,1 +10,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:309 */
    2      3   
pub fn ser_payload_http_payload(
    3      4   
    payload: ::std::option::Option<::std::string::String>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:318 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:330 */
          12  +
                Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:318 */
          13  +
            )
          14  +
        }
    8     15   
    };
    9         -
    Ok(payload.into_bytes())
          16  +
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
          17  +
    Ok(
          18  +
        /* HttpBoundProtocolPayloadGenerator.kt:364 */
          19  +
        payload.into_bytes(), /* HttpBoundProtocolPayloadGenerator.kt:343 */
          20  +
    )
          21  +
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
   10     22   
}

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

@@ -1,1 +56,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_ignore_query_params_in_response_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::IgnoreQueryParamsInResponseInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::ignore_query_params_in_response_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:873 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:534 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   28     41   
pub fn ser_ignore_query_params_in_response_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::IgnoreQueryParamsInResponseOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:534 */
   35     50   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          52  +
        let mut builder = ::http_1x::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          56  +
            ::http_1x::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     63   
        let payload =
   45         -
            crate::protocol_serde::shape_ignore_query_params_in_response_output::ser_ignore_query_params_in_response_output_output_output(&output)?
   46         -
        ;
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_ignore_query_params_in_response_output::ser_ignore_query_params_in_response_output_output_output(&output)?
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
   47     67   
        let content_length = payload.len();
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          70  +
            ::http_1x::header::CONTENT_LENGTH,
   51     71   
            content_length,
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
   53     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   54     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
   55     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
   56     80   
}

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

@@ -1,1 +20,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_ignore_query_params_in_response_output_output_output(
    3      4   
    value: &crate::output::IgnoreQueryParamsInResponseOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_ignore_query_params_in_response_output::ser_ignore_query_params_in_response_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_ignore_query_params_in_response_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::IgnoreQueryParamsInResponseOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.baz {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("baz").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:372 */
   19     29   
    Ok(())
          30  +
    /* JsonSerializerGenerator.kt:358 */
   20     31   
}

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

@@ -1,1 +481,677 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
    3      5   
pub async fn de_input_and_output_with_headers_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           6  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::InputAndOutputWithHeadersInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:534 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
   17     22   
        let mut input = crate::input::input_and_output_with_headers_input::Builder::default();
          23  +
        /* RustType.kt:534 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   22     30   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_boolean_list_header(&headers)? {
   23     31   
                                input = input.set_header_boolean_list(Some(value))
   24     32   
                            }
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   25     34   
        if let Some(value) =
   26     35   
            crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_byte_header(
   27     36   
                &headers,
   28     37   
            )?
   29     38   
        {
   30     39   
            input = input.set_header_byte(Some(value))
   31     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   32     42   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_double_header(&headers)? {
   33     43   
                                input = input.set_header_double(Some(value))
   34     44   
                            }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   35     46   
        if let Some(value) =
   36     47   
            crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_enum_header(
   37     48   
                &headers,
   38     49   
            )?
   39     50   
        {
   40     51   
            input = input.set_header_enum(Some(value))
   41     52   
        }
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   42     54   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_enum_list_header(&headers)? {
   43     55   
                                input = input.set_header_enum_list(Some(value))
   44     56   
                            }
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   45     58   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_false_bool_header(&headers)? {
   46     59   
                                input = input.set_header_false_bool(Some(value))
   47     60   
                            }
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   48     62   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_float_header(&headers)? {
   49     63   
                                input = input.set_header_float(Some(value))
   50     64   
                            }
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   51     66   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_header(&headers)? {
   52     67   
                                input = input.set_header_integer(Some(value))
   53     68   
                            }
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   54     70   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_enum_header(&headers)? {
   55     71   
                                input = input.set_header_integer_enum(Some(value))
   56     72   
                            }
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   57     74   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_enum_list_header(&headers)? {
   58     75   
                                input = input.set_header_integer_enum_list(Some(value))
   59     76   
                            }
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   60     78   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_list_header(&headers)? {
   61     79   
                                input = input.set_header_integer_list(Some(value))
   62     80   
                            }
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   63     82   
        if let Some(value) =
   64     83   
            crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_long_header(
   65     84   
                &headers,
   66     85   
            )?
   67     86   
        {
   68     87   
            input = input.set_header_long(Some(value))
   69     88   
        }
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   70     90   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_short_header(&headers)? {
   71     91   
                                input = input.set_header_short(Some(value))
   72     92   
                            }
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   73     94   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_header(&headers)? {
   74     95   
                                input = input.set_header_string(Some(value))
   75     96   
                            }
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   76     98   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_list_header(&headers)? {
   77     99   
                                input = input.set_header_string_list(Some(value))
   78    100   
                            }
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   79    102   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_set_header(&headers)? {
   80    103   
                                input = input.set_header_string_set(Some(value))
   81    104   
                            }
         105  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   82    106   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_timestamp_list_header(&headers)? {
   83    107   
                                input = input.set_header_timestamp_list(Some(value))
   84    108   
                            }
         109  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
   85    110   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_true_bool_header(&headers)? {
   86    111   
                                input = input.set_header_true_bool(Some(value))
   87    112   
                            }
         113  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
   88    114   
        input.build()?
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
   89    116   
    })
         117  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
   90    118   
}
   91    119   
         120  +
/* RustType.kt:534 */
   92    121   
#[allow(clippy::unnecessary_wraps)]
         122  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
   93    123   
pub fn ser_input_and_output_with_headers_http_response(
   94    124   
    #[allow(unused_variables)] output: crate::output::InputAndOutputWithHeadersOutput,
   95    125   
) -> std::result::Result<
   96    126   
    ::aws_smithy_http_server::response::Response,
   97    127   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   98    128   
> {
         129  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
   99    130   
    Ok({
         131  +
        /* RustType.kt:534 */
  100    132   
        #[allow(unused_mut)]
  101         -
        let mut builder = ::http::Response::builder();
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
         134  +
        let mut builder = ::http_1x::Response::builder();
         135  +
        /* ServerHttpBoundProtocolGenerator.kt:665 */
  102    136   
        builder = crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_headers(&output, builder)?;
         137  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
  103    138   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    139   
            builder,
  105         -
            ::http::header::CONTENT_TYPE,
         140  +
            ::http_1x::header::CONTENT_TYPE,
  106    141   
            "application/json",
  107    142   
        );
         143  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
  108    144   
        let http_status: u16 = 200;
  109    145   
        builder = builder.status(http_status);
         146  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
  110    147   
        let payload =
  111         -
            crate::protocol_serde::shape_input_and_output_with_headers_output::ser_input_and_output_with_headers_output_output_output(&output)?
  112         -
        ;
         148  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_input_and_output_with_headers_output::ser_input_and_output_with_headers_output_output_output(&output)?
         149  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
         150  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
  113    151   
        let content_length = payload.len();
  114    152   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    153   
            builder,
  116         -
            ::http::header::CONTENT_LENGTH,
         154  +
            ::http_1x::header::CONTENT_LENGTH,
  117    155   
            content_length,
  118    156   
        );
         157  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
  119    158   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         159  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
  120    160   
        builder.body(body)?
         161  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
  121    162   
    })
         163  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
  122    164   
}
  123    165   
         166  +
/* RustType.kt:534 */
  124    167   
#[allow(clippy::unnecessary_wraps)]
         168  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
  125    169   
pub fn ser_input_and_output_with_headers_http_error(
  126    170   
    error: &crate::error::InputAndOutputWithHeadersError,
  127    171   
) -> std::result::Result<
  128    172   
    ::aws_smithy_http_server::response::Response,
  129    173   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  130    174   
> {
         175  +
    /* ServerHttpBoundProtocolGenerator.kt:476 */
  131    176   
    Ok({
         177  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
  132    178   
        match error {
         179  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
  133    180   
            crate::error::InputAndOutputWithHeadersError::ValidationException(output) => {
         181  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
  134    182   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         183  +
                /* RustType.kt:534 */
  135    184   
                #[allow(unused_mut)]
  136         -
                let mut builder = ::http::Response::builder();
         185  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         186  +
                let mut builder = ::http_1x::Response::builder();
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  137    188   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  138    189   
                    builder,
  139         -
                    ::http::header::CONTENT_TYPE,
         190  +
                    ::http_1x::header::CONTENT_TYPE,
  140    191   
                    "application/json",
  141    192   
                );
         193  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
  142    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  143    195   
                    builder,
  144         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         196  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  145    197   
                    "ValidationException",
  146    198   
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
  147    200   
                let content_length = payload.len();
  148    201   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  149    202   
                    builder,
  150         -
                    ::http::header::CONTENT_LENGTH,
         203  +
                    ::http_1x::header::CONTENT_LENGTH,
  151    204   
                    content_length,
  152    205   
                );
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
  153    207   
                builder
  154    208   
                    .status(400)
  155    209   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         210  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         211  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
  156    212   
        }
  157         -
        }
         213  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
  158    214   
    })
         215  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
  159    216   
}
  160    217   
         218  +
/* HttpBindingGenerator.kt:565 */
  161    219   
pub fn ser_input_and_output_with_headers_headers(
  162    220   
    input: &crate::output::InputAndOutputWithHeadersOutput,
  163         -
    mut builder: ::http::response::Builder,
  164         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  165         -
{
         221  +
    mut builder: ::http_1x::response::Builder,
         222  +
) -> std::result::Result<
         223  +
    ::http_1x::response::Builder,
         224  +
    ::aws_smithy_types::error::operation::BuildError,
         225  +
> {
         226  +
    /* HttpBindingGenerator.kt:615 */
  166    227   
    if let ::std::option::Option::Some(inner_1) = &input.header_string {
         228  +
        /* HttpBindingGenerator.kt:727 */
  167    229   
        let formatted_2 = inner_1.as_str();
         230  +
        /* HttpBindingGenerator.kt:728 */
  168    231   
        if !formatted_2.is_empty() {
         232  +
            /* HttpBindingGenerator.kt:729 */
  169    233   
            let header_value = formatted_2;
  170         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         234  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  171    235   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  172    236   
                    "header_string",
  173    237   
                    format!(
  174    238   
                        "`{}` cannot be used as a header value: {}",
  175    239   
                        &header_value, err
  176    240   
                    ),
  177    241   
                )
  178    242   
            })?;
  179    243   
            builder = builder.header("X-String", header_value);
         244  +
            /* HttpBindingGenerator.kt:728 */
  180    245   
        }
         246  +
        /* HttpBindingGenerator.kt:615 */
  181    247   
    }
         248  +
    /* HttpBindingGenerator.kt:615 */
  182    249   
    if let ::std::option::Option::Some(inner_3) = &input.header_byte {
         250  +
        /* HttpBindingGenerator.kt:713 */
  183    251   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
         252  +
        /* HttpBindingGenerator.kt:727 */
  184    253   
        let formatted_4 = encoder.encode();
         254  +
        /* HttpBindingGenerator.kt:728 */
  185    255   
        if !formatted_4.is_empty() {
         256  +
            /* HttpBindingGenerator.kt:729 */
  186    257   
            let header_value = formatted_4;
  187         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         258  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  188    259   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  189    260   
                    "header_byte",
  190    261   
                    format!(
  191    262   
                        "`{}` cannot be used as a header value: {}",
  192    263   
                        &header_value, err
  193    264   
                    ),
  194    265   
                )
  195    266   
            })?;
  196    267   
            builder = builder.header("X-Byte", header_value);
         268  +
            /* HttpBindingGenerator.kt:728 */
  197    269   
        }
         270  +
        /* HttpBindingGenerator.kt:615 */
  198    271   
    }
         272  +
    /* HttpBindingGenerator.kt:615 */
  199    273   
    if let ::std::option::Option::Some(inner_5) = &input.header_short {
         274  +
        /* HttpBindingGenerator.kt:713 */
  200    275   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
         276  +
        /* HttpBindingGenerator.kt:727 */
  201    277   
        let formatted_6 = encoder.encode();
         278  +
        /* HttpBindingGenerator.kt:728 */
  202    279   
        if !formatted_6.is_empty() {
         280  +
            /* HttpBindingGenerator.kt:729 */
  203    281   
            let header_value = formatted_6;
  204         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         282  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  205    283   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  206    284   
                    "header_short",
  207    285   
                    format!(
  208    286   
                        "`{}` cannot be used as a header value: {}",
  209    287   
                        &header_value, err
  210    288   
                    ),
  211    289   
                )
  212    290   
            })?;
  213    291   
            builder = builder.header("X-Short", header_value);
         292  +
            /* HttpBindingGenerator.kt:728 */
  214    293   
        }
         294  +
        /* HttpBindingGenerator.kt:615 */
  215    295   
    }
         296  +
    /* HttpBindingGenerator.kt:615 */
  216    297   
    if let ::std::option::Option::Some(inner_7) = &input.header_integer {
         298  +
        /* HttpBindingGenerator.kt:713 */
  217    299   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_7);
         300  +
        /* HttpBindingGenerator.kt:727 */
  218    301   
        let formatted_8 = encoder.encode();
         302  +
        /* HttpBindingGenerator.kt:728 */
  219    303   
        if !formatted_8.is_empty() {
         304  +
            /* HttpBindingGenerator.kt:729 */
  220    305   
            let header_value = formatted_8;
  221         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         306  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  222    307   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  223    308   
                    "header_integer",
  224    309   
                    format!(
  225    310   
                        "`{}` cannot be used as a header value: {}",
  226    311   
                        &header_value, err
  227    312   
                    ),
  228    313   
                )
  229    314   
            })?;
  230    315   
            builder = builder.header("X-Integer", header_value);
         316  +
            /* HttpBindingGenerator.kt:728 */
  231    317   
        }
         318  +
        /* HttpBindingGenerator.kt:615 */
  232    319   
    }
         320  +
    /* HttpBindingGenerator.kt:615 */
  233    321   
    if let ::std::option::Option::Some(inner_9) = &input.header_long {
         322  +
        /* HttpBindingGenerator.kt:713 */
  234    323   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_9);
         324  +
        /* HttpBindingGenerator.kt:727 */
  235    325   
        let formatted_10 = encoder.encode();
         326  +
        /* HttpBindingGenerator.kt:728 */
  236    327   
        if !formatted_10.is_empty() {
         328  +
            /* HttpBindingGenerator.kt:729 */
  237    329   
            let header_value = formatted_10;
  238         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         330  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  239    331   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  240    332   
                    "header_long",
  241    333   
                    format!(
  242    334   
                        "`{}` cannot be used as a header value: {}",
  243    335   
                        &header_value, err
  244    336   
                    ),
  245    337   
                )
  246    338   
            })?;
  247    339   
            builder = builder.header("X-Long", header_value);
         340  +
            /* HttpBindingGenerator.kt:728 */
  248    341   
        }
         342  +
        /* HttpBindingGenerator.kt:615 */
  249    343   
    }
         344  +
    /* HttpBindingGenerator.kt:615 */
  250    345   
    if let ::std::option::Option::Some(inner_11) = &input.header_float {
         346  +
        /* HttpBindingGenerator.kt:713 */
  251    347   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_11);
         348  +
        /* HttpBindingGenerator.kt:727 */
  252    349   
        let formatted_12 = encoder.encode();
         350  +
        /* HttpBindingGenerator.kt:728 */
  253    351   
        if !formatted_12.is_empty() {
         352  +
            /* HttpBindingGenerator.kt:729 */
  254    353   
            let header_value = formatted_12;
  255         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         354  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  256    355   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  257    356   
                    "header_float",
  258    357   
                    format!(
  259    358   
                        "`{}` cannot be used as a header value: {}",
  260    359   
                        &header_value, err
  261    360   
                    ),
  262    361   
                )
  263    362   
            })?;
  264    363   
            builder = builder.header("X-Float", header_value);
         364  +
            /* HttpBindingGenerator.kt:728 */
  265    365   
        }
         366  +
        /* HttpBindingGenerator.kt:615 */
  266    367   
    }
         368  +
    /* HttpBindingGenerator.kt:615 */
  267    369   
    if let ::std::option::Option::Some(inner_13) = &input.header_double {
         370  +
        /* HttpBindingGenerator.kt:713 */
  268    371   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_13);
         372  +
        /* HttpBindingGenerator.kt:727 */
  269    373   
        let formatted_14 = encoder.encode();
         374  +
        /* HttpBindingGenerator.kt:728 */
  270    375   
        if !formatted_14.is_empty() {
         376  +
            /* HttpBindingGenerator.kt:729 */
  271    377   
            let header_value = formatted_14;
  272         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         378  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  273    379   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  274    380   
                    "header_double",
  275    381   
                    format!(
  276    382   
                        "`{}` cannot be used as a header value: {}",
  277    383   
                        &header_value, err
  278    384   
                    ),
  279    385   
                )
  280    386   
            })?;
  281    387   
            builder = builder.header("X-Double", header_value);
         388  +
            /* HttpBindingGenerator.kt:728 */
  282    389   
        }
         390  +
        /* HttpBindingGenerator.kt:615 */
  283    391   
    }
         392  +
    /* HttpBindingGenerator.kt:615 */
  284    393   
    if let ::std::option::Option::Some(inner_15) = &input.header_true_bool {
         394  +
        /* HttpBindingGenerator.kt:713 */
  285    395   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_15);
         396  +
        /* HttpBindingGenerator.kt:727 */
  286    397   
        let formatted_16 = encoder.encode();
         398  +
        /* HttpBindingGenerator.kt:728 */
  287    399   
        if !formatted_16.is_empty() {
         400  +
            /* HttpBindingGenerator.kt:729 */
  288    401   
            let header_value = formatted_16;
  289         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         402  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  290    403   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  291    404   
                    "header_true_bool",
  292    405   
                    format!(
  293    406   
                        "`{}` cannot be used as a header value: {}",
  294    407   
                        &header_value, err
  295    408   
                    ),
  296    409   
                )
  297    410   
            })?;
  298    411   
            builder = builder.header("X-Boolean1", header_value);
         412  +
            /* HttpBindingGenerator.kt:728 */
  299    413   
        }
         414  +
        /* HttpBindingGenerator.kt:615 */
  300    415   
    }
         416  +
    /* HttpBindingGenerator.kt:615 */
  301    417   
    if let ::std::option::Option::Some(inner_17) = &input.header_false_bool {
         418  +
        /* HttpBindingGenerator.kt:713 */
  302    419   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
         420  +
        /* HttpBindingGenerator.kt:727 */
  303    421   
        let formatted_18 = encoder.encode();
         422  +
        /* HttpBindingGenerator.kt:728 */
  304    423   
        if !formatted_18.is_empty() {
         424  +
            /* HttpBindingGenerator.kt:729 */
  305    425   
            let header_value = formatted_18;
  306         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         426  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  307    427   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  308    428   
                    "header_false_bool",
  309    429   
                    format!(
  310    430   
                        "`{}` cannot be used as a header value: {}",
  311    431   
                        &header_value, err
  312    432   
                    ),
  313    433   
                )
  314    434   
            })?;
  315    435   
            builder = builder.header("X-Boolean2", header_value);
         436  +
            /* HttpBindingGenerator.kt:728 */
  316    437   
        }
         438  +
        /* HttpBindingGenerator.kt:615 */
  317    439   
    }
         440  +
    /* HttpBindingGenerator.kt:615 */
  318    441   
    if let ::std::option::Option::Some(inner_19) = &input.header_string_list {
         442  +
        /* HttpBindingGenerator.kt:669 */
  319    443   
        for inner_20 in inner_19 {
         444  +
            /* HttpBindingGenerator.kt:727 */
  320    445   
            let formatted_21 = ::aws_smithy_http::header::quote_header_value(inner_20.as_str());
         446  +
            /* HttpBindingGenerator.kt:728 */
  321    447   
            if !formatted_21.is_empty() {
         448  +
                /* HttpBindingGenerator.kt:729 */
  322    449   
                let header_value = formatted_21;
  323         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         450  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  324    451   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  325    452   
                        "header_string_list",
  326    453   
                        format!(
  327    454   
                            "`{}` cannot be used as a header value: {}",
  328    455   
                            &header_value, err
  329    456   
                        ),
  330    457   
                    )
  331    458   
                })?;
  332    459   
                builder = builder.header("X-StringList", header_value);
         460  +
                /* HttpBindingGenerator.kt:728 */
  333    461   
            }
         462  +
            /* HttpBindingGenerator.kt:669 */
  334    463   
        }
         464  +
        /* HttpBindingGenerator.kt:615 */
  335    465   
    }
         466  +
    /* HttpBindingGenerator.kt:615 */
  336    467   
    if let ::std::option::Option::Some(inner_22) = &input.header_string_set {
         468  +
        /* HttpBindingGenerator.kt:669 */
  337    469   
        for inner_23 in &inner_22.0 {
         470  +
            /* HttpBindingGenerator.kt:727 */
  338    471   
            let formatted_24 = ::aws_smithy_http::header::quote_header_value(inner_23.as_str());
         472  +
            /* HttpBindingGenerator.kt:728 */
  339    473   
            if !formatted_24.is_empty() {
         474  +
                /* HttpBindingGenerator.kt:729 */
  340    475   
                let header_value = formatted_24;
  341         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         476  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  342    477   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  343    478   
                        "header_string_set",
  344    479   
                        format!(
  345    480   
                            "`{}` cannot be used as a header value: {}",
  346    481   
                            &header_value, err
  347    482   
                        ),
  348    483   
                    )
  349    484   
                })?;
  350    485   
                builder = builder.header("X-StringSet", header_value);
         486  +
                /* HttpBindingGenerator.kt:728 */
  351    487   
            }
         488  +
            /* HttpBindingGenerator.kt:669 */
  352    489   
        }
         490  +
        /* HttpBindingGenerator.kt:615 */
  353    491   
    }
         492  +
    /* HttpBindingGenerator.kt:615 */
  354    493   
    if let ::std::option::Option::Some(inner_25) = &input.header_integer_list {
         494  +
        /* HttpBindingGenerator.kt:669 */
  355    495   
        for inner_26 in inner_25 {
         496  +
            /* HttpBindingGenerator.kt:713 */
  356    497   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_26);
         498  +
            /* HttpBindingGenerator.kt:727 */
  357    499   
            let formatted_27 = encoder.encode();
         500  +
            /* HttpBindingGenerator.kt:728 */
  358    501   
            if !formatted_27.is_empty() {
         502  +
                /* HttpBindingGenerator.kt:729 */
  359    503   
                let header_value = formatted_27;
  360         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         504  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  361    505   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  362    506   
                        "header_integer_list",
  363    507   
                        format!(
  364    508   
                            "`{}` cannot be used as a header value: {}",
  365    509   
                            &header_value, err
  366    510   
                        ),
  367    511   
                    )
  368    512   
                })?;
  369    513   
                builder = builder.header("X-IntegerList", header_value);
         514  +
                /* HttpBindingGenerator.kt:728 */
  370    515   
            }
         516  +
            /* HttpBindingGenerator.kt:669 */
  371    517   
        }
         518  +
        /* HttpBindingGenerator.kt:615 */
  372    519   
    }
         520  +
    /* HttpBindingGenerator.kt:615 */
  373    521   
    if let ::std::option::Option::Some(inner_28) = &input.header_boolean_list {
         522  +
        /* HttpBindingGenerator.kt:669 */
  374    523   
        for inner_29 in inner_28 {
         524  +
            /* HttpBindingGenerator.kt:713 */
  375    525   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_29);
         526  +
            /* HttpBindingGenerator.kt:727 */
  376    527   
            let formatted_30 = encoder.encode();
         528  +
            /* HttpBindingGenerator.kt:728 */
  377    529   
            if !formatted_30.is_empty() {
         530  +
                /* HttpBindingGenerator.kt:729 */
  378    531   
                let header_value = formatted_30;
  379         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         532  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  380    533   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  381    534   
                        "header_boolean_list",
  382    535   
                        format!(
  383    536   
                            "`{}` cannot be used as a header value: {}",
  384    537   
                            &header_value, err
  385    538   
                        ),
  386    539   
                    )
  387    540   
                })?;
  388    541   
                builder = builder.header("X-BooleanList", header_value);
         542  +
                /* HttpBindingGenerator.kt:728 */
  389    543   
            }
         544  +
            /* HttpBindingGenerator.kt:669 */
  390    545   
        }
         546  +
        /* HttpBindingGenerator.kt:615 */
  391    547   
    }
         548  +
    /* HttpBindingGenerator.kt:615 */
  392    549   
    if let ::std::option::Option::Some(inner_31) = &input.header_timestamp_list {
         550  +
        /* HttpBindingGenerator.kt:669 */
  393    551   
        for inner_32 in inner_31 {
         552  +
            /* HttpBindingGenerator.kt:727 */
  394    553   
            let formatted_33 = inner_32.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
         554  +
            /* HttpBindingGenerator.kt:728 */
  395    555   
            if !formatted_33.is_empty() {
         556  +
                /* HttpBindingGenerator.kt:729 */
  396    557   
                let header_value = formatted_33;
  397         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         558  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  398    559   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  399    560   
                        "header_timestamp_list",
  400    561   
                        format!(
  401    562   
                            "`{}` cannot be used as a header value: {}",
  402    563   
                            &header_value, err
  403    564   
                        ),
  404    565   
                    )
  405    566   
                })?;
  406    567   
                builder = builder.header("X-TimestampList", header_value);
         568  +
                /* HttpBindingGenerator.kt:728 */
  407    569   
            }
         570  +
            /* HttpBindingGenerator.kt:669 */
  408    571   
        }
         572  +
        /* HttpBindingGenerator.kt:615 */
  409    573   
    }
         574  +
    /* HttpBindingGenerator.kt:615 */
  410    575   
    if let ::std::option::Option::Some(inner_34) = &input.header_enum {
         576  +
        /* HttpBindingGenerator.kt:727 */
  411    577   
        let formatted_35 = inner_34.as_str();
         578  +
        /* HttpBindingGenerator.kt:728 */
  412    579   
        if !formatted_35.is_empty() {
         580  +
            /* HttpBindingGenerator.kt:729 */
  413    581   
            let header_value = formatted_35;
  414         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         582  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  415    583   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  416    584   
                    "header_enum",
  417    585   
                    format!(
  418    586   
                        "`{}` cannot be used as a header value: {}",
  419    587   
                        &header_value, err
  420    588   
                    ),
  421    589   
                )
  422    590   
            })?;
  423    591   
            builder = builder.header("X-Enum", header_value);
         592  +
            /* HttpBindingGenerator.kt:728 */
  424    593   
        }
         594  +
        /* HttpBindingGenerator.kt:615 */
  425    595   
    }
         596  +
    /* HttpBindingGenerator.kt:615 */
  426    597   
    if let ::std::option::Option::Some(inner_36) = &input.header_enum_list {
         598  +
        /* HttpBindingGenerator.kt:669 */
  427    599   
        for inner_37 in inner_36 {
         600  +
            /* HttpBindingGenerator.kt:727 */
  428    601   
            let formatted_38 = ::aws_smithy_http::header::quote_header_value(inner_37.as_str());
         602  +
            /* HttpBindingGenerator.kt:728 */
  429    603   
            if !formatted_38.is_empty() {
         604  +
                /* HttpBindingGenerator.kt:729 */
  430    605   
                let header_value = formatted_38;
  431         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         606  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  432    607   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  433    608   
                        "header_enum_list",
  434    609   
                        format!(
  435    610   
                            "`{}` cannot be used as a header value: {}",
  436    611   
                            &header_value, err
  437    612   
                        ),
  438    613   
                    )
  439    614   
                })?;
  440    615   
                builder = builder.header("X-EnumList", header_value);
         616  +
                /* HttpBindingGenerator.kt:728 */
  441    617   
            }
         618  +
            /* HttpBindingGenerator.kt:669 */
  442    619   
        }
         620  +
        /* HttpBindingGenerator.kt:615 */
  443    621   
    }
         622  +
    /* HttpBindingGenerator.kt:615 */
  444    623   
    if let ::std::option::Option::Some(inner_39) = &input.header_integer_enum {
         624  +
        /* HttpBindingGenerator.kt:713 */
  445    625   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_39);
         626  +
        /* HttpBindingGenerator.kt:727 */
  446    627   
        let formatted_40 = encoder.encode();
         628  +
        /* HttpBindingGenerator.kt:728 */
  447    629   
        if !formatted_40.is_empty() {
         630  +
            /* HttpBindingGenerator.kt:729 */
  448    631   
            let header_value = formatted_40;
  449         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         632  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  450    633   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  451    634   
                    "header_integer_enum",
  452    635   
                    format!(
  453    636   
                        "`{}` cannot be used as a header value: {}",
  454    637   
                        &header_value, err
  455    638   
                    ),
  456    639   
                )
  457    640   
            })?;
  458    641   
            builder = builder.header("X-IntegerEnum", header_value);
         642  +
            /* HttpBindingGenerator.kt:728 */
  459    643   
        }
         644  +
        /* HttpBindingGenerator.kt:615 */
  460    645   
    }
         646  +
    /* HttpBindingGenerator.kt:615 */
  461    647   
    if let ::std::option::Option::Some(inner_41) = &input.header_integer_enum_list {
         648  +
        /* HttpBindingGenerator.kt:669 */
  462    649   
        for inner_42 in inner_41 {
         650  +
            /* HttpBindingGenerator.kt:713 */
  463    651   
            let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_42);
         652  +
            /* HttpBindingGenerator.kt:727 */
  464    653   
            let formatted_43 = encoder.encode();
         654  +
            /* HttpBindingGenerator.kt:728 */
  465    655   
            if !formatted_43.is_empty() {
         656  +
                /* HttpBindingGenerator.kt:729 */
  466    657   
                let header_value = formatted_43;
  467         -
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         658  +
                let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  468    659   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  469    660   
                        "header_integer_enum_list",
  470    661   
                        format!(
  471    662   
                            "`{}` cannot be used as a header value: {}",
  472    663   
                            &header_value, err
  473    664   
                        ),
  474    665   
                    )
  475    666   
                })?;
  476    667   
                builder = builder.header("X-IntegerEnumList", header_value);
         668  +
                /* HttpBindingGenerator.kt:728 */
  477    669   
            }
         670  +
            /* HttpBindingGenerator.kt:669 */
  478    671   
        }
         672  +
        /* HttpBindingGenerator.kt:615 */
  479    673   
    }
         674  +
    /* HttpBindingGenerator.kt:578 */
  480    675   
    Ok(builder)
         676  +
    /* HttpBindingGenerator.kt:565 */
  481    677   
}

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

@@ -1,1 +268,354 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:159 */
    2      3   
pub(crate) fn de_header_boolean_list_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::vec::Vec<bool>>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:166 */
    8     10   
    let headers = header_map.get_all("X-BooleanList");
          11  +
    /* HttpBindingGenerator.kt:427 */
    9     12   
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
          13  +
    /* HttpBindingGenerator.kt:453 */
   10     14   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          15  +
    /* HttpBindingGenerator.kt:159 */
   11     16   
}
   12     17   
          18  +
/* HttpBindingGenerator.kt:159 */
   13     19   
pub(crate) fn de_header_byte_header(
   14     20   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15     21   
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_http::header::ParseError> {
          22  +
    /* HttpBindingGenerator.kt:166 */
   16     23   
    let headers = header_map.get_all("X-Byte");
          24  +
    /* HttpBindingGenerator.kt:427 */
   17     25   
    let var_2 = ::aws_smithy_http::header::read_many_primitive::<i8>(headers)?;
          26  +
    /* HttpBindingGenerator.kt:491 */
   18     27   
    if var_2.len() > 1 {
   19     28   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   20     29   
            "expected one item but found {}",
   21     30   
            var_2.len()
   22     31   
        )))
   23     32   
    } else {
   24     33   
        let mut var_2 = var_2;
   25     34   
        Ok(var_2.pop())
   26     35   
    }
          36  +
    /* HttpBindingGenerator.kt:159 */
   27     37   
}
   28     38   
          39  +
/* HttpBindingGenerator.kt:159 */
   29     40   
pub(crate) fn de_header_double_header(
   30     41   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   31     42   
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_http::header::ParseError> {
          43  +
    /* HttpBindingGenerator.kt:166 */
   32     44   
    let headers = header_map.get_all("X-Double");
          45  +
    /* HttpBindingGenerator.kt:427 */
   33     46   
    let var_3 = ::aws_smithy_http::header::read_many_primitive::<f64>(headers)?;
          47  +
    /* HttpBindingGenerator.kt:491 */
   34     48   
    if var_3.len() > 1 {
   35     49   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   36     50   
            "expected one item but found {}",
   37     51   
            var_3.len()
   38     52   
        )))
   39     53   
    } else {
   40     54   
        let mut var_3 = var_3;
   41     55   
        Ok(var_3.pop())
   42     56   
    }
          57  +
    /* HttpBindingGenerator.kt:159 */
   43     58   
}
   44     59   
          60  +
/* HttpBindingGenerator.kt:159 */
   45     61   
pub(crate) fn de_header_enum_header(
   46     62   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   47     63   
) -> ::std::result::Result<
   48     64   
    ::std::option::Option<::std::string::String>,
   49     65   
    ::aws_smithy_http::header::ParseError,
   50     66   
> {
          67  +
    /* HttpBindingGenerator.kt:166 */
   51     68   
    let headers = header_map.get_all("X-Enum");
          69  +
    /* HttpBindingGenerator.kt:398 */
   52     70   
    ::aws_smithy_http::header::one_or_none(headers)
          71  +
    /* HttpBindingGenerator.kt:159 */
   53     72   
}
   54     73   
          74  +
/* HttpBindingGenerator.kt:159 */
   55     75   
pub(crate) fn de_header_enum_list_header(
   56     76   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   57     77   
) -> ::std::result::Result<
   58     78   
    ::std::option::Option<
   59     79   
        crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained,
   60     80   
    >,
   61     81   
    ::aws_smithy_http::header::ParseError,
   62     82   
> {
          83  +
    /* HttpBindingGenerator.kt:166 */
   63     84   
    let headers = header_map.get_all("X-EnumList");
          85  +
    /* HttpBindingGenerator.kt:432 */
   64     86   
    let var_4: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          87  +
    /* HttpBindingGenerator.kt:479 */
   65     88   
    Ok(if !var_4.is_empty() {
   66     89   
        Some(crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(var_4))
   67     90   
    } else {
   68     91   
        None
   69     92   
    })
          93  +
    /* HttpBindingGenerator.kt:159 */
   70     94   
}
   71     95   
          96  +
/* HttpBindingGenerator.kt:159 */
   72     97   
pub(crate) fn de_header_false_bool_header(
   73     98   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   74     99   
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
         100  +
    /* HttpBindingGenerator.kt:166 */
   75    101   
    let headers = header_map.get_all("X-Boolean2");
         102  +
    /* HttpBindingGenerator.kt:427 */
   76    103   
    let var_5 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
         104  +
    /* HttpBindingGenerator.kt:491 */
   77    105   
    if var_5.len() > 1 {
   78    106   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   79    107   
            "expected one item but found {}",
   80    108   
            var_5.len()
   81    109   
        )))
   82    110   
    } else {
   83    111   
        let mut var_5 = var_5;
   84    112   
        Ok(var_5.pop())
   85    113   
    }
         114  +
    /* HttpBindingGenerator.kt:159 */
   86    115   
}
   87    116   
         117  +
/* HttpBindingGenerator.kt:159 */
   88    118   
pub(crate) fn de_header_float_header(
   89    119   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   90    120   
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_http::header::ParseError> {
         121  +
    /* HttpBindingGenerator.kt:166 */
   91    122   
    let headers = header_map.get_all("X-Float");
         123  +
    /* HttpBindingGenerator.kt:427 */
   92    124   
    let var_6 = ::aws_smithy_http::header::read_many_primitive::<f32>(headers)?;
         125  +
    /* HttpBindingGenerator.kt:491 */
   93    126   
    if var_6.len() > 1 {
   94    127   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   95    128   
            "expected one item but found {}",
   96    129   
            var_6.len()
   97    130   
        )))
   98    131   
    } else {
   99    132   
        let mut var_6 = var_6;
  100    133   
        Ok(var_6.pop())
  101    134   
    }
         135  +
    /* HttpBindingGenerator.kt:159 */
  102    136   
}
  103    137   
         138  +
/* HttpBindingGenerator.kt:159 */
  104    139   
pub(crate) fn de_header_integer_header(
  105    140   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  106    141   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
         142  +
    /* HttpBindingGenerator.kt:166 */
  107    143   
    let headers = header_map.get_all("X-Integer");
         144  +
    /* HttpBindingGenerator.kt:427 */
  108    145   
    let var_7 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         146  +
    /* HttpBindingGenerator.kt:491 */
  109    147   
    if var_7.len() > 1 {
  110    148   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  111    149   
            "expected one item but found {}",
  112    150   
            var_7.len()
  113    151   
        )))
  114    152   
    } else {
  115    153   
        let mut var_7 = var_7;
  116    154   
        Ok(var_7.pop())
  117    155   
    }
         156  +
    /* HttpBindingGenerator.kt:159 */
  118    157   
}
  119    158   
         159  +
/* HttpBindingGenerator.kt:159 */
  120    160   
pub(crate) fn de_header_integer_enum_header(
  121    161   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  122    162   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
         163  +
    /* HttpBindingGenerator.kt:166 */
  123    164   
    let headers = header_map.get_all("X-IntegerEnum");
         165  +
    /* HttpBindingGenerator.kt:427 */
  124    166   
    let var_8 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         167  +
    /* HttpBindingGenerator.kt:491 */
  125    168   
    if var_8.len() > 1 {
  126    169   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  127    170   
            "expected one item but found {}",
  128    171   
            var_8.len()
  129    172   
        )))
  130    173   
    } else {
  131    174   
        let mut var_8 = var_8;
  132    175   
        Ok(var_8.pop())
  133    176   
    }
         177  +
    /* HttpBindingGenerator.kt:159 */
  134    178   
}
  135    179   
         180  +
/* HttpBindingGenerator.kt:159 */
  136    181   
pub(crate) fn de_header_integer_enum_list_header(
  137    182   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  138    183   
) -> ::std::result::Result<
  139    184   
    ::std::option::Option<::std::vec::Vec<i32>>,
  140    185   
    ::aws_smithy_http::header::ParseError,
  141    186   
> {
         187  +
    /* HttpBindingGenerator.kt:166 */
  142    188   
    let headers = header_map.get_all("X-IntegerEnumList");
         189  +
    /* HttpBindingGenerator.kt:427 */
  143    190   
    let var_9 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         191  +
    /* HttpBindingGenerator.kt:453 */
  144    192   
    Ok(if !var_9.is_empty() { Some(var_9) } else { None })
         193  +
    /* HttpBindingGenerator.kt:159 */
  145    194   
}
  146    195   
         196  +
/* HttpBindingGenerator.kt:159 */
  147    197   
pub(crate) fn de_header_integer_list_header(
  148    198   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  149    199   
) -> ::std::result::Result<
  150    200   
    ::std::option::Option<::std::vec::Vec<i32>>,
  151    201   
    ::aws_smithy_http::header::ParseError,
  152    202   
> {
         203  +
    /* HttpBindingGenerator.kt:166 */
  153    204   
    let headers = header_map.get_all("X-IntegerList");
         205  +
    /* HttpBindingGenerator.kt:427 */
  154    206   
    let var_10 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         207  +
    /* HttpBindingGenerator.kt:453 */
  155    208   
    Ok(if !var_10.is_empty() {
  156    209   
        Some(var_10)
  157    210   
    } else {
  158    211   
        None
  159    212   
    })
         213  +
    /* HttpBindingGenerator.kt:159 */
  160    214   
}
  161    215   
         216  +
/* HttpBindingGenerator.kt:159 */
  162    217   
pub(crate) fn de_header_long_header(
  163    218   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  164    219   
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_http::header::ParseError> {
         220  +
    /* HttpBindingGenerator.kt:166 */
  165    221   
    let headers = header_map.get_all("X-Long");
         222  +
    /* HttpBindingGenerator.kt:427 */
  166    223   
    let var_11 = ::aws_smithy_http::header::read_many_primitive::<i64>(headers)?;
         224  +
    /* HttpBindingGenerator.kt:491 */
  167    225   
    if var_11.len() > 1 {
  168    226   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  169    227   
            "expected one item but found {}",
  170    228   
            var_11.len()
  171    229   
        )))
  172    230   
    } else {
  173    231   
        let mut var_11 = var_11;
  174    232   
        Ok(var_11.pop())
  175    233   
    }
         234  +
    /* HttpBindingGenerator.kt:159 */
  176    235   
}
  177    236   
         237  +
/* HttpBindingGenerator.kt:159 */
  178    238   
pub(crate) fn de_header_short_header(
  179    239   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  180    240   
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_http::header::ParseError> {
         241  +
    /* HttpBindingGenerator.kt:166 */
  181    242   
    let headers = header_map.get_all("X-Short");
         243  +
    /* HttpBindingGenerator.kt:427 */
  182    244   
    let var_12 = ::aws_smithy_http::header::read_many_primitive::<i16>(headers)?;
         245  +
    /* HttpBindingGenerator.kt:491 */
  183    246   
    if var_12.len() > 1 {
  184    247   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  185    248   
            "expected one item but found {}",
  186    249   
            var_12.len()
  187    250   
        )))
  188    251   
    } else {
  189    252   
        let mut var_12 = var_12;
  190    253   
        Ok(var_12.pop())
  191    254   
    }
         255  +
    /* HttpBindingGenerator.kt:159 */
  192    256   
}
  193    257   
         258  +
/* HttpBindingGenerator.kt:159 */
  194    259   
pub(crate) fn de_header_string_header(
  195    260   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  196    261   
) -> ::std::result::Result<
  197    262   
    ::std::option::Option<::std::string::String>,
  198    263   
    ::aws_smithy_http::header::ParseError,
  199    264   
> {
         265  +
    /* HttpBindingGenerator.kt:166 */
  200    266   
    let headers = header_map.get_all("X-String");
         267  +
    /* HttpBindingGenerator.kt:398 */
  201    268   
    ::aws_smithy_http::header::one_or_none(headers)
         269  +
    /* HttpBindingGenerator.kt:159 */
  202    270   
}
  203    271   
         272  +
/* HttpBindingGenerator.kt:159 */
  204    273   
pub(crate) fn de_header_string_list_header(
  205    274   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  206    275   
) -> ::std::result::Result<
  207    276   
    ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  208    277   
    ::aws_smithy_http::header::ParseError,
  209    278   
> {
         279  +
    /* HttpBindingGenerator.kt:166 */
  210    280   
    let headers = header_map.get_all("X-StringList");
         281  +
    /* HttpBindingGenerator.kt:432 */
  211    282   
    let var_13: Vec<::std::string::String> =
  212    283   
        ::aws_smithy_http::header::read_many_from_str(headers)?;
         284  +
    /* HttpBindingGenerator.kt:453 */
  213    285   
    Ok(if !var_13.is_empty() {
  214    286   
        Some(var_13)
  215    287   
    } else {
  216    288   
        None
  217    289   
    })
         290  +
    /* HttpBindingGenerator.kt:159 */
  218    291   
}
  219    292   
         293  +
/* HttpBindingGenerator.kt:159 */
  220    294   
pub(crate) fn de_header_string_set_header(
  221    295   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  222    296   
) -> ::std::result::Result<
  223    297   
    ::std::option::Option<crate::unconstrained::string_set_unconstrained::StringSetUnconstrained>,
  224    298   
    ::aws_smithy_http::header::ParseError,
  225    299   
> {
         300  +
    /* HttpBindingGenerator.kt:166 */
  226    301   
    let headers = header_map.get_all("X-StringSet");
         302  +
    /* HttpBindingGenerator.kt:432 */
  227    303   
    let var_14: Vec<::std::string::String> =
  228    304   
        ::aws_smithy_http::header::read_many_from_str(headers)?;
         305  +
    /* HttpBindingGenerator.kt:479 */
  229    306   
    Ok(if !var_14.is_empty() {
  230    307   
        Some(crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(var_14))
  231    308   
    } else {
  232    309   
        None
  233    310   
    })
         311  +
    /* HttpBindingGenerator.kt:159 */
  234    312   
}
  235    313   
         314  +
/* HttpBindingGenerator.kt:159 */
  236    315   
pub(crate) fn de_header_timestamp_list_header(
  237    316   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  238    317   
) -> ::std::result::Result<
  239    318   
    ::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>,
  240    319   
    ::aws_smithy_http::header::ParseError,
  241    320   
> {
         321  +
    /* HttpBindingGenerator.kt:166 */
  242    322   
    let headers = header_map.get_all("X-TimestampList");
  243         -
    let var_15: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
  244         -
        headers,
  245         -
        ::aws_smithy_types::date_time::Format::HttpDate,
  246         -
    )?;
         323  +
    /* HttpBindingGenerator.kt:417 */
         324  +
    let var_15: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
         325  +
    /* HttpBindingGenerator.kt:425 */;
         326  +
    /* HttpBindingGenerator.kt:453 */
  247    327   
    Ok(if !var_15.is_empty() {
  248    328   
        Some(var_15)
  249    329   
    } else {
  250    330   
        None
  251    331   
    })
         332  +
    /* HttpBindingGenerator.kt:159 */
  252    333   
}
  253    334   
         335  +
/* HttpBindingGenerator.kt:159 */
  254    336   
pub(crate) fn de_header_true_bool_header(
  255    337   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  256    338   
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
         339  +
    /* HttpBindingGenerator.kt:166 */
  257    340   
    let headers = header_map.get_all("X-Boolean1");
         341  +
    /* HttpBindingGenerator.kt:427 */
  258    342   
    let var_16 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
         343  +
    /* HttpBindingGenerator.kt:491 */
  259    344   
    if var_16.len() > 1 {
  260    345   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  261    346   
            "expected one item but found {}",
  262    347   
            var_16.len()
  263    348   
        )))
  264    349   
    } else {
  265    350   
        let mut var_16 = var_16;
  266    351   
        Ok(var_16.pop())
  267    352   
    }
         353  +
    /* HttpBindingGenerator.kt:159 */
  268    354   
}

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

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_input_and_output_with_headers_output_output_output(
    3      4   
    value: &crate::output::InputAndOutputWithHeadersOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_input_and_output_with_headers_output::ser_input_and_output_with_headers_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_input_and_output_with_headers_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::InputAndOutputWithHeadersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

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

@@ -1,1 +52,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_integer_enum_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<i32>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   30     40   
                                                .map(i32::try_from)
   31         -
                        .transpose()?;
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   41     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   42     59   
            }
   43         -
            }
          60  +
            /* JsonParserGenerator.kt:446 */
   44     61   
            Ok(Some(items))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   47     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     69   
                    "expected start array or null",
   49     70   
                ),
   50         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}

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

@@ -1,1 +60,85 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_integer_enum_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, i32>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   28     40   
                                                .map(i32::try_from)
   29         -
                        .transpose()?;
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:474 */;
          43  +
                        /* JsonParserGenerator.kt:481 */
   30     44   
                        match value {
   31     45   
                            Some(value) => {
   32     46   
                                map.insert(key, value);
   33     47   
                            }
   34     48   
                            None => {
   35     49   
                                return Err(
   36     50   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                        "dense map cannot contain null values",
   38     52   
                                    ),
   39     53   
                                )
   40     54   
                            }
   41     55   
                        }
          56  +
                        /* JsonParserGenerator.kt:686 */
   42     57   
                    }
          58  +
                    /* JsonParserGenerator.kt:695 */
   43     59   
                    other => {
   44     60   
                        return Err(
   45     61   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     62   
                                format!("expected object key or end object, found: {other:?}"),
   47     63   
                            ),
   48     64   
                        )
          65  +
                    } /* JsonParserGenerator.kt:685 */
   49     66   
                }
          67  +
                /* JsonParserGenerator.kt:684 */
   50     68   
            }
   51         -
            }
          69  +
            /* JsonParserGenerator.kt:504 */
   52     70   
            Ok(Some(map))
          71  +
            /* JsonParserGenerator.kt:713 */
   53     72   
        }
   54         -
        _ => Err(
          73  +
        /* JsonParserGenerator.kt:722 */
          74  +
        _ => {
          75  +
            /* JsonParserGenerator.kt:723 */
          76  +
            Err(
   55     77   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56     78   
                    "expected start object or null",
   57     79   
                ),
   58         -
        ),
          80  +
            )
          81  +
            /* JsonParserGenerator.kt:722 */
          82  +
        } /* JsonParserGenerator.kt:712 */
   59     83   
    }
          84  +
    /* JsonParserGenerator.kt:460 */
   60     85   
}

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

@@ -1,1 +56,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_integer_enum_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   30     40   
                                                .map(i32::try_from)
   31         -
                        .transpose()?;
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   41     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   42     59   
            }
   43         -
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(
   45     62   
                crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained(
   46     63   
                    items,
   47     64   
                ),
   48     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   49     67   
        }
   50         -
        _ => Err(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
   51     72   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   52     73   
                    "expected start array or null",
   53     74   
                ),
   54         -
        ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   55     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   56     80   
}