Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +38,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_xml_timestamps_input_input_input(
    3      4   
    input: &crate::operation::xml_timestamps::XmlTimestampsInput,
    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.date_time {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("dateTime").finish();
   10         -
        inner_writer.data(var_1.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          18  +
            var_1.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          19  +
        );
          20  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     21   
    }
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   12     23   
    if let Some(var_2) = &input.date_time_on_target {
          24  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     25   
        let mut inner_writer = scope.start_el("dateTimeOnTarget").finish();
   14         -
        inner_writer.data(var_2.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref());
          26  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          27  +
        inner_writer.data(
          28  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          29  +
            var_2.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          30  +
        );
          31  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   15     32   
    }
          33  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   16     34   
    if let Some(var_3) = &input.epoch_seconds {
          35  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   17     36   
        let mut inner_writer = scope.start_el("epochSeconds").finish();
   18         -
        inner_writer.data(var_3.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?.as_ref());
          37  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          38  +
        inner_writer.data(
          39  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          40  +
            var_3.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          41  +
        );
          42  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   19     43   
    }
          44  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   20     45   
    if let Some(var_4) = &input.epoch_seconds_on_target {
          46  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   21     47   
        let mut inner_writer = scope.start_el("epochSecondsOnTarget").finish();
   22         -
        inner_writer.data(var_4.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?.as_ref());
          48  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          49  +
        inner_writer.data(
          50  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          51  +
            var_4.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          52  +
        );
          53  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   23     54   
    }
          55  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   24     56   
    if let Some(var_5) = &input.http_date {
          57  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   25     58   
        let mut inner_writer = scope.start_el("httpDate").finish();
   26         -
        inner_writer.data(var_5.fmt(::aws_smithy_types::date_time::Format::HttpDate)?.as_ref());
          59  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          60  +
        inner_writer.data(
          61  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          62  +
            var_5.fmt(::aws_smithy_types::date_time::Format::HttpDate)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          63  +
        );
          64  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   27     65   
    }
          66  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   28     67   
    if let Some(var_6) = &input.http_date_on_target {
          68  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   29     69   
        let mut inner_writer = scope.start_el("httpDateOnTarget").finish();
   30         -
        inner_writer.data(var_6.fmt(::aws_smithy_types::date_time::Format::HttpDate)?.as_ref());
          70  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          71  +
        inner_writer.data(
          72  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          73  +
            var_6.fmt(::aws_smithy_types::date_time::Format::HttpDate)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          74  +
        );
          75  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     76   
    }
          77  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   32     78   
    if let Some(var_7) = &input.normal {
          79  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   33     80   
        let mut inner_writer = scope.start_el("normal").finish();
   34         -
        inner_writer.data(var_7.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref());
          81  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          82  +
        inner_writer.data(
          83  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
          84  +
            var_7.fmt(::aws_smithy_types::date_time::Format::DateTimeWithOffset)?.as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          85  +
        );
          86  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   35     87   
    }
          88  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   36     89   
    scope.finish();
          90  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   37     91   
    Ok(())
          92  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   38     93   
}

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

@@ -1,1 +185,291 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitParserGenerator.kt:439 */
    2      3   
pub fn de_xml_union_shape(
    3      4   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    4      5   
) -> ::std::result::Result<crate::types::XmlUnionShape, ::aws_smithy_xml::decode::XmlDecodeError> {
           6  +
    /* XmlBindingTraitParserGenerator.kt:444 */
    5      7   
    let mut base: Option<crate::types::XmlUnionShape> = None;
           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("stringValue") /* stringValue aws.protocoltests.restxml#XmlUnionShape$stringValue */ =>  {
    9         -
                let tmp =
   10         -
                    Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   11         -
                        ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   12         -
                        .into()
   13         -
                    )
   14         -
                    ?
   15         -
                ;
   16         -
                base = Some(crate::types::XmlUnionShape::StringValue(tmp));
   17         -
            }
          12  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("stringValue") /* stringValue aws.protocoltests.restxml#XmlUnionShape$stringValue */ =>  {
          13  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          14  +
                    /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          15  +
                        /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          16  +
                        /* XmlBindingTraitParserGenerator.kt:748 */.into()
          17  +
                    /* XmlBindingTraitParserGenerator.kt:729 */)
          18  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          19  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          20  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::StringValue(tmp));
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   18     22   
            ,
   19         -
            s if s.matches("booleanValue") /* booleanValue aws.protocoltests.restxml#XmlUnionShape$booleanValue */ =>  {
   20         -
                let tmp =
   21         -
                     {
   22         -
                        <bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   23         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   24         -
                        )
   25         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `smithy.api#Boolean`)"))
   26         -
                    }
   27         -
                    ?
   28         -
                ;
   29         -
                base = Some(crate::types::XmlUnionShape::BooleanValue(tmp));
   30         -
            }
          23  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("booleanValue") /* booleanValue aws.protocoltests.restxml#XmlUnionShape$booleanValue */ =>  {
          24  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          25  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          26  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          27  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          28  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          29  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `smithy.api#Boolean`)"))
          30  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          31  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          32  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          33  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::BooleanValue(tmp));
          34  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   31     35   
            ,
   32         -
            s if s.matches("byteValue") /* byteValue aws.protocoltests.restxml#XmlUnionShape$byteValue */ =>  {
   33         -
                let tmp =
   34         -
                     {
   35         -
                        <i8 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   36         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   37         -
                        )
   38         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (byte: `smithy.api#Byte`)"))
   39         -
                    }
   40         -
                    ?
   41         -
                ;
   42         -
                base = Some(crate::types::XmlUnionShape::ByteValue(tmp));
   43         -
            }
          36  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("byteValue") /* byteValue aws.protocoltests.restxml#XmlUnionShape$byteValue */ =>  {
          37  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          38  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          39  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i8 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          40  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          41  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          42  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (byte: `smithy.api#Byte`)"))
          43  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          44  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          45  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          46  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::ByteValue(tmp));
          47  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   44     48   
            ,
   45         -
            s if s.matches("shortValue") /* shortValue aws.protocoltests.restxml#XmlUnionShape$shortValue */ =>  {
   46         -
                let tmp =
   47         -
                     {
   48         -
                        <i16 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   49         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   50         -
                        )
   51         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (short: `smithy.api#Short`)"))
   52         -
                    }
   53         -
                    ?
   54         -
                ;
   55         -
                base = Some(crate::types::XmlUnionShape::ShortValue(tmp));
   56         -
            }
          49  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("shortValue") /* shortValue aws.protocoltests.restxml#XmlUnionShape$shortValue */ =>  {
          50  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          51  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          52  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i16 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          53  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          54  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          55  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (short: `smithy.api#Short`)"))
          56  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          57  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          58  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          59  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::ShortValue(tmp));
          60  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   57     61   
            ,
   58         -
            s if s.matches("integerValue") /* integerValue aws.protocoltests.restxml#XmlUnionShape$integerValue */ =>  {
   59         -
                let tmp =
   60         -
                     {
   61         -
                        <i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   62         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   63         -
                        )
   64         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `smithy.api#Integer`)"))
   65         -
                    }
   66         -
                    ?
   67         -
                ;
   68         -
                base = Some(crate::types::XmlUnionShape::IntegerValue(tmp));
   69         -
            }
          62  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("integerValue") /* integerValue aws.protocoltests.restxml#XmlUnionShape$integerValue */ =>  {
          63  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          64  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          65  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          66  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          67  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          68  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `smithy.api#Integer`)"))
          69  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          70  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          71  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          72  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::IntegerValue(tmp));
          73  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   70     74   
            ,
   71         -
            s if s.matches("longValue") /* longValue aws.protocoltests.restxml#XmlUnionShape$longValue */ =>  {
   72         -
                let tmp =
   73         -
                     {
   74         -
                        <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   75         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   76         -
                        )
   77         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `smithy.api#Long`)"))
   78         -
                    }
   79         -
                    ?
   80         -
                ;
   81         -
                base = Some(crate::types::XmlUnionShape::LongValue(tmp));
   82         -
            }
          75  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("longValue") /* longValue aws.protocoltests.restxml#XmlUnionShape$longValue */ =>  {
          76  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          77  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          78  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          79  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          80  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          81  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `smithy.api#Long`)"))
          82  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          83  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          84  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          85  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::LongValue(tmp));
          86  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   83     87   
            ,
   84         -
            s if s.matches("floatValue") /* floatValue aws.protocoltests.restxml#XmlUnionShape$floatValue */ =>  {
   85         -
                let tmp =
   86         -
                     {
   87         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
   88         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   89         -
                        )
   90         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (float: `smithy.api#Float`)"))
   91         -
                    }
   92         -
                    ?
   93         -
                ;
   94         -
                base = Some(crate::types::XmlUnionShape::FloatValue(tmp));
   95         -
            }
          88  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("floatValue") /* floatValue aws.protocoltests.restxml#XmlUnionShape$floatValue */ =>  {
          89  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
          90  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
          91  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
          92  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          93  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
          94  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (float: `smithy.api#Float`)"))
          95  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
          96  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
          97  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
          98  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::FloatValue(tmp));
          99  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   96    100   
            ,
   97         -
            s if s.matches("doubleValue") /* doubleValue aws.protocoltests.restxml#XmlUnionShape$doubleValue */ =>  {
   98         -
                let tmp =
   99         -
                     {
  100         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
  101         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
  102         -
                        )
  103         -
                        .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `smithy.api#Double`)"))
  104         -
                    }
  105         -
                    ?
  106         -
                ;
  107         -
                base = Some(crate::types::XmlUnionShape::DoubleValue(tmp));
  108         -
            }
         101  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("doubleValue") /* doubleValue aws.protocoltests.restxml#XmlUnionShape$doubleValue */ =>  {
         102  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
         103  +
                    /* XmlBindingTraitParserGenerator.kt:676 */ {
         104  +
                        /* XmlBindingTraitParserGenerator.kt:677 */<f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
         105  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
         106  +
                        /* XmlBindingTraitParserGenerator.kt:677 */)
         107  +
                        /* XmlBindingTraitParserGenerator.kt:685 */.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `smithy.api#Double`)"))
         108  +
                    /* XmlBindingTraitParserGenerator.kt:676 */}
         109  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
         110  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
         111  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::DoubleValue(tmp));
         112  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
  109    113   
            ,
  110         -
            s if s.matches("unionValue") /* unionValue aws.protocoltests.restxml#XmlUnionShape$unionValue */ =>  {
  111         -
                let tmp =
  112         -
                    Box::new(
  113         -
                        crate::protocol_serde::shape_xml_union_shape::de_xml_union_shape(&mut tag)
  114         -
                        ?
  115         -
                    )
  116         -
                ;
  117         -
                base = Some(crate::types::XmlUnionShape::UnionValue(tmp));
  118         -
            }
         114  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("unionValue") /* unionValue aws.protocoltests.restxml#XmlUnionShape$unionValue */ =>  {
         115  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
         116  +
                    /* XmlBindingTraitParserGenerator.kt:373 */Box::new(
         117  +
                        /* XmlBindingTraitParserGenerator.kt:482 */crate::protocol_serde::shape_xml_union_shape::de_xml_union_shape(&mut tag)
         118  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
         119  +
                    /* XmlBindingTraitParserGenerator.kt:373 */)
         120  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
         121  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::UnionValue(tmp));
         122  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
  119    123   
            ,
  120         -
            s if s.matches("structValue") /* structValue aws.protocoltests.restxml#XmlUnionShape$structValue */ =>  {
  121         -
                let tmp =
  122         -
                    crate::protocol_serde::shape_xml_nested_union_struct::de_xml_nested_union_struct(&mut tag)
  123         -
                    ?
  124         -
                ;
  125         -
                base = Some(crate::types::XmlUnionShape::StructValue(tmp));
  126         -
            }
         124  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("structValue") /* structValue aws.protocoltests.restxml#XmlUnionShape$structValue */ =>  {
         125  +
                /* XmlBindingTraitParserGenerator.kt:460 */let tmp =
         126  +
                    /* XmlBindingTraitParserGenerator.kt:536 */crate::protocol_serde::shape_xml_nested_union_struct::de_xml_nested_union_struct(&mut tag)
         127  +
                    /* XmlBindingTraitParserGenerator.kt:402 */?
         128  +
                /* XmlBindingTraitParserGenerator.kt:460 */;
         129  +
                /* XmlBindingTraitParserGenerator.kt:463 */base = Some(crate::types::XmlUnionShape::StructValue(tmp));
         130  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
  127    131   
            ,
  128         -
            _unknown => base = Some(crate::types::XmlUnionShape::Unknown),
  129         -
        }
         132  +
            /* XmlBindingTraitParserGenerator.kt:468 */_unknown => base = Some(crate::types::XmlUnionShape::Unknown),
         133  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
         134  +
        /* XmlBindingTraitParserGenerator.kt:352 */
  130    135   
    }
         136  +
    /* XmlBindingTraitParserGenerator.kt:476 */
  131    137   
    base.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("expected union, got nothing"))
         138  +
    /* XmlBindingTraitParserGenerator.kt:439 */
  132    139   
}
  133    140   
         141  +
/* XmlBindingTraitSerializerGenerator.kt:450 */
  134    142   
pub fn ser_xml_union_shape(
  135    143   
    input: &crate::types::XmlUnionShape,
  136    144   
    writer: ::aws_smithy_xml::encode::ElWriter,
  137    145   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         146  +
    /* XmlBindingTraitSerializerGenerator.kt:455 */
  138    147   
    let mut scope_writer = writer.finish();
         148  +
    /* XmlBindingTraitSerializerGenerator.kt:456 */
  139    149   
    match input {
  140         -
        crate::types::XmlUnionShape::StringValue(inner) => {
         150  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         151  +
        crate::types::XmlUnionShape::StringValue(inner) =>
         152  +
        /* SerializerUtil.kt:42 */
         153  +
        {
         154  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  141    155   
            let mut inner_writer = scope_writer.start_el("stringValue").finish();
  142         -
            inner_writer.data(inner.as_str());
         156  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         157  +
            inner_writer.data(
         158  +
                /* XmlBindingTraitSerializerGenerator.kt:321 */ inner.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         159  +
            );
         160  +
            /* SerializerUtil.kt:42 */
  143    161   
        }
  144         -
        crate::types::XmlUnionShape::BooleanValue(inner) => {
         162  +
        ,
         163  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         164  +
        crate::types::XmlUnionShape::BooleanValue(inner) =>
         165  +
        /* SerializerUtil.kt:42 */
         166  +
        {
         167  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  145    168   
            let mut inner_writer = scope_writer.start_el("booleanValue").finish();
  146         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         169  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         170  +
            inner_writer.data(
         171  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         172  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         173  +
            );
         174  +
            /* SerializerUtil.kt:42 */
  147    175   
        }
  148         -
        crate::types::XmlUnionShape::ByteValue(inner) => {
         176  +
        ,
         177  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         178  +
        crate::types::XmlUnionShape::ByteValue(inner) =>
         179  +
        /* SerializerUtil.kt:42 */
         180  +
        {
         181  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  149    182   
            let mut inner_writer = scope_writer.start_el("byteValue").finish();
  150         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         183  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         184  +
            inner_writer.data(
         185  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         186  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         187  +
            );
         188  +
            /* SerializerUtil.kt:42 */
  151    189   
        }
  152         -
        crate::types::XmlUnionShape::ShortValue(inner) => {
         190  +
        ,
         191  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         192  +
        crate::types::XmlUnionShape::ShortValue(inner) =>
         193  +
        /* SerializerUtil.kt:42 */
         194  +
        {
         195  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  153    196   
            let mut inner_writer = scope_writer.start_el("shortValue").finish();
  154         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         197  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         198  +
            inner_writer.data(
         199  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         200  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         201  +
            );
         202  +
            /* SerializerUtil.kt:42 */
  155    203   
        }
  156         -
        crate::types::XmlUnionShape::IntegerValue(inner) => {
         204  +
        ,
         205  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         206  +
        crate::types::XmlUnionShape::IntegerValue(inner) =>
         207  +
        /* SerializerUtil.kt:42 */
         208  +
        {
         209  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  157    210   
            let mut inner_writer = scope_writer.start_el("integerValue").finish();
  158         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         211  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         212  +
            inner_writer.data(
         213  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         214  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         215  +
            );
         216  +
            /* SerializerUtil.kt:42 */
  159    217   
        }
  160         -
        crate::types::XmlUnionShape::LongValue(inner) => {
         218  +
        ,
         219  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         220  +
        crate::types::XmlUnionShape::LongValue(inner) =>
         221  +
        /* SerializerUtil.kt:42 */
         222  +
        {
         223  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  161    224   
            let mut inner_writer = scope_writer.start_el("longValue").finish();
  162         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         225  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         226  +
            inner_writer.data(
         227  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         228  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         229  +
            );
         230  +
            /* SerializerUtil.kt:42 */
  163    231   
        }
  164         -
        crate::types::XmlUnionShape::FloatValue(inner) => {
         232  +
        ,
         233  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         234  +
        crate::types::XmlUnionShape::FloatValue(inner) =>
         235  +
        /* SerializerUtil.kt:42 */
         236  +
        {
         237  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  165    238   
            let mut inner_writer = scope_writer.start_el("floatValue").finish();
  166         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         239  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         240  +
            inner_writer.data(
         241  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         242  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         243  +
            );
         244  +
            /* SerializerUtil.kt:42 */
  167    245   
        }
  168         -
        crate::types::XmlUnionShape::DoubleValue(inner) => {
         246  +
        ,
         247  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         248  +
        crate::types::XmlUnionShape::DoubleValue(inner) =>
         249  +
        /* SerializerUtil.kt:42 */
         250  +
        {
         251  +
            /* XmlBindingTraitSerializerGenerator.kt:359 */
  169    252   
            let mut inner_writer = scope_writer.start_el("doubleValue").finish();
  170         -
            inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*inner).encode());
         253  +
            /* XmlBindingTraitSerializerGenerator.kt:360 */
         254  +
            inner_writer.data(
         255  +
                /* XmlBindingTraitSerializerGenerator.kt:325 */
         256  +
                ::aws_smithy_types::primitive::Encoder::from(*inner).encode(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         257  +
            );
         258  +
            /* SerializerUtil.kt:42 */
  171    259   
        }
  172         -
        crate::types::XmlUnionShape::UnionValue(inner) => {
         260  +
        ,
         261  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         262  +
        crate::types::XmlUnionShape::UnionValue(inner) =>
         263  +
        /* SerializerUtil.kt:42 */
         264  +
        {
         265  +
            /* XmlBindingTraitSerializerGenerator.kt:409 */
  173    266   
            let inner_writer = scope_writer.start_el("unionValue");
         267  +
            /* XmlBindingTraitSerializerGenerator.kt:481 */
  174    268   
            crate::protocol_serde::shape_xml_union_shape::ser_xml_union_shape(inner, inner_writer)?
         269  +
            /* SerializerUtil.kt:42 */
  175    270   
        }
  176         -
        crate::types::XmlUnionShape::StructValue(inner) => {
         271  +
        ,
         272  +
        /* XmlBindingTraitSerializerGenerator.kt:465 */
         273  +
        crate::types::XmlUnionShape::StructValue(inner) =>
         274  +
        /* SerializerUtil.kt:42 */
         275  +
        {
         276  +
            /* XmlBindingTraitSerializerGenerator.kt:399 */
  177    277   
            let inner_writer = scope_writer.start_el("structValue");
         278  +
            /* XmlBindingTraitSerializerGenerator.kt:440 */
  178    279   
            crate::protocol_serde::shape_xml_nested_union_struct::ser_xml_nested_union_struct(inner, inner_writer)?
         280  +
            /* SerializerUtil.kt:42 */
  179    281   
        }
         282  +
        ,
         283  +
        /* XmlBindingTraitSerializerGenerator.kt:471 */
  180    284   
        crate::types::XmlUnionShape::Unknown => {
  181    285   
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("XmlUnionShape"))
  182         -
        }
         286  +
        } /* XmlBindingTraitSerializerGenerator.kt:456 */
  183    287   
    }
         288  +
    /* XmlBindingTraitSerializerGenerator.kt:478 */
  184    289   
    Ok(())
         290  +
    /* XmlBindingTraitSerializerGenerator.kt:450 */
  185    291   
}

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

@@ -1,1 +76,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_xml_unions_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::xml_unions::XmlUnionsOutput, crate::operation::xml_unions::XmlUnionsError> {
          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::xml_unions::XmlUnionsError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::xml_unions::XmlUnionsError::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_xml_unions_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::xml_unions::XmlUnionsOutput, crate::operation::xml_unions::XmlUnionsError> {
          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::xml_unions::builders::XmlUnionsOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output = crate::protocol_serde::shape_xml_unions::de_xml_unions(_response_body, output)
   25     38   
            .map_err(crate::operation::xml_unions::XmlUnionsError::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_xml_unions_op_input(
   31     48   
    input: &crate::operation::xml_unions::XmlUnionsInput,
   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("XmlUnionsRequest");
          58  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   38     59   
        crate::protocol_serde::shape_xml_unions_input::ser_xml_unions_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_xml_unions(
   45     71   
    inp: &[u8],
   46     72   
    mut builder: crate::operation::xml_unions::builders::XmlUnionsOutputBuilder,
   47     73   
) -> std::result::Result<crate::operation::xml_unions::builders::XmlUnionsOutputBuilder, ::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("XmlUnionsResponse") {
   55     83   
        return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
   56     84   
            "encountered invalid XML root: expected XmlUnionsResponse 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("unionValue") /* unionValue aws.protocoltests.restxml.synthetic#XmlUnionsOutput$unionValue */ =>  {
   63         -
                let var_1 =
   64         -
                    Some(
   65         -
                        crate::protocol_serde::shape_xml_union_shape::de_xml_union_shape(&mut tag)
   66         -
                        ?
   67         -
                    )
   68         -
                ;
   69         -
                builder = builder.set_union_value(var_1);
   70         -
            }
          92  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("unionValue") /* unionValue aws.protocoltests.restxml.synthetic#XmlUnionsOutput$unionValue */ =>  {
          93  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          94  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          95  +
                        /* XmlBindingTraitParserGenerator.kt:482 */crate::protocol_serde::shape_xml_union_shape::de_xml_union_shape(&mut tag)
          96  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          97  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          98  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          99  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_union_value(var_1);
         100  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   71    101   
            ,
   72         -
            _ => {}
   73         -
        }
         102  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
         103  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
         104  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   74    105   
    }
         106  +
    /* XmlBindingTraitParserGenerator.kt:213 */
   75    107   
    Ok(builder)
         108  +
    /* XmlBindingTraitParserGenerator.kt:189 */
   76    109   
}

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

@@ -1,1 +14,24 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_xml_unions_input_input_input(
    3      4   
    input: &crate::operation::xml_unions::XmlUnionsInput,
    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.union_value {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:409 */
    9     14   
        let inner_writer = scope.start_el("unionValue");
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:481 */
   10     16   
        crate::protocol_serde::shape_xml_union_shape::ser_xml_union_shape(var_1, inner_writer)?
          17  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     18   
    }
          19  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   12     20   
    scope.finish();
          21  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   13     22   
    Ok(())
          23  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   14     24   
}

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

@@ -1,1 +74,108 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_xml_namespace_nested::XmlNamespaceNested;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_xml_attributes_payload_response::XmlAttributesPayloadResponse;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_xml_attributes_payload_request::XmlAttributesPayloadRequest;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_foo_enum::FooEnum;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_greeting_struct::GreetingStruct;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_structure_list_member::StructureListMember;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::_recursive_shapes_input_output_nested1::RecursiveShapesInputOutputNested1;
   15     22   
          23  +
/* CodegenDelegator.kt:255 */
   16     24   
pub use crate::types::_recursive_shapes_input_output_nested2::RecursiveShapesInputOutputNested2;
   17     25   
          26  +
/* CodegenDelegator.kt:255 */
   18     27   
pub use crate::types::_xml_union_shape::XmlUnionShape;
   19     28   
          29  +
/* CodegenDelegator.kt:255 */
   20     30   
pub use crate::types::_xml_nested_union_struct::XmlNestedUnionStruct;
   21     31   
          32  +
/* CodegenDelegator.kt:255 */
   22     33   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorData;
   23     34   
          35  +
/* CodegenDelegator.kt:255 */
   24     36   
pub use crate::types::_payload_with_xml_namespace_and_prefix::PayloadWithXmlNamespaceAndPrefix;
   25     37   
          38  +
/* CodegenDelegator.kt:255 */
   26     39   
pub use crate::types::_payload_with_xml_namespace::PayloadWithXmlNamespace;
   27     40   
          41  +
/* CodegenDelegator.kt:255 */
   28     42   
pub use crate::types::_payload_with_xml_name::PayloadWithXmlName;
   29     43   
          44  +
/* CodegenDelegator.kt:255 */
   30     45   
pub use crate::types::_union_payload::UnionPayload;
   31     46   
          47  +
/* CodegenDelegator.kt:255 */
   32     48   
pub use crate::types::_string_enum::StringEnum;
   33     49   
          50  +
/* CodegenDelegator.kt:255 */
   34     51   
pub use crate::types::_nested_payload::NestedPayload;
   35     52   
          53  +
/* RustModule.kt:172 */
   36     54   
mod _complex_nested_error_data;
   37     55   
          56  +
/* RustModule.kt:172 */
   38     57   
mod _foo_enum;
   39     58   
          59  +
/* RustModule.kt:172 */
   40     60   
mod _greeting_struct;
   41     61   
          62  +
/* RustModule.kt:172 */
   42     63   
mod _nested_payload;
   43     64   
          65  +
/* RustModule.kt:172 */
   44     66   
mod _payload_with_xml_name;
   45     67   
          68  +
/* RustModule.kt:172 */
   46     69   
mod _payload_with_xml_namespace;
   47     70   
          71  +
/* RustModule.kt:172 */
   48     72   
mod _payload_with_xml_namespace_and_prefix;
   49     73   
          74  +
/* RustModule.kt:172 */
   50     75   
mod _recursive_shapes_input_output_nested1;
   51     76   
          77  +
/* RustModule.kt:172 */
   52     78   
mod _recursive_shapes_input_output_nested2;
   53     79   
          80  +
/* RustModule.kt:172 */
   54     81   
mod _string_enum;
   55     82   
          83  +
/* RustModule.kt:172 */
   56     84   
mod _structure_list_member;
   57     85   
          86  +
/* RustModule.kt:172 */
   58     87   
mod _union_payload;
   59     88   
          89  +
/* RustModule.kt:172 */
   60     90   
mod _xml_attributes_payload_request;
   61     91   
          92  +
/* RustModule.kt:172 */
   62     93   
mod _xml_attributes_payload_response;
   63     94   
          95  +
/* RustModule.kt:172 */
   64     96   
mod _xml_namespace_nested;
   65     97   
          98  +
/* RustModule.kt:172 */
   66     99   
mod _xml_nested_union_struct;
   67    100   
         101  +
/* RustModule.kt:172 */
   68    102   
mod _xml_union_shape;
   69    103   
   70         -
/// Builders
         104  +
/// /* CodegenDelegator.kt:51 */Builders
   71    105   
pub mod builders;
   72    106   
   73         -
/// Error types that Sample Rest Xml Protocol Service can respond with.
         107  +
/// /* ClientRustModule.kt:121 */Error types that Sample Rest Xml Protocol Service can respond with.
   74    108   
pub mod error;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_complex_nested_error_data.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ComplexNestedErrorData {
           8  +
pub /* StructureGenerator.kt:201 */ struct ComplexNestedErrorData {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl ComplexNestedErrorData {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.foo.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl ComplexNestedErrorData {
   16         -
    /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::ComplexNestedErrorDataBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::ComplexNestedErrorDataBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct ComplexNestedErrorDataBuilder {
   26         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl ComplexNestedErrorDataBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.foo = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.foo = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.foo
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::ComplexNestedErrorData {
   45         -
        crate::types::ComplexNestedErrorData { foo: self.foo }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::ComplexNestedErrorData {
          82  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_foo_enum.rs

@@ -1,1 +126,152 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `FooEnum`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `FooEnum`, it is important to ensure
    4      4   
/// your code is forward-compatible. That is, if a match arm handles a case for a
    5      5   
/// feature that is supported by the service but has not been represented as an enum
    6      6   
/// variant in a current version of SDK, your code should continue to work when you
    7      7   
/// upgrade SDK to a future version in which the enum does include a variant for that
    8      8   
/// feature.
    9         -
///
   10         -
/// Here is an example of how you can make a match expression forward-compatible:
   11         -
///
   12         -
/// ```text
           9  +
/// /* ClientEnumGenerator.kt:244 */
          10  +
/// /* ClientEnumGenerator.kt:245 */Here is an example of how you can make a match expression forward-compatible:
          11  +
/// /* ClientEnumGenerator.kt:246 */
          12  +
/// /* ClientEnumGenerator.kt:247 */```text
          13  +
/* ClientEnumGenerator.kt:248 */
   13     14   
/// # let fooenum = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match fooenum {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     FooEnum::Zero => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     FooEnum::One => { /* ... */ },
          21  +
/* ClientEnumGenerator.kt:251 */
   17     22   
///     FooEnum::Bar => { /* ... */ },
          23  +
/* ClientEnumGenerator.kt:251 */
   18     24   
///     FooEnum::Baz => { /* ... */ },
          25  +
/* ClientEnumGenerator.kt:251 */
   19     26   
///     FooEnum::Foo => { /* ... */ },
          27  +
/* ClientEnumGenerator.kt:253 */
   20     28   
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          29  +
/* ClientEnumGenerator.kt:254 */
   21     30   
///     _ => { /* ... */ },
          31  +
/* ClientEnumGenerator.kt:255 */
   22     32   
/// }
   23         -
/// ```
   24         -
/// The above code demonstrates that when `fooenum` represents
          33  +
/// /* ClientEnumGenerator.kt:256 */```
          34  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `fooenum` represents
   25     35   
/// `NewFeature`, the execution path will lead to the second last match arm,
   26     36   
/// even though the enum does not contain a variant `FooEnum::NewFeature`
   27     37   
/// in the current version of SDK. The reason is that the variable `other`,
   28     38   
/// created by the `@` operator, is bound to
   29     39   
/// `FooEnum::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
   30     40   
/// and calling `as_str` on it yields `"NewFeature"`.
   31     41   
/// This match expression is forward-compatible when executed with a newer
   32     42   
/// version of SDK where the variant `FooEnum::NewFeature` is defined.
   33     43   
/// Specifically, when `fooenum` represents `NewFeature`,
   34     44   
/// the execution path will hit the second last match arm as before by virtue of
   35     45   
/// calling `as_str` on `FooEnum::NewFeature` also yielding `"NewFeature"`.
   36         -
///
   37         -
/// Explicitly matching on the `Unknown` variant should
          46  +
/// /* ClientEnumGenerator.kt:273 */
          47  +
/// /* ClientEnumGenerator.kt:274 */Explicitly matching on the `Unknown` variant should
   38     48   
/// be avoided for two reasons:
   39     49   
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
   40     50   
/// - It might inadvertently shadow other intended match arms.
   41         -
///
          51  +
/// /* ClientEnumGenerator.kt:282 */
          52  +
/* EnumGenerator.kt:154 */
   42     53   
#[allow(missing_docs)] // documentation missing in model
          54  +
/* RustType.kt:516 */
   43     55   
#[non_exhaustive]
          56  +
/* RustType.kt:516 */
   44     57   
#[derive(
   45     58   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   46     59   
)]
   47         -
pub enum FooEnum {
   48         -
    #[allow(missing_docs)] // documentation missing in model
          60  +
pub /* EnumGenerator.kt:267 */ enum FooEnum {
          61  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          62  +
    /* EnumGenerator.kt:143 */
   49     63   
    Zero,
   50         -
    #[allow(missing_docs)] // documentation missing in model
          64  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          65  +
    /* EnumGenerator.kt:143 */
   51     66   
    One,
   52         -
    #[allow(missing_docs)] // documentation missing in model
          67  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          68  +
    /* EnumGenerator.kt:143 */
   53     69   
    Bar,
   54         -
    #[allow(missing_docs)] // documentation missing in model
          70  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          71  +
    /* EnumGenerator.kt:143 */
   55     72   
    Baz,
   56         -
    #[allow(missing_docs)] // documentation missing in model
          73  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          74  +
    /* EnumGenerator.kt:143 */
   57     75   
    Foo,
   58         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          76  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          77  +
    /* ClientEnumGenerator.kt:176 */
   59     78   
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
   60         -
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          79  +
    /* ClientEnumGenerator.kt:179 */
          80  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   61     81   
}
          82  +
/* ClientEnumGenerator.kt:42 */
   62     83   
impl ::std::convert::From<&str> for FooEnum {
   63     84   
    fn from(s: &str) -> Self {
   64     85   
        match s {
   65     86   
            "0" => FooEnum::Zero,
   66     87   
            "1" => FooEnum::One,
   67     88   
            "Bar" => FooEnum::Bar,
   68     89   
            "Baz" => FooEnum::Baz,
   69     90   
            "Foo" => FooEnum::Foo,
   70     91   
            other => FooEnum::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   71     92   
        }
   72     93   
    }
   73     94   
}
          95  +
/* ClientEnumGenerator.kt:68 */
   74     96   
impl ::std::str::FromStr for FooEnum {
   75     97   
    type Err = ::std::convert::Infallible;
   76     98   
   77     99   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   78    100   
        ::std::result::Result::Ok(FooEnum::from(s))
   79    101   
    }
   80    102   
}
         103  +
/* EnumGenerator.kt:274 */
   81    104   
impl FooEnum {
   82    105   
    /// Returns the `&str` value of the enum member.
   83    106   
    pub fn as_str(&self) -> &str {
   84    107   
        match self {
   85    108   
            FooEnum::Zero => "0",
   86    109   
            FooEnum::One => "1",
   87    110   
            FooEnum::Bar => "Bar",
   88    111   
            FooEnum::Baz => "Baz",
   89    112   
            FooEnum::Foo => "Foo",
   90    113   
            FooEnum::Unknown(value) => value.as_str(),
   91    114   
        }
   92    115   
    }
   93    116   
    /// Returns all the `&str` representations of the enum members.
   94    117   
    pub const fn values() -> &'static [&'static str] {
   95    118   
        &["0", "1", "Bar", "Baz", "Foo"]
   96    119   
    }
   97    120   
}
         121  +
/* EnumGenerator.kt:223 */
   98    122   
impl ::std::convert::AsRef<str> for FooEnum {
   99    123   
    fn as_ref(&self) -> &str {
  100    124   
        self.as_str()
  101    125   
    }
  102    126   
}
         127  +
/* ClientEnumGenerator.kt:117 */
  103    128   
impl FooEnum {
  104    129   
    /// Parses the enum value while disallowing unknown variants.
  105    130   
    ///
  106    131   
    /// Unknown variants will result in an error.
  107    132   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  108    133   
        match Self::from(value) {
  109    134   
            #[allow(deprecated)]
  110    135   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  111    136   
            known => Ok(known),
  112    137   
        }
  113    138   
    }
  114    139   
}
         140  +
/* ClientEnumGenerator.kt:136 */
  115    141   
impl ::std::fmt::Display for FooEnum {
  116    142   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  117    143   
        match self {
  118    144   
            FooEnum::Zero => write!(f, "0"),
  119    145   
            FooEnum::One => write!(f, "1"),
  120    146   
            FooEnum::Bar => write!(f, "Bar"),
  121    147   
            FooEnum::Baz => write!(f, "Baz"),
  122    148   
            FooEnum::Foo => write!(f, "Foo"),
  123    149   
            FooEnum::Unknown(value) => write!(f, "{}", value),
  124    150   
        }

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_greeting_struct.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct GreetingStruct {
           8  +
pub /* StructureGenerator.kt:201 */ struct GreetingStruct {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub hi: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl GreetingStruct {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn hi(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.hi.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl GreetingStruct {
   16         -
    /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::types::GreetingStruct).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GreetingStruct`](crate::types::GreetingStruct).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::GreetingStructBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::GreetingStructBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`GreetingStruct`](crate::types::GreetingStruct).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`GreetingStruct`](crate::types::GreetingStruct).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct GreetingStructBuilder {
   26         -
    pub(crate) hi: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) hi: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl GreetingStructBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn hi(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.hi = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.hi = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_hi(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.hi
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`GreetingStruct`](crate::types::GreetingStruct).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GreetingStruct`](crate::types::GreetingStruct).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::GreetingStruct {
   45         -
        crate::types::GreetingStruct { hi: self.hi }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::GreetingStruct {
          82  +
            /* BuilderGenerator.kt:481 */ hi: self.hi,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_nested_payload.rs

@@ -1,1 +71,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct NestedPayload {
           8  +
pub /* StructureGenerator.kt:201 */ struct NestedPayload {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub greeting: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub name: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl NestedPayload {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn greeting(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.greeting.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn name(&self) -> ::std::option::Option<&str> {
          31  +
        /* StructureGenerator.kt:169 */
   18     32   
        self.name.as_deref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl NestedPayload {
   22         -
    /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::types::NestedPayload).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NestedPayload`](crate::types::NestedPayload).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::types::builders::NestedPayloadBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::types::builders::NestedPayloadBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`NestedPayload`](crate::types::NestedPayload).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`NestedPayload`](crate::types::NestedPayload).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct NestedPayloadBuilder {
   32         -
    pub(crate) greeting: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) greeting: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl NestedPayloadBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn greeting(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.greeting = ::std::option::Option::Some(input.into());
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_greeting(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.greeting = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_greeting(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.greeting
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.name = ::std::option::Option::Some(input.into());
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.name = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.name
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`NestedPayload`](crate::types::NestedPayload).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NestedPayload`](crate::types::NestedPayload).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(self) -> crate::types::NestedPayload {
         119  +
        /* BuilderGenerator.kt:477 */
   66    120   
        crate::types::NestedPayload {
   67         -
            greeting: self.greeting,
         121  +
            /* BuilderGenerator.kt:481 */ greeting: self.greeting,
         122  +
            /* BuilderGenerator.kt:481 */
   68    123   
            name: self.name,
         124  +
            /* BuilderGenerator.kt:477 */
   69    125   
        }
         126  +
        /* BuilderGenerator.kt:253 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:355 */
   71    129   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_payload_with_xml_name.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct PayloadWithXmlName {
           8  +
pub /* StructureGenerator.kt:201 */ struct PayloadWithXmlName {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub name: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PayloadWithXmlName {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn name(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.name.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PayloadWithXmlName {
   16         -
    /// Creates a new builder-style object to manufacture [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::PayloadWithXmlNameBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::PayloadWithXmlNameBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct PayloadWithXmlNameBuilder {
   26         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PayloadWithXmlNameBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.name = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.name = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.name
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::PayloadWithXmlName {
   45         -
        crate::types::PayloadWithXmlName { name: self.name }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::PayloadWithXmlName {
          82  +
            /* BuilderGenerator.kt:481 */ name: self.name,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_payload_with_xml_namespace.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct PayloadWithXmlNamespace {
           8  +
pub /* StructureGenerator.kt:201 */ struct PayloadWithXmlNamespace {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub name: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PayloadWithXmlNamespace {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn name(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.name.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PayloadWithXmlNamespace {
   16         -
    /// Creates a new builder-style object to manufacture [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::PayloadWithXmlNamespaceBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::PayloadWithXmlNamespaceBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct PayloadWithXmlNamespaceBuilder {
   26         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PayloadWithXmlNamespaceBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.name = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.name = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.name
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PayloadWithXmlNamespace`](crate::types::PayloadWithXmlNamespace).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::PayloadWithXmlNamespace {
   45         -
        crate::types::PayloadWithXmlNamespace { name: self.name }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::PayloadWithXmlNamespace {
          82  +
            /* BuilderGenerator.kt:481 */ name: self.name,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_payload_with_xml_namespace_and_prefix.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct PayloadWithXmlNamespaceAndPrefix {
           8  +
pub /* StructureGenerator.kt:201 */ struct PayloadWithXmlNamespaceAndPrefix {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub name: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PayloadWithXmlNamespaceAndPrefix {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn name(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.name.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PayloadWithXmlNamespaceAndPrefix {
   16         -
    /// Creates a new builder-style object to manufacture [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::PayloadWithXmlNamespaceAndPrefixBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::PayloadWithXmlNamespaceAndPrefixBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct PayloadWithXmlNamespaceAndPrefixBuilder {
   26         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PayloadWithXmlNamespaceAndPrefixBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.name = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.name = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.name
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PayloadWithXmlNamespaceAndPrefix`](crate::types::PayloadWithXmlNamespaceAndPrefix).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::PayloadWithXmlNamespaceAndPrefix {
   45         -
        crate::types::PayloadWithXmlNamespaceAndPrefix { name: self.name }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::PayloadWithXmlNamespaceAndPrefix {
          82  +
            /* BuilderGenerator.kt:481 */ name: self.name,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_recursive_shapes_input_output_nested1.rs

@@ -1,1 +71,130 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct RecursiveShapesInputOutputNested1 {
           8  +
pub /* StructureGenerator.kt:201 */ struct RecursiveShapesInputOutputNested1 {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub nested: ::std::option::Option<::std::boxed::Box<crate::types::RecursiveShapesInputOutputNested2>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl RecursiveShapesInputOutputNested1 {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn nested(&self) -> ::std::option::Option<&crate::types::RecursiveShapesInputOutputNested2> {
          31  +
        /* StructureGenerator.kt:169 */
   18     32   
        self.nested.as_deref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl RecursiveShapesInputOutputNested1 {
   22         -
    /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::types::builders::RecursiveShapesInputOutputNested1Builder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::types::builders::RecursiveShapesInputOutputNested1Builder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct RecursiveShapesInputOutputNested1Builder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */
   33     58   
    pub(crate) nested: ::std::option::Option<::std::boxed::Box<crate::types::RecursiveShapesInputOutputNested2>>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl RecursiveShapesInputOutputNested1Builder {
          63  +
    /* BuilderGenerator.kt:286 */
   36     64   
    #[allow(missing_docs)] // documentation missing in model
          65  +
                           /* BuilderGenerator.kt:291 */
   37     66   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          67  +
        /* BuilderGenerator.kt:292 */
   38     68   
        self.foo = ::std::option::Option::Some(input.into());
          69  +
        /* BuilderGenerator.kt:293 */
   39     70   
        self
          71  +
        /* BuilderGenerator.kt:291 */
   40     72   
    }
          73  +
    /* BuilderGenerator.kt:312 */
   41     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* BuilderGenerator.kt:314 */
   42     76   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          77  +
        /* BuilderGenerator.kt:315 */
   43     78   
        self.foo = input;
   44     79   
        self
          80  +
        /* BuilderGenerator.kt:314 */
   45     81   
    }
          82  +
    /* BuilderGenerator.kt:334 */
   46     83   
    #[allow(missing_docs)] // documentation missing in model
          84  +
                           /* BuilderGenerator.kt:336 */
   47     85   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          86  +
        /* BuilderGenerator.kt:337 */
   48     87   
        &self.foo
          88  +
        /* BuilderGenerator.kt:336 */
   49     89   
    }
          90  +
    /* BuilderGenerator.kt:286 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:291 */
   51     93   
    pub fn nested(mut self, input: impl ::std::convert::Into<::std::boxed::Box<crate::types::RecursiveShapesInputOutputNested2>>) -> Self {
          94  +
        /* BuilderGenerator.kt:292 */
   52     95   
        self.nested = ::std::option::Option::Some(input.into());
          96  +
        /* BuilderGenerator.kt:293 */
   53     97   
        self
          98  +
        /* BuilderGenerator.kt:291 */
   54     99   
    }
         100  +
    /* BuilderGenerator.kt:312 */
   55    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:314 */
   56    103   
    pub fn set_nested(mut self, input: ::std::option::Option<::std::boxed::Box<crate::types::RecursiveShapesInputOutputNested2>>) -> Self {
         104  +
        /* BuilderGenerator.kt:315 */
   57    105   
        self.nested = input;
   58    106   
        self
         107  +
        /* BuilderGenerator.kt:314 */
   59    108   
    }
         109  +
    /* BuilderGenerator.kt:334 */
   60    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:336 */
   61    112   
    pub fn get_nested(&self) -> &::std::option::Option<::std::boxed::Box<crate::types::RecursiveShapesInputOutputNested2>> {
         113  +
        /* BuilderGenerator.kt:337 */
   62    114   
        &self.nested
         115  +
        /* BuilderGenerator.kt:336 */
   63    116   
    }
   64         -
    /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
         117  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
         118  +
    /* BuilderGenerator.kt:253 */
   65    119   
    pub fn build(self) -> crate::types::RecursiveShapesInputOutputNested1 {
         120  +
        /* BuilderGenerator.kt:477 */
   66    121   
        crate::types::RecursiveShapesInputOutputNested1 {
   67         -
            foo: self.foo,
         122  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
         123  +
            /* BuilderGenerator.kt:481 */
   68    124   
            nested: self.nested,
         125  +
            /* BuilderGenerator.kt:477 */
   69    126   
        }
         127  +
        /* BuilderGenerator.kt:253 */
   70    128   
    }
         129  +
    /* BuilderGenerator.kt:355 */
   71    130   
}