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_input_and_output_with_headers.rs

@@ -1,1 +381,523 @@
    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_input_and_output_with_headers_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::input_and_output_with_headers::InputAndOutputWithHeadersOutput,
    9     11   
    crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError,
   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::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::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_input_and_output_with_headers_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::input_and_output_with_headers::InputAndOutputWithHeadersOutput,
   27     36   
    crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError,
   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::input_and_output_with_headers::builders::InputAndOutputWithHeadersOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:267 */
   32     45   
        output = output.set_header_boolean_list(
          46  +
            /* ProtocolParserGenerator.kt:302 */
   33     47   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_boolean_list_header(_response_headers).map_err(|_| {
   34     48   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   35     49   
                    "Failed to parse headerBooleanList from header `X-BooleanList",
   36     50   
                )
   37         -
            })?,
          51  +
            })?, /* ProtocolParserGenerator.kt:267 */
   38     52   
        );
          53  +
        /* ProtocolParserGenerator.kt:267 */
   39     54   
        output = output.set_header_byte(
          55  +
            /* ProtocolParserGenerator.kt:302 */
   40     56   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_byte_header(_response_headers).map_err(|_| {
   41     57   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   42     58   
                    "Failed to parse headerByte from header `X-Byte",
   43     59   
                )
   44         -
            })?,
          60  +
            })?, /* ProtocolParserGenerator.kt:267 */
   45     61   
        );
          62  +
        /* ProtocolParserGenerator.kt:267 */
   46     63   
        output = output.set_header_double(
          64  +
            /* ProtocolParserGenerator.kt:302 */
   47     65   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_double_header(_response_headers).map_err(|_| {
   48     66   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   49     67   
                    "Failed to parse headerDouble from header `X-Double",
   50     68   
                )
   51         -
            })?,
          69  +
            })?, /* ProtocolParserGenerator.kt:267 */
   52     70   
        );
          71  +
        /* ProtocolParserGenerator.kt:267 */
   53     72   
        output = output.set_header_enum(
          73  +
            /* ProtocolParserGenerator.kt:302 */
   54     74   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_enum_header(_response_headers).map_err(|_| {
   55     75   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   56     76   
                    "Failed to parse headerEnum from header `X-Enum",
   57     77   
                )
   58         -
            })?,
          78  +
            })?, /* ProtocolParserGenerator.kt:267 */
   59     79   
        );
          80  +
        /* ProtocolParserGenerator.kt:267 */
   60     81   
        output = output.set_header_enum_list(
          82  +
            /* ProtocolParserGenerator.kt:302 */
   61     83   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_enum_list_header(_response_headers).map_err(|_| {
   62     84   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   63     85   
                    "Failed to parse headerEnumList from header `X-EnumList",
   64     86   
                )
   65         -
            })?,
          87  +
            })?, /* ProtocolParserGenerator.kt:267 */
   66     88   
        );
          89  +
        /* ProtocolParserGenerator.kt:267 */
   67     90   
        output = output.set_header_false_bool(
          91  +
            /* ProtocolParserGenerator.kt:302 */
   68     92   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_false_bool_header(_response_headers).map_err(|_| {
   69     93   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   70     94   
                    "Failed to parse headerFalseBool from header `X-Boolean2",
   71     95   
                )
   72         -
            })?,
          96  +
            })?, /* ProtocolParserGenerator.kt:267 */
   73     97   
        );
          98  +
        /* ProtocolParserGenerator.kt:267 */
   74     99   
        output = output.set_header_float(
         100  +
            /* ProtocolParserGenerator.kt:302 */
   75    101   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_float_header(_response_headers).map_err(|_| {
   76    102   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   77    103   
                    "Failed to parse headerFloat from header `X-Float",
   78    104   
                )
   79         -
            })?,
         105  +
            })?, /* ProtocolParserGenerator.kt:267 */
   80    106   
        );
         107  +
        /* ProtocolParserGenerator.kt:267 */
   81    108   
        output = output.set_header_integer(
         109  +
            /* ProtocolParserGenerator.kt:302 */
   82    110   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_integer_header(_response_headers).map_err(|_| {
   83    111   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   84    112   
                    "Failed to parse headerInteger from header `X-Integer",
   85    113   
                )
   86         -
            })?,
         114  +
            })?, /* ProtocolParserGenerator.kt:267 */
   87    115   
        );
         116  +
        /* ProtocolParserGenerator.kt:267 */
   88    117   
        output = output.set_header_integer_list(
         118  +
            /* ProtocolParserGenerator.kt:302 */
   89    119   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_integer_list_header(_response_headers).map_err(|_| {
   90    120   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   91    121   
                    "Failed to parse headerIntegerList from header `X-IntegerList",
   92    122   
                )
   93         -
            })?,
         123  +
            })?, /* ProtocolParserGenerator.kt:267 */
   94    124   
        );
         125  +
        /* ProtocolParserGenerator.kt:267 */
   95    126   
        output = output.set_header_long(
         127  +
            /* ProtocolParserGenerator.kt:302 */
   96    128   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_long_header(_response_headers).map_err(|_| {
   97    129   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
   98    130   
                    "Failed to parse headerLong from header `X-Long",
   99    131   
                )
  100         -
            })?,
         132  +
            })?, /* ProtocolParserGenerator.kt:267 */
  101    133   
        );
         134  +
        /* ProtocolParserGenerator.kt:267 */
  102    135   
        output = output.set_header_short(
         136  +
            /* ProtocolParserGenerator.kt:302 */
  103    137   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_short_header(_response_headers).map_err(|_| {
  104    138   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  105    139   
                    "Failed to parse headerShort from header `X-Short",
  106    140   
                )
  107         -
            })?,
         141  +
            })?, /* ProtocolParserGenerator.kt:267 */
  108    142   
        );
         143  +
        /* ProtocolParserGenerator.kt:267 */
  109    144   
        output = output.set_header_string(
         145  +
            /* ProtocolParserGenerator.kt:302 */
  110    146   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_string_header(_response_headers).map_err(|_| {
  111    147   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  112    148   
                    "Failed to parse headerString from header `X-String",
  113    149   
                )
  114         -
            })?,
         150  +
            })?, /* ProtocolParserGenerator.kt:267 */
  115    151   
        );
         152  +
        /* ProtocolParserGenerator.kt:267 */
  116    153   
        output = output.set_header_string_list(
         154  +
            /* ProtocolParserGenerator.kt:302 */
  117    155   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_string_list_header(_response_headers).map_err(|_| {
  118    156   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  119    157   
                    "Failed to parse headerStringList from header `X-StringList",
  120    158   
                )
  121         -
            })?,
         159  +
            })?, /* ProtocolParserGenerator.kt:267 */
  122    160   
        );
         161  +
        /* ProtocolParserGenerator.kt:267 */
  123    162   
        output = output.set_header_string_set(
         163  +
            /* ProtocolParserGenerator.kt:302 */
  124    164   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_string_set_header(_response_headers).map_err(|_| {
  125    165   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  126    166   
                    "Failed to parse headerStringSet from header `X-StringSet",
  127    167   
                )
  128         -
            })?,
         168  +
            })?, /* ProtocolParserGenerator.kt:267 */
  129    169   
        );
         170  +
        /* ProtocolParserGenerator.kt:267 */
  130    171   
        output = output.set_header_timestamp_list(
         172  +
            /* ProtocolParserGenerator.kt:302 */
  131    173   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_timestamp_list_header(_response_headers).map_err(|_| {
  132    174   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  133    175   
                    "Failed to parse headerTimestampList from header `X-TimestampList",
  134    176   
                )
  135         -
            })?,
         177  +
            })?, /* ProtocolParserGenerator.kt:267 */
  136    178   
        );
         179  +
        /* ProtocolParserGenerator.kt:267 */
  137    180   
        output = output.set_header_true_bool(
         181  +
            /* ProtocolParserGenerator.kt:302 */
  138    182   
            crate::protocol_serde::shape_input_and_output_with_headers_output::de_header_true_bool_header(_response_headers).map_err(|_| {
  139    183   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::unhandled(
  140    184   
                    "Failed to parse headerTrueBool from header `X-Boolean1",
  141    185   
                )
  142         -
            })?,
         186  +
            })?, /* ProtocolParserGenerator.kt:267 */
  143    187   
        );
         188  +
        /* ClientBuilderInstantiator.kt:56 */
  144    189   
        output.build()
         190  +
        /* ProtocolParserGenerator.kt:77 */
  145    191   
    })
         192  +
    /* ProtocolParserGenerator.kt:71 */
  146    193   
}
  147    194   
         195  +
/* HttpBindingGenerator.kt:542 */
  148    196   
pub fn ser_input_and_output_with_headers_headers(
  149    197   
    input: &crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput,
  150    198   
    mut builder: ::http::request::Builder,
  151    199   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         200  +
    /* HttpBindingGenerator.kt:592 */
  152    201   
    if let ::std::option::Option::Some(inner_1) = &input.header_string {
         202  +
        /* HttpBindingGenerator.kt:704 */
  153    203   
        let formatted_2 = inner_1.as_str();
         204  +
        /* HttpBindingGenerator.kt:706 */
  154    205   
        let header_value = formatted_2;
  155    206   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  156    207   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  157    208   
                "header_string",
  158    209   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  159    210   
            )
  160    211   
        })?;
  161    212   
        builder = builder.header("X-String", header_value);
         213  +
        /* HttpBindingGenerator.kt:592 */
  162    214   
    }
         215  +
    /* HttpBindingGenerator.kt:592 */
  163    216   
    if let ::std::option::Option::Some(inner_3) = &input.header_byte {
         217  +
        /* HttpBindingGenerator.kt:690 */
  164    218   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
         219  +
        /* HttpBindingGenerator.kt:704 */
  165    220   
        let formatted_4 = encoder.encode();
         221  +
        /* HttpBindingGenerator.kt:706 */
  166    222   
        let header_value = formatted_4;
  167    223   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  168    224   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  169    225   
                "header_byte",
  170    226   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  171    227   
            )
  172    228   
        })?;
  173    229   
        builder = builder.header("X-Byte", header_value);
         230  +
        /* HttpBindingGenerator.kt:592 */
  174    231   
    }
         232  +
    /* HttpBindingGenerator.kt:592 */
  175    233   
    if let ::std::option::Option::Some(inner_5) = &input.header_short {
         234  +
        /* HttpBindingGenerator.kt:690 */
  176    235   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
         236  +
        /* HttpBindingGenerator.kt:704 */
  177    237   
        let formatted_6 = encoder.encode();
         238  +
        /* HttpBindingGenerator.kt:706 */
  178    239   
        let header_value = formatted_6;
  179    240   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  180    241   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  181    242   
                "header_short",
  182    243   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  183    244   
            )
  184    245   
        })?;
  185    246   
        builder = builder.header("X-Short", header_value);
         247  +
        /* HttpBindingGenerator.kt:592 */
  186    248   
    }
         249  +
    /* HttpBindingGenerator.kt:592 */
  187    250   
    if let ::std::option::Option::Some(inner_7) = &input.header_integer {
         251  +
        /* HttpBindingGenerator.kt:690 */
  188    252   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_7);
         253  +
        /* HttpBindingGenerator.kt:704 */
  189    254   
        let formatted_8 = encoder.encode();
         255  +
        /* HttpBindingGenerator.kt:706 */
  190    256   
        let header_value = formatted_8;
  191    257   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  192    258   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  193    259   
                "header_integer",
  194    260   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  195    261   
            )
  196    262   
        })?;
  197    263   
        builder = builder.header("X-Integer", header_value);
         264  +
        /* HttpBindingGenerator.kt:592 */
  198    265   
    }
         266  +
    /* HttpBindingGenerator.kt:592 */
  199    267   
    if let ::std::option::Option::Some(inner_9) = &input.header_long {
         268  +
        /* HttpBindingGenerator.kt:690 */
  200    269   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_9);
         270  +
        /* HttpBindingGenerator.kt:704 */
  201    271   
        let formatted_10 = encoder.encode();
         272  +
        /* HttpBindingGenerator.kt:706 */
  202    273   
        let header_value = formatted_10;
  203    274   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  204    275   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  205    276   
                "header_long",
  206    277   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  207    278   
            )
  208    279   
        })?;
  209    280   
        builder = builder.header("X-Long", header_value);
         281  +
        /* HttpBindingGenerator.kt:592 */
  210    282   
    }
         283  +
    /* HttpBindingGenerator.kt:592 */
  211    284   
    if let ::std::option::Option::Some(inner_11) = &input.header_float {
         285  +
        /* HttpBindingGenerator.kt:690 */
  212    286   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_11);
         287  +
        /* HttpBindingGenerator.kt:704 */
  213    288   
        let formatted_12 = encoder.encode();
         289  +
        /* HttpBindingGenerator.kt:706 */
  214    290   
        let header_value = formatted_12;
  215    291   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  216    292   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  217    293   
                "header_float",
  218    294   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  219    295   
            )
  220    296   
        })?;
  221    297   
        builder = builder.header("X-Float", header_value);
         298  +
        /* HttpBindingGenerator.kt:592 */
  222    299   
    }
         300  +
    /* HttpBindingGenerator.kt:592 */
  223    301   
    if let ::std::option::Option::Some(inner_13) = &input.header_double {
         302  +
        /* HttpBindingGenerator.kt:690 */
  224    303   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_13);
         304  +
        /* HttpBindingGenerator.kt:704 */
  225    305   
        let formatted_14 = encoder.encode();
         306  +
        /* HttpBindingGenerator.kt:706 */
  226    307   
        let header_value = formatted_14;
  227    308   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  228    309   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  229    310   
                "header_double",
  230    311   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  231    312   
            )
  232    313   
        })?;
  233    314   
        builder = builder.header("X-Double", header_value);
         315  +
        /* HttpBindingGenerator.kt:592 */
  234    316   
    }
         317  +
    /* HttpBindingGenerator.kt:592 */
  235    318   
    if let ::std::option::Option::Some(inner_15) = &input.header_true_bool {
         319  +
        /* HttpBindingGenerator.kt:690 */
  236    320   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_15);
         321  +
        /* HttpBindingGenerator.kt:704 */
  237    322   
        let formatted_16 = encoder.encode();
         323  +
        /* HttpBindingGenerator.kt:706 */
  238    324   
        let header_value = formatted_16;
  239    325   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  240    326   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  241    327   
                "header_true_bool",
  242    328   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  243    329   
            )
  244    330   
        })?;
  245    331   
        builder = builder.header("X-Boolean1", header_value);
         332  +
        /* HttpBindingGenerator.kt:592 */
  246    333   
    }
         334  +
    /* HttpBindingGenerator.kt:592 */
  247    335   
    if let ::std::option::Option::Some(inner_17) = &input.header_false_bool {
         336  +
        /* HttpBindingGenerator.kt:690 */
  248    337   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
         338  +
        /* HttpBindingGenerator.kt:704 */
  249    339   
        let formatted_18 = encoder.encode();
         340  +
        /* HttpBindingGenerator.kt:706 */
  250    341   
        let header_value = formatted_18;
  251    342   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  252    343   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  253    344   
                "header_false_bool",
  254    345   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  255    346   
            )
  256    347   
        })?;
  257    348   
        builder = builder.header("X-Boolean2", header_value);
         349  +
        /* HttpBindingGenerator.kt:592 */
  258    350   
    }
         351  +
    /* HttpBindingGenerator.kt:592 */
  259    352   
    if let ::std::option::Option::Some(inner_19) = &input.header_string_list {
  260         -
        // Empty vec in header is serialized as an empty string
         353  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  261    354   
        if inner_19.is_empty() {
  262    355   
            builder = builder.header("X-StringList", "");
  263    356   
        } else {
         357  +
            /* HttpBindingGenerator.kt:646 */
  264    358   
            for inner_20 in inner_19 {
         359  +
                /* HttpBindingGenerator.kt:704 */
  265    360   
                let formatted_21 = ::aws_smithy_http::header::quote_header_value(inner_20.as_str());
         361  +
                /* HttpBindingGenerator.kt:706 */
  266    362   
                let header_value = formatted_21;
  267    363   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  268    364   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  269    365   
                        "header_string_list",
  270    366   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  271    367   
                    )
  272    368   
                })?;
  273    369   
                builder = builder.header("X-StringList", header_value);
         370  +
                /* HttpBindingGenerator.kt:646 */
  274    371   
            }
         372  +
            /* HttpBindingGenerator.kt:638 */
  275    373   
        }
         374  +
        /* HttpBindingGenerator.kt:592 */
  276    375   
    }
         376  +
    /* HttpBindingGenerator.kt:592 */
  277    377   
    if let ::std::option::Option::Some(inner_22) = &input.header_string_set {
  278         -
        // Empty vec in header is serialized as an empty string
         378  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  279    379   
        if inner_22.is_empty() {
  280    380   
            builder = builder.header("X-StringSet", "");
  281    381   
        } else {
         382  +
            /* HttpBindingGenerator.kt:646 */
  282    383   
            for inner_23 in inner_22 {
         384  +
                /* HttpBindingGenerator.kt:704 */
  283    385   
                let formatted_24 = ::aws_smithy_http::header::quote_header_value(inner_23.as_str());
         386  +
                /* HttpBindingGenerator.kt:706 */
  284    387   
                let header_value = formatted_24;
  285    388   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  286    389   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  287    390   
                        "header_string_set",
  288    391   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  289    392   
                    )
  290    393   
                })?;
  291    394   
                builder = builder.header("X-StringSet", header_value);
         395  +
                /* HttpBindingGenerator.kt:646 */
  292    396   
            }
         397  +
            /* HttpBindingGenerator.kt:638 */
  293    398   
        }
         399  +
        /* HttpBindingGenerator.kt:592 */
  294    400   
    }
         401  +
    /* HttpBindingGenerator.kt:592 */
  295    402   
    if let ::std::option::Option::Some(inner_25) = &input.header_integer_list {
  296         -
        // Empty vec in header is serialized as an empty string
         403  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  297    404   
        if inner_25.is_empty() {
  298    405   
            builder = builder.header("X-IntegerList", "");
  299    406   
        } else {
         407  +
            /* HttpBindingGenerator.kt:646 */
  300    408   
            for inner_26 in inner_25 {
         409  +
                /* HttpBindingGenerator.kt:690 */
  301    410   
                let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_26);
         411  +
                /* HttpBindingGenerator.kt:704 */
  302    412   
                let formatted_27 = encoder.encode();
         413  +
                /* HttpBindingGenerator.kt:706 */
  303    414   
                let header_value = formatted_27;
  304    415   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  305    416   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  306    417   
                        "header_integer_list",
  307    418   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  308    419   
                    )
  309    420   
                })?;
  310    421   
                builder = builder.header("X-IntegerList", header_value);
         422  +
                /* HttpBindingGenerator.kt:646 */
  311    423   
            }
         424  +
            /* HttpBindingGenerator.kt:638 */
  312    425   
        }
         426  +
        /* HttpBindingGenerator.kt:592 */
  313    427   
    }
         428  +
    /* HttpBindingGenerator.kt:592 */
  314    429   
    if let ::std::option::Option::Some(inner_28) = &input.header_boolean_list {
  315         -
        // Empty vec in header is serialized as an empty string
         430  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  316    431   
        if inner_28.is_empty() {
  317    432   
            builder = builder.header("X-BooleanList", "");
  318    433   
        } else {
         434  +
            /* HttpBindingGenerator.kt:646 */
  319    435   
            for inner_29 in inner_28 {
         436  +
                /* HttpBindingGenerator.kt:690 */
  320    437   
                let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_29);
         438  +
                /* HttpBindingGenerator.kt:704 */
  321    439   
                let formatted_30 = encoder.encode();
         440  +
                /* HttpBindingGenerator.kt:706 */
  322    441   
                let header_value = formatted_30;
  323    442   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  324    443   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  325    444   
                        "header_boolean_list",
  326    445   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  327    446   
                    )
  328    447   
                })?;
  329    448   
                builder = builder.header("X-BooleanList", header_value);
         449  +
                /* HttpBindingGenerator.kt:646 */
  330    450   
            }
         451  +
            /* HttpBindingGenerator.kt:638 */
  331    452   
        }
         453  +
        /* HttpBindingGenerator.kt:592 */
  332    454   
    }
         455  +
    /* HttpBindingGenerator.kt:592 */
  333    456   
    if let ::std::option::Option::Some(inner_31) = &input.header_timestamp_list {
  334         -
        // Empty vec in header is serialized as an empty string
         457  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  335    458   
        if inner_31.is_empty() {
  336    459   
            builder = builder.header("X-TimestampList", "");
  337    460   
        } else {
         461  +
            /* HttpBindingGenerator.kt:646 */
  338    462   
            for inner_32 in inner_31 {
         463  +
                /* HttpBindingGenerator.kt:704 */
  339    464   
                let formatted_33 = inner_32.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
         465  +
                /* HttpBindingGenerator.kt:706 */
  340    466   
                let header_value = formatted_33;
  341    467   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  342    468   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  343    469   
                        "header_timestamp_list",
  344    470   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  345    471   
                    )
  346    472   
                })?;
  347    473   
                builder = builder.header("X-TimestampList", header_value);
         474  +
                /* HttpBindingGenerator.kt:646 */
  348    475   
            }
         476  +
            /* HttpBindingGenerator.kt:638 */
  349    477   
        }
         478  +
        /* HttpBindingGenerator.kt:592 */
  350    479   
    }
         480  +
    /* HttpBindingGenerator.kt:592 */
  351    481   
    if let ::std::option::Option::Some(inner_34) = &input.header_enum {
         482  +
        /* HttpBindingGenerator.kt:704 */
  352    483   
        let formatted_35 = inner_34.as_str();
         484  +
        /* HttpBindingGenerator.kt:706 */
  353    485   
        let header_value = formatted_35;
  354    486   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  355    487   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  356    488   
                "header_enum",
  357    489   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  358    490   
            )
  359    491   
        })?;
  360    492   
        builder = builder.header("X-Enum", header_value);
         493  +
        /* HttpBindingGenerator.kt:592 */
  361    494   
    }
         495  +
    /* HttpBindingGenerator.kt:592 */
  362    496   
    if let ::std::option::Option::Some(inner_36) = &input.header_enum_list {
  363         -
        // Empty vec in header is serialized as an empty string
         497  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  364    498   
        if inner_36.is_empty() {
  365    499   
            builder = builder.header("X-EnumList", "");
  366    500   
        } else {
         501  +
            /* HttpBindingGenerator.kt:646 */
  367    502   
            for inner_37 in inner_36 {
         503  +
                /* HttpBindingGenerator.kt:704 */
  368    504   
                let formatted_38 = ::aws_smithy_http::header::quote_header_value(inner_37.as_str());
         505  +
                /* HttpBindingGenerator.kt:706 */
  369    506   
                let header_value = formatted_38;
  370    507   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  371    508   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  372    509   
                        "header_enum_list",
  373    510   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  374    511   
                    )
  375    512   
                })?;
  376    513   
                builder = builder.header("X-EnumList", header_value);
         514  +
                /* HttpBindingGenerator.kt:646 */
  377    515   
            }
         516  +
            /* HttpBindingGenerator.kt:638 */
  378    517   
        }
         518  +
        /* HttpBindingGenerator.kt:592 */
  379    519   
    }
         520  +
    /* HttpBindingGenerator.kt:555 */
  380    521   
    Ok(builder)
         522  +
    /* HttpBindingGenerator.kt:542 */
  381    523   
}

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

@@ -1,1 +190,269 @@
    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_header_boolean_list_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<bool>>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-BooleanList");
           8  +
    /* HttpBindingGenerator.kt:404 */
    6      9   
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
          10  +
    /* HttpBindingGenerator.kt:430 */
    7     11   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          12  +
    /* HttpBindingGenerator.kt:153 */
    8     13   
}
    9     14   
          15  +
/* HttpBindingGenerator.kt:153 */
   10     16   
pub(crate) fn de_header_byte_header(
   11     17   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   12     18   
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_http::header::ParseError> {
          19  +
    /* HttpBindingGenerator.kt:160 */
   13     20   
    let headers = header_map.get_all("X-Byte");
          21  +
    /* HttpBindingGenerator.kt:404 */
   14     22   
    let var_2 = ::aws_smithy_http::header::read_many_primitive::<i8>(headers)?;
          23  +
    /* HttpBindingGenerator.kt:468 */
   15     24   
    if var_2.len() > 1 {
   16     25   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   17     26   
            "expected one item but found {}",
   18     27   
            var_2.len()
   19     28   
        )))
   20     29   
    } else {
   21     30   
        let mut var_2 = var_2;
   22     31   
        Ok(var_2.pop())
   23     32   
    }
          33  +
    /* HttpBindingGenerator.kt:153 */
   24     34   
}
   25     35   
          36  +
/* HttpBindingGenerator.kt:153 */
   26     37   
pub(crate) fn de_header_double_header(
   27     38   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   28     39   
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_http::header::ParseError> {
          40  +
    /* HttpBindingGenerator.kt:160 */
   29     41   
    let headers = header_map.get_all("X-Double");
          42  +
    /* HttpBindingGenerator.kt:404 */
   30     43   
    let var_3 = ::aws_smithy_http::header::read_many_primitive::<f64>(headers)?;
          44  +
    /* HttpBindingGenerator.kt:468 */
   31     45   
    if var_3.len() > 1 {
   32     46   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   33     47   
            "expected one item but found {}",
   34     48   
            var_3.len()
   35     49   
        )))
   36     50   
    } else {
   37     51   
        let mut var_3 = var_3;
   38     52   
        Ok(var_3.pop())
   39     53   
    }
          54  +
    /* HttpBindingGenerator.kt:153 */
   40     55   
}
   41     56   
          57  +
/* HttpBindingGenerator.kt:153 */
   42     58   
pub(crate) fn de_header_enum_header(
   43     59   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   44     60   
) -> ::std::result::Result<::std::option::Option<crate::types::FooEnum>, ::aws_smithy_http::header::ParseError> {
          61  +
    /* HttpBindingGenerator.kt:160 */
   45     62   
    let headers = header_map.get_all("X-Enum");
          63  +
    /* HttpBindingGenerator.kt:375 */
   46     64   
    ::aws_smithy_http::header::one_or_none(headers)
          65  +
    /* HttpBindingGenerator.kt:153 */
   47     66   
}
   48     67   
          68  +
/* HttpBindingGenerator.kt:153 */
   49     69   
pub(crate) fn de_header_enum_list_header(
   50     70   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   51     71   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>, ::aws_smithy_http::header::ParseError> {
          72  +
    /* HttpBindingGenerator.kt:160 */
   52     73   
    let headers = header_map.get_all("X-EnumList");
          74  +
    /* HttpBindingGenerator.kt:409 */
   53     75   
    let var_4: Vec<crate::types::FooEnum> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          76  +
    /* HttpBindingGenerator.kt:430 */
   54     77   
    Ok(if !var_4.is_empty() { Some(var_4) } else { None })
          78  +
    /* HttpBindingGenerator.kt:153 */
   55     79   
}
   56     80   
          81  +
/* HttpBindingGenerator.kt:153 */
   57     82   
pub(crate) fn de_header_false_bool_header(
   58     83   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   59     84   
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
          85  +
    /* HttpBindingGenerator.kt:160 */
   60     86   
    let headers = header_map.get_all("X-Boolean2");
          87  +
    /* HttpBindingGenerator.kt:404 */
   61     88   
    let var_5 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
          89  +
    /* HttpBindingGenerator.kt:468 */
   62     90   
    if var_5.len() > 1 {
   63     91   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   64     92   
            "expected one item but found {}",
   65     93   
            var_5.len()
   66     94   
        )))
   67     95   
    } else {
   68     96   
        let mut var_5 = var_5;
   69     97   
        Ok(var_5.pop())
   70     98   
    }
          99  +
    /* HttpBindingGenerator.kt:153 */
   71    100   
}
   72    101   
         102  +
/* HttpBindingGenerator.kt:153 */
   73    103   
pub(crate) fn de_header_float_header(
   74    104   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   75    105   
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_http::header::ParseError> {
         106  +
    /* HttpBindingGenerator.kt:160 */
   76    107   
    let headers = header_map.get_all("X-Float");
         108  +
    /* HttpBindingGenerator.kt:404 */
   77    109   
    let var_6 = ::aws_smithy_http::header::read_many_primitive::<f32>(headers)?;
         110  +
    /* HttpBindingGenerator.kt:468 */
   78    111   
    if var_6.len() > 1 {
   79    112   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   80    113   
            "expected one item but found {}",
   81    114   
            var_6.len()
   82    115   
        )))
   83    116   
    } else {
   84    117   
        let mut var_6 = var_6;
   85    118   
        Ok(var_6.pop())
   86    119   
    }
         120  +
    /* HttpBindingGenerator.kt:153 */
   87    121   
}
   88    122   
         123  +
/* HttpBindingGenerator.kt:153 */
   89    124   
pub(crate) fn de_header_integer_header(
   90    125   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   91    126   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
         127  +
    /* HttpBindingGenerator.kt:160 */
   92    128   
    let headers = header_map.get_all("X-Integer");
         129  +
    /* HttpBindingGenerator.kt:404 */
   93    130   
    let var_7 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         131  +
    /* HttpBindingGenerator.kt:468 */
   94    132   
    if var_7.len() > 1 {
   95    133   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   96    134   
            "expected one item but found {}",
   97    135   
            var_7.len()
   98    136   
        )))
   99    137   
    } else {
  100    138   
        let mut var_7 = var_7;
  101    139   
        Ok(var_7.pop())
  102    140   
    }
         141  +
    /* HttpBindingGenerator.kt:153 */
  103    142   
}
  104    143   
         144  +
/* HttpBindingGenerator.kt:153 */
  105    145   
pub(crate) fn de_header_integer_list_header(
  106    146   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  107    147   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<i32>>, ::aws_smithy_http::header::ParseError> {
         148  +
    /* HttpBindingGenerator.kt:160 */
  108    149   
    let headers = header_map.get_all("X-IntegerList");
         150  +
    /* HttpBindingGenerator.kt:404 */
  109    151   
    let var_8 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         152  +
    /* HttpBindingGenerator.kt:430 */
  110    153   
    Ok(if !var_8.is_empty() { Some(var_8) } else { None })
         154  +
    /* HttpBindingGenerator.kt:153 */
  111    155   
}
  112    156   
         157  +
/* HttpBindingGenerator.kt:153 */
  113    158   
pub(crate) fn de_header_long_header(
  114    159   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  115    160   
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_http::header::ParseError> {
         161  +
    /* HttpBindingGenerator.kt:160 */
  116    162   
    let headers = header_map.get_all("X-Long");
         163  +
    /* HttpBindingGenerator.kt:404 */
  117    164   
    let var_9 = ::aws_smithy_http::header::read_many_primitive::<i64>(headers)?;
         165  +
    /* HttpBindingGenerator.kt:468 */
  118    166   
    if var_9.len() > 1 {
  119    167   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  120    168   
            "expected one item but found {}",
  121    169   
            var_9.len()
  122    170   
        )))
  123    171   
    } else {
  124    172   
        let mut var_9 = var_9;
  125    173   
        Ok(var_9.pop())
  126    174   
    }
         175  +
    /* HttpBindingGenerator.kt:153 */
  127    176   
}
  128    177   
         178  +
/* HttpBindingGenerator.kt:153 */
  129    179   
pub(crate) fn de_header_short_header(
  130    180   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  131    181   
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_http::header::ParseError> {
         182  +
    /* HttpBindingGenerator.kt:160 */
  132    183   
    let headers = header_map.get_all("X-Short");
         184  +
    /* HttpBindingGenerator.kt:404 */
  133    185   
    let var_10 = ::aws_smithy_http::header::read_many_primitive::<i16>(headers)?;
         186  +
    /* HttpBindingGenerator.kt:468 */
  134    187   
    if var_10.len() > 1 {
  135    188   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  136    189   
            "expected one item but found {}",
  137    190   
            var_10.len()
  138    191   
        )))
  139    192   
    } else {
  140    193   
        let mut var_10 = var_10;
  141    194   
        Ok(var_10.pop())
  142    195   
    }
         196  +
    /* HttpBindingGenerator.kt:153 */
  143    197   
}
  144    198   
         199  +
/* HttpBindingGenerator.kt:153 */
  145    200   
pub(crate) fn de_header_string_header(
  146    201   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  147    202   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
         203  +
    /* HttpBindingGenerator.kt:160 */
  148    204   
    let headers = header_map.get_all("X-String");
         205  +
    /* HttpBindingGenerator.kt:375 */
  149    206   
    ::aws_smithy_http::header::one_or_none(headers)
         207  +
    /* HttpBindingGenerator.kt:153 */
  150    208   
}
  151    209   
         210  +
/* HttpBindingGenerator.kt:153 */
  152    211   
pub(crate) fn de_header_string_list_header(
  153    212   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  154    213   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
         214  +
    /* HttpBindingGenerator.kt:160 */
  155    215   
    let headers = header_map.get_all("X-StringList");
         216  +
    /* HttpBindingGenerator.kt:409 */
  156    217   
    let var_11: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
         218  +
    /* HttpBindingGenerator.kt:430 */
  157    219   
    Ok(if !var_11.is_empty() { Some(var_11) } else { None })
         220  +
    /* HttpBindingGenerator.kt:153 */
  158    221   
}
  159    222   
         223  +
/* HttpBindingGenerator.kt:153 */
  160    224   
pub(crate) fn de_header_string_set_header(
  161    225   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  162    226   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
         227  +
    /* HttpBindingGenerator.kt:160 */
  163    228   
    let headers = header_map.get_all("X-StringSet");
         229  +
    /* HttpBindingGenerator.kt:409 */
  164    230   
    let var_12: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
         231  +
    /* HttpBindingGenerator.kt:430 */
  165    232   
    Ok(if !var_12.is_empty() { Some(var_12) } else { None })
         233  +
    /* HttpBindingGenerator.kt:153 */
  166    234   
}
  167    235   
         236  +
/* HttpBindingGenerator.kt:153 */
  168    237   
pub(crate) fn de_header_timestamp_list_header(
  169    238   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  170    239   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>, ::aws_smithy_http::header::ParseError> {
         240  +
    /* HttpBindingGenerator.kt:160 */
  171    241   
    let headers = header_map.get_all("X-TimestampList");
  172         -
    let var_13: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?;
         242  +
    /* HttpBindingGenerator.kt:394 */
         243  +
    let var_13: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
         244  +
    /* HttpBindingGenerator.kt:402 */;
         245  +
    /* HttpBindingGenerator.kt:430 */
  173    246   
    Ok(if !var_13.is_empty() { Some(var_13) } else { None })
         247  +
    /* HttpBindingGenerator.kt:153 */
  174    248   
}
  175    249   
         250  +
/* HttpBindingGenerator.kt:153 */
  176    251   
pub(crate) fn de_header_true_bool_header(
  177    252   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  178    253   
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
         254  +
    /* HttpBindingGenerator.kt:160 */
  179    255   
    let headers = header_map.get_all("X-Boolean1");
         256  +
    /* HttpBindingGenerator.kt:404 */
  180    257   
    let var_14 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
         258  +
    /* HttpBindingGenerator.kt:468 */
  181    259   
    if var_14.len() > 1 {
  182    260   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  183    261   
            "expected one item but found {}",
  184    262   
            var_14.len()
  185    263   
        )))
  186    264   
    } else {
  187    265   
        let mut var_14 = var_14;
  188    266   
        Ok(var_14.pop())
  189    267   
    }
         268  +
    /* HttpBindingGenerator.kt:153 */
  190    269   
}

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

@@ -1,1 +24,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_integer_enum_list(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:551 */
    5      7   
    let mut out = std::vec::Vec::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
    8         -
            s if s.matches("member") /* member aws.protocoltests.shared#IntegerEnumList$member */ =>  {
    9         -
                out.push(
   10         -
                     {
   11         -
                        <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   12         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   13         -
                        )
   14         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
   15         -
                    }
   16         -
                    ?
   17         -
                );
   18         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#IntegerEnumList$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          15  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          16  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          17  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          18  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
          19  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          20  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          21  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          22  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   19     23   
            ,
   20         -
            _ => {}
   21         -
        }
          24  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          25  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          26  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   22     27   
    }
          28  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   23     29   
    Ok(out)
          30  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   24     31   
}

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

@@ -1,1 +54,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:586 */
    2      3   
pub fn de_integer_enum_map(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::collections::HashMap<::std::string::String, i32>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:591 */
    5      7   
    let mut out = ::std::collections::HashMap::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
          12  +
            /* XmlBindingTraitParserGenerator.kt:593 */
    8     13   
            s if s.matches("entry") => {
          14  +
                /* XmlBindingTraitParserGenerator.kt:594 */
    9     15   
                crate::protocol_serde::shape_integer_enum_map::de_integer_enum_map_entry(&mut tag, &mut out)?;
          16  +
                /* XmlBindingTraitParserGenerator.kt:593 */
   10     17   
            }
   11         -
            _ => {}
          18  +
            /* XmlBindingTraitParserGenerator.kt:356 */ _ => {} /* XmlBindingTraitParserGenerator.kt:353 */
   12     19   
        }
          20  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   13     21   
    }
          22  +
    /* XmlBindingTraitParserGenerator.kt:597 */
   14     23   
    Ok(out)
          24  +
    /* XmlBindingTraitParserGenerator.kt:586 */
   15     25   
}
   16     26   
          27  +
/* XmlBindingTraitParserGenerator.kt:628 */
   17     28   
pub fn de_integer_enum_map_entry(
   18     29   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   19     30   
    out: &mut ::std::collections::HashMap<::std::string::String, i32>,
   20     31   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
          32  +
    /* XmlBindingTraitParserGenerator.kt:634 */
   21     33   
    let mut k: Option<::std::string::String> = None;
          34  +
    /* XmlBindingTraitParserGenerator.kt:635 */
   22     35   
    let mut v: Option<i32> = None;
          36  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   23     37   
    while let Some(mut tag) = decoder.next_tag() {
          38  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   24     39   
        match tag.start_el() {
   25         -
            s if s.matches("key") /* key aws.protocoltests.shared#IntegerEnumMap$key */ =>  {
   26         -
                k = 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         -
            }
          40  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("key") /* key aws.protocoltests.shared#IntegerEnumMap$key */ =>  {
          41  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = Some(
          42  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          43  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          44  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          45  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          46  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          47  +
                /* XmlBindingTraitParserGenerator.kt:641 */)
          48  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   34     49   
            ,
   35         -
            s if s.matches("value") /* value aws.protocoltests.shared#IntegerEnumMap$value */ =>  {
   36         -
                v = Some(
   37         -
                     {
   38         -
                        <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   39         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   40         -
                        )
   41         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
   42         -
                    }
   43         -
                    ?
   44         -
                )
   45         -
            }
          50  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("value") /* value aws.protocoltests.shared#IntegerEnumMap$value */ =>  {
          51  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          52  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          53  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          54  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          55  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          56  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
          57  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          58  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          59  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          60  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   46     61   
            ,
   47         -
            _ => {}
   48         -
        }
          62  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          63  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          64  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   49     65   
    }
          66  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   50     67   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   51     68   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   52     69   
    out.insert(k, v);
   53     70   
    Ok(())
          71  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   54     72   
}

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

@@ -1,1 +24,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_integer_enum_set(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:551 */
    5      7   
    let mut out = std::vec::Vec::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
    8         -
            s if s.matches("member") /* member aws.protocoltests.shared#IntegerEnumSet$member */ =>  {
    9         -
                out.push(
   10         -
                     {
   11         -
                        <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   12         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   13         -
                        )
   14         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
   15         -
                    }
   16         -
                    ?
   17         -
                );
   18         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#IntegerEnumSet$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          15  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          16  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          17  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          18  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (intEnum: `aws.protocoltests.shared#IntegerEnum`)"))
          19  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          20  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          21  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          22  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   19     23   
            ,
   20         -
            _ => {}
   21         -
        }
          24  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          25  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          26  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   22     27   
    }
          28  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   23     29   
    Ok(out)
          30  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   24     31   
}

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

@@ -1,1 +24,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_integer_list(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:551 */
    5      7   
    let mut out = std::vec::Vec::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
    8         -
            s if s.matches("member") /* member aws.protocoltests.shared#IntegerList$member */ =>  {
    9         -
                out.push(
   10         -
                     {
   11         -
                        <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   12         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   13         -
                        )
   14         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `smithy.api#Integer`)"))
   15         -
                    }
   16         -
                    ?
   17         -
                );
   18         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#IntegerList$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          15  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          16  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          17  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          18  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `smithy.api#Integer`)"))
          19  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          20  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          21  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          22  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   19     23   
            ,
   20         -
            _ => {}
   21         -
        }
          24  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          25  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          26  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   22     27   
    }
          28  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   23     29   
    Ok(out)
          30  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   24     31   
}

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

@@ -1,1 +32,41 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(unused_mut)]
           4  +
/* XmlBindingTraitParserGenerator.kt:221 */
    3      5   
pub fn de_invalid_greeting_xml_err(
    4      6   
    inp: &[u8],
    5      7   
    mut builder: crate::types::error::builders::InvalidGreetingBuilder,
    6      8   
) -> std::result::Result<crate::types::error::builders::InvalidGreetingBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
           9  +
    /* XmlBindingTraitParserGenerator.kt:227 */
    7     10   
    if inp.is_empty() {
    8     11   
        return Ok(builder);
    9     12   
    }
          13  +
    /* XmlBindingTraitParserGenerator.kt:229 */
   10     14   
    let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   11     15   
    #[allow(unused_mut)]
   12     16   
    let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?;
          17  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   13     18   
    while let Some(mut tag) = error_decoder.next_tag() {
          19  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   14     20   
        match tag.start_el() {
   15         -
            s if s.matches("Message") /* Message aws.protocoltests.restxml#InvalidGreeting$Message */ =>  {
   16         -
                let var_1 =
   17         -
                    Some(
   18         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   19         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   20         -
                            .into()
   21         -
                        )
   22         -
                        ?
   23         -
                    )
   24         -
                ;
   25         -
                builder = builder.set_message(var_1);
   26         -
            }
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("Message") /* Message aws.protocoltests.restxml#InvalidGreeting$Message */ =>  {
          22  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          23  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          24  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          25  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          26  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          27  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          28  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          29  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          30  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          31  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_message(var_1);
          32  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   27     33   
            ,
   28         -
            _ => {}
   29         -
        }
          34  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          35  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          36  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   30     37   
    }
          38  +
    /* XmlBindingTraitParserGenerator.kt:240 */
   31     39   
    Ok(builder)
          40  +
    /* XmlBindingTraitParserGenerator.kt:221 */
   32     41   
}

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

@@ -1,1 +52,70 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:586 */
    2      3   
pub fn de_nested_map(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
    6      7   
    ::aws_smithy_xml::decode::XmlDecodeError,
    7      8   
> {
           9  +
    /* XmlBindingTraitParserGenerator.kt:591 */
    8     10   
    let mut out = ::std::collections::HashMap::new();
          11  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    9     12   
    while let Some(mut tag) = decoder.next_tag() {
          13  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   10     14   
        match tag.start_el() {
          15  +
            /* XmlBindingTraitParserGenerator.kt:593 */
   11     16   
            s if s.matches("entry") => {
          17  +
                /* XmlBindingTraitParserGenerator.kt:594 */
   12     18   
                crate::protocol_serde::shape_nested_map::de_nested_map_entry(&mut tag, &mut out)?;
          19  +
                /* XmlBindingTraitParserGenerator.kt:593 */
   13     20   
            }
   14         -
            _ => {}
          21  +
            /* XmlBindingTraitParserGenerator.kt:356 */ _ => {} /* XmlBindingTraitParserGenerator.kt:353 */
   15     22   
        }
          23  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   16     24   
    }
          25  +
    /* XmlBindingTraitParserGenerator.kt:597 */
   17     26   
    Ok(out)
          27  +
    /* XmlBindingTraitParserGenerator.kt:586 */
   18     28   
}
   19     29   
          30  +
/* XmlBindingTraitParserGenerator.kt:628 */
   20     31   
pub fn de_nested_map_entry(
   21     32   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   22     33   
    out: &mut ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
   23     34   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
          35  +
    /* XmlBindingTraitParserGenerator.kt:634 */
   24     36   
    let mut k: Option<::std::string::String> = None;
          37  +
    /* XmlBindingTraitParserGenerator.kt:635 */
   25     38   
    let mut v: Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> = None;
          39  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   26     40   
    while let Some(mut tag) = decoder.next_tag() {
          41  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   27     42   
        match tag.start_el() {
   28         -
            s if s.matches("key") /* key aws.protocoltests.restxml#NestedMap$key */ =>  {
   29         -
                k = Some(
   30         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   31         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   32         -
                        .into()
   33         -
                    )
   34         -
                    ?
   35         -
                )
   36         -
            }
          43  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("key") /* key aws.protocoltests.restxml#NestedMap$key */ =>  {
          44  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = 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:641 */)
          51  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   37     52   
            ,
   38         -
            s if s.matches("value") /* value aws.protocoltests.restxml#NestedMap$value */ =>  {
   39         -
                v = Some(
   40         -
                    crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(&mut tag)
   41         -
                    ?
   42         -
                )
   43         -
            }
          53  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("value") /* value aws.protocoltests.restxml#NestedMap$value */ =>  {
          54  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          55  +
                    /* XmlBindingTraitParserGenerator.kt:600 */crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(&mut tag)
          56  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          57  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          58  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   44     59   
            ,
   45         -
            _ => {}
   46         -
        }
          60  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          61  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          62  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   47     63   
    }
          64  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   48     65   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   49     66   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   50     67   
    out.insert(k, v);
   51     68   
    Ok(())
          69  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   52     70   
}

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

@@ -1,1 +58,85 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_nested_payload(
    3      4   
    input: &crate::types::NestedPayload,
    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.greeting {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("greeting").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:555 */
   12     22   
    if let Some(var_2) = &input.name {
          23  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     24   
        let mut inner_writer = scope.start_el("name").finish();
   14         -
        inner_writer.data(var_2.as_str());
          25  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          26  +
        inner_writer.data(
          27  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */ var_2.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          28  +
        );
          29  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   15     30   
    }
          31  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   16     32   
    scope.finish();
          33  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   17     34   
    Ok(())
          35  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   18     36   
}
   19     37   
          38  +
/* RustType.kt:516 */
   20     39   
#[allow(clippy::needless_question_mark)]
          40  +
/* XmlBindingTraitParserGenerator.kt:510 */
   21     41   
pub fn de_nested_payload(
   22     42   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   23     43   
) -> ::std::result::Result<crate::types::NestedPayload, ::aws_smithy_xml::decode::XmlDecodeError> {
          44  +
    /* RustType.kt:516 */
   24     45   
    #[allow(unused_mut)]
          46  +
    /* XmlBindingTraitParserGenerator.kt:515 */
   25     47   
    let mut builder = crate::types::NestedPayload::builder();
          48  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   26     49   
    while let Some(mut tag) = decoder.next_tag() {
          50  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   27     51   
        match tag.start_el() {
   28         -
            s if s.matches("greeting") /* greeting aws.protocoltests.restxml#NestedPayload$greeting */ =>  {
   29         -
                let var_3 =
   30         -
                    Some(
   31         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   32         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   33         -
                            .into()
   34         -
                        )
   35         -
                        ?
   36         -
                    )
   37         -
                ;
   38         -
                builder = builder.set_greeting(var_3);
   39         -
            }
          52  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("greeting") /* greeting aws.protocoltests.restxml#NestedPayload$greeting */ =>  {
          53  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_3 =
          54  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          55  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          56  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          57  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          58  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          59  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          60  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          61  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          62  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_greeting(var_3);
          63  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   40     64   
            ,
   41         -
            s if s.matches("name") /* name aws.protocoltests.restxml#NestedPayload$name */ =>  {
   42         -
                let var_4 =
   43         -
                    Some(
   44         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   45         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   46         -
                            .into()
   47         -
                        )
   48         -
                        ?
   49         -
                    )
   50         -
                ;
   51         -
                builder = builder.set_name(var_4);
   52         -
            }
          65  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("name") /* name aws.protocoltests.restxml#NestedPayload$name */ =>  {
          66  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_4 =
          67  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          68  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          69  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          70  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          71  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          72  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          73  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          74  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          75  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_name(var_4);
          76  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   53     77   
            ,
   54         -
            _ => {}
   55         -
        }
          78  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          79  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          80  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   56     81   
    }
          82  +
    /* XmlBindingTraitParserGenerator.kt:533 */
   57     83   
    Ok(builder.build())
          84  +
    /* XmlBindingTraitParserGenerator.kt:510 */
   58     85   
}

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

@@ -1,1 +19,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_nested_string_list(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<::std::vec::Vec<::std::string::String>>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:551 */
    5      7   
    let mut out = std::vec::Vec::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
    8         -
            s if s.matches("member") /* member aws.protocoltests.shared#NestedStringList$member */ =>  {
    9         -
                out.push(
   10         -
                    crate::protocol_serde::shape_string_list::de_string_list(&mut tag)
   11         -
                    ?
   12         -
                );
   13         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#NestedStringList$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:562 */crate::protocol_serde::shape_string_list::de_string_list(&mut tag)
          15  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          16  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          17  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   14     18   
            ,
   15         -
            _ => {}
   16         -
        }
          19  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          20  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          21  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   17     22   
    }
          23  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   18     24   
    Ok(out)
          25  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   19     26   
}

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

@@ -1,1 +87,120 @@
    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_nested_xml_map_with_xml_name_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::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
    9     11   
    crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   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::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError::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_nested_xml_map_with_xml_name_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::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameOutput,
   27     36   
    crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError,
   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::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:247 */
   32     45   
        output = crate::protocol_serde::shape_nested_xml_map_with_xml_name::de_nested_xml_map_with_xml_name(_response_body, output)
   33     46   
            .map_err(crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameError::unhandled)?;
          47  +
        /* ClientBuilderInstantiator.kt:56 */
   34     48   
        output.build()
          49  +
        /* ProtocolParserGenerator.kt:77 */
   35     50   
    })
          51  +
    /* ProtocolParserGenerator.kt:71 */
   36     52   
}
   37     53   
          54  +
/* XmlBindingTraitSerializerGenerator.kt:116 */
   38     55   
pub fn ser_nested_xml_map_with_xml_name_op_input(
   39     56   
    input: &crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
   40     57   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          58  +
    /* XmlBindingTraitSerializerGenerator.kt:120 */
   41     59   
    let mut out = String::new();
          60  +
    /* XmlBindingTraitSerializerGenerator.kt:124 */
   42     61   
    {
          62  +
        /* XmlBindingTraitSerializerGenerator.kt:125 */
   43     63   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
   44     64   
        #[allow(unused_mut)]
   45     65   
        let mut root = writer.start_el("NestedXmlMapWithXmlNameInputOutput");
          66  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   46     67   
        crate::protocol_serde::shape_nested_xml_map_with_xml_name_input::ser_nested_xml_map_with_xml_name_input_input_input(input, root)?
          68  +
        /* XmlBindingTraitSerializerGenerator.kt:124 */
   47     69   
    }
          70  +
    /* XmlBindingTraitSerializerGenerator.kt:137 */
   48     71   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          72  +
    /* XmlBindingTraitSerializerGenerator.kt:116 */
   49     73   
}
   50     74   
          75  +
/* RustType.kt:516 */
   51     76   
#[allow(unused_mut)]
          77  +
/* XmlBindingTraitParserGenerator.kt:189 */
   52     78   
pub fn de_nested_xml_map_with_xml_name(
   53     79   
    inp: &[u8],
   54     80   
    mut builder: crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameOutputBuilder,
   55     81   
) -> std::result::Result<
   56     82   
    crate::operation::nested_xml_map_with_xml_name::builders::NestedXmlMapWithXmlNameOutputBuilder,
   57     83   
    ::aws_smithy_xml::decode::XmlDecodeError,
   58     84   
> {
          85  +
    /* XmlBindingTraitParserGenerator.kt:194 */
   59     86   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   60     87   
   61     88   
    #[allow(unused_mut)]
   62     89   
    let mut decoder = doc.root_element()?;
   63     90   
    #[allow(unused_variables)]
   64     91   
    let start_el = decoder.start_el();
          92  +
    /* RestXmlParserGenerator.kt:36 */
   65     93   
    if !start_el.matches("NestedXmlMapWithXmlNameInputOutput") {
   66     94   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   67     95   
            "encountered invalid XML root: expected NestedXmlMapWithXmlNameInputOutput but got {:?}. This is likely a bug in the SDK.",
   68     96   
            start_el
   69     97   
        )));
   70     98   
    }
          99  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   71    100   
    while let Some(mut tag) = decoder.next_tag() {
         101  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   72    102   
        match tag.start_el() {
   73         -
            s if s.matches("nestedXmlMapWithXmlNameMap") /* nestedXmlMapWithXmlNameMap aws.protocoltests.restxml.synthetic#NestedXmlMapWithXmlNameOutput$nestedXmlMapWithXmlNameMap */ =>  {
   74         -
                let var_1 =
   75         -
                    Some(
   76         -
                        crate::protocol_serde::shape_nested_xml_map_with_xml_name_map::de_nested_xml_map_with_xml_name_map(&mut tag)
   77         -
                        ?
   78         -
                    )
   79         -
                ;
   80         -
                builder = builder.set_nested_xml_map_with_xml_name_map(var_1);
   81         -
            }
         103  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("nestedXmlMapWithXmlNameMap") /* nestedXmlMapWithXmlNameMap aws.protocoltests.restxml.synthetic#NestedXmlMapWithXmlNameOutput$nestedXmlMapWithXmlNameMap */ =>  {
         104  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
         105  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
         106  +
                        /* XmlBindingTraitParserGenerator.kt:600 */crate::protocol_serde::shape_nested_xml_map_with_xml_name_map::de_nested_xml_map_with_xml_name_map(&mut tag)
         107  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
         108  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
         109  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
         110  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_nested_xml_map_with_xml_name_map(var_1);
         111  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   82    112   
            ,
   83         -
            _ => {}
   84         -
        }
         113  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
         114  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
         115  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   85    116   
    }
         117  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   86    118   
    Ok(builder)
         119  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   87    120   
}

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

@@ -1,1 +54,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:586 */
    2      3   
pub fn de_nested_xml_map_with_xml_name_inner_map(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::collections::HashMap<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:591 */
    5      7   
    let mut out = ::std::collections::HashMap::new();
           8  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    6      9   
    while let Some(mut tag) = decoder.next_tag() {
          10  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    7     11   
        match tag.start_el() {
          12  +
            /* XmlBindingTraitParserGenerator.kt:593 */
    8     13   
            s if s.matches("entry") => {
          14  +
                /* XmlBindingTraitParserGenerator.kt:594 */
    9     15   
                crate::protocol_serde::shape_nested_xml_map_with_xml_name_inner_map::de_nested_xml_map_with_xml_name_inner_map_entry(
   10     16   
                    &mut tag, &mut out,
   11     17   
                )?;
          18  +
                /* XmlBindingTraitParserGenerator.kt:593 */
   12     19   
            }
   13         -
            _ => {}
          20  +
            /* XmlBindingTraitParserGenerator.kt:356 */ _ => {} /* XmlBindingTraitParserGenerator.kt:353 */
   14     21   
        }
          22  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   15     23   
    }
          24  +
    /* XmlBindingTraitParserGenerator.kt:597 */
   16     25   
    Ok(out)
          26  +
    /* XmlBindingTraitParserGenerator.kt:586 */
   17     27   
}
   18     28   
          29  +
/* XmlBindingTraitParserGenerator.kt:628 */
   19     30   
pub fn de_nested_xml_map_with_xml_name_inner_map_entry(
   20     31   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   21     32   
    out: &mut ::std::collections::HashMap<::std::string::String, ::std::string::String>,
   22     33   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
          34  +
    /* XmlBindingTraitParserGenerator.kt:634 */
   23     35   
    let mut k: Option<::std::string::String> = None;
          36  +
    /* XmlBindingTraitParserGenerator.kt:635 */
   24     37   
    let mut v: Option<::std::string::String> = None;
          38  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   25     39   
    while let Some(mut tag) = decoder.next_tag() {
          40  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   26     41   
        match tag.start_el() {
   27         -
            s if s.matches("InnerKey") /* key aws.protocoltests.restxml#NestedXmlMapWithXmlNameInnerMap$key */ =>  {
   28         -
                k = Some(
   29         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   30         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   31         -
                        .into()
   32         -
                    )
   33         -
                    ?
   34         -
                )
   35         -
            }
          42  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("InnerKey") /* key aws.protocoltests.restxml#NestedXmlMapWithXmlNameInnerMap$key */ =>  {
          43  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = Some(
          44  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          45  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          46  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          47  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          48  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          49  +
                /* XmlBindingTraitParserGenerator.kt:641 */)
          50  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   36     51   
            ,
   37         -
            s if s.matches("InnerValue") /* value aws.protocoltests.restxml#NestedXmlMapWithXmlNameInnerMap$value */ =>  {
   38         -
                v = Some(
   39         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   40         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   41         -
                        .into()
   42         -
                    )
   43         -
                    ?
   44         -
                )
   45         -
            }
          52  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("InnerValue") /* value aws.protocoltests.restxml#NestedXmlMapWithXmlNameInnerMap$value */ =>  {
          53  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          54  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          55  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          56  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          57  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          58  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          59  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          60  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   46     61   
            ,
   47         -
            _ => {}
   48         -
        }
          62  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          63  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          64  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   49     65   
    }
          66  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   50     67   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   51     68   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   52     69   
    out.insert(k, v);
   53     70   
    Ok(())
          71  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   54     72   
}

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

@@ -1,1 +34,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_nested_xml_map_with_xml_name_input_input_input(
    3      4   
    input: &crate::operation::nested_xml_map_with_xml_name::NestedXmlMapWithXmlNameInput,
    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.nested_xml_map_with_xml_name_map {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:377 */
    9     14   
        let mut inner_writer = scope.start_el("nestedXmlMapWithXmlNameMap").finish();
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:512 */
   10     16   
        for (key_2, value_3) in var_1 {
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:513 */
   11     18   
            let mut entry = inner_writer.start_el("entry").finish();
          19  +
            /* SerializerUtil.kt:42 */
   12     20   
            {
          21  +
                /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     22   
                let mut inner_writer = entry.start_el("OuterKey").finish();
   14         -
                inner_writer.data(key_2.as_str());
          23  +
                /* XmlBindingTraitSerializerGenerator.kt:360 */
          24  +
                inner_writer.data(
          25  +
                    /* XmlBindingTraitSerializerGenerator.kt:321 */ key_2.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          26  +
                );
          27  +
                /* SerializerUtil.kt:42 */
   15     28   
            }
          29  +
            /* SerializerUtil.kt:42 */
   16     30   
            {
          31  +
                /* XmlBindingTraitSerializerGenerator.kt:377 */
   17     32   
                let mut inner_writer = entry.start_el("value").finish();
          33  +
                /* XmlBindingTraitSerializerGenerator.kt:512 */
   18     34   
                for (key_4, value_5) in value_3 {
          35  +
                    /* XmlBindingTraitSerializerGenerator.kt:513 */
   19     36   
                    let mut entry = inner_writer.start_el("entry").finish();
          37  +
                    /* SerializerUtil.kt:42 */
   20     38   
                    {
          39  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   21     40   
                        let mut inner_writer = entry.start_el("InnerKey").finish();
   22         -
                        inner_writer.data(key_4.as_str());
          41  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
          42  +
                        inner_writer.data(
          43  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
          44  +
                            key_4.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          45  +
                        );
          46  +
                        /* SerializerUtil.kt:42 */
   23     47   
                    }
          48  +
                    /* SerializerUtil.kt:42 */
   24     49   
                    {
          50  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   25     51   
                        let mut inner_writer = entry.start_el("InnerValue").finish();
   26         -
                        inner_writer.data(value_5.as_str());
          52  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
          53  +
                        inner_writer.data(
          54  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
          55  +
                            value_5.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          56  +
                        );
          57  +
                        /* SerializerUtil.kt:42 */
   27     58   
                    }
          59  +
                    /* XmlBindingTraitSerializerGenerator.kt:512 */
   28     60   
                }
          61  +
                /* SerializerUtil.kt:42 */
   29     62   
            }
          63  +
            /* XmlBindingTraitSerializerGenerator.kt:512 */
   30     64   
        }
          65  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     66   
    }
          67  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   32     68   
    scope.finish();
          69  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   33     70   
    Ok(())
          71  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   34     72   
}

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

@@ -1,1 +52,70 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:586 */
    2      3   
pub fn de_nested_xml_map_with_xml_name_map(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    6      7   
    ::aws_smithy_xml::decode::XmlDecodeError,
    7      8   
> {
           9  +
    /* XmlBindingTraitParserGenerator.kt:591 */
    8     10   
    let mut out = ::std::collections::HashMap::new();
          11  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    9     12   
    while let Some(mut tag) = decoder.next_tag() {
          13  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   10     14   
        match tag.start_el() {
          15  +
            /* XmlBindingTraitParserGenerator.kt:593 */
   11     16   
            s if s.matches("entry") => {
          17  +
                /* XmlBindingTraitParserGenerator.kt:594 */
   12     18   
                crate::protocol_serde::shape_nested_xml_map_with_xml_name_map::de_nested_xml_map_with_xml_name_map_entry(&mut tag, &mut out)?;
          19  +
                /* XmlBindingTraitParserGenerator.kt:593 */
   13     20   
            }
   14         -
            _ => {}
          21  +
            /* XmlBindingTraitParserGenerator.kt:356 */ _ => {} /* XmlBindingTraitParserGenerator.kt:353 */
   15     22   
        }
          23  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   16     24   
    }
          25  +
    /* XmlBindingTraitParserGenerator.kt:597 */
   17     26   
    Ok(out)
          27  +
    /* XmlBindingTraitParserGenerator.kt:586 */
   18     28   
}
   19     29   
          30  +
/* XmlBindingTraitParserGenerator.kt:628 */
   20     31   
pub fn de_nested_xml_map_with_xml_name_map_entry(
   21     32   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
   22     33   
    out: &mut ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   23     34   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
          35  +
    /* XmlBindingTraitParserGenerator.kt:634 */
   24     36   
    let mut k: Option<::std::string::String> = None;
          37  +
    /* XmlBindingTraitParserGenerator.kt:635 */
   25     38   
    let mut v: Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> = None;
          39  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   26     40   
    while let Some(mut tag) = decoder.next_tag() {
          41  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   27     42   
        match tag.start_el() {
   28         -
            s if s.matches("OuterKey") /* key aws.protocoltests.restxml#NestedXmlMapWithXmlNameMap$key */ =>  {
   29         -
                k = Some(
   30         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   31         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   32         -
                        .into()
   33         -
                    )
   34         -
                    ?
   35         -
                )
   36         -
            }
          43  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("OuterKey") /* key aws.protocoltests.restxml#NestedXmlMapWithXmlNameMap$key */ =>  {
          44  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = 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:641 */)
          51  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   37     52   
            ,
   38         -
            s if s.matches("value") /* value aws.protocoltests.restxml#NestedXmlMapWithXmlNameMap$value */ =>  {
   39         -
                v = Some(
   40         -
                    crate::protocol_serde::shape_nested_xml_map_with_xml_name_inner_map::de_nested_xml_map_with_xml_name_inner_map(&mut tag)
   41         -
                    ?
   42         -
                )
   43         -
            }
          53  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("value") /* value aws.protocoltests.restxml#NestedXmlMapWithXmlNameMap$value */ =>  {
          54  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          55  +
                    /* XmlBindingTraitParserGenerator.kt:600 */crate::protocol_serde::shape_nested_xml_map_with_xml_name_inner_map::de_nested_xml_map_with_xml_name_inner_map(&mut tag)
          56  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          57  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          58  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   44     59   
            ,
   45         -
            _ => {}
   46         -
        }
          60  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          61  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          62  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   47     63   
    }
          64  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   48     65   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   49     66   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   50     67   
    out.insert(k, v);
   51     68   
    Ok(())
          69  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   52     70   
}

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

@@ -1,1 +90,123 @@
    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_nested_xml_maps_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::nested_xml_maps::NestedXmlMapsOutput, crate::operation::nested_xml_maps::NestedXmlMapsError> {
          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::nested_xml_maps::NestedXmlMapsError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::nested_xml_maps::NestedXmlMapsError::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_nested_xml_maps_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::nested_xml_maps::NestedXmlMapsOutput, crate::operation::nested_xml_maps::NestedXmlMapsError> {
          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::nested_xml_maps::builders::NestedXmlMapsOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output = crate::protocol_serde::shape_nested_xml_maps::de_nested_xml_maps(_response_body, output)
   25     38   
            .map_err(crate::operation::nested_xml_maps::NestedXmlMapsError::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_nested_xml_maps_op_input(
   31     48   
    input: &crate::operation::nested_xml_maps::NestedXmlMapsInput,
   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("NestedXmlMapsRequest");
          58  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   38     59   
        crate::protocol_serde::shape_nested_xml_maps_input::ser_nested_xml_maps_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_nested_xml_maps(
   45     71   
    inp: &[u8],
   46     72   
    mut builder: crate::operation::nested_xml_maps::builders::NestedXmlMapsOutputBuilder,
   47     73   
) -> std::result::Result<crate::operation::nested_xml_maps::builders::NestedXmlMapsOutputBuilder, ::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("NestedXmlMapsResponse") {
   55     83   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   56     84   
            "encountered invalid XML root: expected NestedXmlMapsResponse 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("nestedMap") /* nestedMap aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$nestedMap */ =>  {
   63         -
                let var_1 =
   64         -
                    Some(
   65         -
                        crate::protocol_serde::shape_nested_map::de_nested_map(&mut tag)
   66         -
                        ?
   67         -
                    )
   68         -
                ;
   69         -
                builder = builder.set_nested_map(var_1);
   70         -
            }
          92  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("nestedMap") /* nestedMap aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$nestedMap */ =>  {
          93  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          94  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          95  +
                        /* XmlBindingTraitParserGenerator.kt:600 */crate::protocol_serde::shape_nested_map::de_nested_map(&mut tag)
          96  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          97  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          98  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          99  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_nested_map(var_1);
         100  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   71    101   
            ,
   72         -
            s if s.matches("flatNestedMap") /* flatNestedMap aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$flatNestedMap */ =>  {
   73         -
                let var_2 =
   74         -
                    Some(
   75         -
                        Result::<::std::collections::HashMap::<::std::string::String, ::std::collections::HashMap::<::std::string::String, crate::types::FooEnum>>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
   76         -
                            let mut map_3 = builder.flat_nested_map.take().unwrap_or_default();
         102  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("flatNestedMap") /* flatNestedMap aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$flatNestedMap */ =>  {
         103  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
         104  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
         105  +
                        /* XmlBindingTraitParserGenerator.kt:609 */Result::<::std::collections::HashMap::<::std::string::String, ::std::collections::HashMap::<::std::string::String, crate::types::FooEnum>>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
         106  +
                            /* XmlBindingTraitParserGenerator.kt:611 */let mut map_3 = builder.flat_nested_map.take().unwrap_or_default();
   77    107   
                                            crate::protocol_serde::shape_nested_map::de_nested_map_entry(&mut tag, &mut map_3)?;
   78    108   
                                            map_3
   79         -
                        })
   80         -
                        ?
   81         -
                    )
   82         -
                ;
   83         -
                builder = builder.set_flat_nested_map(var_2);
   84         -
            }
         109  +
                        /* XmlBindingTraitParserGenerator.kt:609 */})
         110  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
         111  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
         112  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
         113  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_flat_nested_map(var_2);
         114  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   85    115   
            ,
   86         -
            _ => {}
   87         -
        }
         116  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
         117  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
         118  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   88    119   
    }
         120  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   89    121   
    Ok(builder)
         122  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   90    123   
}

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

@@ -1,1 +57,126 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_nested_xml_maps_input_input_input(
    3      4   
    input: &crate::operation::nested_xml_maps::NestedXmlMapsInput,
    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.flat_nested_map {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:512 */
    9     14   
        for (key_2, value_3) in var_1 {
          15  +
            /* XmlBindingTraitSerializerGenerator.kt:513 */
   10     16   
            let mut entry = scope.start_el("flatNestedMap").finish();
          17  +
            /* SerializerUtil.kt:42 */
   11     18   
            {
          19  +
                /* XmlBindingTraitSerializerGenerator.kt:359 */
   12     20   
                let mut inner_writer = entry.start_el("key").finish();
   13         -
                inner_writer.data(key_2.as_str());
          21  +
                /* XmlBindingTraitSerializerGenerator.kt:360 */
          22  +
                inner_writer.data(
          23  +
                    /* XmlBindingTraitSerializerGenerator.kt:321 */ key_2.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          24  +
                );
          25  +
                /* SerializerUtil.kt:42 */
   14     26   
            }
          27  +
            /* SerializerUtil.kt:42 */
   15     28   
            {
          29  +
                /* XmlBindingTraitSerializerGenerator.kt:377 */
   16     30   
                let mut inner_writer = entry.start_el("value").finish();
          31  +
                /* XmlBindingTraitSerializerGenerator.kt:512 */
   17     32   
                for (key_4, value_5) in value_3 {
          33  +
                    /* XmlBindingTraitSerializerGenerator.kt:513 */
   18     34   
                    let mut entry = inner_writer.start_el("entry").finish();
          35  +
                    /* SerializerUtil.kt:42 */
   19     36   
                    {
          37  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   20     38   
                        let mut inner_writer = entry.start_el("key").finish();
   21         -
                        inner_writer.data(key_4.as_str());
          39  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
          40  +
                        inner_writer.data(
          41  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
          42  +
                            key_4.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          43  +
                        );
          44  +
                        /* SerializerUtil.kt:42 */
   22     45   
                    }
          46  +
                    /* SerializerUtil.kt:42 */
   23     47   
                    {
          48  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   24     49   
                        let mut inner_writer = entry.start_el("value").finish();
   25         -
                        inner_writer.data(value_5.as_str());
          50  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
          51  +
                        inner_writer.data(
          52  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
          53  +
                            value_5.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          54  +
                        );
          55  +
                        /* SerializerUtil.kt:42 */
   26     56   
                    }
          57  +
                    /* XmlBindingTraitSerializerGenerator.kt:512 */
   27     58   
                }
          59  +
                /* SerializerUtil.kt:42 */
   28     60   
            }
          61  +
            /* XmlBindingTraitSerializerGenerator.kt:512 */
   29     62   
        }
          63  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   30     64   
    }
          65  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     66   
    if let Some(var_6) = &input.nested_map {
          67  +
        /* XmlBindingTraitSerializerGenerator.kt:377 */
   32     68   
        let mut inner_writer = scope.start_el("nestedMap").finish();
          69  +
        /* XmlBindingTraitSerializerGenerator.kt:512 */
   33     70   
        for (key_7, value_8) in var_6 {
          71  +
            /* XmlBindingTraitSerializerGenerator.kt:513 */
   34     72   
            let mut entry = inner_writer.start_el("entry").finish();
          73  +
            /* SerializerUtil.kt:42 */
   35     74   
            {
          75  +
                /* XmlBindingTraitSerializerGenerator.kt:359 */
   36     76   
                let mut inner_writer = entry.start_el("key").finish();
   37         -
                inner_writer.data(key_7.as_str());
          77  +
                /* XmlBindingTraitSerializerGenerator.kt:360 */
          78  +
                inner_writer.data(
          79  +
                    /* XmlBindingTraitSerializerGenerator.kt:321 */ key_7.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          80  +
                );
          81  +
                /* SerializerUtil.kt:42 */
   38     82   
            }
          83  +
            /* SerializerUtil.kt:42 */
   39     84   
            {
          85  +
                /* XmlBindingTraitSerializerGenerator.kt:377 */
   40     86   
                let mut inner_writer = entry.start_el("value").finish();
          87  +
                /* XmlBindingTraitSerializerGenerator.kt:512 */
   41     88   
                for (key_9, value_10) in value_8 {
          89  +
                    /* XmlBindingTraitSerializerGenerator.kt:513 */
   42     90   
                    let mut entry = inner_writer.start_el("entry").finish();
          91  +
                    /* SerializerUtil.kt:42 */
   43     92   
                    {
          93  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   44     94   
                        let mut inner_writer = entry.start_el("key").finish();
   45         -
                        inner_writer.data(key_9.as_str());
          95  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
          96  +
                        inner_writer.data(
          97  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
          98  +
                            key_9.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          99  +
                        );
         100  +
                        /* SerializerUtil.kt:42 */
   46    101   
                    }
         102  +
                    /* SerializerUtil.kt:42 */
   47    103   
                    {
         104  +
                        /* XmlBindingTraitSerializerGenerator.kt:359 */
   48    105   
                        let mut inner_writer = entry.start_el("value").finish();
   49         -
                        inner_writer.data(value_10.as_str());
         106  +
                        /* XmlBindingTraitSerializerGenerator.kt:360 */
         107  +
                        inner_writer.data(
         108  +
                            /* XmlBindingTraitSerializerGenerator.kt:321 */
         109  +
                            value_10.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         110  +
                        );
         111  +
                        /* SerializerUtil.kt:42 */
   50    112   
                    }
         113  +
                    /* XmlBindingTraitSerializerGenerator.kt:512 */
   51    114   
                }
         115  +
                /* SerializerUtil.kt:42 */
   52    116   
            }
         117  +
            /* XmlBindingTraitSerializerGenerator.kt:512 */
   53    118   
        }
         119  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   54    120   
    }
         121  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   55    122   
    scope.finish();
         123  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   56    124   
    Ok(())
         125  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   57    126   
}