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

@@ -1,1 +37,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:628 */
    2      3   
pub fn de_flattened_xml_map_with_xml_name_input_output_map_entry(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
    out: &mut ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
           7  +
    /* XmlBindingTraitParserGenerator.kt:634 */
    6      8   
    let mut k: Option<::std::string::String> = None;
           9  +
    /* XmlBindingTraitParserGenerator.kt:635 */
    7     10   
    let mut v: Option<::std::string::String> = None;
          11  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    8     12   
    while let Some(mut tag) = decoder.next_tag() {
          13  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    9     14   
        match tag.start_el() {
   10         -
            s if s.matches("K") /* key aws.protocoltests.restxml#FlattenedXmlMapWithXmlNameInputOutputMap$key */ =>  {
   11         -
                k = Some(
   12         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   13         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   14         -
                        .into()
   15         -
                    )
   16         -
                    ?
   17         -
                )
   18         -
            }
          15  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("K") /* key aws.protocoltests.restxml#FlattenedXmlMapWithXmlNameInputOutputMap$key */ =>  {
          16  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = Some(
          17  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          18  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          19  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          20  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          21  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          22  +
                /* XmlBindingTraitParserGenerator.kt:641 */)
          23  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   19     24   
            ,
   20         -
            s if s.matches("V") /* value aws.protocoltests.restxml#FlattenedXmlMapWithXmlNameInputOutputMap$value */ =>  {
   21         -
                v = Some(
   22         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   23         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   24         -
                        .into()
   25         -
                    )
   26         -
                    ?
   27         -
                )
   28         -
            }
          25  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("V") /* value aws.protocoltests.restxml#FlattenedXmlMapWithXmlNameInputOutputMap$value */ =>  {
          26  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          27  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          28  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          29  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          30  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          31  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          32  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          33  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   29     34   
            ,
   30         -
            _ => {}
   31         -
        }
          35  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          36  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          37  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   32     38   
    }
          39  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   33     40   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   34     41   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   35     42   
    out.insert(k, v);
   36     43   
    Ok(())
          44  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   37     45   
}

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

@@ -1,1 +76,101 @@
    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_flattened_xml_map_with_xml_namespace_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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
    9     11   
    crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_flattened_xml_map_with_xml_namespace_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   25     34   
    crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_flattened_xml_map_with_xml_namespace::de_flattened_xml_map_with_xml_namespace(_response_body, output)
   31     44   
            .map_err(crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* RustType.kt:516 */
   36     53   
#[allow(unused_mut)]
          54  +
/* XmlBindingTraitParserGenerator.kt:189 */
   37     55   
pub fn de_flattened_xml_map_with_xml_namespace(
   38     56   
    inp: &[u8],
   39     57   
    mut builder: crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceOutputBuilder,
   40     58   
) -> std::result::Result<
   41     59   
    crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceOutputBuilder,
   42     60   
    ::aws_smithy_xml::decode::XmlDecodeError,
   43     61   
> {
          62  +
    /* XmlBindingTraitParserGenerator.kt:194 */
   44     63   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   45     64   
   46     65   
    #[allow(unused_mut)]
   47     66   
    let mut decoder = doc.root_element()?;
   48     67   
    #[allow(unused_variables)]
   49     68   
    let start_el = decoder.start_el();
          69  +
    /* RestXmlParserGenerator.kt:36 */
   50     70   
    if !start_el.matches("FlattenedXmlMapWithXmlNamespaceOutput") {
   51     71   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   52     72   
            "encountered invalid XML root: expected FlattenedXmlMapWithXmlNamespaceOutput but got {:?}. This is likely a bug in the SDK.",
   53     73   
            start_el
   54     74   
        )));
   55     75   
    }
          76  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   56     77   
    while let Some(mut tag) = decoder.next_tag() {
          78  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   57     79   
        match tag.start_el() {
   58         -
            s if s.matches("KVP") /* myMap aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNamespaceOutput$myMap */ =>  {
   59         -
                let var_1 =
   60         -
                    Some(
   61         -
                        Result::<::std::collections::HashMap::<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
   62         -
                            let mut map_2 = builder.my_map.take().unwrap_or_default();
          80  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("KVP") /* myMap aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNamespaceOutput$myMap */ =>  {
          81  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          82  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          83  +
                        /* XmlBindingTraitParserGenerator.kt:609 */Result::<::std::collections::HashMap::<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
          84  +
                            /* XmlBindingTraitParserGenerator.kt:611 */let mut map_2 = builder.my_map.take().unwrap_or_default();
   63     85   
                                            crate::protocol_serde::shape_flattened_xml_map_with_xml_namespace_output_map::de_flattened_xml_map_with_xml_namespace_output_map_entry(&mut tag, &mut map_2)?;
   64     86   
                                            map_2
   65         -
                        })
   66         -
                        ?
   67         -
                    )
   68         -
                ;
   69         -
                builder = builder.set_my_map(var_1);
   70         -
            }
          87  +
                        /* XmlBindingTraitParserGenerator.kt:609 */})
          88  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          89  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          90  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          91  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_my_map(var_1);
          92  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   71     93   
            ,
   72         -
            _ => {}
   73         -
        }
          94  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          95  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          96  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   74     97   
    }
          98  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   75     99   
    Ok(builder)
         100  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   76    101   
}

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

@@ -1,1 +37,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:628 */
    2      3   
pub fn de_flattened_xml_map_with_xml_namespace_output_map_entry(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
    out: &mut ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_xml::decode::XmlDecodeError> {
           7  +
    /* XmlBindingTraitParserGenerator.kt:634 */
    6      8   
    let mut k: Option<::std::string::String> = None;
           9  +
    /* XmlBindingTraitParserGenerator.kt:635 */
    7     10   
    let mut v: Option<::std::string::String> = None;
          11  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    8     12   
    while let Some(mut tag) = decoder.next_tag() {
          13  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    9     14   
        match tag.start_el() {
   10         -
            s if s.matches("K") /* key aws.protocoltests.restxml#FlattenedXmlMapWithXmlNamespaceOutputMap$key */ =>  {
   11         -
                k = Some(
   12         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   13         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   14         -
                        .into()
   15         -
                    )
   16         -
                    ?
   17         -
                )
   18         -
            }
          15  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("K") /* key aws.protocoltests.restxml#FlattenedXmlMapWithXmlNamespaceOutputMap$key */ =>  {
          16  +
                /* XmlBindingTraitParserGenerator.kt:641 */k = Some(
          17  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          18  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          19  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          20  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          21  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          22  +
                /* XmlBindingTraitParserGenerator.kt:641 */)
          23  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   19     24   
            ,
   20         -
            s if s.matches("V") /* value aws.protocoltests.restxml#FlattenedXmlMapWithXmlNamespaceOutputMap$value */ =>  {
   21         -
                v = Some(
   22         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   23         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   24         -
                        .into()
   25         -
                    )
   26         -
                    ?
   27         -
                )
   28         -
            }
          25  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("V") /* value aws.protocoltests.restxml#FlattenedXmlMapWithXmlNamespaceOutputMap$value */ =>  {
          26  +
                /* XmlBindingTraitParserGenerator.kt:646 */v = Some(
          27  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          28  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          29  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          30  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          31  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          32  +
                /* XmlBindingTraitParserGenerator.kt:646 */)
          33  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   29     34   
            ,
   30         -
            _ => {}
   31         -
        }
          35  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          36  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          37  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   32     38   
    }
          39  +
    /* XmlBindingTraitParserGenerator.kt:652 */
   33     40   
    let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?;
   34     41   
    let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?;
   35     42   
    out.insert(k, v);
   36     43   
    Ok(())
          44  +
    /* XmlBindingTraitParserGenerator.kt:628 */
   37     45   
}

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

@@ -1,1 +23,30 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_foo_enum_list(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<crate::types::FooEnum>, ::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#FooEnumList$member */ =>  {
    9         -
                out.push(
   10         -
                    Result::<crate::types::FooEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   11         -
                        crate::types::FooEnum::from(
   12         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   13         -
                        )
   14         -
                    )
   15         -
                    ?
   16         -
                );
   17         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#FooEnumList$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<crate::types::FooEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          15  +
                        /* XmlBindingTraitParserGenerator.kt:741 */crate::types::FooEnum::from(
          16  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          17  +
                        /* XmlBindingTraitParserGenerator.kt:741 */)
          18  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          19  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          20  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   18     22   
            ,
   19         -
            _ => {}
   20         -
        }
          23  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          24  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          25  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   21     26   
    }
          27  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   22     28   
    Ok(out)
          29  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   23     30   
}

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

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

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

@@ -1,1 +23,30 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:546 */
    2      3   
pub fn de_foo_enum_set(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<crate::types::FooEnum>, ::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#FooEnumSet$member */ =>  {
    9         -
                out.push(
   10         -
                    Result::<crate::types::FooEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   11         -
                        crate::types::FooEnum::from(
   12         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   13         -
                        )
   14         -
                    )
   15         -
                    ?
   16         -
                );
   17         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("member") /* member aws.protocoltests.shared#FooEnumSet$member */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:554 */out.push(
          14  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<crate::types::FooEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          15  +
                        /* XmlBindingTraitParserGenerator.kt:741 */crate::types::FooEnum::from(
          16  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          17  +
                        /* XmlBindingTraitParserGenerator.kt:741 */)
          18  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          19  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          20  +
                /* XmlBindingTraitParserGenerator.kt:554 */);
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   18     22   
            ,
   19         -
            _ => {}
   20         -
        }
          23  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          24  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          25  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   21     26   
    }
          27  +
    /* XmlBindingTraitParserGenerator.kt:559 */
   22     28   
    Ok(out)
          29  +
    /* XmlBindingTraitParserGenerator.kt:546 */
   23     30   
}

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

@@ -1,1 +69,94 @@
    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_fractional_seconds_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::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
    8     10   
{
          11  +
    /* RustType.kt:516 */
    9     12   
    #[allow(unused_mut)]
          13  +
    /* ProtocolParserGenerator.kt:106 */
   10     14   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11     15   
        .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
          16  +
    /* ProtocolParserGenerator.kt:120 */
   12     17   
    let generic = generic_builder.build();
          18  +
    /* ProtocolParserGenerator.kt:185 */
   13     19   
    Err(crate::operation::fractional_seconds::FractionalSecondsError::generic(generic))
          20  +
    /* ProtocolParserGenerator.kt:99 */
   14     21   
}
   15     22   
          23  +
/* RustType.kt:516 */
   16     24   
#[allow(clippy::unnecessary_wraps)]
          25  +
/* ProtocolParserGenerator.kt:71 */
   17     26   
pub fn de_fractional_seconds_http_response(
   18     27   
    _response_status: u16,
   19     28   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20     29   
    _response_body: &[u8],
   21     30   
) -> std::result::Result<crate::operation::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
   22     31   
{
          32  +
    /* ProtocolParserGenerator.kt:77 */
   23     33   
    Ok({
          34  +
        /* RustType.kt:516 */
   24     35   
        #[allow(unused_mut)]
          36  +
        /* ProtocolParserGenerator.kt:240 */
   25     37   
        let mut output = crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder::default();
          38  +
        /* ProtocolParserGenerator.kt:247 */
   26     39   
        output = crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds(_response_body, output)
   27     40   
            .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
          41  +
        /* ClientBuilderInstantiator.kt:56 */
   28     42   
        output.build()
          43  +
        /* ProtocolParserGenerator.kt:77 */
   29     44   
    })
          45  +
    /* ProtocolParserGenerator.kt:71 */
   30     46   
}
   31     47   
          48  +
/* RustType.kt:516 */
   32     49   
#[allow(unused_mut)]
          50  +
/* XmlBindingTraitParserGenerator.kt:189 */
   33     51   
pub fn de_fractional_seconds(
   34     52   
    inp: &[u8],
   35     53   
    mut builder: crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder,
   36     54   
) -> std::result::Result<crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
          55  +
    /* XmlBindingTraitParserGenerator.kt:194 */
   37     56   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   38     57   
   39     58   
    #[allow(unused_mut)]
   40     59   
    let mut decoder = doc.root_element()?;
   41     60   
    #[allow(unused_variables)]
   42     61   
    let start_el = decoder.start_el();
          62  +
    /* RestXmlParserGenerator.kt:36 */
   43     63   
    if !start_el.matches("FractionalSecondsOutput") {
   44     64   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   45     65   
            "encountered invalid XML root: expected FractionalSecondsOutput but got {:?}. This is likely a bug in the SDK.",
   46     66   
            start_el
   47     67   
        )));
   48     68   
    }
          69  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   49     70   
    while let Some(mut tag) = decoder.next_tag() {
          71  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   50     72   
        match tag.start_el() {
   51         -
            s if s.matches("datetime") /* datetime aws.protocoltests.restxml.synthetic#FractionalSecondsOutput$datetime */ =>  {
   52         -
                let var_1 =
   53         -
                    Some(
   54         -
                        ::aws_smithy_types::DateTime::from_str(
   55         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   56         -
                            , ::aws_smithy_types::date_time::Format::DateTimeWithOffset
   57         -
                        )
   58         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#DateTime`)"))
   59         -
                        ?
   60         -
                    )
   61         -
                ;
   62         -
                builder = builder.set_datetime(var_1);
   63         -
            }
          73  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("datetime") /* datetime aws.protocoltests.restxml.synthetic#FractionalSecondsOutput$datetime */ =>  {
          74  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          75  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          76  +
                        /* XmlBindingTraitParserGenerator.kt:701 */::aws_smithy_types::DateTime::from_str(
          77  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          78  +
                            /* XmlBindingTraitParserGenerator.kt:703 */, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
          79  +
                        /* XmlBindingTraitParserGenerator.kt:701 */)
          80  +
                        /* XmlBindingTraitParserGenerator.kt:705 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `aws.protocoltests.shared#DateTime`)"))
          81  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          82  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          83  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          84  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_datetime(var_1);
          85  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   64     86   
            ,
   65         -
            _ => {}
   66         -
        }
          87  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          88  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          89  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   67     90   
    }
          91  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   68     92   
    Ok(builder)
          93  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   69     94   
}

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

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

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

@@ -1,1 +77,106 @@
    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_greeting_with_errors_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::greeting_with_errors::GreetingWithErrorsOutput,
    9     11   
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   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::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "InvalidGreeting" => crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InvalidGreetingBuilder::default();
   27         -
                output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_xml_err(_response_body, output)
   28         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidGreetingBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_xml_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:170 */
   32     43   
            if tmp.message.is_none() {
   33     44   
                tmp.message = _error_message;
   34     45   
            }
          46  +
            /* ProtocolParserGenerator.kt:179 */
   35     47   
            tmp
          48  +
            /* ProtocolParserGenerator.kt:139 */
   36     49   
        }),
          50  +
        /* ProtocolParserGenerator.kt:139 */
   37     51   
        "ComplexError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError({
          52  +
            /* RustType.kt:516 */
   38     53   
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_complex_error::de_complex_error_xml_err(_response_body, output)
   43         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   44         -
                output = output.set_header(
   45         -
                    crate::protocol_serde::shape_complex_error::de_header_header(_response_headers).map_err(|_| {
   46         -
                        crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse Header from header `X-Header")
   47         -
                    })?,
   48         -
                );
   49         -
                let output = output.meta(generic);
   50         -
                output.build()
   51         -
            };
          54  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          55  +
                /* ProtocolParserGenerator.kt:146 */ {
          56  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          57  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
          58  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_complex_error::de_complex_error_xml_err(_response_body, output).map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
          59  +
                    /* ProtocolParserGenerator.kt:267 */output = output.set_header(
          60  +
                        /* ProtocolParserGenerator.kt:302 */crate::protocol_serde::shape_complex_error::de_header_header(_response_headers)
          61  +
                                                    .map_err(|_|crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse Header from header `X-Header"))?
          62  +
                    /* ProtocolParserGenerator.kt:267 */);
          63  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          64  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          65  +
                /* ProtocolParserGenerator.kt:146 */}
          66  +
            /* ProtocolParserGenerator.kt:145 */;
          67  +
            /* ProtocolParserGenerator.kt:179 */
   52     68   
            tmp
          69  +
            /* ProtocolParserGenerator.kt:139 */
   53     70   
        }),
   54         -
        _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
          71  +
        /* ProtocolParserGenerator.kt:182 */
          72  +
        _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   55     73   
    })
          74  +
    /* ProtocolParserGenerator.kt:99 */
   56     75   
}
   57     76   
          77  +
/* RustType.kt:516 */
   58     78   
#[allow(clippy::unnecessary_wraps)]
          79  +
/* ProtocolParserGenerator.kt:71 */
   59     80   
pub fn de_greeting_with_errors_http_response(
   60     81   
    _response_status: u16,
   61     82   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   62     83   
    _response_body: &[u8],
   63     84   
) -> std::result::Result<
   64     85   
    crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   65     86   
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   66     87   
> {
          88  +
    /* ProtocolParserGenerator.kt:77 */
   67     89   
    Ok({
          90  +
        /* RustType.kt:516 */
   68     91   
        #[allow(unused_mut)]
          92  +
        /* ProtocolParserGenerator.kt:240 */
   69     93   
        let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
          94  +
        /* ProtocolParserGenerator.kt:267 */
   70     95   
        output = output.set_greeting(
          96  +
            /* ProtocolParserGenerator.kt:302 */
   71     97   
            crate::protocol_serde::shape_greeting_with_errors_output::de_greeting_header(_response_headers).map_err(|_| {
   72     98   
                crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled("Failed to parse greeting from header `X-Greeting")
   73         -
            })?,
          99  +
            })?, /* ProtocolParserGenerator.kt:267 */
   74    100   
        );
         101  +
        /* ClientBuilderInstantiator.kt:56 */
   75    102   
        output.build()
         103  +
        /* ProtocolParserGenerator.kt:77 */
   76    104   
    })
         105  +
    /* ProtocolParserGenerator.kt:71 */
   77    106   
}

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

@@ -1,1 +7,11 @@
    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_greeting_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-Greeting");
           8  +
    /* HttpBindingGenerator.kt:375 */
    6      9   
    ::aws_smithy_http::header::one_or_none(headers)
          10  +
    /* HttpBindingGenerator.kt:153 */
    7     11   
}

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

@@ -1,1 +27,46 @@
    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_http_enum_payload_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::http_enum_payload::HttpEnumPayloadOutput, crate::operation::http_enum_payload::HttpEnumPayloadError> {
          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::http_enum_payload::HttpEnumPayloadError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::http_enum_payload::HttpEnumPayloadError::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_http_enum_payload_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::http_enum_payload::HttpEnumPayloadOutput, crate::operation::http_enum_payload::HttpEnumPayloadError> {
          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::http_enum_payload::builders::HttpEnumPayloadOutputBuilder::default();
   24         -
        output = output.set_payload(crate::protocol_serde::shape_http_enum_payload_output::de_payload_payload(_response_body)?);
          36  +
        /* ProtocolParserGenerator.kt:267 */
          37  +
        output = output.set_payload(
          38  +
            /* ProtocolParserGenerator.kt:327 */
          39  +
            crate::protocol_serde::shape_http_enum_payload_output::de_payload_payload(_response_body)?, /* ProtocolParserGenerator.kt:267 */
          40  +
        );
          41  +
        /* ClientBuilderInstantiator.kt:56 */
   25     42   
        output.build()
          43  +
        /* ProtocolParserGenerator.kt:77 */
   26     44   
    })
          45  +
    /* ProtocolParserGenerator.kt:71 */
   27     46   
}

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

@@ -1,1 +10,21 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_payload_http_payload(
    3      4   
    payload: ::std::option::Option<crate::types::StringEnum>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:320 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:332 */ Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:320 */
          12  +
            )
          13  +
        }
    8     14   
    };
    9         -
    Ok(payload.as_str().as_bytes().to_vec())
          15  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          16  +
    Ok(
          17  +
        /* HttpBoundProtocolPayloadGenerator.kt:363 */
          18  +
        payload.as_str().as_bytes().to_vec(), /* HttpBoundProtocolPayloadGenerator.kt:345 */
          19  +
    )
          20  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
   10     21   
}

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

@@ -1,1 +11,17 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:248 */
    2      3   
pub(crate) fn de_payload_payload(
    3      4   
    body: &[u8],
    4      5   
) -> std::result::Result<::std::option::Option<crate::types::StringEnum>, crate::operation::http_enum_payload::HttpEnumPayloadError> {
           6  +
    /* HttpBindingGenerator.kt:319 */
    5      7   
    (!body.is_empty())
    6      8   
        .then(|| {
           9  +
            /* HttpBindingGenerator.kt:325 */
    7     10   
            let body_str = std::str::from_utf8(body).map_err(crate::operation::http_enum_payload::HttpEnumPayloadError::unhandled)?;
          11  +
            /* HttpBindingGenerator.kt:339 */
    8     12   
            Ok(crate::types::StringEnum::from(body_str))
          13  +
            /* HttpBindingGenerator.kt:319 */
    9     14   
        })
   10     15   
        .transpose()
          16  +
    /* HttpBindingGenerator.kt:248 */
   11     17   
}

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

@@ -1,1 +51,81 @@
    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_http_payload_traits_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::http_payload_traits::HttpPayloadTraitsOutput, crate::operation::http_payload_traits::HttpPayloadTraitsError>
    8     10   
{
          11  +
    /* RustType.kt:516 */
    9     12   
    #[allow(unused_mut)]
          13  +
    /* ProtocolParserGenerator.kt:106 */
   10     14   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11     15   
        .map_err(crate::operation::http_payload_traits::HttpPayloadTraitsError::unhandled)?;
          16  +
    /* ProtocolParserGenerator.kt:120 */
   12     17   
    let generic = generic_builder.build();
          18  +
    /* ProtocolParserGenerator.kt:185 */
   13     19   
    Err(crate::operation::http_payload_traits::HttpPayloadTraitsError::generic(generic))
          20  +
    /* ProtocolParserGenerator.kt:99 */
   14     21   
}
   15     22   
          23  +
/* RustType.kt:516 */
   16     24   
#[allow(clippy::unnecessary_wraps)]
          25  +
/* ProtocolParserGenerator.kt:71 */
   17     26   
pub fn de_http_payload_traits_http_response(
   18     27   
    _response_status: u16,
   19     28   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20     29   
    _response_body: &[u8],
   21     30   
) -> std::result::Result<crate::operation::http_payload_traits::HttpPayloadTraitsOutput, crate::operation::http_payload_traits::HttpPayloadTraitsError>
   22     31   
{
          32  +
    /* ProtocolParserGenerator.kt:77 */
   23     33   
    Ok({
          34  +
        /* RustType.kt:516 */
   24     35   
        #[allow(unused_mut)]
          36  +
        /* ProtocolParserGenerator.kt:240 */
   25     37   
        let mut output = crate::operation::http_payload_traits::builders::HttpPayloadTraitsOutputBuilder::default();
   26         -
        output = output.set_blob(crate::protocol_serde::shape_http_payload_traits_output::de_blob_payload(_response_body)?);
   27         -
        output = output.set_foo(
   28         -
            crate::protocol_serde::shape_http_payload_traits_output::de_foo_header(_response_headers)
   29         -
                .map_err(|_| crate::operation::http_payload_traits::HttpPayloadTraitsError::unhandled("Failed to parse foo from header `X-Foo"))?,
          38  +
        /* ProtocolParserGenerator.kt:267 */
          39  +
        output = output.set_blob(
          40  +
            /* ProtocolParserGenerator.kt:327 */
          41  +
            crate::protocol_serde::shape_http_payload_traits_output::de_blob_payload(_response_body)?, /* ProtocolParserGenerator.kt:267 */
   30     42   
        );
          43  +
        /* ProtocolParserGenerator.kt:267 */
          44  +
        output =
          45  +
            output.set_foo(
          46  +
                /* ProtocolParserGenerator.kt:302 */
          47  +
                crate::protocol_serde::shape_http_payload_traits_output::de_foo_header(_response_headers).map_err(|_| {
          48  +
                    crate::operation::http_payload_traits::HttpPayloadTraitsError::unhandled("Failed to parse foo from header `X-Foo")
          49  +
                })?, /* ProtocolParserGenerator.kt:267 */
          50  +
            );
          51  +
        /* ClientBuilderInstantiator.kt:56 */
   31     52   
        output.build()
          53  +
        /* ProtocolParserGenerator.kt:77 */
   32     54   
    })
          55  +
    /* ProtocolParserGenerator.kt:71 */
   33     56   
}
   34     57   
          58  +
/* HttpBindingGenerator.kt:542 */
   35     59   
pub fn ser_http_payload_traits_headers(
   36     60   
    input: &crate::operation::http_payload_traits::HttpPayloadTraitsInput,
   37     61   
    mut builder: ::http::request::Builder,
   38     62   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          63  +
    /* HttpBindingGenerator.kt:592 */
   39     64   
    if let ::std::option::Option::Some(inner_1) = &input.foo {
          65  +
        /* HttpBindingGenerator.kt:704 */
   40     66   
        let formatted_2 = inner_1.as_str();
          67  +
        /* HttpBindingGenerator.kt:706 */
   41     68   
        let header_value = formatted_2;
   42     69   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   43     70   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   44     71   
                "foo",
   45     72   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   46     73   
            )
   47     74   
        })?;
   48     75   
        builder = builder.header("X-Foo", header_value);
          76  +
        /* HttpBindingGenerator.kt:592 */
   49     77   
    }
          78  +
    /* HttpBindingGenerator.kt:555 */
   50     79   
    Ok(builder)
          80  +
    /* HttpBindingGenerator.kt:542 */
   51     81   
}

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

@@ -1,1 +10,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_blob_http_payload(
    3      4   
    payload: ::std::option::Option<::aws_smithy_types::Blob>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:320 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:332 */ Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:320 */
          12  +
            )
          13  +
        }
    8     14   
    };
    9         -
    Ok(payload.into_inner())
          15  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          16  +
    Ok(
          17  +
        /* HttpBoundProtocolPayloadGenerator.kt:377 */ payload.into_inner(), /* HttpBoundProtocolPayloadGenerator.kt:345 */
          18  +
    )
          19  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
   10     20   
}

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

@@ -1,1 +13,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:248 */
    2      3   
pub(crate) fn de_blob_payload(
    3      4   
    body: &[u8],
    4      5   
) -> std::result::Result<::std::option::Option<::aws_smithy_types::Blob>, crate::operation::http_payload_traits::HttpPayloadTraitsError> {
    5         -
    (!body.is_empty()).then(|| Ok(::aws_smithy_types::Blob::new(body))).transpose()
           6  +
    /* HttpBindingGenerator.kt:319 */
           7  +
    (!body.is_empty())
           8  +
        .then(|| {
           9  +
            /* HttpBindingGenerator.kt:349 */
          10  +
            Ok(::aws_smithy_types::Blob::new(body))
          11  +
            /* HttpBindingGenerator.kt:319 */
          12  +
        })
          13  +
        .transpose()
          14  +
    /* HttpBindingGenerator.kt:248 */
    6     15   
}
    7     16   
          17  +
/* HttpBindingGenerator.kt:153 */
    8     18   
pub(crate) fn de_foo_header(
    9     19   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   10     20   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          21  +
    /* HttpBindingGenerator.kt:160 */
   11     22   
    let headers = header_map.get_all("X-Foo");
          23  +
    /* HttpBindingGenerator.kt:375 */
   12     24   
    ::aws_smithy_http::header::one_or_none(headers)
          25  +
    /* HttpBindingGenerator.kt:153 */
   13     26   
}