Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_innermost_shape.rs

@@ -1,1 +206,376 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_innermost_shape<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::InnermostShape>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::InnermostShapeBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "aString" => {
   18         -
                            builder = builder.set_a_string(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
          26  +
                            "aString" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_a_string(
          29  +
                                    /* JsonParserGenerator.kt:354 */
          30  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          36  +
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
          38  +
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
          40  +
                            "aBoolean" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
          42  +
                                builder = builder.set_a_boolean(
          43  +
                                    /* JsonParserGenerator.kt:298 */
          44  +
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?, /* JsonParserGenerator.kt:265 */
          45  +
                                );
          46  +
                                /* JsonParserGenerator.kt:262 */
          47  +
                            }
          48  +
                            /* JsonParserGenerator.kt:262 */
          49  +
                            "aByte" => {
          50  +
                                /* JsonParserGenerator.kt:265 */
          51  +
                                builder = builder.set_a_byte(
          52  +
                                    /* JsonParserGenerator.kt:365 */
          53  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          54  +
                                        .map(i8::try_from)
          55  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          56  +
                                );
          57  +
                                /* JsonParserGenerator.kt:262 */
          58  +
                            }
          59  +
                            /* JsonParserGenerator.kt:262 */
          60  +
                            "aShort" => {
          61  +
                                /* JsonParserGenerator.kt:265 */
          62  +
                                builder = builder.set_a_short(
          63  +
                                    /* JsonParserGenerator.kt:365 */
          64  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          65  +
                                        .map(i16::try_from)
          66  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          67  +
                                );
          68  +
                                /* JsonParserGenerator.kt:262 */
          69  +
                            }
          70  +
                            /* JsonParserGenerator.kt:262 */
          71  +
                            "anInt" => {
          72  +
                                /* JsonParserGenerator.kt:265 */
          73  +
                                builder = builder.set_an_int(
          74  +
                                    /* JsonParserGenerator.kt:365 */
          75  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          76  +
                                        .map(i32::try_from)
          77  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          78  +
                                );
          79  +
                                /* JsonParserGenerator.kt:262 */
          80  +
                            }
          81  +
                            /* JsonParserGenerator.kt:262 */
          82  +
                            "aLong" => {
          83  +
                                /* JsonParserGenerator.kt:265 */
          84  +
                                builder = builder.set_a_long(
          85  +
                                    /* JsonParserGenerator.kt:365 */
          86  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          87  +
                                        .map(i64::try_from)
          88  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          89  +
                                );
          90  +
                                /* JsonParserGenerator.kt:262 */
          91  +
                            }
          92  +
                            /* JsonParserGenerator.kt:262 */
          93  +
                            "aFloat" => {
          94  +
                                /* JsonParserGenerator.kt:265 */
          95  +
                                builder = builder.set_a_float(
          96  +
                                    /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
          97  +
                                /* JsonParserGenerator.kt:265 */);
          98  +
                                /* JsonParserGenerator.kt:262 */
          99  +
                            }
         100  +
                            /* JsonParserGenerator.kt:262 */
         101  +
                            "aDouble" => {
         102  +
                                /* JsonParserGenerator.kt:265 */
         103  +
                                builder = builder.set_a_double(
         104  +
                                    /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         105  +
                                /* JsonParserGenerator.kt:265 */);
         106  +
                                /* JsonParserGenerator.kt:262 */
         107  +
                            }
         108  +
                            /* JsonParserGenerator.kt:262 */
         109  +
                            "aTimestamp" => {
         110  +
                                /* JsonParserGenerator.kt:265 */
         111  +
                                builder = builder.set_a_timestamp(
         112  +
                                    /* JsonParserGenerator.kt:384 */
         113  +
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
         114  +
                                        tokens.next(),
         115  +
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
         116  +
                                    )?, /* JsonParserGenerator.kt:265 */
         117  +
                                );
         118  +
                                /* JsonParserGenerator.kt:262 */
         119  +
                            }
         120  +
                            /* JsonParserGenerator.kt:262 */
         121  +
                            "aDocument" => {
         122  +
                                /* JsonParserGenerator.kt:265 */
         123  +
                                builder = builder.set_a_document(
         124  +
                                    /* JsonParserGenerator.kt:384 */
         125  +
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
         126  +
                                        tokens.next(),
         127  +
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
         128  +
                                    )?, /* JsonParserGenerator.kt:265 */
         129  +
                                );
         130  +
                                /* JsonParserGenerator.kt:262 */
         131  +
                            }
         132  +
                            /* JsonParserGenerator.kt:262 */
         133  +
                            "aStringList" => {
         134  +
                                /* JsonParserGenerator.kt:265 */
         135  +
                                builder = builder.set_a_string_list(
         136  +
                                    /* JsonParserGenerator.kt:451 */
         137  +
                                    crate::protocol_serde::shape_a_string_list::de_a_string_list(tokens)?, /* JsonParserGenerator.kt:265 */
         138  +
                                );
         139  +
                                /* JsonParserGenerator.kt:262 */
         140  +
                            }
         141  +
                            /* JsonParserGenerator.kt:262 */
         142  +
                            "aStringMap" => {
         143  +
                                /* JsonParserGenerator.kt:265 */
         144  +
                                builder = builder.set_a_string_map(
         145  +
                                    /* JsonParserGenerator.kt:509 */
         146  +
                                    crate::protocol_serde::shape_a_map::de_a_map(tokens)?, /* JsonParserGenerator.kt:265 */
         147  +
                                );
         148  +
                                /* JsonParserGenerator.kt:262 */
         149  +
                            }
         150  +
                            /* JsonParserGenerator.kt:262 */
         151  +
                            "aStringSet" => {
         152  +
                                /* JsonParserGenerator.kt:265 */
         153  +
                                builder = builder.set_a_string_set(
         154  +
                                    /* JsonParserGenerator.kt:451 */
         155  +
                                    crate::protocol_serde::shape_a_string_set::de_a_string_set(tokens)?, /* JsonParserGenerator.kt:265 */
         156  +
                                );
         157  +
                                /* JsonParserGenerator.kt:262 */
         158  +
                            }
         159  +
                            /* JsonParserGenerator.kt:262 */
         160  +
                            "aBlob" => {
         161  +
                                /* JsonParserGenerator.kt:265 */
         162  +
                                builder = builder.set_a_blob(
         163  +
                                    /* JsonParserGenerator.kt:326 */
         164  +
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?, /* JsonParserGenerator.kt:265 */
         165  +
                                );
         166  +
                                /* JsonParserGenerator.kt:262 */
         167  +
                            }
         168  +
                            /* JsonParserGenerator.kt:262 */
         169  +
                            "aUnion" => {
         170  +
                                /* JsonParserGenerator.kt:265 */
         171  +
                                builder = builder.set_a_union(
         172  +
                                    /* JsonParserGenerator.kt:660 */
         173  +
                                    crate::protocol_serde::shape_a_union::de_a_union(tokens)?, /* JsonParserGenerator.kt:265 */
         174  +
                                );
         175  +
                                /* JsonParserGenerator.kt:262 */
         176  +
                            }
         177  +
                            /* JsonParserGenerator.kt:290 */
         178  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   23    179   
                        }
   24         -
                        "aBoolean" => {
   25         -
                            builder = builder.set_a_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   26         -
                        }
   27         -
                        "aByte" => {
   28         -
                            builder = builder.set_a_byte(
   29         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   30         -
                                    .map(i8::try_from)
   31         -
                                    .transpose()?,
   32         -
                            );
   33         -
                        }
   34         -
                        "aShort" => {
   35         -
                            builder = builder.set_a_short(
   36         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   37         -
                                    .map(i16::try_from)
   38         -
                                    .transpose()?,
   39         -
                            );
   40         -
                        }
   41         -
                        "anInt" => {
   42         -
                            builder = builder.set_an_int(
   43         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   44         -
                                    .map(i32::try_from)
   45         -
                                    .transpose()?,
   46         -
                            );
   47         -
                        }
   48         -
                        "aLong" => {
   49         -
                            builder = builder.set_a_long(
   50         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   51         -
                                    .map(i64::try_from)
   52         -
                                    .transpose()?,
   53         -
                            );
   54         -
                        }
   55         -
                        "aFloat" => {
   56         -
                            builder = builder
   57         -
                                .set_a_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
   58         -
                        }
   59         -
                        "aDouble" => {
   60         -
                            builder = builder
   61         -
                                .set_a_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   62         -
                        }
   63         -
                        "aTimestamp" => {
   64         -
                            builder = builder.set_a_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   65         -
                                tokens.next(),
   66         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   67         -
                            )?);
   68         -
                        }
   69         -
                        "aDocument" => {
   70         -
                            builder = builder.set_a_document(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   71         -
                                tokens.next(),
   72         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   73         -
                            )?);
   74         -
                        }
   75         -
                        "aStringList" => {
   76         -
                            builder = builder.set_a_string_list(crate::protocol_serde::shape_a_string_list::de_a_string_list(tokens)?);
   77         -
                        }
   78         -
                        "aStringMap" => {
   79         -
                            builder = builder.set_a_string_map(crate::protocol_serde::shape_a_map::de_a_map(tokens)?);
   80         -
                        }
   81         -
                        "aStringSet" => {
   82         -
                            builder = builder.set_a_string_set(crate::protocol_serde::shape_a_string_set::de_a_string_set(tokens)?);
   83         -
                        }
   84         -
                        "aBlob" => {
   85         -
                            builder = builder.set_a_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
   86         -
                        }
   87         -
                        "aUnion" => {
   88         -
                            builder = builder.set_a_union(crate::protocol_serde::shape_a_union::de_a_union(tokens)?);
   89         -
                        }
   90         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   91         -
                    },
         180  +
                        /* JsonParserGenerator.kt:686 */
         181  +
                    }
         182  +
                    /* JsonParserGenerator.kt:695 */
   92    183   
                    other => {
   93    184   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   94    185   
                            "expected object key or end object, found: {:?}",
   95    186   
                            other
   96    187   
                        )))
   97         -
                    }
         188  +
                    } /* JsonParserGenerator.kt:685 */
   98    189   
                }
         190  +
                /* JsonParserGenerator.kt:684 */
   99    191   
            }
         192  +
            /* JsonParserGenerator.kt:540 */
  100    193   
            Ok(Some(crate::serde_util::innermost_shape_correct_errors(builder).build().map_err(
  101    194   
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
  102    195   
            )?))
         196  +
            /* JsonParserGenerator.kt:713 */
  103    197   
        }
  104         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  105         -
            "expected start object or null",
  106         -
        )),
         198  +
        /* JsonParserGenerator.kt:722 */
         199  +
        _ => {
         200  +
            /* JsonParserGenerator.kt:723 */
         201  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
         202  +
                "expected start object or null",
         203  +
            ))
         204  +
            /* JsonParserGenerator.kt:722 */
         205  +
        } /* JsonParserGenerator.kt:712 */
  107    206   
    }
         207  +
    /* JsonParserGenerator.kt:516 */
  108    208   
}
  109    209   
         210  +
/* JsonSerializerGenerator.kt:358 */
  110    211   
pub fn ser_innermost_shape(
  111    212   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  112    213   
    input: &crate::types::InnermostShape,
  113    214   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         215  +
    /* SerializerUtil.kt:42 */
  114    216   
    {
         217  +
        /* JsonSerializerGenerator.kt:423 */
  115    218   
        object.key("aString").string(input.a_string.as_str());
         219  +
        /* SerializerUtil.kt:42 */
  116    220   
    }
         221  +
    /* SerializerUtil.kt:42 */
  117    222   
    {
         223  +
        /* JsonSerializerGenerator.kt:424 */
  118    224   
        object.key("aBoolean").boolean(input.a_boolean);
         225  +
        /* SerializerUtil.kt:42 */
  119    226   
    }
         227  +
    /* SerializerUtil.kt:42 */
  120    228   
    {
         229  +
        /* JsonSerializerGenerator.kt:432 */
  121    230   
        object.key("aByte").number(
  122    231   
            #[allow(clippy::useless_conversion)]
  123    232   
            ::aws_smithy_types::Number::NegInt((input.a_byte).into()),
  124    233   
        );
         234  +
        /* SerializerUtil.kt:42 */
  125    235   
    }
         236  +
    /* SerializerUtil.kt:42 */
  126    237   
    {
         238  +
        /* JsonSerializerGenerator.kt:432 */
  127    239   
        object.key("aShort").number(
  128    240   
            #[allow(clippy::useless_conversion)]
  129    241   
            ::aws_smithy_types::Number::NegInt((input.a_short).into()),
  130    242   
        );
         243  +
        /* SerializerUtil.kt:42 */
  131    244   
    }
         245  +
    /* SerializerUtil.kt:42 */
  132    246   
    {
         247  +
        /* JsonSerializerGenerator.kt:432 */
  133    248   
        object.key("anInt").number(
  134    249   
            #[allow(clippy::useless_conversion)]
  135    250   
            ::aws_smithy_types::Number::NegInt((input.an_int).into()),
  136    251   
        );
         252  +
        /* SerializerUtil.kt:42 */
  137    253   
    }
         254  +
    /* SerializerUtil.kt:42 */
  138    255   
    {
         256  +
        /* JsonSerializerGenerator.kt:432 */
  139    257   
        object.key("aLong").number(
  140    258   
            #[allow(clippy::useless_conversion)]
  141    259   
            ::aws_smithy_types::Number::NegInt((input.a_long).into()),
  142    260   
        );
         261  +
        /* SerializerUtil.kt:42 */
  143    262   
    }
         263  +
    /* SerializerUtil.kt:42 */
  144    264   
    {
         265  +
        /* JsonSerializerGenerator.kt:432 */
  145    266   
        object.key("aFloat").number(
  146    267   
            #[allow(clippy::useless_conversion)]
  147    268   
            ::aws_smithy_types::Number::Float((input.a_float).into()),
  148    269   
        );
         270  +
        /* SerializerUtil.kt:42 */
  149    271   
    }
         272  +
    /* SerializerUtil.kt:42 */
  150    273   
    {
         274  +
        /* JsonSerializerGenerator.kt:432 */
  151    275   
        object.key("aDouble").number(
  152    276   
            #[allow(clippy::useless_conversion)]
  153    277   
            ::aws_smithy_types::Number::Float((input.a_double).into()),
  154    278   
        );
         279  +
        /* SerializerUtil.kt:42 */
  155    280   
    }
         281  +
    /* SerializerUtil.kt:42 */
  156    282   
    {
         283  +
        /* JsonSerializerGenerator.kt:448 */
  157    284   
        object
  158    285   
            .key("aTimestamp")
  159    286   
            .date_time(&input.a_timestamp, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         287  +
        /* SerializerUtil.kt:42 */
  160    288   
    }
         289  +
    /* SerializerUtil.kt:42 */
  161    290   
    {
         291  +
        /* JsonSerializerGenerator.kt:448 */
  162    292   
        object
  163    293   
            .key("aDocument")
  164    294   
            .date_time(&input.a_document, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         295  +
        /* SerializerUtil.kt:42 */
  165    296   
    }
         297  +
    /* SerializerUtil.kt:42 */
  166    298   
    {
         299  +
        /* JsonSerializerGenerator.kt:484 */
  167    300   
        let mut array_1 = object.key("aStringList").start_array();
         301  +
        /* JsonSerializerGenerator.kt:524 */
  168    302   
        for item_2 in &input.a_string_list {
         303  +
            /* SerializerUtil.kt:42 */
  169    304   
            {
         305  +
                /* JsonSerializerGenerator.kt:423 */
  170    306   
                array_1.value().string(item_2.as_str());
         307  +
                /* SerializerUtil.kt:42 */
  171    308   
            }
         309  +
            /* JsonSerializerGenerator.kt:524 */
  172    310   
        }
         311  +
        /* JsonSerializerGenerator.kt:486 */
  173    312   
        array_1.finish();
         313  +
        /* SerializerUtil.kt:42 */
  174    314   
    }
         315  +
    /* SerializerUtil.kt:42 */
  175    316   
    {
         317  +
        /* JsonSerializerGenerator.kt:495 */
  176    318   
        #[allow(unused_mut)]
         319  +
        /* JsonSerializerGenerator.kt:496 */
  177    320   
        let mut object_3 = object.key("aStringMap").start_object();
         321  +
        /* JsonSerializerGenerator.kt:537 */
  178    322   
        for (key_4, value_5) in &input.a_string_map {
         323  +
            /* SerializerUtil.kt:42 */
  179    324   
            {
         325  +
                /* JsonSerializerGenerator.kt:448 */
  180    326   
                object_3
  181    327   
                    .key(key_4.as_str())
  182    328   
                    .date_time(value_5, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         329  +
                /* SerializerUtil.kt:42 */
  183    330   
            }
         331  +
            /* JsonSerializerGenerator.kt:537 */
  184    332   
        }
         333  +
        /* JsonSerializerGenerator.kt:515 */
  185    334   
        object_3.finish();
         335  +
        /* SerializerUtil.kt:42 */
  186    336   
    }
         337  +
    /* SerializerUtil.kt:42 */
  187    338   
    {
         339  +
        /* JsonSerializerGenerator.kt:484 */
  188    340   
        let mut array_6 = object.key("aStringSet").start_array();
         341  +
        /* JsonSerializerGenerator.kt:524 */
  189    342   
        for item_7 in &input.a_string_set {
         343  +
            /* SerializerUtil.kt:42 */
  190    344   
            {
         345  +
                /* JsonSerializerGenerator.kt:423 */
  191    346   
                array_6.value().string(item_7.as_str());
         347  +
                /* SerializerUtil.kt:42 */
  192    348   
            }
         349  +
            /* JsonSerializerGenerator.kt:524 */
  193    350   
        }
         351  +
        /* JsonSerializerGenerator.kt:486 */
  194    352   
        array_6.finish();
         353  +
        /* SerializerUtil.kt:42 */
  195    354   
    }
         355  +
    /* SerializerUtil.kt:42 */
  196    356   
    {
         357  +
        /* JsonSerializerGenerator.kt:439 */
  197    358   
        object.key("aBlob").string_unchecked(&::aws_smithy_types::base64::encode(&input.a_blob));
         359  +
        /* SerializerUtil.kt:42 */
  198    360   
    }
         361  +
    /* SerializerUtil.kt:42 */
  199    362   
    {
         363  +
        /* JsonSerializerGenerator.kt:495 */
  200    364   
        #[allow(unused_mut)]
         365  +
        /* JsonSerializerGenerator.kt:496 */
  201    366   
        let mut object_8 = object.key("aUnion").start_object();
         367  +
        /* JsonSerializerGenerator.kt:579 */
  202    368   
        crate::protocol_serde::shape_a_union::ser_a_union(&mut object_8, &input.a_union)?;
         369  +
        /* JsonSerializerGenerator.kt:515 */
  203    370   
        object_8.finish();
         371  +
        /* SerializerUtil.kt:42 */
  204    372   
    }
         373  +
    /* JsonSerializerGenerator.kt:372 */
  205    374   
    Ok(())
         375  +
    /* JsonSerializerGenerator.kt:358 */
  206    376   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_a.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
   22         -
                        let value = crate::protocol_serde::shape_list_b::de_list_b(tokens)?;
          31  +
                        /* JsonParserGenerator.kt:419 */
          32  +
                        let value =
          33  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_b::de_list_b(tokens)?
          34  +
                        /* JsonParserGenerator.kt:419 */;
          35  +
                        /* JsonParserGenerator.kt:422 */
   23     36   
                        if let Some(value) = value {
   24     37   
                            items.push(value);
   25     38   
                        }
   26         -
                    }
          39  +
                        /* JsonParserGenerator.kt:413 */
          40  +
                    } /* JsonParserGenerator.kt:409 */
   27     41   
                }
          42  +
                /* JsonParserGenerator.kt:408 */
   28     43   
            }
          44  +
            /* JsonParserGenerator.kt:446 */
   29     45   
            Ok(Some(items))
          46  +
            /* JsonParserGenerator.kt:713 */
   30     47   
        }
   31         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "expected start array or null",
   33         -
        )),
          48  +
        /* JsonParserGenerator.kt:722 */
          49  +
        _ => {
          50  +
            /* JsonParserGenerator.kt:723 */
          51  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          52  +
                "expected start array or null",
          53  +
            ))
          54  +
            /* JsonParserGenerator.kt:722 */
          55  +
        } /* JsonParserGenerator.kt:712 */
   34     56   
    }
          57  +
    /* JsonParserGenerator.kt:398 */
   35     58   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_b.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_b<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
   22         -
                        let value = crate::protocol_serde::shape_list_c::de_list_c(tokens)?;
          31  +
                        /* JsonParserGenerator.kt:419 */
          32  +
                        let value =
          33  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_c::de_list_c(tokens)?
          34  +
                        /* JsonParserGenerator.kt:419 */;
          35  +
                        /* JsonParserGenerator.kt:422 */
   23     36   
                        if let Some(value) = value {
   24     37   
                            items.push(value);
   25     38   
                        }
   26         -
                    }
          39  +
                        /* JsonParserGenerator.kt:413 */
          40  +
                    } /* JsonParserGenerator.kt:409 */
   27     41   
                }
          42  +
                /* JsonParserGenerator.kt:408 */
   28     43   
            }
          44  +
            /* JsonParserGenerator.kt:446 */
   29     45   
            Ok(Some(items))
          46  +
            /* JsonParserGenerator.kt:713 */
   30     47   
        }
   31         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "expected start array or null",
   33         -
        )),
          48  +
        /* JsonParserGenerator.kt:722 */
          49  +
        _ => {
          50  +
            /* JsonParserGenerator.kt:723 */
          51  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          52  +
                "expected start array or null",
          53  +
            ))
          54  +
            /* JsonParserGenerator.kt:722 */
          55  +
        } /* JsonParserGenerator.kt:712 */
   34     56   
    }
          57  +
    /* JsonParserGenerator.kt:398 */
   35     58   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_c.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_c<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
   22         -
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens)?;
          31  +
                        /* JsonParserGenerator.kt:419 */
          32  +
                        let value =
          33  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_a::de_map_a(tokens)?
          34  +
                        /* JsonParserGenerator.kt:419 */;
          35  +
                        /* JsonParserGenerator.kt:422 */
   23     36   
                        if let Some(value) = value {
   24     37   
                            items.push(value);
   25     38   
                        }
   26         -
                    }
          39  +
                        /* JsonParserGenerator.kt:413 */
          40  +
                    } /* JsonParserGenerator.kt:409 */
   27     41   
                }
          42  +
                /* JsonParserGenerator.kt:408 */
   28     43   
            }
          44  +
            /* JsonParserGenerator.kt:446 */
   29     45   
            Ok(Some(items))
          46  +
            /* JsonParserGenerator.kt:713 */
   30     47   
        }
   31         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "expected start array or null",
   33         -
        )),
          48  +
        /* JsonParserGenerator.kt:722 */
          49  +
        _ => {
          50  +
            /* JsonParserGenerator.kt:723 */
          51  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          52  +
                "expected start array or null",
          53  +
            ))
          54  +
            /* JsonParserGenerator.kt:722 */
          55  +
        } /* JsonParserGenerator.kt:712 */
   34     56   
    }
          57  +
    /* JsonParserGenerator.kt:398 */
   35     58   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_map_a.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,1 +117,158 @@
    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_required_header_collection_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
    9     11   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ValidationException" => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::ValidationError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
   33         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:179 */
   34     43   
            tmp
          44  +
            /* ProtocolParserGenerator.kt:139 */
   35     45   
        }),
   36         -
        _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic),
          46  +
        /* ProtocolParserGenerator.kt:182 */
          47  +
        _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   37     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:99 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ProtocolParserGenerator.kt:71 */
   41     55   
pub fn de_required_header_collection_operation_http_response(
   42     56   
    _response_status: u16,
   43     57   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44     58   
    _response_body: &[u8],
   45     59   
) -> std::result::Result<
   46     60   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   47     61   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   48     62   
> {
          63  +
    /* ProtocolParserGenerator.kt:77 */
   49     64   
    Ok({
          65  +
        /* RustType.kt:516 */
   50     66   
        #[allow(unused_mut)]
          67  +
        /* ProtocolParserGenerator.kt:240 */
   51     68   
        let mut output = crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default();
          69  +
        /* ProtocolParserGenerator.kt:267 */
   52     70   
        output = output.set_required_header_list(
          71  +
            /* ProtocolParserGenerator.kt:302 */
   53     72   
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_list_header(_response_headers).map_err(
   54     73   
                |_| {
   55     74   
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   56     75   
                        "Failed to parse requiredHeaderList from header `X-Required-List",
   57     76   
                    )
   58     77   
                },
   59         -
            )?,
          78  +
            )?, /* ProtocolParserGenerator.kt:267 */
   60     79   
        );
          80  +
        /* ProtocolParserGenerator.kt:267 */
   61     81   
        output = output.set_required_header_set(
          82  +
            /* ProtocolParserGenerator.kt:302 */
   62     83   
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_set_header(_response_headers).map_err(
   63     84   
                |_| {
   64     85   
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   65     86   
                        "Failed to parse requiredHeaderSet from header `X-Required-Set",
   66     87   
                    )
   67     88   
                },
   68         -
            )?,
          89  +
            )?, /* ProtocolParserGenerator.kt:267 */
   69     90   
        );
          91  +
        /* ClientBuilderInstantiator.kt:46 */
   70     92   
        crate::serde_util::required_header_collection_operation_output_output_correct_errors(output)
   71     93   
            .build()
   72     94   
            .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
          95  +
        /* ProtocolParserGenerator.kt:77 */
   73     96   
    })
          97  +
    /* ProtocolParserGenerator.kt:71 */
   74     98   
}
   75     99   
         100  +
/* HttpBindingGenerator.kt:542 */
   76    101   
pub fn ser_required_header_collection_operation_headers(
   77    102   
    input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   78    103   
    mut builder: ::http::request::Builder,
   79    104   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         105  +
    /* HttpBindingGenerator.kt:592 */
   80    106   
    if let ::std::option::Option::Some(inner_1) = &input.required_header_list {
   81         -
        // Empty vec in header is serialized as an empty string
         107  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
   82    108   
        if inner_1.is_empty() {
   83    109   
            builder = builder.header("X-Required-List", "");
   84    110   
        } else {
         111  +
            /* HttpBindingGenerator.kt:646 */
   85    112   
            for inner_2 in inner_1 {
         113  +
                /* HttpBindingGenerator.kt:704 */
   86    114   
                let formatted_3 = ::aws_smithy_http::header::quote_header_value(inner_2.as_str());
         115  +
                /* HttpBindingGenerator.kt:706 */
   87    116   
                let header_value = formatted_3;
   88    117   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   89    118   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   90    119   
                        "required_header_list",
   91    120   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   92    121   
                    )
   93    122   
                })?;
   94    123   
                builder = builder.header("X-Required-List", header_value);
         124  +
                /* HttpBindingGenerator.kt:646 */
   95    125   
            }
         126  +
            /* HttpBindingGenerator.kt:638 */
   96    127   
        }
         128  +
        /* HttpBindingGenerator.kt:592 */
   97    129   
    }
         130  +
    /* HttpBindingGenerator.kt:592 */
   98    131   
    if let ::std::option::Option::Some(inner_4) = &input.required_header_set {
   99         -
        // Empty vec in header is serialized as an empty string
         132  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  100    133   
        if inner_4.is_empty() {
  101    134   
            builder = builder.header("X-Required-Set", "");
  102    135   
        } else {
         136  +
            /* HttpBindingGenerator.kt:646 */
  103    137   
            for inner_5 in inner_4 {
         138  +
                /* HttpBindingGenerator.kt:704 */
  104    139   
                let formatted_6 = ::aws_smithy_http::header::quote_header_value(inner_5.as_str());
         140  +
                /* HttpBindingGenerator.kt:706 */
  105    141   
                let header_value = formatted_6;
  106    142   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  107    143   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  108    144   
                        "required_header_set",
  109    145   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  110    146   
                    )
  111    147   
                })?;
  112    148   
                builder = builder.header("X-Required-Set", header_value);
         149  +
                /* HttpBindingGenerator.kt:646 */
  113    150   
            }
         151  +
            /* HttpBindingGenerator.kt:638 */
  114    152   
        }
         153  +
        /* HttpBindingGenerator.kt:592 */
  115    154   
    }
         155  +
    /* HttpBindingGenerator.kt:555 */
  116    156   
    Ok(builder)
         157  +
    /* HttpBindingGenerator.kt:542 */
  117    158   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,1 +101,151 @@
    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_required_inner_shape_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
    9     11   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ValidationException" => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::ValidationError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?
   33         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:179 */
   34     43   
            tmp
          44  +
            /* ProtocolParserGenerator.kt:139 */
   35     45   
        }),
   36         -
        _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic),
          46  +
        /* ProtocolParserGenerator.kt:182 */
          47  +
        _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   37     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:99 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ProtocolParserGenerator.kt:71 */
   41     55   
pub fn de_required_inner_shape_operation_http_response(
   42     56   
    _response_status: u16,
   43     57   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44     58   
    _response_body: &[u8],
   45     59   
) -> std::result::Result<
   46     60   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   47     61   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   48     62   
> {
          63  +
    /* ProtocolParserGenerator.kt:77 */
   49     64   
    Ok({
          65  +
        /* RustType.kt:516 */
   50     66   
        #[allow(unused_mut)]
          67  +
        /* ProtocolParserGenerator.kt:240 */
   51     68   
        let mut output = crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default();
          69  +
        /* ProtocolParserGenerator.kt:247 */
   52     70   
        output = crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation(_response_body, output)
   53     71   
            .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          72  +
        /* ClientBuilderInstantiator.kt:56 */
   54     73   
        output.build()
          74  +
        /* ProtocolParserGenerator.kt:77 */
   55     75   
    })
          76  +
    /* ProtocolParserGenerator.kt:71 */
   56     77   
}
   57     78   
          79  +
/* JsonSerializerGenerator.kt:287 */
   58     80   
pub fn ser_required_inner_shape_operation_input(
   59     81   
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   60     82   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          83  +
    /* JsonSerializerGenerator.kt:291 */
   61     84   
    let mut out = String::new();
          85  +
    /* JsonSerializerGenerator.kt:292 */
   62     86   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          87  +
    /* JsonSerializerGenerator.kt:375 */
   63     88   
    crate::protocol_serde::shape_required_inner_shape_operation_input::ser_required_inner_shape_operation_input_input(&mut object, input)?;
          89  +
    /* JsonSerializerGenerator.kt:295 */
   64     90   
    object.finish();
          91  +
    /* JsonSerializerGenerator.kt:296 */
   65     92   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          93  +
    /* JsonSerializerGenerator.kt:287 */
   66     94   
}
   67     95   
          96  +
/* JsonParserGenerator.kt:148 */
   68     97   
pub(crate) fn de_required_inner_shape_operation(
   69     98   
    value: &[u8],
   70     99   
    mut builder: crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   71    100   
) -> ::std::result::Result<
   72    101   
    crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   73    102   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   74    103   
> {
         104  +
    /* JsonParserGenerator.kt:153 */
   75    105   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   76    106   
    let tokens = &mut tokens_owned;
   77    107   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         108  +
    /* JsonParserGenerator.kt:684 */
   78    109   
    loop {
         110  +
        /* JsonParserGenerator.kt:685 */
   79    111   
        match tokens.next().transpose()? {
   80         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   81         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   82         -
                "inner" => {
   83         -
                    builder = builder.set_inner(crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?);
         112  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         113  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         114  +
                /* JsonParserGenerator.kt:260 */
         115  +
                match key.to_unescaped()?.as_ref() {
         116  +
                    /* JsonParserGenerator.kt:262 */
         117  +
                    "inner" => {
         118  +
                        /* JsonParserGenerator.kt:265 */
         119  +
                        builder = builder.set_inner(
         120  +
                            /* JsonParserGenerator.kt:544 */
         121  +
                            crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?, /* JsonParserGenerator.kt:265 */
         122  +
                        );
         123  +
                        /* JsonParserGenerator.kt:262 */
         124  +
                    }
         125  +
                    /* JsonParserGenerator.kt:290 */
         126  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   84    127   
                }
   85         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   86         -
            },
         128  +
                /* JsonParserGenerator.kt:686 */
         129  +
            }
         130  +
            /* JsonParserGenerator.kt:695 */
   87    131   
            other => {
   88    132   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   89    133   
                    "expected object key or end object, found: {:?}",
   90    134   
                    other
   91    135   
                )))
   92         -
            }
         136  +
            } /* JsonParserGenerator.kt:685 */
   93    137   
        }
         138  +
        /* JsonParserGenerator.kt:684 */
   94    139   
    }
         140  +
    /* JsonParserGenerator.kt:250 */
   95    141   
    if tokens.next().is_some() {
         142  +
        /* JsonParserGenerator.kt:251 */
   96    143   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   97    144   
            "found more JSON tokens after completing parsing",
   98    145   
        ));
         146  +
        /* JsonParserGenerator.kt:250 */
   99    147   
    }
         148  +
    /* JsonParserGenerator.kt:163 */
  100    149   
    Ok(builder)
         150  +
    /* JsonParserGenerator.kt:148 */
  101    151   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation_input.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_required_inner_shape_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.inner {
           9  +
        /* JsonSerializerGenerator.kt:495 */
    7     10   
        #[allow(unused_mut)]
          11  +
        /* JsonSerializerGenerator.kt:496 */
    8     12   
        let mut object_2 = object.key("inner").start_object();
          13  +
        /* JsonSerializerGenerator.kt:375 */
    9     14   
        crate::protocol_serde::shape_inner_shape::ser_inner_shape(&mut object_2, var_1)?;
          15  +
        /* JsonSerializerGenerator.kt:515 */
   10     16   
        object_2.finish();
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_default_operation.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_http_fallback_operation.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,1 +35,53 @@
    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_response_code_required_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
    9     11   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_response_code_required_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   25     34   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default();
   30         -
        output = output.set_response_code(Some(_response_status as _));
          42  +
        /* ProtocolParserGenerator.kt:267 */
          43  +
        output = output.set_response_code(
          44  +
            /* ProtocolParserGenerator.kt:332 */ Some(_response_status as _), /* ProtocolParserGenerator.kt:267 */
          45  +
        );
          46  +
        /* ClientBuilderInstantiator.kt:46 */
   31     47   
        crate::serde_util::response_code_required_operation_output_output_correct_errors(output)
   32     48   
            .build()
   33     49   
            .map_err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?
          50  +
        /* ProtocolParserGenerator.kt:77 */
   34     51   
    })
          52  +
    /* ProtocolParserGenerator.kt:71 */
   35     53   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation.rs

@@ -1,1 +81,126 @@
    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_type_complexity_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
    9     11   
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::type_complexity_operation::TypeComplexityOperationError::generic(
   16     22   
        generic,
   17     23   
    ))
          24  +
    /* ProtocolParserGenerator.kt:99 */
   18     25   
}
   19     26   
          27  +
/* RustType.kt:516 */
   20     28   
#[allow(clippy::unnecessary_wraps)]
          29  +
/* ProtocolParserGenerator.kt:71 */
   21     30   
pub fn de_type_complexity_operation_http_response(
   22     31   
    _response_status: u16,
   23     32   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24     33   
    _response_body: &[u8],
   25     34   
) -> std::result::Result<
   26     35   
    crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
   27     36   
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   28     37   
> {
          38  +
    /* ProtocolParserGenerator.kt:77 */
   29     39   
    Ok({
          40  +
        /* RustType.kt:516 */
   30     41   
        #[allow(unused_mut)]
          42  +
        /* ProtocolParserGenerator.kt:240 */
   31     43   
        let mut output = crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:247 */
   32     45   
        output = crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation(_response_body, output)
   33     46   
            .map_err(crate::operation::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
          47  +
        /* ClientBuilderInstantiator.kt:56 */
   34     48   
        output.build()
          49  +
        /* ProtocolParserGenerator.kt:77 */
   35     50   
    })
          51  +
    /* ProtocolParserGenerator.kt:71 */
   36     52   
}
   37     53   
          54  +
/* JsonSerializerGenerator.kt:287 */
   38     55   
pub fn ser_type_complexity_operation_input(
   39     56   
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
   40     57   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          58  +
    /* JsonSerializerGenerator.kt:291 */
   41     59   
    let mut out = String::new();
          60  +
    /* JsonSerializerGenerator.kt:292 */
   42     61   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          62  +
    /* JsonSerializerGenerator.kt:375 */
   43     63   
    crate::protocol_serde::shape_type_complexity_operation_input::ser_type_complexity_operation_input_input(&mut object, input)?;
          64  +
    /* JsonSerializerGenerator.kt:295 */
   44     65   
    object.finish();
          66  +
    /* JsonSerializerGenerator.kt:296 */
   45     67   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          68  +
    /* JsonSerializerGenerator.kt:287 */
   46     69   
}
   47     70   
          71  +
/* JsonParserGenerator.kt:148 */
   48     72   
pub(crate) fn de_type_complexity_operation(
   49     73   
    value: &[u8],
   50     74   
    mut builder: crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   51     75   
) -> ::std::result::Result<
   52     76   
    crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   53     77   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54     78   
> {
          79  +
    /* JsonParserGenerator.kt:153 */
   55     80   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   56     81   
    let tokens = &mut tokens_owned;
   57     82   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          83  +
    /* JsonParserGenerator.kt:684 */
   58     84   
    loop {
          85  +
        /* JsonParserGenerator.kt:685 */
   59     86   
        match tokens.next().transpose()? {
   60         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   61         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   62         -
                "list" => {
   63         -
                    builder = builder.set_list(crate::protocol_serde::shape_list_a::de_list_a(tokens)?);
          87  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          88  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          89  +
                /* JsonParserGenerator.kt:260 */
          90  +
                match key.to_unescaped()?.as_ref() {
          91  +
                    /* JsonParserGenerator.kt:262 */
          92  +
                    "list" => {
          93  +
                        /* JsonParserGenerator.kt:265 */
          94  +
                        builder = builder.set_list(
          95  +
                            /* JsonParserGenerator.kt:451 */
          96  +
                            crate::protocol_serde::shape_list_a::de_list_a(tokens)?, /* JsonParserGenerator.kt:265 */
          97  +
                        );
          98  +
                        /* JsonParserGenerator.kt:262 */
          99  +
                    }
         100  +
                    /* JsonParserGenerator.kt:290 */
         101  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   64    102   
                }
   65         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   66         -
            },
         103  +
                /* JsonParserGenerator.kt:686 */
         104  +
            }
         105  +
            /* JsonParserGenerator.kt:695 */
   67    106   
            other => {
   68    107   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69    108   
                    "expected object key or end object, found: {:?}",
   70    109   
                    other
   71    110   
                )))
   72         -
            }
         111  +
            } /* JsonParserGenerator.kt:685 */
   73    112   
        }
         113  +
        /* JsonParserGenerator.kt:684 */
   74    114   
    }
         115  +
    /* JsonParserGenerator.kt:250 */
   75    116   
    if tokens.next().is_some() {
         117  +
        /* JsonParserGenerator.kt:251 */
   76    118   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   77    119   
            "found more JSON tokens after completing parsing",
   78    120   
        ));
         121  +
        /* JsonParserGenerator.kt:250 */
   79    122   
    }
         123  +
    /* JsonParserGenerator.kt:163 */
   80    124   
    Ok(builder)
         125  +
    /* JsonParserGenerator.kt:148 */
   81    126   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation_input.rs

@@ -1,1 +38,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_type_complexity_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.list {
           9  +
        /* JsonSerializerGenerator.kt:484 */
    7     10   
        let mut array_2 = object.key("list").start_array();
          11  +
        /* JsonSerializerGenerator.kt:524 */
    8     12   
        for item_3 in var_1 {
          13  +
            /* SerializerUtil.kt:42 */
    9     14   
            {
          15  +
                /* JsonSerializerGenerator.kt:484 */
   10     16   
                let mut array_4 = array_2.value().start_array();
          17  +
                /* JsonSerializerGenerator.kt:524 */
   11     18   
                for item_5 in item_3 {
          19  +
                    /* SerializerUtil.kt:42 */
   12     20   
                    {
          21  +
                        /* JsonSerializerGenerator.kt:484 */
   13     22   
                        let mut array_6 = array_4.value().start_array();
          23  +
                        /* JsonSerializerGenerator.kt:524 */
   14     24   
                        for item_7 in item_5 {
          25  +
                            /* SerializerUtil.kt:42 */
   15     26   
                            {
          27  +
                                /* JsonSerializerGenerator.kt:495 */
   16     28   
                                #[allow(unused_mut)]
          29  +
                                /* JsonSerializerGenerator.kt:496 */
   17     30   
                                let mut object_8 = array_6.value().start_object();
          31  +
                                /* JsonSerializerGenerator.kt:537 */
   18     32   
                                for (key_9, value_10) in item_7 {
          33  +
                                    /* SerializerUtil.kt:42 */
   19     34   
                                    {
          35  +
                                        /* JsonSerializerGenerator.kt:495 */
   20     36   
                                        #[allow(unused_mut)]
          37  +
                                        /* JsonSerializerGenerator.kt:496 */
   21     38   
                                        let mut object_11 = object_8.key(key_9.as_str()).start_object();
          39  +
                                        /* JsonSerializerGenerator.kt:375 */
   22     40   
                                        crate::protocol_serde::shape_empty_structure::ser_empty_structure(&mut object_11, value_10)?;
          41  +
                                        /* JsonSerializerGenerator.kt:515 */
   23     42   
                                        object_11.finish();
          43  +
                                        /* SerializerUtil.kt:42 */
   24     44   
                                    }
          45  +
                                    /* JsonSerializerGenerator.kt:537 */
   25     46   
                                }
          47  +
                                /* JsonSerializerGenerator.kt:515 */
   26     48   
                                object_8.finish();
          49  +
                                /* SerializerUtil.kt:42 */
   27     50   
                            }
          51  +
                            /* JsonSerializerGenerator.kt:524 */
   28     52   
                        }
          53  +
                        /* JsonSerializerGenerator.kt:486 */
   29     54   
                        array_6.finish();
          55  +
                        /* SerializerUtil.kt:42 */
   30     56   
                    }
          57  +
                    /* JsonSerializerGenerator.kt:524 */
   31     58   
                }
          59  +
                /* JsonSerializerGenerator.kt:486 */
   32     60   
                array_4.finish();
          61  +
                /* SerializerUtil.kt:42 */
   33     62   
            }
          63  +
            /* JsonSerializerGenerator.kt:524 */
   34     64   
        }
          65  +
        /* JsonSerializerGenerator.kt:486 */
   35     66   
        array_2.finish();
          67  +
        /* JsonSerializerGenerator.kt:382 */
   36     68   
    }
          69  +
    /* JsonSerializerGenerator.kt:372 */
   37     70   
    Ok(())
          71  +
    /* JsonSerializerGenerator.kt:358 */
   38     72   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +40,67 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_validation_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ValidationErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
          20  +
                    "message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
          22  +
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
          24  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
          30  +
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
          32  +
                    }
          33  +
                    /* JsonParserGenerator.kt:262 */
          34  +
                    "fieldList" => {
          35  +
                        /* JsonParserGenerator.kt:265 */
          36  +
                        builder = builder.set_field_list(
          37  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens)?
          38  +
                        /* JsonParserGenerator.kt:265 */);
          39  +
                        /* JsonParserGenerator.kt:262 */
          40  +
                    }
          41  +
                    /* JsonParserGenerator.kt:290 */
          42  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   19     43   
                }
   20         -
                "fieldList" => {
   21         -
                    builder = builder
   22         -
                        .set_field_list(crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens)?);
   23         -
                }
   24         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
            },
          44  +
                /* JsonParserGenerator.kt:686 */
          45  +
            }
          46  +
            /* JsonParserGenerator.kt:695 */
   26     47   
            other => {
   27     48   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     49   
                    "expected object key or end object, found: {:?}",
   29     50   
                    other
   30     51   
                )))
   31         -
            }
          52  +
            } /* JsonParserGenerator.kt:685 */
   32     53   
        }
          54  +
        /* JsonParserGenerator.kt:684 */
   33     55   
    }
          56  +
    /* JsonParserGenerator.kt:250 */
   34     57   
    if tokens.next().is_some() {
          58  +
        /* JsonParserGenerator.kt:251 */
   35     59   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     60   
            "found more JSON tokens after completing parsing",
   37     61   
        ));
          62  +
        /* JsonParserGenerator.kt:250 */
   38     63   
    }
          64  +
    /* JsonParserGenerator.kt:163 */
   39     65   
    Ok(builder)
          66  +
    /* JsonParserGenerator.kt:148 */
   40     67   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -1,1 +51,86 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_validation_exception_field<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::ValidationExceptionField>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::ValidationExceptionFieldBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "path" => {
   18         -
                            builder = builder.set_path(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
          26  +
                            "path" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_path(
          29  +
                                    /* JsonParserGenerator.kt:354 */
          30  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          36  +
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
          38  +
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
          40  +
                            "message" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
          42  +
                                builder = builder.set_message(
          43  +
                                    /* JsonParserGenerator.kt:354 */
          44  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          45  +
                                        .map(|s|
          46  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          47  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          48  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          49  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          50  +
                                );
          51  +
                                /* JsonParserGenerator.kt:262 */
          52  +
                            }
          53  +
                            /* JsonParserGenerator.kt:290 */
          54  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   23     55   
                        }
   24         -
                        "message" => {
   25         -
                            builder = builder.set_message(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
          56  +
                        /* JsonParserGenerator.kt:686 */
          57  +
                    }
          58  +
                    /* JsonParserGenerator.kt:695 */
   33     59   
                    other => {
   34     60   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35     61   
                            "expected object key or end object, found: {:?}",
   36     62   
                            other
   37     63   
                        )))
   38         -
                    }
          64  +
                    } /* JsonParserGenerator.kt:685 */
   39     65   
                }
          66  +
                /* JsonParserGenerator.kt:684 */
   40     67   
            }
          68  +
            /* JsonParserGenerator.kt:540 */
   41     69   
            Ok(Some(
   42     70   
                crate::serde_util::validation_exception_field_correct_errors(builder)
   43     71   
                    .build()
   44     72   
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
   45     73   
            ))
          74  +
            /* JsonParserGenerator.kt:713 */
   46     75   
        }
   47         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
            "expected start object or null",
   49         -
        )),
          76  +
        /* JsonParserGenerator.kt:722 */
          77  +
        _ => {
          78  +
            /* JsonParserGenerator.kt:723 */
          79  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                "expected start object or null",
          81  +
            ))
          82  +
            /* JsonParserGenerator.kt:722 */
          83  +
        } /* JsonParserGenerator.kt:712 */
   50     84   
    }
          85  +
    /* JsonParserGenerator.kt:516 */
   51     86   
}