Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

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]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/_structure_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_struct(&STRUCTUREPAYLOADEVENT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl StructurePayloadEvent {
   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(&STRUCTUREPAYLOADEVENT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&STRUCTUREPAYLOADEVENT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(crate::types::PayloadStructure::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl StructurePayloadEvent {
          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 StructurePayloadEvent {
   79     90   
    /// Creates a new builder-style object to manufacture [`StructurePayloadEvent`](crate::types::StructurePayloadEvent).
   80     91   
    pub fn builder() -> crate::types::builders::StructurePayloadEventBuilder {
   81     92   
        crate::types::builders::StructurePayloadEventBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`StructurePayloadEvent`](crate::types::StructurePayloadEvent).
   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/_test_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.timeout {
   43     43   
            ser.write_integer(&TESTCONFIG_MEMBER_TIMEOUT, *val)?;
   44     44   
        }
   45     45   
        Ok(())
   46     46   
    }
   47     47   
}
   48     48   
impl TestConfig {
   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(&TESTCONFIG_SCHEMA, (), |_, member, deser| {
          62  +
        deserializer.read_struct(&TESTCONFIG_SCHEMA, &mut |member, deser| {
   63     63   
            match member.member_index() {
   64     64   
                Some(0) => {
   65     65   
                    builder.timeout = 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 TestConfig {
          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 TestConfig {
   75     86   
    /// Creates a new builder-style object to manufacture [`TestConfig`](crate::types::TestConfig).
   76     87   
    pub fn builder() -> crate::types::builders::TestConfigBuilder {
   77     88   
        crate::types::builders::TestConfigBuilder::default()
   78     89   
    }
   79     90   
}
   80     91   
   81     92   
/// A builder for [`TestConfig`](crate::types::TestConfig).
   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/_top_level.rs

@@ -9,9 +180,185 @@
   29     29   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#TopLevel", "aws.protocoltests.restjson", "TopLevel");
   30     30   
static TOPLEVEL_MEMBER_DIALOG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   31     31   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#TopLevel$dialog", "aws.protocoltests.restjson", "TopLevel"),
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    "dialog",
   34     34   
    0,
   35     35   
);
   36     36   
static TOPLEVEL_MEMBER_DIALOG_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#TopLevel$dialogList", "aws.protocoltests.restjson", "TopLevel"),
   38     38   
    ::aws_smithy_schema::ShapeType::List,
   39         -
    "dialog_list",
          39  +
    "dialogList",
   40     40   
    1,
   41     41   
);
   42     42   
static TOPLEVEL_MEMBER_DIALOG_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   43     43   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#TopLevel$dialogMap", "aws.protocoltests.restjson", "TopLevel"),
   44     44   
    ::aws_smithy_schema::ShapeType::Map,
   45         -
    "dialog_map",
          45  +
    "dialogMap",
   46     46   
    2,
   47     47   
);
   48     48   
static TOPLEVEL_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    TOPLEVEL_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&TOPLEVEL_MEMBER_DIALOG, &TOPLEVEL_MEMBER_DIALOG_LIST, &TOPLEVEL_MEMBER_DIALOG_MAP],
   52     52   
);
   53     53   
impl TopLevel {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TOPLEVEL_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for TopLevel {
   58     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     59   
    fn serialize_members(
   60     60   
        &self,
   61     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     63   
        {
   64     64   
            let val = &self.dialog;
   65     65   
            ser.write_struct(&TOPLEVEL_MEMBER_DIALOG, val)?;
   66     66   
        }
   67     67   
        {
   68     68   
            let val = &self.dialog_list;
   69     69   
   70     70   
            ser.write_list(
   71     71   
                &TOPLEVEL_MEMBER_DIALOG_LIST,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::Dialog::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        {
   81     81   
            let val = &self.dialog_map;
   82     82   
   83     83   
            ser.write_map(
   84     84   
                &TOPLEVEL_MEMBER_DIALOG_MAP,
   85     85   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   86     86   
                    for (key, value) in val {
   87     87   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   88     88   
                        ser.write_struct(crate::types::Dialog::SCHEMA, value)?;
   89     89   
                    }
   90     90   
                    Ok(())
   91     91   
                },
   92     92   
            )?;
   93     93   
        }
   94     94   
        Ok(())
   95     95   
    }
   96     96   
}
   97     97   
impl TopLevel {
   98     98   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   99         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  100         -
        deserializer: &mut D,
          99  +
    pub fn deserialize(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  101    101   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  102    102   
        #[allow(unused_variables, unused_mut)]
  103    103   
        let mut builder = Self::builder();
  104    104   
        #[allow(
  105    105   
            unused_variables,
  106    106   
            unreachable_code,
  107    107   
            clippy::single_match,
  108    108   
            clippy::match_single_binding,
  109    109   
            clippy::diverging_sub_expression
  110    110   
        )]
  111         -
        deserializer.read_struct(&TOPLEVEL_SCHEMA, (), |_, member, deser| {
         111  +
        deserializer.read_struct(&TOPLEVEL_SCHEMA, &mut |member, deser| {
  112    112   
            match member.member_index() {
  113    113   
                Some(0) => {
  114    114   
                    builder.dialog = Some(crate::types::Dialog::deserialize(deser)?);
  115    115   
                }
  116    116   
                Some(1) => {
  117    117   
                    builder.dialog_list = Some({
  118         -
                        let container = if let Some(cap) = deser.container_size() {
  119         -
                            Vec::with_capacity(cap)
  120         -
                        } else {
  121         -
                            Vec::new()
  122         -
                        };
  123         -
                        deser.read_list(member, container, |mut list, deser| {
  124         -
                            list.push(crate::types::Dialog::deserialize(deser)?);
  125         -
                            Ok(list)
  126         -
                        })?
         118  +
                        let mut container = Vec::new();
         119  +
                        deser.read_list(member, &mut |deser| {
         120  +
                            container.push(crate::types::Dialog::deserialize(deser)?);
         121  +
                            Ok(())
         122  +
                        })?;
         123  +
                        container
  127    124   
                    });
  128    125   
                }
  129    126   
                Some(2) => {
  130    127   
                    builder.dialog_map = Some({
  131         -
                        let container = if let Some(cap) = deser.container_size() {
  132         -
                            std::collections::HashMap::with_capacity(cap)
  133         -
                        } else {
  134         -
                            std::collections::HashMap::new()
  135         -
                        };
  136         -
                        deser.read_map(member, container, |mut map, key, deser| {
  137         -
                            map.insert(key, crate::types::Dialog::deserialize(deser)?);
  138         -
                            Ok(map)
  139         -
                        })?
         128  +
                        let mut container = std::collections::HashMap::new();
         129  +
                        deser.read_map(member, &mut |key, deser| {
         130  +
                            container.insert(key, crate::types::Dialog::deserialize(deser)?);
         131  +
                            Ok(())
         132  +
                        })?;
         133  +
                        container
  140    134   
                    });
  141    135   
                }
  142    136   
                _ => {}
  143    137   
            }
  144    138   
            Ok(())
  145    139   
        })?;
  146    140   
        builder
  147    141   
            .build()
  148    142   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  149    143   
    }
  150    144   
}
         145  +
impl TopLevel {
         146  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         147  +
    pub fn deserialize_with_response(
         148  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         149  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         150  +
        _status: u16,
         151  +
        _body: &[u8],
         152  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         153  +
        Self::deserialize(deserializer)
         154  +
    }
         155  +
}
  151    156   
impl TopLevel {
  152    157   
    /// Creates a new builder-style object to manufacture [`TopLevel`](crate::types::TopLevel).
  153    158   
    pub fn builder() -> crate::types::builders::TopLevelBuilder {
  154    159   
        crate::types::builders::TopLevelBuilder::default()
  155    160   
    }
  156    161   
}
  157    162   
  158    163   
/// A builder for [`TopLevel`](crate::types::TopLevel).
  159    164   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  160    165   
#[non_exhaustive]

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

@@ -8,8 +0,90 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Greeting`](crate::types::UnionPayload::Greeting).
   30     30   
    pub fn is_greeting(&self) -> bool {
   31     31   
        self.as_greeting().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 UNIONPAYLOAD_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          39  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#UnionPayload", "aws.protocoltests.restjson", "UnionPayload");
          40  +
static UNIONPAYLOAD_MEMBER_GREETING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_static(
          42  +
        "aws.protocoltests.restjson#UnionPayload$greeting",
          43  +
        "aws.protocoltests.restjson",
          44  +
        "UnionPayload",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::String,
          47  +
    "greeting",
          48  +
    0,
          49  +
);
          50  +
static UNIONPAYLOAD_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          51  +
    UNIONPAYLOAD_SCHEMA_ID,
          52  +
    ::aws_smithy_schema::ShapeType::Union,
          53  +
    &[&UNIONPAYLOAD_MEMBER_GREETING],
          54  +
);
          55  +
impl UnionPayload {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UNIONPAYLOAD_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for UnionPayload {
          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::Greeting(val) => {
          67  +
                ser.write_string(&UNIONPAYLOAD_MEMBER_GREETING, 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 UnionPayload {
          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(&UNIONPAYLOAD_SCHEMA, &mut |member, deser| {
          82  +
            result = ::std::option::Option::Some(match member.member_index() {
          83  +
                Some(0) => Self::Greeting(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  +
}