Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_no_input_and_no_output.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_no_input_and_no_output_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput,
    9     11   
    crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::no_input_and_no_output::NoInputAndNoOutputError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::no_input_and_no_output::NoInputAndNoOutputError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_no_input_and_no_output_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput,
   25     34   
    crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_no_input_and_output.rs

@@ -1,1 +28,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_no_input_and_output_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::no_input_and_output::NoInputAndOutputOutput, crate::operation::no_input_and_output::NoInputAndOutputError>
    8     10   
{
          11  +
    /* RustType.kt:516 */
    9     12   
    #[allow(unused_mut)]
          13  +
    /* ProtocolParserGenerator.kt:106 */
   10     14   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11     15   
        .map_err(crate::operation::no_input_and_output::NoInputAndOutputError::unhandled)?;
          16  +
    /* ProtocolParserGenerator.kt:120 */
   12     17   
    let generic = generic_builder.build();
          18  +
    /* ProtocolParserGenerator.kt:185 */
   13     19   
    Err(crate::operation::no_input_and_output::NoInputAndOutputError::generic(generic))
          20  +
    /* ProtocolParserGenerator.kt:99 */
   14     21   
}
   15     22   
          23  +
/* RustType.kt:516 */
   16     24   
#[allow(clippy::unnecessary_wraps)]
          25  +
/* ProtocolParserGenerator.kt:71 */
   17     26   
pub fn de_no_input_and_output_http_response(
   18     27   
    _response_status: u16,
   19     28   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20     29   
    _response_body: &[u8],
   21     30   
) -> std::result::Result<crate::operation::no_input_and_output::NoInputAndOutputOutput, crate::operation::no_input_and_output::NoInputAndOutputError>
   22     31   
{
          32  +
    /* ProtocolParserGenerator.kt:77 */
   23     33   
    Ok({
          34  +
        /* RustType.kt:516 */
   24     35   
        #[allow(unused_mut)]
          36  +
        /* ProtocolParserGenerator.kt:240 */
   25     37   
        let mut output = crate::operation::no_input_and_output::builders::NoInputAndOutputOutputBuilder::default();
          38  +
        /* ClientBuilderInstantiator.kt:56 */
   26     39   
        output.build()
          40  +
        /* ProtocolParserGenerator.kt:77 */
   27     41   
    })
          42  +
    /* ProtocolParserGenerator.kt:71 */
   28     43   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_null_and_empty_headers_client.rs

@@ -1,1 +96,135 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_null_and_empty_headers_client_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
    9     11   
    crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError::generic(
   16     22   
        generic,
   17     23   
    ))
          24  +
    /* ProtocolParserGenerator.kt:99 */
   18     25   
}
   19     26   
          27  +
/* RustType.kt:516 */
   20     28   
#[allow(clippy::unnecessary_wraps)]
          29  +
/* ProtocolParserGenerator.kt:71 */
   21     30   
pub fn de_null_and_empty_headers_client_http_response(
   22     31   
    _response_status: u16,
   23     32   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24     33   
    _response_body: &[u8],
   25     34   
) -> std::result::Result<
   26     35   
    crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   27     36   
    crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   28     37   
> {
          38  +
    /* ProtocolParserGenerator.kt:77 */
   29     39   
    Ok({
          40  +
        /* RustType.kt:516 */
   30     41   
        #[allow(unused_mut)]
          42  +
        /* ProtocolParserGenerator.kt:240 */
   31     43   
        let mut output = crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:267 */
   32     45   
        output = output.set_a(
          46  +
            /* ProtocolParserGenerator.kt:302 */
   33     47   
            crate::protocol_serde::shape_null_and_empty_headers_client_output::de_a_header(_response_headers).map_err(|_| {
   34     48   
                crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError::unhandled("Failed to parse a from header `X-A")
   35         -
            })?,
          49  +
            })?, /* ProtocolParserGenerator.kt:267 */
   36     50   
        );
          51  +
        /* ProtocolParserGenerator.kt:267 */
   37     52   
        output = output.set_b(
          53  +
            /* ProtocolParserGenerator.kt:302 */
   38     54   
            crate::protocol_serde::shape_null_and_empty_headers_client_output::de_b_header(_response_headers).map_err(|_| {
   39     55   
                crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError::unhandled("Failed to parse b from header `X-B")
   40         -
            })?,
          56  +
            })?, /* ProtocolParserGenerator.kt:267 */
   41     57   
        );
          58  +
        /* ProtocolParserGenerator.kt:267 */
   42     59   
        output = output.set_c(
          60  +
            /* ProtocolParserGenerator.kt:302 */
   43     61   
            crate::protocol_serde::shape_null_and_empty_headers_client_output::de_c_header(_response_headers).map_err(|_| {
   44     62   
                crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError::unhandled("Failed to parse c from header `X-C")
   45         -
            })?,
          63  +
            })?, /* ProtocolParserGenerator.kt:267 */
   46     64   
        );
          65  +
        /* ClientBuilderInstantiator.kt:56 */
   47     66   
        output.build()
          67  +
        /* ProtocolParserGenerator.kt:77 */
   48     68   
    })
          69  +
    /* ProtocolParserGenerator.kt:71 */
   49     70   
}
   50     71   
          72  +
/* HttpBindingGenerator.kt:542 */
   51     73   
pub fn ser_null_and_empty_headers_client_headers(
   52     74   
    input: &crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput,
   53     75   
    mut builder: ::http::request::Builder,
   54     76   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          77  +
    /* HttpBindingGenerator.kt:592 */
   55     78   
    if let ::std::option::Option::Some(inner_1) = &input.a {
          79  +
        /* HttpBindingGenerator.kt:704 */
   56     80   
        let formatted_2 = inner_1.as_str();
          81  +
        /* HttpBindingGenerator.kt:706 */
   57     82   
        let header_value = formatted_2;
   58     83   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   59     84   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   60     85   
                "a",
   61     86   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   62     87   
            )
   63     88   
        })?;
   64     89   
        builder = builder.header("X-A", header_value);
          90  +
        /* HttpBindingGenerator.kt:592 */
   65     91   
    }
          92  +
    /* HttpBindingGenerator.kt:592 */
   66     93   
    if let ::std::option::Option::Some(inner_3) = &input.b {
          94  +
        /* HttpBindingGenerator.kt:704 */
   67     95   
        let formatted_4 = inner_3.as_str();
          96  +
        /* HttpBindingGenerator.kt:706 */
   68     97   
        let header_value = formatted_4;
   69     98   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   70     99   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   71    100   
                "b",
   72    101   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   73    102   
            )
   74    103   
        })?;
   75    104   
        builder = builder.header("X-B", header_value);
         105  +
        /* HttpBindingGenerator.kt:592 */
   76    106   
    }
         107  +
    /* HttpBindingGenerator.kt:592 */
   77    108   
    if let ::std::option::Option::Some(inner_5) = &input.c {
   78         -
        // Empty vec in header is serialized as an empty string
         109  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
   79    110   
        if inner_5.is_empty() {
   80    111   
            builder = builder.header("X-C", "");
   81    112   
        } else {
         113  +
            /* HttpBindingGenerator.kt:646 */
   82    114   
            for inner_6 in inner_5 {
         115  +
                /* HttpBindingGenerator.kt:704 */
   83    116   
                let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
         117  +
                /* HttpBindingGenerator.kt:706 */
   84    118   
                let header_value = formatted_7;
   85    119   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   86    120   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   87    121   
                        "c",
   88    122   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   89    123   
                    )
   90    124   
                })?;
   91    125   
                builder = builder.header("X-C", header_value);
         126  +
                /* HttpBindingGenerator.kt:646 */
   92    127   
            }
         128  +
            /* HttpBindingGenerator.kt:638 */
   93    129   
        }
         130  +
        /* HttpBindingGenerator.kt:592 */
   94    131   
    }
         132  +
    /* HttpBindingGenerator.kt:555 */
   95    133   
    Ok(builder)
         134  +
    /* HttpBindingGenerator.kt:542 */
   96    135   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_null_and_empty_headers_client_output.rs

@@ -1,1 +22,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_a_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-A");
           8  +
    /* HttpBindingGenerator.kt:375 */
    6      9   
    ::aws_smithy_http::header::one_or_none(headers)
          10  +
    /* HttpBindingGenerator.kt:153 */
    7     11   
}
    8     12   
          13  +
/* HttpBindingGenerator.kt:153 */
    9     14   
pub(crate) fn de_b_header(
   10     15   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   11     16   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          17  +
    /* HttpBindingGenerator.kt:160 */
   12     18   
    let headers = header_map.get_all("X-B");
          19  +
    /* HttpBindingGenerator.kt:375 */
   13     20   
    ::aws_smithy_http::header::one_or_none(headers)
          21  +
    /* HttpBindingGenerator.kt:153 */
   14     22   
}
   15     23   
          24  +
/* HttpBindingGenerator.kt:153 */
   16     25   
pub(crate) fn de_c_header(
   17     26   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   18     27   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
          28  +
    /* HttpBindingGenerator.kt:160 */
   19     29   
    let headers = header_map.get_all("X-C");
          30  +
    /* HttpBindingGenerator.kt:409 */
   20     31   
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          32  +
    /* HttpBindingGenerator.kt:430 */
   21     33   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          34  +
    /* HttpBindingGenerator.kt:153 */
   22     35   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_null_and_empty_headers_server.rs

@@ -1,1 +96,135 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_null_and_empty_headers_server_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
    9     11   
    crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError::generic(
   16     22   
        generic,
   17     23   
    ))
          24  +
    /* ProtocolParserGenerator.kt:99 */
   18     25   
}
   19     26   
          27  +
/* RustType.kt:516 */
   20     28   
#[allow(clippy::unnecessary_wraps)]
          29  +
/* ProtocolParserGenerator.kt:71 */
   21     30   
pub fn de_null_and_empty_headers_server_http_response(
   22     31   
    _response_status: u16,
   23     32   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24     33   
    _response_body: &[u8],
   25     34   
) -> std::result::Result<
   26     35   
    crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   27     36   
    crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   28     37   
> {
          38  +
    /* ProtocolParserGenerator.kt:77 */
   29     39   
    Ok({
          40  +
        /* RustType.kt:516 */
   30     41   
        #[allow(unused_mut)]
          42  +
        /* ProtocolParserGenerator.kt:240 */
   31     43   
        let mut output = crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:267 */
   32     45   
        output = output.set_a(
          46  +
            /* ProtocolParserGenerator.kt:302 */
   33     47   
            crate::protocol_serde::shape_null_and_empty_headers_server_output::de_a_header(_response_headers).map_err(|_| {
   34     48   
                crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError::unhandled("Failed to parse a from header `X-A")
   35         -
            })?,
          49  +
            })?, /* ProtocolParserGenerator.kt:267 */
   36     50   
        );
          51  +
        /* ProtocolParserGenerator.kt:267 */
   37     52   
        output = output.set_b(
          53  +
            /* ProtocolParserGenerator.kt:302 */
   38     54   
            crate::protocol_serde::shape_null_and_empty_headers_server_output::de_b_header(_response_headers).map_err(|_| {
   39     55   
                crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError::unhandled("Failed to parse b from header `X-B")
   40         -
            })?,
          56  +
            })?, /* ProtocolParserGenerator.kt:267 */
   41     57   
        );
          58  +
        /* ProtocolParserGenerator.kt:267 */
   42     59   
        output = output.set_c(
          60  +
            /* ProtocolParserGenerator.kt:302 */
   43     61   
            crate::protocol_serde::shape_null_and_empty_headers_server_output::de_c_header(_response_headers).map_err(|_| {
   44     62   
                crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError::unhandled("Failed to parse c from header `X-C")
   45         -
            })?,
          63  +
            })?, /* ProtocolParserGenerator.kt:267 */
   46     64   
        );
          65  +
        /* ClientBuilderInstantiator.kt:56 */
   47     66   
        output.build()
          67  +
        /* ProtocolParserGenerator.kt:77 */
   48     68   
    })
          69  +
    /* ProtocolParserGenerator.kt:71 */
   49     70   
}
   50     71   
          72  +
/* HttpBindingGenerator.kt:542 */
   51     73   
pub fn ser_null_and_empty_headers_server_headers(
   52     74   
    input: &crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput,
   53     75   
    mut builder: ::http::request::Builder,
   54     76   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          77  +
    /* HttpBindingGenerator.kt:592 */
   55     78   
    if let ::std::option::Option::Some(inner_1) = &input.a {
          79  +
        /* HttpBindingGenerator.kt:704 */
   56     80   
        let formatted_2 = inner_1.as_str();
          81  +
        /* HttpBindingGenerator.kt:706 */
   57     82   
        let header_value = formatted_2;
   58     83   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   59     84   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   60     85   
                "a",
   61     86   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   62     87   
            )
   63     88   
        })?;
   64     89   
        builder = builder.header("X-A", header_value);
          90  +
        /* HttpBindingGenerator.kt:592 */
   65     91   
    }
          92  +
    /* HttpBindingGenerator.kt:592 */
   66     93   
    if let ::std::option::Option::Some(inner_3) = &input.b {
          94  +
        /* HttpBindingGenerator.kt:704 */
   67     95   
        let formatted_4 = inner_3.as_str();
          96  +
        /* HttpBindingGenerator.kt:706 */
   68     97   
        let header_value = formatted_4;
   69     98   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   70     99   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   71    100   
                "b",
   72    101   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   73    102   
            )
   74    103   
        })?;
   75    104   
        builder = builder.header("X-B", header_value);
         105  +
        /* HttpBindingGenerator.kt:592 */
   76    106   
    }
         107  +
    /* HttpBindingGenerator.kt:592 */
   77    108   
    if let ::std::option::Option::Some(inner_5) = &input.c {
   78         -
        // Empty vec in header is serialized as an empty string
         109  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
   79    110   
        if inner_5.is_empty() {
   80    111   
            builder = builder.header("X-C", "");
   81    112   
        } else {
         113  +
            /* HttpBindingGenerator.kt:646 */
   82    114   
            for inner_6 in inner_5 {
         115  +
                /* HttpBindingGenerator.kt:704 */
   83    116   
                let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
         117  +
                /* HttpBindingGenerator.kt:706 */
   84    118   
                let header_value = formatted_7;
   85    119   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   86    120   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   87    121   
                        "c",
   88    122   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   89    123   
                    )
   90    124   
                })?;
   91    125   
                builder = builder.header("X-C", header_value);
         126  +
                /* HttpBindingGenerator.kt:646 */
   92    127   
            }
         128  +
            /* HttpBindingGenerator.kt:638 */
   93    129   
        }
         130  +
        /* HttpBindingGenerator.kt:592 */
   94    131   
    }
         132  +
    /* HttpBindingGenerator.kt:555 */
   95    133   
    Ok(builder)
         134  +
    /* HttpBindingGenerator.kt:542 */
   96    135   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_null_and_empty_headers_server_output.rs

@@ -1,1 +22,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_a_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-A");
           8  +
    /* HttpBindingGenerator.kt:375 */
    6      9   
    ::aws_smithy_http::header::one_or_none(headers)
          10  +
    /* HttpBindingGenerator.kt:153 */
    7     11   
}
    8     12   
          13  +
/* HttpBindingGenerator.kt:153 */
    9     14   
pub(crate) fn de_b_header(
   10     15   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   11     16   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          17  +
    /* HttpBindingGenerator.kt:160 */
   12     18   
    let headers = header_map.get_all("X-B");
          19  +
    /* HttpBindingGenerator.kt:375 */
   13     20   
    ::aws_smithy_http::header::one_or_none(headers)
          21  +
    /* HttpBindingGenerator.kt:153 */
   14     22   
}
   15     23   
          24  +
/* HttpBindingGenerator.kt:153 */
   16     25   
pub(crate) fn de_c_header(
   17     26   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   18     27   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
          28  +
    /* HttpBindingGenerator.kt:160 */
   19     29   
    let headers = header_map.get_all("X-C");
          30  +
    /* HttpBindingGenerator.kt:409 */
   20     31   
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          32  +
    /* HttpBindingGenerator.kt:430 */
   21     33   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          34  +
    /* HttpBindingGenerator.kt:153 */
   22     35   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_omits_null_serializes_empty_string.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_omits_null_serializes_empty_string_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
    9     11   
    crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_omits_null_serializes_empty_string_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   25     34   
    crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_payload_with_xml_name.rs

@@ -1,1 +41,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::needless_question_mark)]
           4  +
/* XmlBindingTraitParserGenerator.kt:510 */
    3      5   
pub fn de_payload_with_xml_name(
    4      6   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    5      7   
) -> ::std::result::Result<crate::types::PayloadWithXmlName, ::aws_smithy_xml::decode::XmlDecodeError> {
           8  +
    /* RustType.kt:516 */
    6      9   
    #[allow(unused_mut)]
          10  +
    /* XmlBindingTraitParserGenerator.kt:515 */
    7     11   
    let mut builder = crate::types::PayloadWithXmlName::builder();
          12  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    8     13   
    while let Some(mut tag) = decoder.next_tag() {
          14  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    9     15   
        match tag.start_el() {
   10         -
            s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlName$name */ =>  {
   11         -
                let var_1 =
   12         -
                    Some(
   13         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   14         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   15         -
                            .into()
   16         -
                        )
   17         -
                        ?
   18         -
                    )
   19         -
                ;
   20         -
                builder = builder.set_name(var_1);
   21         -
            }
          16  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlName$name */ =>  {
          17  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          18  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          19  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          20  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          21  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          22  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          23  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          24  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          25  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          26  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_name(var_1);
          27  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   22     28   
            ,
   23         -
            _ => {}
   24         -
        }
          29  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          30  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          31  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   25     32   
    }
          33  +
    /* XmlBindingTraitParserGenerator.kt:533 */
   26     34   
    Ok(builder.build())
          35  +
    /* XmlBindingTraitParserGenerator.kt:510 */
   27     36   
}
   28     37   
          38  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
   29     39   
pub fn ser_payload_with_xml_name(
   30     40   
    input: &crate::types::PayloadWithXmlName,
   31     41   
    writer: ::aws_smithy_xml::encode::ElWriter,
   32     42   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          43  +
    /* RustType.kt:516 */
   33     44   
    #[allow(unused_mut)]
          45  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
   34     46   
    let mut scope = writer.finish();
          47  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   35     48   
    if let Some(var_2) = &input.name {
          49  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   36     50   
        let mut inner_writer = scope.start_el("name").finish();
   37         -
        inner_writer.data(var_2.as_str());
          51  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          52  +
        inner_writer.data(
          53  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */ var_2.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          54  +
        );
          55  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   38     56   
    }
          57  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   39     58   
    scope.finish();
          59  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   40     60   
    Ok(())
          61  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   41     62   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_payload_with_xml_namespace.rs

@@ -1,1 +41,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_payload_with_xml_namespace(
    3      4   
    input: &crate::types::PayloadWithXmlNamespace,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.name {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("name").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */ var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          18  +
        );
          19  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     20   
    }
          21  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   12     22   
    scope.finish();
          23  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   13     24   
    Ok(())
          25  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   14     26   
}
   15     27   
          28  +
/* RustType.kt:516 */
   16     29   
#[allow(clippy::needless_question_mark)]
          30  +
/* XmlBindingTraitParserGenerator.kt:510 */
   17     31   
pub fn de_payload_with_xml_namespace(
   18     32   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   19     33   
) -> ::std::result::Result<crate::types::PayloadWithXmlNamespace, ::aws_smithy_xml::decode::XmlDecodeError> {
          34  +
    /* RustType.kt:516 */
   20     35   
    #[allow(unused_mut)]
          36  +
    /* XmlBindingTraitParserGenerator.kt:515 */
   21     37   
    let mut builder = crate::types::PayloadWithXmlNamespace::builder();
          38  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   22     39   
    while let Some(mut tag) = decoder.next_tag() {
          40  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   23     41   
        match tag.start_el() {
   24         -
            s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlNamespace$name */ =>  {
   25         -
                let var_2 =
   26         -
                    Some(
   27         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   28         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   29         -
                            .into()
   30         -
                        )
   31         -
                        ?
   32         -
                    )
   33         -
                ;
   34         -
                builder = builder.set_name(var_2);
   35         -
            }
          42  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlNamespace$name */ =>  {
          43  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
          44  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          45  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          46  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          47  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          48  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          49  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          50  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          51  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          52  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_name(var_2);
          53  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   36     54   
            ,
   37         -
            _ => {}
   38         -
        }
          55  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          56  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          57  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   39     58   
    }
          59  +
    /* XmlBindingTraitParserGenerator.kt:533 */
   40     60   
    Ok(builder.build())
          61  +
    /* XmlBindingTraitParserGenerator.kt:510 */
   41     62   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_payload_with_xml_namespace_and_prefix.rs

@@ -1,1 +41,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_payload_with_xml_namespace_and_prefix(
    3      4   
    input: &crate::types::PayloadWithXmlNamespaceAndPrefix,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.name {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("name").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */ var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          18  +
        );
          19  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     20   
    }
          21  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   12     22   
    scope.finish();
          23  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   13     24   
    Ok(())
          25  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   14     26   
}
   15     27   
          28  +
/* RustType.kt:516 */
   16     29   
#[allow(clippy::needless_question_mark)]
          30  +
/* XmlBindingTraitParserGenerator.kt:510 */
   17     31   
pub fn de_payload_with_xml_namespace_and_prefix(
   18     32   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   19     33   
) -> ::std::result::Result<crate::types::PayloadWithXmlNamespaceAndPrefix, ::aws_smithy_xml::decode::XmlDecodeError> {
          34  +
    /* RustType.kt:516 */
   20     35   
    #[allow(unused_mut)]
          36  +
    /* XmlBindingTraitParserGenerator.kt:515 */
   21     37   
    let mut builder = crate::types::PayloadWithXmlNamespaceAndPrefix::builder();
          38  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   22     39   
    while let Some(mut tag) = decoder.next_tag() {
          40  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   23     41   
        match tag.start_el() {
   24         -
            s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlNamespaceAndPrefix$name */ =>  {
   25         -
                let var_2 =
   26         -
                    Some(
   27         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   28         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   29         -
                            .into()
   30         -
                        )
   31         -
                        ?
   32         -
                    )
   33         -
                ;
   34         -
                builder = builder.set_name(var_2);
   35         -
            }
          42  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("name") /* name aws.protocoltests.restxml#PayloadWithXmlNamespaceAndPrefix$name */ =>  {
          43  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
          44  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          45  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          46  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          47  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          48  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          49  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          50  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          51  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          52  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_name(var_2);
          53  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   36     54   
            ,
   37         -
            _ => {}
   38         -
        }
          55  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          56  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          57  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   39     58   
    }
          59  +
    /* XmlBindingTraitParserGenerator.kt:533 */
   40     60   
    Ok(builder.build())
          61  +
    /* XmlBindingTraitParserGenerator.kt:510 */
   41     62   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +63,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_put_with_content_encoding_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
    9     11   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_put_with_content_encoding_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   25     34   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* HttpBindingGenerator.kt:542 */
   34     50   
pub fn ser_put_with_content_encoding_headers(
   35     51   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   36     52   
    mut builder: ::http::request::Builder,
   37     53   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          54  +
    /* HttpBindingGenerator.kt:592 */
   38     55   
    if let ::std::option::Option::Some(inner_1) = &input.encoding {
          56  +
        /* HttpBindingGenerator.kt:704 */
   39     57   
        let formatted_2 = inner_1.as_str();
          58  +
        /* HttpBindingGenerator.kt:706 */
   40     59   
        let header_value = formatted_2;
   41     60   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   42     61   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   43     62   
                "encoding",
   44     63   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   45     64   
            )
   46     65   
        })?;
   47     66   
        builder = builder.header("Content-Encoding", header_value);
          67  +
        /* HttpBindingGenerator.kt:592 */
   48     68   
    }
          69  +
    /* HttpBindingGenerator.kt:555 */
   49     70   
    Ok(builder)
          71  +
    /* HttpBindingGenerator.kt:542 */
   50     72   
}
   51     73   
          74  +
/* XmlBindingTraitSerializerGenerator.kt:116 */
   52     75   
pub fn ser_put_with_content_encoding_op_input(
   53     76   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   54     77   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          78  +
    /* XmlBindingTraitSerializerGenerator.kt:120 */
   55     79   
    let mut out = String::new();
          80  +
    /* XmlBindingTraitSerializerGenerator.kt:124 */
   56     81   
    {
          82  +
        /* XmlBindingTraitSerializerGenerator.kt:125 */
   57     83   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
   58     84   
        #[allow(unused_mut)]
   59     85   
        let mut root = writer.start_el("PutWithContentEncodingInput");
          86  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   60     87   
        crate::protocol_serde::shape_put_with_content_encoding_input::ser_put_with_content_encoding_input_input_input(input, root)?
          88  +
        /* XmlBindingTraitSerializerGenerator.kt:124 */
   61     89   
    }
          90  +
    /* XmlBindingTraitSerializerGenerator.kt:137 */
   62     91   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          92  +
    /* XmlBindingTraitSerializerGenerator.kt:116 */
   63     93   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding_input.rs

@@ -1,1 +14,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_put_with_content_encoding_input_input_input(
    3      4   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.data {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("data").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */ var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          18  +
        );
          19  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     20   
    }
          21  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   12     22   
    scope.finish();
          23  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   13     24   
    Ok(())
          25  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   14     26   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_query_idempotency_token_auto_fill.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_query_idempotency_token_auto_fill_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
    9     11   
    crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_query_idempotency_token_auto_fill_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   25     34   
    crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_query_params_as_string_list_map.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_query_params_as_string_list_map_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
    9     11   
    crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_query_params_as_string_list_map_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   25     34   
    crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_query_precedence.rs

@@ -1,1 +26,41 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_query_precedence_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::query_precedence::QueryPrecedenceOutput, crate::operation::query_precedence::QueryPrecedenceError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::query_precedence::QueryPrecedenceError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::query_precedence::QueryPrecedenceError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_query_precedence_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::query_precedence::QueryPrecedenceOutput, crate::operation::query_precedence::QueryPrecedenceError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/protocol_serde/shape_recursive_shapes.rs

@@ -1,1 +76,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_recursive_shapes_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::recursive_shapes::RecursiveShapesOutput, crate::operation::recursive_shapes::RecursiveShapesError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::recursive_shapes::RecursiveShapesError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::recursive_shapes::RecursiveShapesError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_recursive_shapes_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::recursive_shapes::RecursiveShapesOutput, crate::operation::recursive_shapes::RecursiveShapesError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output = crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes(_response_body, output)
   25     38   
            .map_err(crate::operation::recursive_shapes::RecursiveShapesError::unhandled)?;
          39  +
        /* ClientBuilderInstantiator.kt:56 */
   26     40   
        output.build()
          41  +
        /* ProtocolParserGenerator.kt:77 */
   27     42   
    })
          43  +
    /* ProtocolParserGenerator.kt:71 */
   28     44   
}
   29     45   
          46  +
/* XmlBindingTraitSerializerGenerator.kt:116 */
   30     47   
pub fn ser_recursive_shapes_op_input(
   31     48   
    input: &crate::operation::recursive_shapes::RecursiveShapesInput,
   32     49   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          50  +
    /* XmlBindingTraitSerializerGenerator.kt:120 */
   33     51   
    let mut out = String::new();
          52  +
    /* XmlBindingTraitSerializerGenerator.kt:124 */
   34     53   
    {
          54  +
        /* XmlBindingTraitSerializerGenerator.kt:125 */
   35     55   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
   36     56   
        #[allow(unused_mut)]
   37     57   
        let mut root = writer.start_el("RecursiveShapesRequest");
          58  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   38     59   
        crate::protocol_serde::shape_recursive_shapes_input::ser_recursive_shapes_input_input_input(input, root)?
          60  +
        /* XmlBindingTraitSerializerGenerator.kt:124 */
   39     61   
    }
          62  +
    /* XmlBindingTraitSerializerGenerator.kt:137 */
   40     63   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          64  +
    /* XmlBindingTraitSerializerGenerator.kt:116 */
   41     65   
}
   42     66   
          67  +
/* RustType.kt:516 */
   43     68   
#[allow(unused_mut)]
          69  +
/* XmlBindingTraitParserGenerator.kt:189 */
   44     70   
pub fn de_recursive_shapes(
   45     71   
    inp: &[u8],
   46     72   
    mut builder: crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder,
   47     73   
) -> std::result::Result<crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
          74  +
    /* XmlBindingTraitParserGenerator.kt:194 */
   48     75   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   49     76   
   50     77   
    #[allow(unused_mut)]
   51     78   
    let mut decoder = doc.root_element()?;
   52     79   
    #[allow(unused_variables)]
   53     80   
    let start_el = decoder.start_el();
          81  +
    /* RestXmlParserGenerator.kt:36 */
   54     82   
    if !start_el.matches("RecursiveShapesResponse") {
   55     83   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   56     84   
            "encountered invalid XML root: expected RecursiveShapesResponse but got {:?}. This is likely a bug in the SDK.",
   57     85   
            start_el
   58     86   
        )));
   59     87   
    }
          88  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   60     89   
    while let Some(mut tag) = decoder.next_tag() {
          90  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   61     91   
        match tag.start_el() {
   62         -
            s if s.matches("nested") /* nested aws.protocoltests.restxml.synthetic#RecursiveShapesOutput$nested */ =>  {
   63         -
                let var_1 =
   64         -
                    Some(
   65         -
                        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(&mut tag)
   66         -
                        ?
   67         -
                    )
   68         -
                ;
   69         -
                builder = builder.set_nested(var_1);
   70         -
            }
          92  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("nested") /* nested aws.protocoltests.restxml.synthetic#RecursiveShapesOutput$nested */ =>  {
          93  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          94  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          95  +
                        /* XmlBindingTraitParserGenerator.kt:536 */crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(&mut tag)
          96  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          97  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          98  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          99  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_nested(var_1);
         100  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   71    101   
            ,
   72         -
            _ => {}
   73         -
        }
         102  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
         103  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
         104  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   74    105   
    }
         106  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   75    107   
    Ok(builder)
         108  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   76    109   
}