Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

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

@@ -46,46 +132,143 @@
   66     66   
            ser.write_string(&HEADERSANDIMPLICITPAYLOADEVENT_MEMBER_HEADER, val)?;
   67     67   
        }
   68     68   
        if let Some(ref val) = self.payload {
   69     69   
            ser.write_string(&HEADERSANDIMPLICITPAYLOADEVENT_MEMBER_PAYLOAD, val)?;
   70     70   
        }
   71     71   
        Ok(())
   72     72   
    }
   73     73   
}
   74     74   
impl HeadersAndImplicitPayloadEvent {
   75     75   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   76         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   77         -
        deserializer: &mut D,
          76  +
    pub fn deserialize(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   78     78   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   79     79   
        #[allow(unused_variables, unused_mut)]
   80     80   
        let mut builder = Self::builder();
   81     81   
        #[allow(
   82     82   
            unused_variables,
   83     83   
            unreachable_code,
   84     84   
            clippy::single_match,
   85     85   
            clippy::match_single_binding,
   86     86   
            clippy::diverging_sub_expression
   87     87   
        )]
   88         -
        deserializer.read_struct(&HEADERSANDIMPLICITPAYLOADEVENT_SCHEMA, (), |_, member, deser| {
          88  +
        deserializer.read_struct(&HEADERSANDIMPLICITPAYLOADEVENT_SCHEMA, &mut |member, deser| {
   89     89   
            match member.member_index() {
   90     90   
                Some(0) => {
   91     91   
                    builder.header = Some(deser.read_string(member)?);
   92     92   
                }
   93     93   
                Some(1) => {
   94     94   
                    builder.payload = Some(deser.read_string(member)?);
   95     95   
                }
   96     96   
                _ => {}
   97     97   
            }
   98     98   
            Ok(())
   99     99   
        })?;
  100    100   
        Ok(builder.build())
  101    101   
    }
  102    102   
}
         103  +
impl HeadersAndImplicitPayloadEvent {
         104  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         105  +
    pub fn deserialize_with_response(
         106  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         107  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         108  +
        _status: u16,
         109  +
        _body: &[u8],
         110  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         111  +
        Self::deserialize(deserializer)
         112  +
    }
         113  +
}
  103    114   
impl HeadersAndImplicitPayloadEvent {
  104    115   
    /// Creates a new builder-style object to manufacture [`HeadersAndImplicitPayloadEvent`](crate::types::HeadersAndImplicitPayloadEvent).
  105    116   
    pub fn builder() -> crate::types::builders::HeadersAndImplicitPayloadEventBuilder {
  106    117   
        crate::types::builders::HeadersAndImplicitPayloadEventBuilder::default()
  107    118   
    }
  108    119   
}
  109    120   
  110    121   
/// A builder for [`HeadersAndImplicitPayloadEvent`](crate::types::HeadersAndImplicitPayloadEvent).
  111    122   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  112    123   
#[non_exhaustive]

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

@@ -36,36 +274,286 @@
   56     56   
}
   57     57   
static HEADERSEVENT_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   58     58   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#HeadersEvent", "aws.protocoltests.restjson", "HeadersEvent");
   59     59   
static HEADERSEVENT_MEMBER_BOOLEAN_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   60     60   
    ::aws_smithy_schema::ShapeId::from_static(
   61     61   
        "aws.protocoltests.restjson#HeadersEvent$booleanHeader",
   62     62   
        "aws.protocoltests.restjson",
   63     63   
        "HeadersEvent",
   64     64   
    ),
   65     65   
    ::aws_smithy_schema::ShapeType::Boolean,
   66         -
    "boolean_header",
          66  +
    "booleanHeader",
   67     67   
    0,
   68     68   
)
   69     69   
.with_event_header();
   70     70   
static HEADERSEVENT_MEMBER_BYTE_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   71     71   
    ::aws_smithy_schema::ShapeId::from_static(
   72     72   
        "aws.protocoltests.restjson#HeadersEvent$byteHeader",
   73     73   
        "aws.protocoltests.restjson",
   74     74   
        "HeadersEvent",
   75     75   
    ),
   76     76   
    ::aws_smithy_schema::ShapeType::Byte,
   77         -
    "byte_header",
          77  +
    "byteHeader",
   78     78   
    1,
   79     79   
)
   80     80   
.with_event_header();
   81     81   
static HEADERSEVENT_MEMBER_SHORT_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   82     82   
    ::aws_smithy_schema::ShapeId::from_static(
   83     83   
        "aws.protocoltests.restjson#HeadersEvent$shortHeader",
   84     84   
        "aws.protocoltests.restjson",
   85     85   
        "HeadersEvent",
   86     86   
    ),
   87     87   
    ::aws_smithy_schema::ShapeType::Short,
   88         -
    "short_header",
          88  +
    "shortHeader",
   89     89   
    2,
   90     90   
)
   91     91   
.with_event_header();
   92     92   
static HEADERSEVENT_MEMBER_INT_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   93     93   
    ::aws_smithy_schema::ShapeId::from_static(
   94     94   
        "aws.protocoltests.restjson#HeadersEvent$intHeader",
   95     95   
        "aws.protocoltests.restjson",
   96     96   
        "HeadersEvent",
   97     97   
    ),
   98     98   
    ::aws_smithy_schema::ShapeType::Integer,
   99         -
    "int_header",
          99  +
    "intHeader",
  100    100   
    3,
  101    101   
)
  102    102   
.with_event_header();
  103    103   
static HEADERSEVENT_MEMBER_LONG_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  104    104   
    ::aws_smithy_schema::ShapeId::from_static(
  105    105   
        "aws.protocoltests.restjson#HeadersEvent$longHeader",
  106    106   
        "aws.protocoltests.restjson",
  107    107   
        "HeadersEvent",
  108    108   
    ),
  109    109   
    ::aws_smithy_schema::ShapeType::Long,
  110         -
    "long_header",
         110  +
    "longHeader",
  111    111   
    4,
  112    112   
)
  113    113   
.with_event_header();
  114    114   
static HEADERSEVENT_MEMBER_BLOB_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  115    115   
    ::aws_smithy_schema::ShapeId::from_static(
  116    116   
        "aws.protocoltests.restjson#HeadersEvent$blobHeader",
  117    117   
        "aws.protocoltests.restjson",
  118    118   
        "HeadersEvent",
  119    119   
    ),
  120    120   
    ::aws_smithy_schema::ShapeType::Blob,
  121         -
    "blob_header",
         121  +
    "blobHeader",
  122    122   
    5,
  123    123   
)
  124    124   
.with_event_header();
  125    125   
static HEADERSEVENT_MEMBER_STRING_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  126    126   
    ::aws_smithy_schema::ShapeId::from_static(
  127    127   
        "aws.protocoltests.restjson#HeadersEvent$stringHeader",
  128    128   
        "aws.protocoltests.restjson",
  129    129   
        "HeadersEvent",
  130    130   
    ),
  131    131   
    ::aws_smithy_schema::ShapeType::String,
  132         -
    "string_header",
         132  +
    "stringHeader",
  133    133   
    6,
  134    134   
)
  135    135   
.with_event_header();
  136    136   
static HEADERSEVENT_MEMBER_TIMESTAMP_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson#HeadersEvent$timestampHeader",
  139    139   
        "aws.protocoltests.restjson",
  140    140   
        "HeadersEvent",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::Timestamp,
  143         -
    "timestamp_header",
         143  +
    "timestampHeader",
  144    144   
    7,
  145    145   
)
  146         -
.with_event_header();
         146  +
.with_event_header()
         147  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
  147    148   
static HEADERSEVENT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  148    149   
    HEADERSEVENT_SCHEMA_ID,
  149    150   
    ::aws_smithy_schema::ShapeType::Structure,
  150    151   
    &[
  151    152   
        &HEADERSEVENT_MEMBER_BOOLEAN_HEADER,
  152    153   
        &HEADERSEVENT_MEMBER_BYTE_HEADER,
  153    154   
        &HEADERSEVENT_MEMBER_SHORT_HEADER,
  154    155   
        &HEADERSEVENT_MEMBER_INT_HEADER,
  155    156   
        &HEADERSEVENT_MEMBER_LONG_HEADER,
  156    157   
        &HEADERSEVENT_MEMBER_BLOB_HEADER,
  157    158   
        &HEADERSEVENT_MEMBER_STRING_HEADER,
  158    159   
        &HEADERSEVENT_MEMBER_TIMESTAMP_HEADER,
  159    160   
    ],
  160    161   
);
  161    162   
impl HeadersEvent {
  162    163   
    /// The schema for this shape.
  163    164   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HEADERSEVENT_SCHEMA;
  164    165   
}
  165    166   
impl ::aws_smithy_schema::serde::SerializableStruct for HeadersEvent {
  166    167   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  167    168   
    fn serialize_members(
  168    169   
        &self,
  169    170   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  170    171   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  171    172   
        if let Some(ref val) = self.boolean_header {
  172    173   
            ser.write_boolean(&HEADERSEVENT_MEMBER_BOOLEAN_HEADER, *val)?;
  173    174   
        }
  174    175   
        if let Some(ref val) = self.byte_header {
  175    176   
            ser.write_byte(&HEADERSEVENT_MEMBER_BYTE_HEADER, *val)?;
  176    177   
        }
  177    178   
        if let Some(ref val) = self.short_header {
  178    179   
            ser.write_short(&HEADERSEVENT_MEMBER_SHORT_HEADER, *val)?;
  179    180   
        }
  180    181   
        if let Some(ref val) = self.int_header {
  181    182   
            ser.write_integer(&HEADERSEVENT_MEMBER_INT_HEADER, *val)?;
  182    183   
        }
  183    184   
        if let Some(ref val) = self.long_header {
  184    185   
            ser.write_long(&HEADERSEVENT_MEMBER_LONG_HEADER, *val)?;
  185    186   
        }
  186    187   
        if let Some(ref val) = self.blob_header {
  187    188   
            ser.write_blob(&HEADERSEVENT_MEMBER_BLOB_HEADER, val)?;
  188    189   
        }
  189    190   
        if let Some(ref val) = self.string_header {
  190    191   
            ser.write_string(&HEADERSEVENT_MEMBER_STRING_HEADER, val)?;
  191    192   
        }
  192    193   
        if let Some(ref val) = self.timestamp_header {
  193    194   
            ser.write_timestamp(&HEADERSEVENT_MEMBER_TIMESTAMP_HEADER, val)?;
  194    195   
        }
  195    196   
        Ok(())
  196    197   
    }
  197    198   
}
  198    199   
impl HeadersEvent {
  199    200   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  200         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  201         -
        deserializer: &mut D,
         201  +
    pub fn deserialize(
         202  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  202    203   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  203    204   
        #[allow(unused_variables, unused_mut)]
  204    205   
        let mut builder = Self::builder();
  205    206   
        #[allow(
  206    207   
            unused_variables,
  207    208   
            unreachable_code,
  208    209   
            clippy::single_match,
  209    210   
            clippy::match_single_binding,
  210    211   
            clippy::diverging_sub_expression
  211    212   
        )]
  212         -
        deserializer.read_struct(&HEADERSEVENT_SCHEMA, (), |_, member, deser| {
         213  +
        deserializer.read_struct(&HEADERSEVENT_SCHEMA, &mut |member, deser| {
  213    214   
            match member.member_index() {
  214    215   
                Some(0) => {
  215    216   
                    builder.boolean_header = Some(deser.read_boolean(member)?);
  216    217   
                }
  217    218   
                Some(1) => {
  218    219   
                    builder.byte_header = Some(deser.read_byte(member)?);
  219    220   
                }
  220    221   
                Some(2) => {
  221    222   
                    builder.short_header = Some(deser.read_short(member)?);
  222    223   
                }
  223    224   
                Some(3) => {
  224    225   
                    builder.int_header = Some(deser.read_integer(member)?);
  225    226   
                }
  226    227   
                Some(4) => {
  227    228   
                    builder.long_header = Some(deser.read_long(member)?);
  228    229   
                }
  229    230   
                Some(5) => {
  230    231   
                    builder.blob_header = Some(deser.read_blob(member)?);
  231    232   
                }
  232    233   
                Some(6) => {
  233    234   
                    builder.string_header = Some(deser.read_string(member)?);
  234    235   
                }
  235    236   
                Some(7) => {
  236    237   
                    builder.timestamp_header = Some(deser.read_timestamp(member)?);
  237    238   
                }
  238    239   
                _ => {}
  239    240   
            }
  240    241   
            Ok(())
  241    242   
        })?;
  242    243   
        Ok(builder.build())
  243    244   
    }
  244    245   
}
         246  +
impl HeadersEvent {
         247  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         248  +
    pub fn deserialize_with_response(
         249  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         250  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         251  +
        _status: u16,
         252  +
        _body: &[u8],
         253  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         254  +
        Self::deserialize(deserializer)
         255  +
    }
         256  +
}
  245    257   
impl HeadersEvent {
  246    258   
    /// Creates a new builder-style object to manufacture [`HeadersEvent`](crate::types::HeadersEvent).
  247    259   
    pub fn builder() -> crate::types::builders::HeadersEventBuilder {
  248    260   
        crate::types::builders::HeadersEventBuilder::default()
  249    261   
    }
  250    262   
}
  251    263   
  252    264   
/// A builder for [`HeadersEvent`](crate::types::HeadersEvent).
  253    265   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  254    266   
#[non_exhaustive]

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

@@ -143,143 +0,334 @@
  163    163   
    }
  164    164   
    /// Returns true if this is a [`TimestampValue`](crate::types::MyUnion::TimestampValue).
  165    165   
    pub fn is_timestamp_value(&self) -> bool {
  166    166   
        self.as_timestamp_value().is_ok()
  167    167   
    }
  168    168   
    /// Returns true if the enum instance is the `Unknown` variant.
  169    169   
    pub fn is_unknown(&self) -> bool {
  170    170   
        matches!(self, Self::Unknown)
  171    171   
    }
  172    172   
}
         173  +
static MYUNION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
         174  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion", "aws.protocoltests.restjson", "MyUnion");
         175  +
static MYUNION_MEMBER_STRINGVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         176  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$stringValue", "aws.protocoltests.restjson", "MyUnion"),
         177  +
    ::aws_smithy_schema::ShapeType::String,
         178  +
    "stringValue",
         179  +
    0,
         180  +
);
         181  +
static MYUNION_MEMBER_BOOLEANVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         182  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$booleanValue", "aws.protocoltests.restjson", "MyUnion"),
         183  +
    ::aws_smithy_schema::ShapeType::Boolean,
         184  +
    "booleanValue",
         185  +
    1,
         186  +
);
         187  +
static MYUNION_MEMBER_NUMBERVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         188  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$numberValue", "aws.protocoltests.restjson", "MyUnion"),
         189  +
    ::aws_smithy_schema::ShapeType::Integer,
         190  +
    "numberValue",
         191  +
    2,
         192  +
);
         193  +
static MYUNION_MEMBER_BLOBVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         194  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$blobValue", "aws.protocoltests.restjson", "MyUnion"),
         195  +
    ::aws_smithy_schema::ShapeType::Blob,
         196  +
    "blobValue",
         197  +
    3,
         198  +
);
         199  +
static MYUNION_MEMBER_TIMESTAMPVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         200  +
    ::aws_smithy_schema::ShapeId::from_static(
         201  +
        "aws.protocoltests.restjson#MyUnion$timestampValue",
         202  +
        "aws.protocoltests.restjson",
         203  +
        "MyUnion",
         204  +
    ),
         205  +
    ::aws_smithy_schema::ShapeType::Timestamp,
         206  +
    "timestampValue",
         207  +
    4,
         208  +
);
         209  +
static MYUNION_MEMBER_ENUMVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         210  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$enumValue", "aws.protocoltests.restjson", "MyUnion"),
         211  +
    ::aws_smithy_schema::ShapeType::String,
         212  +
    "enumValue",
         213  +
    5,
         214  +
);
         215  +
static MYUNION_MEMBER_LISTVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         216  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$listValue", "aws.protocoltests.restjson", "MyUnion"),
         217  +
    ::aws_smithy_schema::ShapeType::List,
         218  +
    "listValue",
         219  +
    6,
         220  +
);
         221  +
static MYUNION_MEMBER_MAPVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         222  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#MyUnion$mapValue", "aws.protocoltests.restjson", "MyUnion"),
         223  +
    ::aws_smithy_schema::ShapeType::Map,
         224  +
    "mapValue",
         225  +
    7,
         226  +
);
         227  +
static MYUNION_MEMBER_STRUCTUREVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         228  +
    ::aws_smithy_schema::ShapeId::from_static(
         229  +
        "aws.protocoltests.restjson#MyUnion$structureValue",
         230  +
        "aws.protocoltests.restjson",
         231  +
        "MyUnion",
         232  +
    ),
         233  +
    ::aws_smithy_schema::ShapeType::Structure,
         234  +
    "structureValue",
         235  +
    8,
         236  +
);
         237  +
static MYUNION_MEMBER_RENAMEDSTRUCTUREVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         238  +
    ::aws_smithy_schema::ShapeId::from_static(
         239  +
        "aws.protocoltests.restjson#MyUnion$renamedStructureValue",
         240  +
        "aws.protocoltests.restjson",
         241  +
        "MyUnion",
         242  +
    ),
         243  +
    ::aws_smithy_schema::ShapeType::Structure,
         244  +
    "renamedStructureValue",
         245  +
    9,
         246  +
);
         247  +
static MYUNION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
         248  +
    MYUNION_SCHEMA_ID,
         249  +
    ::aws_smithy_schema::ShapeType::Union,
         250  +
    &[
         251  +
        &MYUNION_MEMBER_STRINGVALUE,
         252  +
        &MYUNION_MEMBER_BOOLEANVALUE,
         253  +
        &MYUNION_MEMBER_NUMBERVALUE,
         254  +
        &MYUNION_MEMBER_BLOBVALUE,
         255  +
        &MYUNION_MEMBER_TIMESTAMPVALUE,
         256  +
        &MYUNION_MEMBER_ENUMVALUE,
         257  +
        &MYUNION_MEMBER_LISTVALUE,
         258  +
        &MYUNION_MEMBER_MAPVALUE,
         259  +
        &MYUNION_MEMBER_STRUCTUREVALUE,
         260  +
        &MYUNION_MEMBER_RENAMEDSTRUCTUREVALUE,
         261  +
    ],
         262  +
);
         263  +
impl MyUnion {
         264  +
    /// The schema for this shape.
         265  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MYUNION_SCHEMA;
         266  +
}
         267  +
impl ::aws_smithy_schema::serde::SerializableStruct for MyUnion {
         268  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         269  +
    fn serialize_members(
         270  +
        &self,
         271  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         272  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         273  +
        match self {
         274  +
            Self::StringValue(val) => {
         275  +
                ser.write_string(&MYUNION_MEMBER_STRINGVALUE, val)?;
         276  +
            }
         277  +
            Self::BooleanValue(val) => {
         278  +
                ser.write_boolean(&MYUNION_MEMBER_BOOLEANVALUE, *val)?;
         279  +
            }
         280  +
            Self::NumberValue(val) => {
         281  +
                ser.write_integer(&MYUNION_MEMBER_NUMBERVALUE, *val)?;
         282  +
            }
         283  +
            Self::BlobValue(val) => {
         284  +
                ser.write_blob(&MYUNION_MEMBER_BLOBVALUE, val)?;
         285  +
            }
         286  +
            Self::TimestampValue(val) => {
         287  +
                ser.write_timestamp(&MYUNION_MEMBER_TIMESTAMPVALUE, val)?;
         288  +
            }
         289  +
            Self::EnumValue(val) => {
         290  +
                ser.write_string(&MYUNION_MEMBER_ENUMVALUE, val.as_str())?;
         291  +
            }
         292  +
            Self::ListValue(val) => {
         293  +
                ser.write_string_list(&MYUNION_MEMBER_LISTVALUE, val)?;
         294  +
            }
         295  +
            Self::MapValue(val) => {
         296  +
                ser.write_string_string_map(&MYUNION_MEMBER_MAPVALUE, val)?;
         297  +
            }
         298  +
            Self::StructureValue(val) => {
         299  +
                ser.write_struct(&MYUNION_MEMBER_STRUCTUREVALUE, val)?;
         300  +
            }
         301  +
            Self::RenamedStructureValue(val) => {
         302  +
                ser.write_struct(&MYUNION_MEMBER_RENAMEDSTRUCTUREVALUE, val)?;
         303  +
            }
         304  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
         305  +
        }
         306  +
        Ok(())
         307  +
    }
         308  +
}
         309  +
impl MyUnion {
         310  +
    /// Deserializes this union from a [`ShapeDeserializer`].
         311  +
    pub fn deserialize(
         312  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         313  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         314  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
         315  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
         316  +
        deserializer.read_struct(&MYUNION_SCHEMA, &mut |member, deser| {
         317  +
            result = ::std::option::Option::Some(match member.member_index() {
         318  +
                Some(0) => Self::StringValue(deser.read_string(member)?),
         319  +
                Some(1) => Self::BooleanValue(deser.read_boolean(member)?),
         320  +
                Some(2) => Self::NumberValue(deser.read_integer(member)?),
         321  +
                Some(3) => Self::BlobValue(deser.read_blob(member)?),
         322  +
                Some(4) => Self::TimestampValue(deser.read_timestamp(member)?),
         323  +
                Some(5) => Self::EnumValue(crate::types::FooEnum::from(deser.read_string(member)?.as_str())),
         324  +
                Some(6) => Self::ListValue(deser.read_string_list(member)?),
         325  +
                Some(7) => Self::MapValue(deser.read_string_string_map(member)?),
         326  +
                Some(8) => Self::StructureValue(crate::types::GreetingStruct::deserialize(deser)?),
         327  +
                Some(9) => Self::RenamedStructureValue(crate::types::RenamedGreeting::deserialize(deser)?),
         328  +
                _ => Self::Unknown,
         329  +
            });
         330  +
            Ok(())
         331  +
        })?;
         332  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         333  +
    }
         334  +
}

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

@@ -39,39 +125,136 @@
   59     59   
            ser.write_string(&NESTEDPAYLOAD_MEMBER_GREETING, val)?;
   60     60   
        }
   61     61   
        if let Some(ref val) = self.name {
   62     62   
            ser.write_string(&NESTEDPAYLOAD_MEMBER_NAME, val)?;
   63     63   
        }
   64     64   
        Ok(())
   65     65   
    }
   66     66   
}
   67     67   
impl NestedPayload {
   68     68   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   69         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   70         -
        deserializer: &mut D,
          69  +
    pub fn deserialize(
          70  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   71     71   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   72     72   
        #[allow(unused_variables, unused_mut)]
   73     73   
        let mut builder = Self::builder();
   74     74   
        #[allow(
   75     75   
            unused_variables,
   76     76   
            unreachable_code,
   77     77   
            clippy::single_match,
   78     78   
            clippy::match_single_binding,
   79     79   
            clippy::diverging_sub_expression
   80     80   
        )]
   81         -
        deserializer.read_struct(&NESTEDPAYLOAD_SCHEMA, (), |_, member, deser| {
          81  +
        deserializer.read_struct(&NESTEDPAYLOAD_SCHEMA, &mut |member, deser| {
   82     82   
            match member.member_index() {
   83     83   
                Some(0) => {
   84     84   
                    builder.greeting = Some(deser.read_string(member)?);
   85     85   
                }
   86     86   
                Some(1) => {
   87     87   
                    builder.name = Some(deser.read_string(member)?);
   88     88   
                }
   89     89   
                _ => {}
   90     90   
            }
   91     91   
            Ok(())
   92     92   
        })?;
   93     93   
        Ok(builder.build())
   94     94   
    }
   95     95   
}
          96  +
impl NestedPayload {
          97  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          98  +
    pub fn deserialize_with_response(
          99  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         100  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         101  +
        _status: u16,
         102  +
        _body: &[u8],
         103  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         104  +
        Self::deserialize(deserializer)
         105  +
    }
         106  +
}
   96    107   
impl NestedPayload {
   97    108   
    /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::types::NestedPayload).
   98    109   
    pub fn builder() -> crate::types::builders::NestedPayloadBuilder {
   99    110   
        crate::types::builders::NestedPayloadBuilder::default()
  100    111   
    }
  101    112   
}
  102    113   
  103    114   
/// A builder for [`NestedPayload`](crate::types::NestedPayload).
  104    115   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  105    116   
#[non_exhaustive]

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

@@ -20,20 +103,114 @@
   40     40   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   41     41   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   42     42   
        if let Some(ref val) = self.data {
   43     43   
            ser.write_integer(&PAYLOADCONFIG_MEMBER_DATA, *val)?;
   44     44   
        }
   45     45   
        Ok(())
   46     46   
    }
   47     47   
}
   48     48   
impl PayloadConfig {
   49     49   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   50         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   51         -
        deserializer: &mut D,
          50  +
    pub fn deserialize(
          51  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   52     52   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   53     53   
        #[allow(unused_variables, unused_mut)]
   54     54   
        let mut builder = Self::builder();
   55     55   
        #[allow(
   56     56   
            unused_variables,
   57     57   
            unreachable_code,
   58     58   
            clippy::single_match,
   59     59   
            clippy::match_single_binding,
   60     60   
            clippy::diverging_sub_expression
   61     61   
        )]
   62         -
        deserializer.read_struct(&PAYLOADCONFIG_SCHEMA, (), |_, member, deser| {
          62  +
        deserializer.read_struct(&PAYLOADCONFIG_SCHEMA, &mut |member, deser| {
   63     63   
            match member.member_index() {
   64     64   
                Some(0) => {
   65     65   
                    builder.data = Some(deser.read_integer(member)?);
   66     66   
                }
   67     67   
                _ => {}
   68     68   
            }
   69     69   
            Ok(())
   70     70   
        })?;
   71     71   
        Ok(builder.build())
   72     72   
    }
   73     73   
}
          74  +
impl PayloadConfig {
          75  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          76  +
    pub fn deserialize_with_response(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          78  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          79  +
        _status: u16,
          80  +
        _body: &[u8],
          81  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          82  +
        Self::deserialize(deserializer)
          83  +
    }
          84  +
}
   74     85   
impl PayloadConfig {
   75     86   
    /// Creates a new builder-style object to manufacture [`PayloadConfig`](crate::types::PayloadConfig).
   76     87   
    pub fn builder() -> crate::types::builders::PayloadConfigBuilder {
   77     88   
        crate::types::builders::PayloadConfigBuilder::default()
   78     89   
    }
   79     90   
}
   80     91   
   81     92   
/// A builder for [`PayloadConfig`](crate::types::PayloadConfig).
   82     93   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   83     94   
#[non_exhaustive]

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

@@ -1,1 +106,117 @@
   17     17   
    "aws.protocoltests.restjson",
   18     18   
    "PayloadStructure",
   19     19   
);
   20     20   
static PAYLOADSTRUCTURE_MEMBER_STRUCTURE_MEMBER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restjson#PayloadStructure$structureMember",
   23     23   
        "aws.protocoltests.restjson",
   24     24   
        "PayloadStructure",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "structure_member",
          27  +
    "structureMember",
   28     28   
    0,
   29     29   
);
   30     30   
static PAYLOADSTRUCTURE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    PAYLOADSTRUCTURE_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&PAYLOADSTRUCTURE_MEMBER_STRUCTURE_MEMBER],
   34     34   
);
   35     35   
impl PayloadStructure {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PAYLOADSTRUCTURE_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for PayloadStructure {
   40     40   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     41   
    fn serialize_members(
   42     42   
        &self,
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.structure_member {
   46     46   
            ser.write_string(&PAYLOADSTRUCTURE_MEMBER_STRUCTURE_MEMBER, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl PayloadStructure {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&PAYLOADSTRUCTURE_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&PAYLOADSTRUCTURE_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.structure_member = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl PayloadStructure {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl PayloadStructure {
   78     89   
    /// Creates a new builder-style object to manufacture [`PayloadStructure`](crate::types::PayloadStructure).
   79     90   
    pub fn builder() -> crate::types::builders::PayloadStructureBuilder {
   80     91   
        crate::types::builders::PayloadStructureBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`PayloadStructure`](crate::types::PayloadStructure).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

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

@@ -8,8 +0,90 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`UnionMember`](crate::types::PayloadUnion::UnionMember).
   30     30   
    pub fn is_union_member(&self) -> bool {
   31     31   
        self.as_union_member().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static PAYLOADUNION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          39  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#PayloadUnion", "aws.protocoltests.restjson", "PayloadUnion");
          40  +
static PAYLOADUNION_MEMBER_UNIONMEMBER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_static(
          42  +
        "aws.protocoltests.restjson#PayloadUnion$unionMember",
          43  +
        "aws.protocoltests.restjson",
          44  +
        "PayloadUnion",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::String,
          47  +
    "unionMember",
          48  +
    0,
          49  +
);
          50  +
static PAYLOADUNION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          51  +
    PAYLOADUNION_SCHEMA_ID,
          52  +
    ::aws_smithy_schema::ShapeType::Union,
          53  +
    &[&PAYLOADUNION_MEMBER_UNIONMEMBER],
          54  +
);
          55  +
impl PayloadUnion {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PAYLOADUNION_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for PayloadUnion {
          60  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          61  +
    fn serialize_members(
          62  +
        &self,
          63  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          64  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          65  +
        match self {
          66  +
            Self::UnionMember(val) => {
          67  +
                ser.write_string(&PAYLOADUNION_MEMBER_UNIONMEMBER, val)?;
          68  +
            }
          69  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          70  +
        }
          71  +
        Ok(())
          72  +
    }
          73  +
}
          74  +
impl PayloadUnion {
          75  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          76  +
    pub fn deserialize(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          78  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          79  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          80  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          81  +
        deserializer.read_struct(&PAYLOADUNION_SCHEMA, &mut |member, deser| {
          82  +
            result = ::std::option::Option::Some(match member.member_index() {
          83  +
                Some(0) => Self::UnionMember(deser.read_string(member)?),
          84  +
                _ => Self::Unknown,
          85  +
            });
          86  +
            Ok(())
          87  +
        })?;
          88  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          89  +
    }
          90  +
}

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

@@ -8,8 +0,102 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Quit`](crate::types::PlayerAction::Quit).
   30     30   
    pub fn is_quit(&self) -> bool {
   31     31   
        self.as_quit().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static PLAYERACTION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          39  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#PlayerAction", "aws.protocoltests.restjson", "PlayerAction");
          40  +
static PLAYERACTION_MEMBER_QUIT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_static(
          42  +
        "aws.protocoltests.restjson#PlayerAction$quit",
          43  +
        "aws.protocoltests.restjson",
          44  +
        "PlayerAction",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::Structure,
          47  +
    "quit",
          48  +
    0,
          49  +
);
          50  +
static PLAYERACTION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          51  +
    PLAYERACTION_SCHEMA_ID,
          52  +
    ::aws_smithy_schema::ShapeType::Union,
          53  +
    &[&PLAYERACTION_MEMBER_QUIT],
          54  +
);
          55  +
impl PlayerAction {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PLAYERACTION_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for PlayerAction {
          60  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          61  +
    fn serialize_members(
          62  +
        &self,
          63  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          64  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          65  +
        match self {
          66  +
            Self::Quit => {
          67  +
                struct Empty;
          68  +
                impl ::aws_smithy_schema::serde::SerializableStruct for Empty {
          69  +
                    fn serialize_members(
          70  +
                        &self,
          71  +
                        _ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          72  +
                    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          73  +
                        Ok(())
          74  +
                    }
          75  +
                }
          76  +
                ser.write_struct(&PLAYERACTION_MEMBER_QUIT, &Empty)?;
          77  +
            }
          78  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          79  +
        }
          80  +
        Ok(())
          81  +
    }
          82  +
}
          83  +
impl PlayerAction {
          84  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          89  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          90  +
        deserializer.read_struct(&PLAYERACTION_SCHEMA, &mut |member, deser| {
          91  +
            result = ::std::option::Option::Some(match member.member_index() {
          92  +
                Some(0) => {
          93  +
                    deser.read_struct(member, &mut |_, _| Ok(()))?;
          94  +
                    Self::Quit
          95  +
                }
          96  +
                _ => Self::Unknown,
          97  +
            });
          98  +
            Ok(())
          99  +
        })?;
         100  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         101  +
    }
         102  +
}

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

@@ -45,45 +131,142 @@
   65     65   
            ser.write_string(&RECURSIVESHAPESINPUTOUTPUTNESTED1_MEMBER_FOO, val)?;
   66     66   
        }
   67     67   
        if let Some(ref val) = self.nested {
   68     68   
            ser.write_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED1_MEMBER_NESTED, val)?;
   69     69   
        }
   70     70   
        Ok(())
   71     71   
    }
   72     72   
}
   73     73   
impl RecursiveShapesInputOutputNested1 {
   74     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     78   
        #[allow(unused_variables, unused_mut)]
   79     79   
        let mut builder = Self::builder();
   80     80   
        #[allow(
   81     81   
            unused_variables,
   82     82   
            unreachable_code,
   83     83   
            clippy::single_match,
   84     84   
            clippy::match_single_binding,
   85     85   
            clippy::diverging_sub_expression
   86     86   
        )]
   87         -
        deserializer.read_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED1_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED1_SCHEMA, &mut |member, deser| {
   88     88   
            match member.member_index() {
   89     89   
                Some(0) => {
   90     90   
                    builder.foo = Some(deser.read_string(member)?);
   91     91   
                }
   92     92   
                Some(1) => {
   93     93   
                    builder.nested = Some(Box::new(crate::types::RecursiveShapesInputOutputNested2::deserialize(deser)?));
   94     94   
                }
   95     95   
                _ => {}
   96     96   
            }
   97     97   
            Ok(())
   98     98   
        })?;
   99     99   
        Ok(builder.build())
  100    100   
    }
  101    101   
}
         102  +
impl RecursiveShapesInputOutputNested1 {
         103  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         104  +
    pub fn deserialize_with_response(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         106  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         107  +
        _status: u16,
         108  +
        _body: &[u8],
         109  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         110  +
        Self::deserialize(deserializer)
         111  +
    }
         112  +
}
  102    113   
impl RecursiveShapesInputOutputNested1 {
  103    114   
    /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
  104    115   
    pub fn builder() -> crate::types::builders::RecursiveShapesInputOutputNested1Builder {
  105    116   
        crate::types::builders::RecursiveShapesInputOutputNested1Builder::default()
  106    117   
    }
  107    118   
}
  108    119   
  109    120   
/// A builder for [`RecursiveShapesInputOutputNested1`](crate::types::RecursiveShapesInputOutputNested1).
  110    121   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  111    122   
#[non_exhaustive]

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

@@ -13,13 +131,142 @@
   33     33   
    "bar",
   34     34   
    0,
   35     35   
);
   36     36   
static RECURSIVESHAPESINPUTOUTPUTNESTED2_MEMBER_RECURSIVE_MEMBER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "aws.protocoltests.restjson#RecursiveShapesInputOutputNested2$recursiveMember",
   39     39   
        "aws.protocoltests.restjson",
   40     40   
        "RecursiveShapesInputOutputNested2",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Structure,
   43         -
    "recursive_member",
          43  +
    "recursiveMember",
   44     44   
    1,
   45     45   
);
   46     46   
static RECURSIVESHAPESINPUTOUTPUTNESTED2_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    RECURSIVESHAPESINPUTOUTPUTNESTED2_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &RECURSIVESHAPESINPUTOUTPUTNESTED2_MEMBER_BAR,
   51     51   
        &RECURSIVESHAPESINPUTOUTPUTNESTED2_MEMBER_RECURSIVE_MEMBER,
   52     52   
    ],
   53     53   
);
   54     54   
impl RecursiveShapesInputOutputNested2 {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RECURSIVESHAPESINPUTOUTPUTNESTED2_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for RecursiveShapesInputOutputNested2 {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.bar {
   65     65   
            ser.write_string(&RECURSIVESHAPESINPUTOUTPUTNESTED2_MEMBER_BAR, val)?;
   66     66   
        }
   67     67   
        if let Some(ref val) = self.recursive_member {
   68     68   
            ser.write_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED2_MEMBER_RECURSIVE_MEMBER, val)?;
   69     69   
        }
   70     70   
        Ok(())
   71     71   
    }
   72     72   
}
   73     73   
impl RecursiveShapesInputOutputNested2 {
   74     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     78   
        #[allow(unused_variables, unused_mut)]
   79     79   
        let mut builder = Self::builder();
   80     80   
        #[allow(
   81     81   
            unused_variables,
   82     82   
            unreachable_code,
   83     83   
            clippy::single_match,
   84     84   
            clippy::match_single_binding,
   85     85   
            clippy::diverging_sub_expression
   86     86   
        )]
   87         -
        deserializer.read_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED2_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&RECURSIVESHAPESINPUTOUTPUTNESTED2_SCHEMA, &mut |member, deser| {
   88     88   
            match member.member_index() {
   89     89   
                Some(0) => {
   90     90   
                    builder.bar = Some(deser.read_string(member)?);
   91     91   
                }
   92     92   
                Some(1) => {
   93     93   
                    builder.recursive_member = Some(crate::types::RecursiveShapesInputOutputNested1::deserialize(deser)?);
   94     94   
                }
   95     95   
                _ => {}
   96     96   
            }
   97     97   
            Ok(())
   98     98   
        })?;
   99     99   
        Ok(builder.build())
  100    100   
    }
  101    101   
}
         102  +
impl RecursiveShapesInputOutputNested2 {
         103  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         104  +
    pub fn deserialize_with_response(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         106  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         107  +
        _status: u16,
         108  +
        _body: &[u8],
         109  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         110  +
        Self::deserialize(deserializer)
         111  +
    }
         112  +
}
  102    113   
impl RecursiveShapesInputOutputNested2 {
  103    114   
    /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::types::RecursiveShapesInputOutputNested2).
  104    115   
    pub fn builder() -> crate::types::builders::RecursiveShapesInputOutputNested2Builder {
  105    116   
        crate::types::builders::RecursiveShapesInputOutputNested2Builder::default()
  106    117   
    }
  107    118   
}
  108    119   
  109    120   
/// A builder for [`RecursiveShapesInputOutputNested2`](crate::types::RecursiveShapesInputOutputNested2).
  110    121   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  111    122   
#[non_exhaustive]

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

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.salutation {
   46     46   
            ser.write_string(&RENAMEDGREETING_MEMBER_SALUTATION, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RenamedGreeting {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&RENAMEDGREETING_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&RENAMEDGREETING_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.salutation = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl RenamedGreeting {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl RenamedGreeting {
   78     89   
    /// Creates a new builder-style object to manufacture [`RenamedGreeting`](crate::types::RenamedGreeting).
   79     90   
    pub fn builder() -> crate::types::builders::RenamedGreetingBuilder {
   80     91   
        crate::types::builders::RenamedGreetingBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`RenamedGreeting`](crate::types::RenamedGreeting).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

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

@@ -22,22 +0,114 @@
   42     42   
    }
   43     43   
    /// Returns true if this is a [`String`](crate::types::SimpleUnion::String).
   44     44   
    pub fn is_string(&self) -> bool {
   45     45   
        self.as_string().is_ok()
   46     46   
    }
   47     47   
    /// Returns true if the enum instance is the `Unknown` variant.
   48     48   
    pub fn is_unknown(&self) -> bool {
   49     49   
        matches!(self, Self::Unknown)
   50     50   
    }
   51     51   
}
          52  +
static SIMPLEUNION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          53  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#SimpleUnion", "aws.protocoltests.restjson", "SimpleUnion");
          54  +
static SIMPLEUNION_MEMBER_INT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          55  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#SimpleUnion$int", "aws.protocoltests.restjson", "SimpleUnion"),
          56  +
    ::aws_smithy_schema::ShapeType::Integer,
          57  +
    "int",
          58  +
    0,
          59  +
);
          60  +
static SIMPLEUNION_MEMBER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_static(
          62  +
        "aws.protocoltests.restjson#SimpleUnion$string",
          63  +
        "aws.protocoltests.restjson",
          64  +
        "SimpleUnion",
          65  +
    ),
          66  +
    ::aws_smithy_schema::ShapeType::String,
          67  +
    "string",
          68  +
    1,
          69  +
);
          70  +
static SIMPLEUNION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          71  +
    SIMPLEUNION_SCHEMA_ID,
          72  +
    ::aws_smithy_schema::ShapeType::Union,
          73  +
    &[&SIMPLEUNION_MEMBER_INT, &SIMPLEUNION_MEMBER_STRING],
          74  +
);
          75  +
impl SimpleUnion {
          76  +
    /// The schema for this shape.
          77  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLEUNION_SCHEMA;
          78  +
}
          79  +
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleUnion {
          80  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          81  +
    fn serialize_members(
          82  +
        &self,
          83  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          84  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          85  +
        match self {
          86  +
            Self::Int(val) => {
          87  +
                ser.write_integer(&SIMPLEUNION_MEMBER_INT, *val)?;
          88  +
            }
          89  +
            Self::String(val) => {
          90  +
                ser.write_string(&SIMPLEUNION_MEMBER_STRING, val)?;
          91  +
            }
          92  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          93  +
        }
          94  +
        Ok(())
          95  +
    }
          96  +
}
          97  +
impl SimpleUnion {
          98  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          99  +
    pub fn deserialize(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         101  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         102  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
         103  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
         104  +
        deserializer.read_struct(&SIMPLEUNION_SCHEMA, &mut |member, deser| {
         105  +
            result = ::std::option::Option::Some(match member.member_index() {
         106  +
                Some(0) => Self::Int(deser.read_integer(member)?),
         107  +
                Some(1) => Self::String(deser.read_string(member)?),
         108  +
                _ => Self::Unknown,
         109  +
            });
         110  +
            Ok(())
         111  +
        })?;
         112  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         113  +
    }
         114  +
}

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

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.value {
   46     46   
            ser.write_string(&SINGLETONEVENT_MEMBER_VALUE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl SingletonEvent {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&SINGLETONEVENT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&SINGLETONEVENT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.value = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl SingletonEvent {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl SingletonEvent {
   78     89   
    /// Creates a new builder-style object to manufacture [`SingletonEvent`](crate::types::SingletonEvent).
   79     90   
    pub fn builder() -> crate::types::builders::SingletonEventBuilder {
   80     91   
        crate::types::builders::SingletonEventBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`SingletonEvent`](crate::types::SingletonEvent).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

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

@@ -8,8 +0,93 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Singleton`](crate::types::SingletonEventStream::Singleton).
   30     30   
    pub fn is_singleton(&self) -> bool {
   31     31   
        self.as_singleton().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static SINGLETONEVENTSTREAM_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
          39  +
    "aws.protocoltests.restjson#SingletonEventStream",
          40  +
    "aws.protocoltests.restjson",
          41  +
    "SingletonEventStream",
          42  +
);
          43  +
static SINGLETONEVENTSTREAM_MEMBER_SINGLETON: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_static(
          45  +
        "aws.protocoltests.restjson#SingletonEventStream$singleton",
          46  +
        "aws.protocoltests.restjson",
          47  +
        "SingletonEventStream",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::Structure,
          50  +
    "singleton",
          51  +
    0,
          52  +
);
          53  +
static SINGLETONEVENTSTREAM_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          54  +
    SINGLETONEVENTSTREAM_SCHEMA_ID,
          55  +
    ::aws_smithy_schema::ShapeType::Union,
          56  +
    &[&SINGLETONEVENTSTREAM_MEMBER_SINGLETON],
          57  +
);
          58  +
impl SingletonEventStream {
          59  +
    /// The schema for this shape.
          60  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SINGLETONEVENTSTREAM_SCHEMA;
          61  +
}
          62  +
impl ::aws_smithy_schema::serde::SerializableStruct for SingletonEventStream {
          63  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          64  +
    fn serialize_members(
          65  +
        &self,
          66  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          67  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          68  +
        match self {
          69  +
            Self::Singleton(val) => {
          70  +
                ser.write_struct(&SINGLETONEVENTSTREAM_MEMBER_SINGLETON, val)?;
          71  +
            }
          72  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          73  +
        }
          74  +
        Ok(())
          75  +
    }
          76  +
}
          77  +
impl SingletonEventStream {
          78  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          79  +
    pub fn deserialize(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          82  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          83  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          84  +
        deserializer.read_struct(&SINGLETONEVENTSTREAM_SCHEMA, &mut |member, deser| {
          85  +
            result = ::std::option::Option::Some(match member.member_index() {
          86  +
                Some(0) => Self::Singleton(crate::types::SingletonEvent::deserialize(deser)?),
          87  +
                _ => Self::Unknown,
          88  +
            });
          89  +
            Ok(())
          90  +
        })?;
          91  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          92  +
    }
          93  +
}

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

@@ -24,24 +107,118 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.payload {
   47     47   
            ser.write_string(&STRINGPAYLOADEVENT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl StringPayloadEvent {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&STRINGPAYLOADEVENT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&STRINGPAYLOADEVENT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl StringPayloadEvent {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   78     89   
impl StringPayloadEvent {
   79     90   
    /// Creates a new builder-style object to manufacture [`StringPayloadEvent`](crate::types::StringPayloadEvent).
   80     91   
    pub fn builder() -> crate::types::builders::StringPayloadEventBuilder {
   81     92   
        crate::types::builders::StringPayloadEventBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`StringPayloadEvent`](crate::types::StringPayloadEvent).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]

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

@@ -44,44 +130,141 @@
   64     64   
            ser.write_string(&STRUCTURELISTMEMBER_MEMBER_A, val)?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.b {
   67     67   
            ser.write_string(&STRUCTURELISTMEMBER_MEMBER_B, val)?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl StructureListMember {
   73     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   74         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   75         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   76     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   77     77   
        #[allow(unused_variables, unused_mut)]
   78     78   
        let mut builder = Self::builder();
   79     79   
        #[allow(
   80     80   
            unused_variables,
   81     81   
            unreachable_code,
   82     82   
            clippy::single_match,
   83     83   
            clippy::match_single_binding,
   84     84   
            clippy::diverging_sub_expression
   85     85   
        )]
   86         -
        deserializer.read_struct(&STRUCTURELISTMEMBER_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&STRUCTURELISTMEMBER_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.a = Some(deser.read_string(member)?);
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.b = Some(deser.read_string(member)?);
   93     93   
                }
   94     94   
                _ => {}
   95     95   
            }
   96     96   
            Ok(())
   97     97   
        })?;
   98     98   
        Ok(builder.build())
   99     99   
    }
  100    100   
}
         101  +
impl StructureListMember {
         102  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         103  +
    pub fn deserialize_with_response(
         104  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         105  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         106  +
        _status: u16,
         107  +
        _body: &[u8],
         108  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         109  +
        Self::deserialize(deserializer)
         110  +
    }
         111  +
}
  101    112   
impl StructureListMember {
  102    113   
    /// Creates a new builder-style object to manufacture [`StructureListMember`](crate::types::StructureListMember).
  103    114   
    pub fn builder() -> crate::types::builders::StructureListMemberBuilder {
  104    115   
        crate::types::builders::StructureListMemberBuilder::default()
  105    116   
    }
  106    117   
}
  107    118   
  108    119   
/// A builder for [`StructureListMember`](crate::types::StructureListMember).
  109    120   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  110    121   
#[non_exhaustive]