Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/types/error/_validation_exception.rs

@@ -6,6 +142,151 @@
   26     26   
    "message",
   27     27   
    0,
   28     28   
);
   29     29   
static VALIDATIONERROR_MEMBER_FIELD_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   30     30   
    ::aws_smithy_schema::ShapeId::from_static(
   31     31   
        "smithy.framework#ValidationException$fieldList",
   32     32   
        "smithy.framework",
   33     33   
        "ValidationException",
   34     34   
    ),
   35     35   
    ::aws_smithy_schema::ShapeType::List,
   36         -
    "field_list",
          36  +
    "fieldList",
   37     37   
    1,
   38     38   
);
   39     39   
static VALIDATIONERROR_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   40     40   
    VALIDATIONERROR_SCHEMA_ID,
   41     41   
    ::aws_smithy_schema::ShapeType::Structure,
   42     42   
    &[&VALIDATIONERROR_MEMBER_MESSAGE, &VALIDATIONERROR_MEMBER_FIELD_LIST],
   43     43   
);
   44     44   
impl ValidationError {
   45     45   
    /// The schema for this shape.
   46     46   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &VALIDATIONERROR_SCHEMA;
   47     47   
}
   48     48   
impl ::aws_smithy_schema::serde::SerializableStruct for ValidationError {
   49     49   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   50     50   
    fn serialize_members(
   51     51   
        &self,
   52     52   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   53     53   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   54     54   
        {
   55     55   
            let val = &self.message;
   56     56   
            ser.write_string(&VALIDATIONERROR_MEMBER_MESSAGE, val)?;
   57     57   
        }
   58     58   
        if let Some(ref val) = self.field_list {
   59     59   
            ser.write_list(
   60     60   
                &VALIDATIONERROR_MEMBER_FIELD_LIST,
   61     61   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   62     62   
                    for item in val {
   63     63   
                        ser.write_struct(crate::types::ValidationExceptionField::SCHEMA, item)?;
   64     64   
                    }
   65     65   
                    Ok(())
   66     66   
                },
   67     67   
            )?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl ValidationError {
   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(&VALIDATIONERROR_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&VALIDATIONERROR_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.message = Some(deser.read_string(member)?);
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.field_list = Some({
   93         -
                        let container = if let Some(cap) = deser.container_size() {
   94         -
                            Vec::with_capacity(cap)
   95         -
                        } else {
   96         -
                            Vec::new()
   97         -
                        };
   98         -
                        deser.read_list(member, container, |mut list, deser| {
   99         -
                            list.push(crate::types::ValidationExceptionField::deserialize(deser)?);
  100         -
                            Ok(list)
  101         -
                        })?
          93  +
                        let mut container = Vec::new();
          94  +
                        deser.read_list(member, &mut |deser| {
          95  +
                            container.push(crate::types::ValidationExceptionField::deserialize(deser)?);
          96  +
                            Ok(())
          97  +
                        })?;
          98  +
                        container
  102     99   
                    });
  103    100   
                }
  104    101   
                _ => {}
  105    102   
            }
  106    103   
            Ok(())
  107    104   
        })?;
         105  +
        builder.message = builder.message.or(Some(String::new()));
  108    106   
        builder
  109    107   
            .build()
  110    108   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  111    109   
    }
  112    110   
}
         111  +
impl ValidationError {
         112  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         113  +
    pub fn deserialize_with_response(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         116  +
        _status: u16,
         117  +
        _body: &[u8],
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        Self::deserialize(deserializer)
         120  +
    }
         121  +
}
  113    122   
impl ValidationError {
  114    123   
    /// Returns the error message.
  115    124   
    pub fn message(&self) -> &str {
  116    125   
        &self.message
  117    126   
    }
  118    127   
}
  119    128   
impl ::std::fmt::Display for ValidationError {
  120    129   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  121    130   
        ::std::write!(f, "ValidationError [ValidationException]")?;
  122    131   
        {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/complex_struct_operation.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ComplexStructOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ComplexStructOperation;
    6      6   
impl ComplexStructOperation {
    7      7   
    /// Creates a new `ComplexStructOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::complex_struct_operation::ComplexStructOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::complex_struct_operation::ComplexStructOperationOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::complex_struct_operation::ComplexStructOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::complex_struct_operation::ComplexStructOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::complex_struct_operation::ComplexStructOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::complex_struct_operation::ComplexStructOperationError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct ComplexStructOperationResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ComplexStructOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_complex_struct_operation::de_complex_struct_operation_http_error(status, headers, body)
  152    157   
        } else {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/complex_struct_operation/_complex_struct_operation_input.rs

@@ -67,67 +424,423 @@
   87     87   
    "structure",
   88     88   
    0,
   89     89   
);
   90     90   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_EMPTY_STRUCTURE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$emptyStructure",
   93     93   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   94     94   
        "ComplexStructOperationInput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::Structure,
   97         -
    "empty_structure",
          97  +
    "emptyStructure",
   98     98   
    1,
   99     99   
);
  100    100   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  101    101   
    ::aws_smithy_schema::ShapeId::from_static(
  102    102   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$list",
  103    103   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  104    104   
        "ComplexStructOperationInput",
  105    105   
    ),
  106    106   
    ::aws_smithy_schema::ShapeType::List,
  107    107   
    "list",
  108    108   
    2,
  109    109   
);
  110    110   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$map",
  113    113   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  114    114   
        "ComplexStructOperationInput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::Map,
  117    117   
    "map",
  118    118   
    3,
  119    119   
);
  120    120   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$union",
  123    123   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  124    124   
        "ComplexStructOperationInput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::Union,
  127    127   
    "union",
  128    128   
    4,
  129    129   
);
  130    130   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNIT_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  131    131   
    ::aws_smithy_schema::ShapeId::from_static(
  132    132   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$unitUnion",
  133    133   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  134    134   
        "ComplexStructOperationInput",
  135    135   
    ),
  136    136   
    ::aws_smithy_schema::ShapeType::Union,
  137         -
    "unit_union",
         137  +
    "unitUnion",
  138    138   
    5,
  139    139   
);
  140    140   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$structureList",
  143    143   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  144    144   
        "ComplexStructOperationInput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::List,
  147         -
    "structure_list",
         147  +
    "structureList",
  148    148   
    6,
  149    149   
);
  150    150   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  151    151   
    ::aws_smithy_schema::ShapeId::from_static(
  152    152   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$complexList",
  153    153   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  154    154   
        "ComplexStructOperationInput",
  155    155   
    ),
  156    156   
    ::aws_smithy_schema::ShapeType::List,
  157         -
    "complex_list",
         157  +
    "complexList",
  158    158   
    7,
  159    159   
);
  160    160   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static(
  162    162   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$complexMap",
  163    163   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  164    164   
        "ComplexStructOperationInput",
  165    165   
    ),
  166    166   
    ::aws_smithy_schema::ShapeType::Map,
  167         -
    "complex_map",
         167  +
    "complexMap",
  168    168   
    8,
  169    169   
);
  170    170   
static COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  171    171   
    ::aws_smithy_schema::ShapeId::from_static(
  172    172   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationInput$complexUnion",
  173    173   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  174    174   
        "ComplexStructOperationInput",
  175    175   
    ),
  176    176   
    ::aws_smithy_schema::ShapeType::Union,
  177         -
    "complex_union",
         177  +
    "complexUnion",
  178    178   
    9,
  179    179   
);
  180    180   
static COMPLEXSTRUCTOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  181    181   
    COMPLEXSTRUCTOPERATIONINPUT_SCHEMA_ID,
  182    182   
    ::aws_smithy_schema::ShapeType::Structure,
  183    183   
    &[
  184    184   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_STRUCTURE,
  185    185   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_EMPTY_STRUCTURE,
  186    186   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_LIST,
  187    187   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_MAP,
  188    188   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNION,
  189    189   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNIT_UNION,
  190    190   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_STRUCTURE_LIST,
  191    191   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_LIST,
  192    192   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_MAP,
  193    193   
        &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_UNION,
  194    194   
    ],
  195    195   
);
  196    196   
impl ComplexStructOperationInput {
  197    197   
    /// The schema for this shape.
  198    198   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXSTRUCTOPERATIONINPUT_SCHEMA;
  199    199   
}
  200    200   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexStructOperationInput {
  201    201   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  202    202   
    fn serialize_members(
  203    203   
        &self,
  204    204   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  205    205   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  206    206   
        if let Some(ref val) = self.structure {
  207    207   
            ser.write_struct(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_STRUCTURE, val)?;
  208    208   
        }
  209    209   
        if let Some(ref val) = self.empty_structure {
  210    210   
            ser.write_struct(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_EMPTY_STRUCTURE, val)?;
  211    211   
        }
  212    212   
        if let Some(ref val) = self.list {
  213    213   
            ser.write_list(
  214    214   
                &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_LIST,
  215    215   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  216    216   
                    for item in val {
  217    217   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  218    218   
                    }
  219    219   
                    Ok(())
  220    220   
                },
  221    221   
            )?;
  222    222   
        }
  223    223   
        if let Some(ref val) = self.map {
  224    224   
            ser.write_map(
  225    225   
                &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_MAP,
  226    226   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  227    227   
                    for (key, value) in val {
  228    228   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  229    229   
                        ser.write_integer(&::aws_smithy_schema::prelude::INTEGER, *value)?;
  230    230   
                    }
  231    231   
                    Ok(())
  232    232   
                },
  233    233   
            )?;
  234    234   
        }
  235    235   
        if let Some(ref val) = self.union {
  236         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNION)?;
         236  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNION, val)?;
  237    237   
        }
  238    238   
        if let Some(ref val) = self.unit_union {
  239         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNIT_UNION)?;
         239  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_UNIT_UNION, val)?;
  240    240   
        }
  241    241   
        if let Some(ref val) = self.structure_list {
  242    242   
            ser.write_list(
  243    243   
                &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_STRUCTURE_LIST,
  244    244   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  245    245   
                    for item in val {
  246    246   
                        ser.write_struct(crate::types::SimpleStruct::SCHEMA, item)?;
  247    247   
                    }
  248    248   
                    Ok(())
  249    249   
                },
  250    250   
            )?;
  251    251   
        }
  252    252   
        if let Some(ref val) = self.complex_list {
  253    253   
            ser.write_list(
  254    254   
                &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_LIST,
  255    255   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  256    256   
                    for item in val {
  257         -
                        todo!("schema: unsupported list element type");
         257  +
                        ser.write_map(
         258  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         259  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         260  +
                                for (key, value) in item {
         261  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         262  +
                                    ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
         263  +
                                }
         264  +
                                Ok(())
         265  +
                            },
         266  +
                        )?;
  258    267   
                    }
  259    268   
                    Ok(())
  260    269   
                },
  261    270   
            )?;
  262    271   
        }
  263    272   
        if let Some(ref val) = self.complex_map {
  264    273   
            ser.write_map(
  265    274   
                &COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_MAP,
  266    275   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  267    276   
                    for (key, value) in val {
  268    277   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  269         -
                        todo!("schema: unsupported map value type");
         278  +
                        ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
  270    279   
                    }
  271    280   
                    Ok(())
  272    281   
                },
  273    282   
            )?;
  274    283   
        }
  275    284   
        if let Some(ref val) = self.complex_union {
  276         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_UNION)?;
         285  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONINPUT_MEMBER_COMPLEX_UNION, val)?;
  277    286   
        }
  278    287   
        Ok(())
  279    288   
    }
  280    289   
}
  281    290   
impl ComplexStructOperationInput {
  282    291   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  283         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  284         -
        deserializer: &mut D,
         292  +
    pub fn deserialize(
         293  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  285    294   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  286    295   
        #[allow(unused_variables, unused_mut)]
  287    296   
        let mut builder = Self::builder();
  288    297   
        #[allow(
  289    298   
            unused_variables,
  290    299   
            unreachable_code,
  291    300   
            clippy::single_match,
  292    301   
            clippy::match_single_binding,
  293    302   
            clippy::diverging_sub_expression
  294    303   
        )]
  295         -
        deserializer.read_struct(&COMPLEXSTRUCTOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
         304  +
        deserializer.read_struct(&COMPLEXSTRUCTOPERATIONINPUT_SCHEMA, &mut |member, deser| {
  296    305   
            match member.member_index() {
  297    306   
                Some(0) => {
  298    307   
                    builder.structure = Some(crate::types::SimpleStruct::deserialize(deser)?);
  299    308   
                }
  300    309   
                Some(1) => {
  301    310   
                    builder.empty_structure = Some(crate::types::EmptyStruct::deserialize(deser)?);
  302    311   
                }
  303    312   
                Some(2) => {
  304         -
                    builder.list = Some({
  305         -
                        let container = if let Some(cap) = deser.container_size() {
  306         -
                            Vec::with_capacity(cap)
  307         -
                        } else {
  308         -
                            Vec::new()
  309         -
                        };
  310         -
                        deser.read_list(member, container, |mut list, deser| {
  311         -
                            list.push(deser.read_string(member)?);
  312         -
                            Ok(list)
  313         -
                        })?
  314         -
                    });
         313  +
                    builder.list = Some(deser.read_string_list(member)?);
  315    314   
                }
  316    315   
                Some(3) => {
  317    316   
                    builder.map = Some({
  318         -
                        let container = if let Some(cap) = deser.container_size() {
  319         -
                            std::collections::HashMap::with_capacity(cap)
  320         -
                        } else {
  321         -
                            std::collections::HashMap::new()
  322         -
                        };
  323         -
                        deser.read_map(member, container, |mut map, key, deser| {
  324         -
                            map.insert(key, deser.read_integer(member)?);
  325         -
                            Ok(map)
  326         -
                        })?
         317  +
                        let mut container = std::collections::HashMap::new();
         318  +
                        deser.read_map(member, &mut |key, deser| {
         319  +
                            container.insert(key, deser.read_integer(member)?);
         320  +
                            Ok(())
         321  +
                        })?;
         322  +
                        container
  327    323   
                    });
  328    324   
                }
  329    325   
                Some(4) => {
  330         -
                    builder.union = Some({
  331         -
                        let _ = member;
  332         -
                        todo!("deserialize aggregate")
  333         -
                    });
         326  +
                    builder.union = Some(crate::types::SimpleUnion::deserialize(deser)?);
  334    327   
                }
  335    328   
                Some(5) => {
  336         -
                    builder.unit_union = Some({
  337         -
                        let _ = member;
  338         -
                        todo!("deserialize aggregate")
  339         -
                    });
         329  +
                    builder.unit_union = Some(crate::types::UnitUnion::deserialize(deser)?);
  340    330   
                }
  341    331   
                Some(6) => {
  342    332   
                    builder.structure_list = Some({
  343         -
                        let container = if let Some(cap) = deser.container_size() {
  344         -
                            Vec::with_capacity(cap)
  345         -
                        } else {
  346         -
                            Vec::new()
  347         -
                        };
  348         -
                        deser.read_list(member, container, |mut list, deser| {
  349         -
                            list.push(crate::types::SimpleStruct::deserialize(deser)?);
  350         -
                            Ok(list)
  351         -
                        })?
         333  +
                        let mut container = Vec::new();
         334  +
                        deser.read_list(member, &mut |deser| {
         335  +
                            container.push(crate::types::SimpleStruct::deserialize(deser)?);
         336  +
                            Ok(())
         337  +
                        })?;
         338  +
                        container
  352    339   
                    });
  353    340   
                }
  354    341   
                Some(7) => {
  355    342   
                    builder.complex_list = Some({
  356         -
                        let container = if let Some(cap) = deser.container_size() {
  357         -
                            Vec::with_capacity(cap)
  358         -
                        } else {
  359         -
                            Vec::new()
  360         -
                        };
  361         -
                        deser.read_list(member, container, |mut list, deser| {
  362         -
                            list.push(todo!("deserialize nested aggregate"));
  363         -
                            Ok(list)
  364         -
                        })?
         343  +
                        let mut container = Vec::new();
         344  +
                        deser.read_list(member, &mut |deser| {
         345  +
                            container.push({
         346  +
                                let mut map = ::std::collections::HashMap::new();
         347  +
                                deser.read_map(member, &mut |key, deser| {
         348  +
                                    let value = crate::types::ComplexUnion::deserialize(deser)?;
         349  +
                                    map.insert(key, value);
         350  +
                                    Ok(())
         351  +
                                })?;
         352  +
                                map
         353  +
                            });
         354  +
                            Ok(())
         355  +
                        })?;
         356  +
                        container
  365    357   
                    });
  366    358   
                }
  367    359   
                Some(8) => {
  368    360   
                    builder.complex_map = Some({
  369         -
                        let container = if let Some(cap) = deser.container_size() {
  370         -
                            std::collections::HashMap::with_capacity(cap)
  371         -
                        } else {
  372         -
                            std::collections::HashMap::new()
  373         -
                        };
  374         -
                        deser.read_map(member, container, |mut map, key, deser| {
  375         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  376         -
                            Ok(map)
  377         -
                        })?
         361  +
                        let mut container = std::collections::HashMap::new();
         362  +
                        deser.read_map(member, &mut |key, deser| {
         363  +
                            container.insert(key, crate::types::ComplexUnion::deserialize(deser)?);
         364  +
                            Ok(())
         365  +
                        })?;
         366  +
                        container
  378    367   
                    });
  379    368   
                }
  380    369   
                Some(9) => {
  381         -
                    builder.complex_union = Some(Box::new({
  382         -
                        let _ = member;
  383         -
                        todo!("deserialize aggregate")
  384         -
                    }));
         370  +
                    builder.complex_union = Some(Box::new(crate::types::ComplexUnion::deserialize(deser)?));
  385    371   
                }
  386    372   
                _ => {}
  387    373   
            }
  388    374   
            Ok(())
  389    375   
        })?;
         376  +
        builder.complex_list = builder.complex_list.or(Some(Vec::new()));
         377  +
        builder.complex_map = builder.complex_map.or(Some(::std::collections::HashMap::new()));
  390    378   
        builder
  391    379   
            .build()
  392    380   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  393    381   
    }
  394    382   
}
         383  +
impl ComplexStructOperationInput {
         384  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         385  +
    pub fn deserialize_with_response(
         386  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         387  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         388  +
        _status: u16,
         389  +
        _body: &[u8],
         390  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         391  +
        Self::deserialize(deserializer)
         392  +
    }
         393  +
}
  395    394   
impl ComplexStructOperationInput {
  396    395   
    /// Creates a new builder-style object to manufacture [`ComplexStructOperationInput`](crate::operation::complex_struct_operation::ComplexStructOperationInput).
  397    396   
    pub fn builder() -> crate::operation::complex_struct_operation::builders::ComplexStructOperationInputBuilder {
  398    397   
        crate::operation::complex_struct_operation::builders::ComplexStructOperationInputBuilder::default()
  399    398   
    }
  400    399   
}
  401    400   
  402    401   
/// A builder for [`ComplexStructOperationInput`](crate::operation::complex_struct_operation::ComplexStructOperationInput).
  403    402   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  404    403   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/complex_struct_operation/_complex_struct_operation_output.rs

@@ -67,67 +429,428 @@
   87     87   
    "structure",
   88     88   
    0,
   89     89   
);
   90     90   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$emptyStructure",
   93     93   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   94     94   
        "ComplexStructOperationOutput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::Structure,
   97         -
    "empty_structure",
          97  +
    "emptyStructure",
   98     98   
    1,
   99     99   
);
  100    100   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  101    101   
    ::aws_smithy_schema::ShapeId::from_static(
  102    102   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$list",
  103    103   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  104    104   
        "ComplexStructOperationOutput",
  105    105   
    ),
  106    106   
    ::aws_smithy_schema::ShapeType::List,
  107    107   
    "list",
  108    108   
    2,
  109    109   
);
  110    110   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$map",
  113    113   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  114    114   
        "ComplexStructOperationOutput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::Map,
  117    117   
    "map",
  118    118   
    3,
  119    119   
);
  120    120   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$union",
  123    123   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  124    124   
        "ComplexStructOperationOutput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::Union,
  127    127   
    "union",
  128    128   
    4,
  129    129   
);
  130    130   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  131    131   
    ::aws_smithy_schema::ShapeId::from_static(
  132    132   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$unitUnion",
  133    133   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  134    134   
        "ComplexStructOperationOutput",
  135    135   
    ),
  136    136   
    ::aws_smithy_schema::ShapeType::Union,
  137         -
    "unit_union",
         137  +
    "unitUnion",
  138    138   
    5,
  139    139   
);
  140    140   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$structureList",
  143    143   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  144    144   
        "ComplexStructOperationOutput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::List,
  147         -
    "structure_list",
         147  +
    "structureList",
  148    148   
    6,
  149    149   
);
  150    150   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  151    151   
    ::aws_smithy_schema::ShapeId::from_static(
  152    152   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexList",
  153    153   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  154    154   
        "ComplexStructOperationOutput",
  155    155   
    ),
  156    156   
    ::aws_smithy_schema::ShapeType::List,
  157         -
    "complex_list",
         157  +
    "complexList",
  158    158   
    7,
  159    159   
);
  160    160   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static(
  162    162   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexMap",
  163    163   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  164    164   
        "ComplexStructOperationOutput",
  165    165   
    ),
  166    166   
    ::aws_smithy_schema::ShapeType::Map,
  167         -
    "complex_map",
         167  +
    "complexMap",
  168    168   
    8,
  169    169   
);
  170    170   
static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  171    171   
    ::aws_smithy_schema::ShapeId::from_static(
  172    172   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexUnion",
  173    173   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  174    174   
        "ComplexStructOperationOutput",
  175    175   
    ),
  176    176   
    ::aws_smithy_schema::ShapeType::Union,
  177         -
    "complex_union",
         177  +
    "complexUnion",
  178    178   
    9,
  179    179   
);
  180    180   
static COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  181    181   
    COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA_ID,
  182    182   
    ::aws_smithy_schema::ShapeType::Structure,
  183    183   
    &[
  184    184   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE,
  185    185   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE,
  186    186   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST,
  187    187   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP,
  188    188   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION,
  189    189   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION,
  190    190   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST,
  191    191   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST,
  192    192   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP,
  193    193   
        &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION,
  194    194   
    ],
  195    195   
);
  196    196   
impl ComplexStructOperationOutput {
  197    197   
    /// The schema for this shape.
  198    198   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA;
  199    199   
}
  200    200   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexStructOperationOutput {
  201    201   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  202    202   
    fn serialize_members(
  203    203   
        &self,
  204    204   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  205    205   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  206    206   
        if let Some(ref val) = self.structure {
  207    207   
            ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE, val)?;
  208    208   
        }
  209    209   
        if let Some(ref val) = self.empty_structure {
  210    210   
            ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE, val)?;
  211    211   
        }
  212    212   
        if let Some(ref val) = self.list {
  213    213   
            ser.write_list(
  214    214   
                &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST,
  215    215   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  216    216   
                    for item in val {
  217    217   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  218    218   
                    }
  219    219   
                    Ok(())
  220    220   
                },
  221    221   
            )?;
  222    222   
        }
  223    223   
        if let Some(ref val) = self.map {
  224    224   
            ser.write_map(
  225    225   
                &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP,
  226    226   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  227    227   
                    for (key, value) in val {
  228    228   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  229    229   
                        ser.write_integer(&::aws_smithy_schema::prelude::INTEGER, *value)?;
  230    230   
                    }
  231    231   
                    Ok(())
  232    232   
                },
  233    233   
            )?;
  234    234   
        }
  235    235   
        if let Some(ref val) = self.union {
  236         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION)?;
         236  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION, val)?;
  237    237   
        }
  238    238   
        if let Some(ref val) = self.unit_union {
  239         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION)?;
         239  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION, val)?;
  240    240   
        }
  241    241   
        if let Some(ref val) = self.structure_list {
  242    242   
            ser.write_list(
  243    243   
                &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST,
  244    244   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  245    245   
                    for item in val {
  246    246   
                        ser.write_struct(crate::types::SimpleStruct::SCHEMA, item)?;
  247    247   
                    }
  248    248   
                    Ok(())
  249    249   
                },
  250    250   
            )?;
  251    251   
        }
  252    252   
        {
  253    253   
            let val = &self.complex_list;
  254    254   
  255    255   
            ser.write_list(
  256    256   
                &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST,
  257    257   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  258    258   
                    for item in val {
  259         -
                        todo!("schema: unsupported list element type");
         259  +
                        ser.write_map(
         260  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         261  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         262  +
                                for (key, value) in item {
         263  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         264  +
                                    ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
         265  +
                                }
         266  +
                                Ok(())
         267  +
                            },
         268  +
                        )?;
  260    269   
                    }
  261    270   
                    Ok(())
  262    271   
                },
  263    272   
            )?;
  264    273   
        }
  265    274   
        {
  266    275   
            let val = &self.complex_map;
  267    276   
  268    277   
            ser.write_map(
  269    278   
                &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP,
  270    279   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  271    280   
                    for (key, value) in val {
  272    281   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  273         -
                        todo!("schema: unsupported map value type");
         282  +
                        ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
  274    283   
                    }
  275    284   
                    Ok(())
  276    285   
                },
  277    286   
            )?;
  278    287   
        }
  279    288   
        {
  280    289   
            let val = &self.complex_union;
  281         -
            ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION)?;
         290  +
            ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION, val)?;
  282    291   
        }
  283    292   
        Ok(())
  284    293   
    }
  285    294   
}
  286    295   
impl ComplexStructOperationOutput {
  287    296   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  288         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  289         -
        deserializer: &mut D,
         297  +
    pub fn deserialize(
         298  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  290    299   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  291    300   
        #[allow(unused_variables, unused_mut)]
  292    301   
        let mut builder = Self::builder();
  293    302   
        #[allow(
  294    303   
            unused_variables,
  295    304   
            unreachable_code,
  296    305   
            clippy::single_match,
  297    306   
            clippy::match_single_binding,
  298    307   
            clippy::diverging_sub_expression
  299    308   
        )]
  300         -
        deserializer.read_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
         309  +
        deserializer.read_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
  301    310   
            match member.member_index() {
  302    311   
                Some(0) => {
  303    312   
                    builder.structure = Some(crate::types::SimpleStruct::deserialize(deser)?);
  304    313   
                }
  305    314   
                Some(1) => {
  306    315   
                    builder.empty_structure = Some(crate::types::EmptyStruct::deserialize(deser)?);
  307    316   
                }
  308    317   
                Some(2) => {
  309         -
                    builder.list = Some({
  310         -
                        let container = if let Some(cap) = deser.container_size() {
  311         -
                            Vec::with_capacity(cap)
  312         -
                        } else {
  313         -
                            Vec::new()
  314         -
                        };
  315         -
                        deser.read_list(member, container, |mut list, deser| {
  316         -
                            list.push(deser.read_string(member)?);
  317         -
                            Ok(list)
  318         -
                        })?
  319         -
                    });
         318  +
                    builder.list = Some(deser.read_string_list(member)?);
  320    319   
                }
  321    320   
                Some(3) => {
  322    321   
                    builder.map = Some({
  323         -
                        let container = if let Some(cap) = deser.container_size() {
  324         -
                            std::collections::HashMap::with_capacity(cap)
  325         -
                        } else {
  326         -
                            std::collections::HashMap::new()
  327         -
                        };
  328         -
                        deser.read_map(member, container, |mut map, key, deser| {
  329         -
                            map.insert(key, deser.read_integer(member)?);
  330         -
                            Ok(map)
  331         -
                        })?
         322  +
                        let mut container = std::collections::HashMap::new();
         323  +
                        deser.read_map(member, &mut |key, deser| {
         324  +
                            container.insert(key, deser.read_integer(member)?);
         325  +
                            Ok(())
         326  +
                        })?;
         327  +
                        container
  332    328   
                    });
  333    329   
                }
  334    330   
                Some(4) => {
  335         -
                    builder.union = Some({
  336         -
                        let _ = member;
  337         -
                        todo!("deserialize aggregate")
  338         -
                    });
         331  +
                    builder.union = Some(crate::types::SimpleUnion::deserialize(deser)?);
  339    332   
                }
  340    333   
                Some(5) => {
  341         -
                    builder.unit_union = Some({
  342         -
                        let _ = member;
  343         -
                        todo!("deserialize aggregate")
  344         -
                    });
         334  +
                    builder.unit_union = Some(crate::types::UnitUnion::deserialize(deser)?);
  345    335   
                }
  346    336   
                Some(6) => {
  347    337   
                    builder.structure_list = Some({
  348         -
                        let container = if let Some(cap) = deser.container_size() {
  349         -
                            Vec::with_capacity(cap)
  350         -
                        } else {
  351         -
                            Vec::new()
  352         -
                        };
  353         -
                        deser.read_list(member, container, |mut list, deser| {
  354         -
                            list.push(crate::types::SimpleStruct::deserialize(deser)?);
  355         -
                            Ok(list)
  356         -
                        })?
         338  +
                        let mut container = Vec::new();
         339  +
                        deser.read_list(member, &mut |deser| {
         340  +
                            container.push(crate::types::SimpleStruct::deserialize(deser)?);
         341  +
                            Ok(())
         342  +
                        })?;
         343  +
                        container
  357    344   
                    });
  358    345   
                }
  359    346   
                Some(7) => {
  360    347   
                    builder.complex_list = Some({
  361         -
                        let container = if let Some(cap) = deser.container_size() {
  362         -
                            Vec::with_capacity(cap)
  363         -
                        } else {
  364         -
                            Vec::new()
  365         -
                        };
  366         -
                        deser.read_list(member, container, |mut list, deser| {
  367         -
                            list.push(todo!("deserialize nested aggregate"));
  368         -
                            Ok(list)
  369         -
                        })?
         348  +
                        let mut container = Vec::new();
         349  +
                        deser.read_list(member, &mut |deser| {
         350  +
                            container.push({
         351  +
                                let mut map = ::std::collections::HashMap::new();
         352  +
                                deser.read_map(member, &mut |key, deser| {
         353  +
                                    let value = crate::types::ComplexUnion::deserialize(deser)?;
         354  +
                                    map.insert(key, value);
         355  +
                                    Ok(())
         356  +
                                })?;
         357  +
                                map
         358  +
                            });
         359  +
                            Ok(())
         360  +
                        })?;
         361  +
                        container
  370    362   
                    });
  371    363   
                }
  372    364   
                Some(8) => {
  373    365   
                    builder.complex_map = Some({
  374         -
                        let container = if let Some(cap) = deser.container_size() {
  375         -
                            std::collections::HashMap::with_capacity(cap)
  376         -
                        } else {
  377         -
                            std::collections::HashMap::new()
  378         -
                        };
  379         -
                        deser.read_map(member, container, |mut map, key, deser| {
  380         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  381         -
                            Ok(map)
  382         -
                        })?
         366  +
                        let mut container = std::collections::HashMap::new();
         367  +
                        deser.read_map(member, &mut |key, deser| {
         368  +
                            container.insert(key, crate::types::ComplexUnion::deserialize(deser)?);
         369  +
                            Ok(())
         370  +
                        })?;
         371  +
                        container
  383    372   
                    });
  384    373   
                }
  385    374   
                Some(9) => {
  386         -
                    builder.complex_union = Some(Box::new({
  387         -
                        let _ = member;
  388         -
                        todo!("deserialize aggregate")
  389         -
                    }));
         375  +
                    builder.complex_union = Some(Box::new(crate::types::ComplexUnion::deserialize(deser)?));
  390    376   
                }
  391    377   
                _ => {}
  392    378   
            }
  393    379   
            Ok(())
  394    380   
        })?;
         381  +
        builder.complex_list = builder.complex_list.or(Some(Vec::new()));
         382  +
        builder.complex_map = builder.complex_map.or(Some(::std::collections::HashMap::new()));
  395    383   
        builder
  396    384   
            .build()
  397    385   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  398    386   
    }
  399    387   
}
         388  +
impl ComplexStructOperationOutput {
         389  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         390  +
    pub fn deserialize_with_response(
         391  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         392  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         393  +
        _status: u16,
         394  +
        _body: &[u8],
         395  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         396  +
        Self::deserialize(deserializer)
         397  +
    }
         398  +
}
  400    399   
impl ComplexStructOperationOutput {
  401    400   
    /// Creates a new builder-style object to manufacture [`ComplexStructOperationOutput`](crate::operation::complex_struct_operation::ComplexStructOperationOutput).
  402    401   
    pub fn builder() -> crate::operation::complex_struct_operation::builders::ComplexStructOperationOutputBuilder {
  403    402   
        crate::operation::complex_struct_operation::builders::ComplexStructOperationOutputBuilder::default()
  404    403   
    }
  405    404   
}
  406    405   
  407    406   
/// A builder for [`ComplexStructOperationOutput`](crate::operation::complex_struct_operation::ComplexStructOperationOutput).
  408    407   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  409    408   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/empty_struct_operation.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `EmptyStructOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EmptyStructOperation;
    6      6   
impl EmptyStructOperation {
    7      7   
    /// Creates a new `EmptyStructOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::empty_struct_operation::EmptyStructOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::empty_struct_operation::EmptyStructOperationOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::empty_struct_operation::EmptyStructOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::empty_struct_operation::EmptyStructOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::empty_struct_operation::EmptyStructOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::empty_struct_operation::EmptyStructOperationError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct EmptyStructOperationResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyStructOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_empty_struct_operation::de_empty_struct_operation_http_error(status, headers, body)
  152    157   
        } else {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/empty_struct_operation/_empty_struct_operation_input.rs

@@ -1,1 +70,83 @@
   18     18   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     19   
    fn serialize_members(
   20     20   
        &self,
   21     21   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     22   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     23   
        Ok(())
   24     24   
    }
   25     25   
}
   26     26   
impl EmptyStructOperationInput {
   27     27   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          28  +
    pub fn deserialize(
          29  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     30   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     31   
        #[allow(unused_variables, unused_mut)]
   32     32   
        let mut builder = Self::builder();
   33     33   
        #[allow(
   34     34   
            unused_variables,
   35     35   
            unreachable_code,
   36     36   
            clippy::single_match,
   37     37   
            clippy::match_single_binding,
   38     38   
            clippy::diverging_sub_expression
   39     39   
        )]
   40         -
        deserializer.read_struct(&EMPTYSTRUCTOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&EMPTYSTRUCTOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   41     41   
            match member.member_index() {
   42     42   
                _ => {}
   43     43   
            }
   44     44   
            Ok(())
   45     45   
        })?;
   46     46   
        builder
   47     47   
            .build()
   48     48   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     49   
    }
   50     50   
}
          51  +
impl EmptyStructOperationInput {
          52  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          53  +
    pub fn deserialize_with_response(
          54  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          55  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          56  +
        _status: u16,
          57  +
        _body: &[u8],
          58  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          59  +
        Self::builder()
          60  +
            .build()
          61  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          62  +
    }
          63  +
}
   51     64   
impl EmptyStructOperationInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`EmptyStructOperationInput`](crate::operation::empty_struct_operation::EmptyStructOperationInput).
   53     66   
    pub fn builder() -> crate::operation::empty_struct_operation::builders::EmptyStructOperationInputBuilder {
   54     67   
        crate::operation::empty_struct_operation::builders::EmptyStructOperationInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`EmptyStructOperationInput`](crate::operation::empty_struct_operation::EmptyStructOperationInput).
   59     72   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     73   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/empty_struct_operation/_empty_struct_operation_output.rs

@@ -1,1 +65,76 @@
   18     18   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     19   
    fn serialize_members(
   20     20   
        &self,
   21     21   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     22   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     23   
        Ok(())
   24     24   
    }
   25     25   
}
   26     26   
impl EmptyStructOperationOutput {
   27     27   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          28  +
    pub fn deserialize(
          29  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     30   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     31   
        #[allow(unused_variables, unused_mut)]
   32     32   
        let mut builder = Self::builder();
   33     33   
        #[allow(
   34     34   
            unused_variables,
   35     35   
            unreachable_code,
   36     36   
            clippy::single_match,
   37     37   
            clippy::match_single_binding,
   38     38   
            clippy::diverging_sub_expression
   39     39   
        )]
   40         -
        deserializer.read_struct(&EMPTYSTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&EMPTYSTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   41     41   
            match member.member_index() {
   42     42   
                _ => {}
   43     43   
            }
   44     44   
            Ok(())
   45     45   
        })?;
   46     46   
        Ok(builder.build())
   47     47   
    }
   48     48   
}
          49  +
impl EmptyStructOperationOutput {
          50  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          51  +
    pub fn deserialize_with_response(
          52  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          53  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          54  +
        _status: u16,
          55  +
        _body: &[u8],
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        Ok(Self::builder().build())
          58  +
    }
          59  +
}
   49     60   
impl EmptyStructOperationOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`EmptyStructOperationOutput`](crate::operation::empty_struct_operation::EmptyStructOperationOutput).
   51     62   
    pub fn builder() -> crate::operation::empty_struct_operation::builders::EmptyStructOperationOutputBuilder {
   52     63   
        crate::operation::empty_struct_operation::builders::EmptyStructOperationOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`EmptyStructOperationOutput`](crate::operation::empty_struct_operation::EmptyStructOperationOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/error_serialization_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ErrorSerializationOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ErrorSerializationOperation;
    6      6   
impl ErrorSerializationOperation {
    7      7   
    /// Creates a new `ErrorSerializationOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::error_serialization_operation::ErrorSerializationOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::error_serialization_operation::ErrorSerializationOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::error_serialization_operation::ErrorSerializationOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::error_serialization_operation::ErrorSerializationOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::error_serialization_operation::ErrorSerializationOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::error_serialization_operation::ErrorSerializationOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct ErrorSerializationOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ErrorSerializationOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_error_serialization_operation::de_error_serialization_operation_http_error(status, headers, body)
  152    159   
        } else {
@@ -262,269 +322,333 @@
  282    289   
            .expect("the config must have a deserializer");
  283    290   
  284    291   
        let parsed = de.deserialize_streaming(&mut http_response);
  285    292   
        let parsed = parsed.unwrap_or_else(|| {
  286    293   
            let http_response = http_response.map(|body| {
  287    294   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  288    295   
                    body.bytes().unwrap(),
  289    296   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  290    297   
                )))
  291    298   
            });
  292         -
            de.deserialize_nonstreaming(&http_response)
         299  +
            // Build a config bag with the protocol for schema-based deserialization
         300  +
            #[allow(unused_mut)]
         301  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         302  +
         303  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  293    304   
        });
  294    305   
        let parsed = parsed
  295    306   
            .expect("should be successful response")
  296    307   
            .downcast::<crate::operation::error_serialization_operation::ErrorSerializationOperationOutput>()
  297    308   
            .unwrap();
  298    309   
        ::pretty_assertions::assert_eq!(parsed.error_shape, expected_output.error_shape, "Unexpected value for `error_shape`");
  299    310   
    }
  300    311   
}
  301    312   
  302    313   
/// Error type for the `ErrorSerializationOperationError` operation.

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/error_serialization_operation/_error_serialization_operation_input.rs

@@ -223,223 +393,393 @@
  243    243   
    "timestamp",
  244    244   
    9,
  245    245   
);
  246    246   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  247    247   
    ::aws_smithy_schema::ShapeId::from_static(
  248    248   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$enum",
  249    249   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  250    250   
        "ErrorSerializationOperationInput",
  251    251   
    ),
  252    252   
    ::aws_smithy_schema::ShapeType::String,
  253         -
    "r##enum",
         253  +
    "enum",
  254    254   
    10,
  255    255   
);
  256    256   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  257    257   
    ::aws_smithy_schema::ShapeId::from_static(
  258    258   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredBlob",
  259    259   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  260    260   
        "ErrorSerializationOperationInput",
  261    261   
    ),
  262    262   
    ::aws_smithy_schema::ShapeType::Blob,
  263         -
    "required_blob",
         263  +
    "requiredBlob",
  264    264   
    11,
  265    265   
);
  266    266   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  267    267   
    ::aws_smithy_schema::ShapeId::from_static(
  268    268   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredBoolean",
  269    269   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  270    270   
        "ErrorSerializationOperationInput",
  271    271   
    ),
  272    272   
    ::aws_smithy_schema::ShapeType::Boolean,
  273         -
    "required_boolean",
         273  +
    "requiredBoolean",
  274    274   
    12,
  275    275   
);
  276    276   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  277    277   
    ::aws_smithy_schema::ShapeId::from_static(
  278    278   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredString",
  279    279   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  280    280   
        "ErrorSerializationOperationInput",
  281    281   
    ),
  282    282   
    ::aws_smithy_schema::ShapeType::String,
  283         -
    "required_string",
         283  +
    "requiredString",
  284    284   
    13,
  285    285   
);
  286    286   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  287    287   
    ::aws_smithy_schema::ShapeId::from_static(
  288    288   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredByte",
  289    289   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  290    290   
        "ErrorSerializationOperationInput",
  291    291   
    ),
  292    292   
    ::aws_smithy_schema::ShapeType::Byte,
  293         -
    "required_byte",
         293  +
    "requiredByte",
  294    294   
    14,
  295    295   
);
  296    296   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  297    297   
    ::aws_smithy_schema::ShapeId::from_static(
  298    298   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredShort",
  299    299   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  300    300   
        "ErrorSerializationOperationInput",
  301    301   
    ),
  302    302   
    ::aws_smithy_schema::ShapeType::Short,
  303         -
    "required_short",
         303  +
    "requiredShort",
  304    304   
    15,
  305    305   
);
  306    306   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  307    307   
    ::aws_smithy_schema::ShapeId::from_static(
  308    308   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredInteger",
  309    309   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  310    310   
        "ErrorSerializationOperationInput",
  311    311   
    ),
  312    312   
    ::aws_smithy_schema::ShapeType::Integer,
  313         -
    "required_integer",
         313  +
    "requiredInteger",
  314    314   
    16,
  315    315   
);
  316    316   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  317    317   
    ::aws_smithy_schema::ShapeId::from_static(
  318    318   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredLong",
  319    319   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  320    320   
        "ErrorSerializationOperationInput",
  321    321   
    ),
  322    322   
    ::aws_smithy_schema::ShapeType::Long,
  323         -
    "required_long",
         323  +
    "requiredLong",
  324    324   
    17,
  325    325   
);
  326    326   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  327    327   
    ::aws_smithy_schema::ShapeId::from_static(
  328    328   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredFloat",
  329    329   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  330    330   
        "ErrorSerializationOperationInput",
  331    331   
    ),
  332    332   
    ::aws_smithy_schema::ShapeType::Float,
  333         -
    "required_float",
         333  +
    "requiredFloat",
  334    334   
    18,
  335    335   
);
  336    336   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  337    337   
    ::aws_smithy_schema::ShapeId::from_static(
  338    338   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredDouble",
  339    339   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  340    340   
        "ErrorSerializationOperationInput",
  341    341   
    ),
  342    342   
    ::aws_smithy_schema::ShapeType::Double,
  343         -
    "required_double",
         343  +
    "requiredDouble",
  344    344   
    19,
  345    345   
);
  346    346   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  347    347   
    ::aws_smithy_schema::ShapeId::from_static(
  348    348   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredTimestamp",
  349    349   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  350    350   
        "ErrorSerializationOperationInput",
  351    351   
    ),
  352    352   
    ::aws_smithy_schema::ShapeType::Timestamp,
  353         -
    "required_timestamp",
         353  +
    "requiredTimestamp",
  354    354   
    20,
  355    355   
);
  356    356   
static ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  357    357   
    ::aws_smithy_schema::ShapeId::from_static(
  358    358   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationInput$requiredEnum",
  359    359   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  360    360   
        "ErrorSerializationOperationInput",
  361    361   
    ),
  362    362   
    ::aws_smithy_schema::ShapeType::String,
  363         -
    "required_enum",
         363  +
    "requiredEnum",
  364    364   
    21,
  365    365   
);
  366    366   
static ERRORSERIALIZATIONOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  367    367   
    ERRORSERIALIZATIONOPERATIONINPUT_SCHEMA_ID,
  368    368   
    ::aws_smithy_schema::ShapeType::Structure,
  369    369   
    &[
  370    370   
        &ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_BLOB,
  371    371   
        &ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_BOOLEAN,
  372    372   
        &ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_STRING,
  373    373   
        &ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_BYTE,
@@ -445,445 +517,517 @@
  465    465   
            ser.write_timestamp(&ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_TIMESTAMP, val)?;
  466    466   
        }
  467    467   
        if let Some(ref val) = self.required_enum {
  468    468   
            ser.write_string(&ERRORSERIALIZATIONOPERATIONINPUT_MEMBER_REQUIRED_ENUM, val.as_str())?;
  469    469   
        }
  470    470   
        Ok(())
  471    471   
    }
  472    472   
}
  473    473   
impl ErrorSerializationOperationInput {
  474    474   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  475         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  476         -
        deserializer: &mut D,
         475  +
    pub fn deserialize(
         476  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  477    477   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  478    478   
        #[allow(unused_variables, unused_mut)]
  479    479   
        let mut builder = Self::builder();
  480    480   
        #[allow(
  481    481   
            unused_variables,
  482    482   
            unreachable_code,
  483    483   
            clippy::single_match,
  484    484   
            clippy::match_single_binding,
  485    485   
            clippy::diverging_sub_expression
  486    486   
        )]
  487         -
        deserializer.read_struct(&ERRORSERIALIZATIONOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
         487  +
        deserializer.read_struct(&ERRORSERIALIZATIONOPERATIONINPUT_SCHEMA, &mut |member, deser| {
  488    488   
            match member.member_index() {
  489    489   
                Some(0) => {
  490    490   
                    builder.blob = Some(deser.read_blob(member)?);
  491    491   
                }
  492    492   
                Some(1) => {
  493    493   
                    builder.boolean = Some(deser.read_boolean(member)?);
  494    494   
                }
  495    495   
                Some(2) => {
  496    496   
                    builder.string = Some(deser.read_string(member)?);
  497    497   
                }
@@ -529,529 +593,614 @@
  549    549   
                Some(20) => {
  550    550   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  551    551   
                }
  552    552   
                Some(21) => {
  553    553   
                    builder.required_enum = Some(crate::types::Suit::from(deser.read_string(member)?.as_str()));
  554    554   
                }
  555    555   
                _ => {}
  556    556   
            }
  557    557   
            Ok(())
  558    558   
        })?;
         559  +
        builder.required_blob = builder.required_blob.or(Some(::aws_smithy_types::Blob::new("")));
         560  +
        builder.required_boolean = builder.required_boolean.or(Some(false));
         561  +
        builder.required_string = builder.required_string.or(Some(String::new()));
         562  +
        builder.required_byte = builder.required_byte.or(Some(0i8));
         563  +
        builder.required_short = builder.required_short.or(Some(0i16));
         564  +
        builder.required_integer = builder.required_integer.or(Some(0i32));
         565  +
        builder.required_long = builder.required_long.or(Some(0i64));
         566  +
        builder.required_float = builder.required_float.or(Some(0.0f32));
         567  +
        builder.required_double = builder.required_double.or(Some(0.0f64));
         568  +
        builder.required_timestamp = builder.required_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  559    569   
        builder
  560    570   
            .build()
  561    571   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  562    572   
    }
  563    573   
}
         574  +
impl ErrorSerializationOperationInput {
         575  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         576  +
    pub fn deserialize_with_response(
         577  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         578  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         579  +
        _status: u16,
         580  +
        _body: &[u8],
         581  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         582  +
        Self::deserialize(deserializer)
         583  +
    }
         584  +
}
  564    585   
impl ErrorSerializationOperationInput {
  565    586   
    /// Creates a new builder-style object to manufacture [`ErrorSerializationOperationInput`](crate::operation::error_serialization_operation::ErrorSerializationOperationInput).
  566    587   
    pub fn builder() -> crate::operation::error_serialization_operation::builders::ErrorSerializationOperationInputBuilder {
  567    588   
        crate::operation::error_serialization_operation::builders::ErrorSerializationOperationInputBuilder::default()
  568    589   
    }
  569    590   
}
  570    591   
  571    592   
/// A builder for [`ErrorSerializationOperationInput`](crate::operation::error_serialization_operation::ErrorSerializationOperationInput).
  572    593   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  573    594   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/error_serialization_operation/_error_serialization_operation_output.rs

@@ -1,1 +106,117 @@
   17     17   
    "smithy.protocoltests.rpcv2Cbor.synthetic",
   18     18   
    "ErrorSerializationOperationOutput",
   19     19   
);
   20     20   
static ERRORSERIALIZATIONOPERATIONOUTPUT_MEMBER_ERROR_SHAPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "smithy.protocoltests.rpcv2Cbor.synthetic#ErrorSerializationOperationOutput$errorShape",
   23     23   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   24     24   
        "ErrorSerializationOperationOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27         -
    "error_shape",
          27  +
    "errorShape",
   28     28   
    0,
   29     29   
);
   30     30   
static ERRORSERIALIZATIONOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    ERRORSERIALIZATIONOPERATIONOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&ERRORSERIALIZATIONOPERATIONOUTPUT_MEMBER_ERROR_SHAPE],
   34     34   
);
   35     35   
impl ErrorSerializationOperationOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ERRORSERIALIZATIONOPERATIONOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for ErrorSerializationOperationOutput {
   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.error_shape {
   46     46   
            ser.write_struct(&ERRORSERIALIZATIONOPERATIONOUTPUT_MEMBER_ERROR_SHAPE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl ErrorSerializationOperationOutput {
   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(&ERRORSERIALIZATIONOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&ERRORSERIALIZATIONOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.error_shape = Some(crate::types::error::ValidationError::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl ErrorSerializationOperationOutput {
          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 ErrorSerializationOperationOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`ErrorSerializationOperationOutput`](crate::operation::error_serialization_operation::ErrorSerializationOperationOutput).
   79     90   
    pub fn builder() -> crate::operation::error_serialization_operation::builders::ErrorSerializationOperationOutputBuilder {
   80     91   
        crate::operation::error_serialization_operation::builders::ErrorSerializationOperationOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`ErrorSerializationOperationOutput`](crate::operation::error_serialization_operation::ErrorSerializationOperationOutput).
   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/rpcv2Cbor_extras/rust-client-codegen/src/operation/recursive_union_operation.rs

@@ -1,1 +40,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `RecursiveUnionOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct RecursiveUnionOperation;
    6      6   
impl RecursiveUnionOperation {
    7      7   
    /// Creates a new `RecursiveUnionOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::recursive_union_operation::RecursiveUnionOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          15  +
        crate::operation::recursive_union_operation::RecursiveUnionOperationOutput::SCHEMA;
   11     16   
    pub(crate) async fn orchestrate(
   12     17   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     18   
        input: crate::operation::recursive_union_operation::RecursiveUnionOperationInput,
   14     19   
    ) -> ::std::result::Result<
   15     20   
        crate::operation::recursive_union_operation::RecursiveUnionOperationOutput,
   16     21   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     22   
            crate::operation::recursive_union_operation::RecursiveUnionOperationError,
   18     23   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     24   
        >,
   20     25   
    > {
@@ -110,115 +172,178 @@
  130    135   
                crate::operation::recursive_union_operation::RecursiveUnionOperationError,
  131    136   
            >::new());
  132    137   
  133    138   
        ::std::borrow::Cow::Owned(rcb)
  134    139   
    }
  135    140   
}
  136    141   
  137    142   
#[derive(Debug)]
  138    143   
struct RecursiveUnionOperationResponseDeserializer;
  139    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RecursiveUnionOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         145  +
    fn deserialize_nonstreaming_with_config(
  141    146   
        &self,
  142    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         148  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    149   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    150   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    151   
        let headers = response.headers();
  146    152   
        let body = response.body().bytes().expect("body loaded");
  147    153   
        #[allow(unused_mut)]
  148    154   
        let mut force_error = false;
  149    155   
  150    156   
        let parse_result = if !success && status != 200 || force_error {
  151    157   
            crate::protocol_serde::shape_recursive_union_operation::de_recursive_union_operation_http_error(status, headers, body)
  152    158   
        } else {
@@ -293,299 +353,363 @@
  313    319   
            .expect("the config must have a deserializer");
  314    320   
  315    321   
        let parsed = de.deserialize_streaming(&mut http_response);
  316    322   
        let parsed = parsed.unwrap_or_else(|| {
  317    323   
            let http_response = http_response.map(|body| {
  318    324   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  319    325   
                    body.bytes().unwrap(),
  320    326   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  321    327   
                )))
  322    328   
            });
  323         -
            de.deserialize_nonstreaming(&http_response)
         329  +
            // Build a config bag with the protocol for schema-based deserialization
         330  +
            #[allow(unused_mut)]
         331  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         332  +
         333  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  324    334   
        });
  325    335   
        let parsed = parsed
  326    336   
            .expect("should be successful response")
  327    337   
            .downcast::<crate::operation::recursive_union_operation::RecursiveUnionOperationOutput>()
  328    338   
            .unwrap();
  329    339   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  330    340   
    }
  331    341   
}
  332    342   
  333    343   
/// Error type for the `RecursiveUnionOperationError` operation.

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/recursive_union_operation/_recursive_union_operation_input.rs

@@ -23,23 +108,119 @@
   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.nested {
   46     46   
            ser.write_struct(&RECURSIVEUNIONOPERATIONINPUT_MEMBER_NESTED, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RecursiveUnionOperationInput {
   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(&RECURSIVEUNIONOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&RECURSIVEUNIONOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.nested = Some(crate::types::RecursiveOperationInputOutputNested1::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        builder
   75     75   
            .build()
   76     76   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     77   
    }
   78     78   
}
          79  +
impl RecursiveUnionOperationInput {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          81  +
    pub fn deserialize_with_response(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          83  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          84  +
        _status: u16,
          85  +
        _body: &[u8],
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        Self::deserialize(deserializer)
          88  +
    }
          89  +
}
   79     90   
impl RecursiveUnionOperationInput {
   80     91   
    /// Creates a new builder-style object to manufacture [`RecursiveUnionOperationInput`](crate::operation::recursive_union_operation::RecursiveUnionOperationInput).
   81     92   
    pub fn builder() -> crate::operation::recursive_union_operation::builders::RecursiveUnionOperationInputBuilder {
   82     93   
        crate::operation::recursive_union_operation::builders::RecursiveUnionOperationInputBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`RecursiveUnionOperationInput`](crate::operation::recursive_union_operation::RecursiveUnionOperationInput).
   87     98   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88     99   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/recursive_union_operation/_recursive_union_operation_output.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.nested {
   46     46   
            ser.write_struct(&RECURSIVEUNIONOPERATIONOUTPUT_MEMBER_NESTED, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RecursiveUnionOperationOutput {
   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(&RECURSIVEUNIONOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&RECURSIVEUNIONOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.nested = Some(crate::types::RecursiveOperationInputOutputNested1::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl RecursiveUnionOperationOutput {
          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 RecursiveUnionOperationOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`RecursiveUnionOperationOutput`](crate::operation::recursive_union_operation::RecursiveUnionOperationOutput).
   79     90   
    pub fn builder() -> crate::operation::recursive_union_operation::builders::RecursiveUnionOperationOutputBuilder {
   80     91   
        crate::operation::recursive_union_operation::builders::RecursiveUnionOperationOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`RecursiveUnionOperationOutput`](crate::operation::recursive_union_operation::RecursiveUnionOperationOutput).
   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/rpcv2Cbor_extras/rust-client-codegen/src/operation/simple_struct_operation.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `SimpleStructOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleStructOperation;
    6      6   
impl SimpleStructOperation {
    7      7   
    /// Creates a new `SimpleStructOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_struct_operation::SimpleStructOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_struct_operation::SimpleStructOperationOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::simple_struct_operation::SimpleStructOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::simple_struct_operation::SimpleStructOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::simple_struct_operation::SimpleStructOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::simple_struct_operation::SimpleStructOperationError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct SimpleStructOperationResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleStructOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_simple_struct_operation::de_simple_struct_operation_http_error(status, headers, body)
  152    157   
        } else {
@@ -289,294 +349,358 @@
  309    314   
            .expect("the config must have a deserializer");
  310    315   
  311    316   
        let parsed = de.deserialize_streaming(&mut http_response);
  312    317   
        let parsed = parsed.unwrap_or_else(|| {
  313    318   
            let http_response = http_response.map(|body| {
  314    319   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  315    320   
                    body.bytes().unwrap(),
  316    321   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  317    322   
                )))
  318    323   
            });
  319         -
            de.deserialize_nonstreaming(&http_response)
         324  +
            // Build a config bag with the protocol for schema-based deserialization
         325  +
            #[allow(unused_mut)]
         326  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         327  +
         328  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  320    329   
        });
  321    330   
        let parsed = parsed
  322    331   
            .expect("should be successful response")
  323    332   
            .downcast::<crate::operation::simple_struct_operation::SimpleStructOperationOutput>()
  324    333   
            .unwrap();
  325    334   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
  326    335   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
  327    336   
        ::pretty_assertions::assert_eq!(parsed.string, expected_output.string, "Unexpected value for `string`");
  328    337   
        ::pretty_assertions::assert_eq!(parsed.byte, expected_output.byte, "Unexpected value for `byte`");
  329    338   
        ::pretty_assertions::assert_eq!(parsed.short, expected_output.short, "Unexpected value for `short`");
@@ -422,431 +482,495 @@
  442    451   
            .expect("the config must have a deserializer");
  443    452   
  444    453   
        let parsed = de.deserialize_streaming(&mut http_response);
  445    454   
        let parsed = parsed.unwrap_or_else(|| {
  446    455   
            let http_response = http_response.map(|body| {
  447    456   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  448    457   
                    body.bytes().unwrap(),
  449    458   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  450    459   
                )))
  451    460   
            });
  452         -
            de.deserialize_nonstreaming(&http_response)
         461  +
            // Build a config bag with the protocol for schema-based deserialization
         462  +
            #[allow(unused_mut)]
         463  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         464  +
         465  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  453    466   
        });
  454    467   
        let parsed = parsed
  455    468   
            .expect("should be successful response")
  456    469   
            .downcast::<crate::operation::simple_struct_operation::SimpleStructOperationOutput>()
  457    470   
            .unwrap();
  458    471   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
  459    472   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
  460    473   
        ::pretty_assertions::assert_eq!(parsed.string, expected_output.string, "Unexpected value for `string`");
  461    474   
        ::pretty_assertions::assert_eq!(parsed.byte, expected_output.byte, "Unexpected value for `byte`");
  462    475   
        ::pretty_assertions::assert_eq!(parsed.short, expected_output.short, "Unexpected value for `short`");

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/simple_struct_operation/_simple_struct_operation_input.rs

@@ -223,223 +423,424 @@
  243    243   
    "timestamp",
  244    244   
    9,
  245    245   
);
  246    246   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  247    247   
    ::aws_smithy_schema::ShapeId::from_static(
  248    248   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$enum",
  249    249   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  250    250   
        "SimpleStructOperationInput",
  251    251   
    ),
  252    252   
    ::aws_smithy_schema::ShapeType::String,
  253         -
    "r##enum",
         253  +
    "enum",
  254    254   
    10,
  255    255   
);
  256    256   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  257    257   
    ::aws_smithy_schema::ShapeId::from_static(
  258    258   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredBlob",
  259    259   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  260    260   
        "SimpleStructOperationInput",
  261    261   
    ),
  262    262   
    ::aws_smithy_schema::ShapeType::Blob,
  263         -
    "required_blob",
         263  +
    "requiredBlob",
  264    264   
    11,
  265    265   
);
  266    266   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  267    267   
    ::aws_smithy_schema::ShapeId::from_static(
  268    268   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredBoolean",
  269    269   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  270    270   
        "SimpleStructOperationInput",
  271    271   
    ),
  272    272   
    ::aws_smithy_schema::ShapeType::Boolean,
  273         -
    "required_boolean",
         273  +
    "requiredBoolean",
  274    274   
    12,
  275    275   
);
  276    276   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  277    277   
    ::aws_smithy_schema::ShapeId::from_static(
  278    278   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredString",
  279    279   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  280    280   
        "SimpleStructOperationInput",
  281    281   
    ),
  282    282   
    ::aws_smithy_schema::ShapeType::String,
  283         -
    "required_string",
         283  +
    "requiredString",
  284    284   
    13,
  285    285   
);
  286    286   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  287    287   
    ::aws_smithy_schema::ShapeId::from_static(
  288    288   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredByte",
  289    289   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  290    290   
        "SimpleStructOperationInput",
  291    291   
    ),
  292    292   
    ::aws_smithy_schema::ShapeType::Byte,
  293         -
    "required_byte",
         293  +
    "requiredByte",
  294    294   
    14,
  295    295   
);
  296    296   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  297    297   
    ::aws_smithy_schema::ShapeId::from_static(
  298    298   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredShort",
  299    299   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  300    300   
        "SimpleStructOperationInput",
  301    301   
    ),
  302    302   
    ::aws_smithy_schema::ShapeType::Short,
  303         -
    "required_short",
         303  +
    "requiredShort",
  304    304   
    15,
  305    305   
);
  306    306   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  307    307   
    ::aws_smithy_schema::ShapeId::from_static(
  308    308   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredInteger",
  309    309   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  310    310   
        "SimpleStructOperationInput",
  311    311   
    ),
  312    312   
    ::aws_smithy_schema::ShapeType::Integer,
  313         -
    "required_integer",
         313  +
    "requiredInteger",
  314    314   
    16,
  315    315   
);
  316    316   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  317    317   
    ::aws_smithy_schema::ShapeId::from_static(
  318    318   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredLong",
  319    319   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  320    320   
        "SimpleStructOperationInput",
  321    321   
    ),
  322    322   
    ::aws_smithy_schema::ShapeType::Long,
  323         -
    "required_long",
         323  +
    "requiredLong",
  324    324   
    17,
  325    325   
);
  326    326   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  327    327   
    ::aws_smithy_schema::ShapeId::from_static(
  328    328   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredFloat",
  329    329   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  330    330   
        "SimpleStructOperationInput",
  331    331   
    ),
  332    332   
    ::aws_smithy_schema::ShapeType::Float,
  333         -
    "required_float",
         333  +
    "requiredFloat",
  334    334   
    18,
  335    335   
);
  336    336   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  337    337   
    ::aws_smithy_schema::ShapeId::from_static(
  338    338   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredDouble",
  339    339   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  340    340   
        "SimpleStructOperationInput",
  341    341   
    ),
  342    342   
    ::aws_smithy_schema::ShapeType::Double,
  343         -
    "required_double",
         343  +
    "requiredDouble",
  344    344   
    19,
  345    345   
);
  346    346   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  347    347   
    ::aws_smithy_schema::ShapeId::from_static(
  348    348   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredTimestamp",
  349    349   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  350    350   
        "SimpleStructOperationInput",
  351    351   
    ),
  352    352   
    ::aws_smithy_schema::ShapeType::Timestamp,
  353         -
    "required_timestamp",
         353  +
    "requiredTimestamp",
  354    354   
    20,
  355    355   
);
  356    356   
static SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  357    357   
    ::aws_smithy_schema::ShapeId::from_static(
  358    358   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationInput$requiredEnum",
  359    359   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  360    360   
        "SimpleStructOperationInput",
  361    361   
    ),
  362    362   
    ::aws_smithy_schema::ShapeType::String,
  363         -
    "required_enum",
         363  +
    "requiredEnum",
  364    364   
    21,
  365    365   
);
  366    366   
static SIMPLESTRUCTOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  367    367   
    SIMPLESTRUCTOPERATIONINPUT_SCHEMA_ID,
  368    368   
    ::aws_smithy_schema::ShapeType::Structure,
  369    369   
    &[
  370    370   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_BLOB,
  371    371   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_BOOLEAN,
  372    372   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_STRING,
  373    373   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_BYTE,
  374    374   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_SHORT,
  375    375   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_INTEGER,
  376    376   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_LONG,
  377    377   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_FLOAT,
  378    378   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_DOUBLE,
  379    379   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_TIMESTAMP,
  380    380   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_ENUM,
  381    381   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BLOB,
  382    382   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BOOLEAN,
  383    383   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_STRING,
  384    384   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_BYTE,
  385    385   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_SHORT,
  386    386   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_INTEGER,
  387    387   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_LONG,
  388    388   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_FLOAT,
  389    389   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_DOUBLE,
  390    390   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_TIMESTAMP,
  391    391   
        &SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_ENUM,
  392    392   
    ],
  393         -
);
         393  +
)
         394  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/simple-struct-operation", None));
  394    395   
impl SimpleStructOperationInput {
  395    396   
    /// The schema for this shape.
  396    397   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLESTRUCTOPERATIONINPUT_SCHEMA;
  397    398   
}
  398    399   
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleStructOperationInput {
  399    400   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  400    401   
    fn serialize_members(
  401    402   
        &self,
  402    403   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  403    404   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -445,446 +517,518 @@
  465    466   
            ser.write_timestamp(&SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_TIMESTAMP, val)?;
  466    467   
        }
  467    468   
        if let Some(ref val) = self.required_enum {
  468    469   
            ser.write_string(&SIMPLESTRUCTOPERATIONINPUT_MEMBER_REQUIRED_ENUM, val.as_str())?;
  469    470   
        }
  470    471   
        Ok(())
  471    472   
    }
  472    473   
}
  473    474   
impl SimpleStructOperationInput {
  474    475   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  475         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  476         -
        deserializer: &mut D,
         476  +
    pub fn deserialize(
         477  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  477    478   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  478    479   
        #[allow(unused_variables, unused_mut)]
  479    480   
        let mut builder = Self::builder();
  480    481   
        #[allow(
  481    482   
            unused_variables,
  482    483   
            unreachable_code,
  483    484   
            clippy::single_match,
  484    485   
            clippy::match_single_binding,
  485    486   
            clippy::diverging_sub_expression
  486    487   
        )]
  487         -
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
         488  +
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONINPUT_SCHEMA, &mut |member, deser| {
  488    489   
            match member.member_index() {
  489    490   
                Some(0) => {
  490    491   
                    builder.blob = Some(deser.read_blob(member)?);
  491    492   
                }
  492    493   
                Some(1) => {
  493    494   
                    builder.boolean = Some(deser.read_boolean(member)?);
  494    495   
                }
  495    496   
                Some(2) => {
  496    497   
                    builder.string = Some(deser.read_string(member)?);
  497    498   
                }
@@ -529,530 +593,615 @@
  549    550   
                Some(20) => {
  550    551   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  551    552   
                }
  552    553   
                Some(21) => {
  553    554   
                    builder.required_enum = Some(crate::types::Suit::from(deser.read_string(member)?.as_str()));
  554    555   
                }
  555    556   
                _ => {}
  556    557   
            }
  557    558   
            Ok(())
  558    559   
        })?;
         560  +
        builder.required_blob = builder.required_blob.or(Some(::aws_smithy_types::Blob::new("")));
         561  +
        builder.required_boolean = builder.required_boolean.or(Some(false));
         562  +
        builder.required_string = builder.required_string.or(Some(String::new()));
         563  +
        builder.required_byte = builder.required_byte.or(Some(0i8));
         564  +
        builder.required_short = builder.required_short.or(Some(0i16));
         565  +
        builder.required_integer = builder.required_integer.or(Some(0i32));
         566  +
        builder.required_long = builder.required_long.or(Some(0i64));
         567  +
        builder.required_float = builder.required_float.or(Some(0.0f32));
         568  +
        builder.required_double = builder.required_double.or(Some(0.0f64));
         569  +
        builder.required_timestamp = builder.required_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  559    570   
        builder
  560    571   
            .build()
  561    572   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  562    573   
    }
  563    574   
}
         575  +
impl SimpleStructOperationInput {
         576  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         577  +
    pub fn deserialize_with_response(
         578  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         579  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         580  +
        _status: u16,
         581  +
        _body: &[u8],
         582  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         583  +
        Self::deserialize(deserializer)
         584  +
    }
         585  +
}
  564    586   
impl SimpleStructOperationInput {
  565    587   
    /// Creates a new builder-style object to manufacture [`SimpleStructOperationInput`](crate::operation::simple_struct_operation::SimpleStructOperationInput).
  566    588   
    pub fn builder() -> crate::operation::simple_struct_operation::builders::SimpleStructOperationInputBuilder {
  567    589   
        crate::operation::simple_struct_operation::builders::SimpleStructOperationInputBuilder::default()
  568    590   
    }
  569    591   
}
  570    592   
  571    593   
/// A builder for [`SimpleStructOperationInput`](crate::operation::simple_struct_operation::SimpleStructOperationInput).
  572    594   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  573    595   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/simple_struct_operation/_simple_struct_operation_output.rs

@@ -224,224 +394,394 @@
  244    244   
    "timestamp",
  245    245   
    9,
  246    246   
);
  247    247   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  248    248   
    ::aws_smithy_schema::ShapeId::from_static(
  249    249   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$enum",
  250    250   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  251    251   
        "SimpleStructOperationOutput",
  252    252   
    ),
  253    253   
    ::aws_smithy_schema::ShapeType::String,
  254         -
    "r##enum",
         254  +
    "enum",
  255    255   
    10,
  256    256   
);
  257    257   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  258    258   
    ::aws_smithy_schema::ShapeId::from_static(
  259    259   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredBlob",
  260    260   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  261    261   
        "SimpleStructOperationOutput",
  262    262   
    ),
  263    263   
    ::aws_smithy_schema::ShapeType::Blob,
  264         -
    "required_blob",
         264  +
    "requiredBlob",
  265    265   
    11,
  266    266   
);
  267    267   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  268    268   
    ::aws_smithy_schema::ShapeId::from_static(
  269    269   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredBoolean",
  270    270   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  271    271   
        "SimpleStructOperationOutput",
  272    272   
    ),
  273    273   
    ::aws_smithy_schema::ShapeType::Boolean,
  274         -
    "required_boolean",
         274  +
    "requiredBoolean",
  275    275   
    12,
  276    276   
);
  277    277   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  278    278   
    ::aws_smithy_schema::ShapeId::from_static(
  279    279   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredString",
  280    280   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  281    281   
        "SimpleStructOperationOutput",
  282    282   
    ),
  283    283   
    ::aws_smithy_schema::ShapeType::String,
  284         -
    "required_string",
         284  +
    "requiredString",
  285    285   
    13,
  286    286   
);
  287    287   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  288    288   
    ::aws_smithy_schema::ShapeId::from_static(
  289    289   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredByte",
  290    290   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  291    291   
        "SimpleStructOperationOutput",
  292    292   
    ),
  293    293   
    ::aws_smithy_schema::ShapeType::Byte,
  294         -
    "required_byte",
         294  +
    "requiredByte",
  295    295   
    14,
  296    296   
);
  297    297   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  298    298   
    ::aws_smithy_schema::ShapeId::from_static(
  299    299   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredShort",
  300    300   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  301    301   
        "SimpleStructOperationOutput",
  302    302   
    ),
  303    303   
    ::aws_smithy_schema::ShapeType::Short,
  304         -
    "required_short",
         304  +
    "requiredShort",
  305    305   
    15,
  306    306   
);
  307    307   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  308    308   
    ::aws_smithy_schema::ShapeId::from_static(
  309    309   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredInteger",
  310    310   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  311    311   
        "SimpleStructOperationOutput",
  312    312   
    ),
  313    313   
    ::aws_smithy_schema::ShapeType::Integer,
  314         -
    "required_integer",
         314  +
    "requiredInteger",
  315    315   
    16,
  316    316   
);
  317    317   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  318    318   
    ::aws_smithy_schema::ShapeId::from_static(
  319    319   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredLong",
  320    320   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  321    321   
        "SimpleStructOperationOutput",
  322    322   
    ),
  323    323   
    ::aws_smithy_schema::ShapeType::Long,
  324         -
    "required_long",
         324  +
    "requiredLong",
  325    325   
    17,
  326    326   
);
  327    327   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  328    328   
    ::aws_smithy_schema::ShapeId::from_static(
  329    329   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredFloat",
  330    330   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  331    331   
        "SimpleStructOperationOutput",
  332    332   
    ),
  333    333   
    ::aws_smithy_schema::ShapeType::Float,
  334         -
    "required_float",
         334  +
    "requiredFloat",
  335    335   
    18,
  336    336   
);
  337    337   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  338    338   
    ::aws_smithy_schema::ShapeId::from_static(
  339    339   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredDouble",
  340    340   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  341    341   
        "SimpleStructOperationOutput",
  342    342   
    ),
  343    343   
    ::aws_smithy_schema::ShapeType::Double,
  344         -
    "required_double",
         344  +
    "requiredDouble",
  345    345   
    19,
  346    346   
);
  347    347   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  348    348   
    ::aws_smithy_schema::ShapeId::from_static(
  349    349   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredTimestamp",
  350    350   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  351    351   
        "SimpleStructOperationOutput",
  352    352   
    ),
  353    353   
    ::aws_smithy_schema::ShapeType::Timestamp,
  354         -
    "required_timestamp",
         354  +
    "requiredTimestamp",
  355    355   
    20,
  356    356   
);
  357    357   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  358    358   
    ::aws_smithy_schema::ShapeId::from_static(
  359    359   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredEnum",
  360    360   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  361    361   
        "SimpleStructOperationOutput",
  362    362   
    ),
  363    363   
    ::aws_smithy_schema::ShapeType::String,
  364         -
    "required_enum",
         364  +
    "requiredEnum",
  365    365   
    21,
  366    366   
);
  367    367   
static SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  368    368   
    SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA_ID,
  369    369   
    ::aws_smithy_schema::ShapeType::Structure,
  370    370   
    &[
  371    371   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BLOB,
  372    372   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BOOLEAN,
  373    373   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_STRING,
  374    374   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BYTE,
@@ -457,457 +529,529 @@
  477    477   
        }
  478    478   
        {
  479    479   
            let val = &self.required_enum;
  480    480   
            ser.write_string(&SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_ENUM, val.as_str())?;
  481    481   
        }
  482    482   
        Ok(())
  483    483   
    }
  484    484   
}
  485    485   
impl SimpleStructOperationOutput {
  486    486   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  487         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  488         -
        deserializer: &mut D,
         487  +
    pub fn deserialize(
         488  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  489    489   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  490    490   
        #[allow(unused_variables, unused_mut)]
  491    491   
        let mut builder = Self::builder();
  492    492   
        #[allow(
  493    493   
            unused_variables,
  494    494   
            unreachable_code,
  495    495   
            clippy::single_match,
  496    496   
            clippy::match_single_binding,
  497    497   
            clippy::diverging_sub_expression
  498    498   
        )]
  499         -
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
         499  +
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
  500    500   
            match member.member_index() {
  501    501   
                Some(0) => {
  502    502   
                    builder.blob = Some(deser.read_blob(member)?);
  503    503   
                }
  504    504   
                Some(1) => {
  505    505   
                    builder.boolean = Some(deser.read_boolean(member)?);
  506    506   
                }
  507    507   
                Some(2) => {
  508    508   
                    builder.string = Some(deser.read_string(member)?);
  509    509   
                }
@@ -541,541 +605,626 @@
  561    561   
                Some(20) => {
  562    562   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  563    563   
                }
  564    564   
                Some(21) => {
  565    565   
                    builder.required_enum = Some(crate::types::Suit::from(deser.read_string(member)?.as_str()));
  566    566   
                }
  567    567   
                _ => {}
  568    568   
            }
  569    569   
            Ok(())
  570    570   
        })?;
         571  +
        builder.required_blob = builder.required_blob.or(Some(::aws_smithy_types::Blob::new("")));
         572  +
        builder.required_boolean = builder.required_boolean.or(Some(false));
         573  +
        builder.required_string = builder.required_string.or(Some(String::new()));
         574  +
        builder.required_byte = builder.required_byte.or(Some(0i8));
         575  +
        builder.required_short = builder.required_short.or(Some(0i16));
         576  +
        builder.required_integer = builder.required_integer.or(Some(0i32));
         577  +
        builder.required_long = builder.required_long.or(Some(0i64));
         578  +
        builder.required_float = builder.required_float.or(Some(0.0f32));
         579  +
        builder.required_double = builder.required_double.or(Some(0.0f64));
         580  +
        builder.required_timestamp = builder.required_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  571    581   
        builder
  572    582   
            .build()
  573    583   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  574    584   
    }
  575    585   
}
         586  +
impl SimpleStructOperationOutput {
         587  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         588  +
    pub fn deserialize_with_response(
         589  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         590  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         591  +
        _status: u16,
         592  +
        _body: &[u8],
         593  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         594  +
        Self::deserialize(deserializer)
         595  +
    }
         596  +
}
  576    597   
impl SimpleStructOperationOutput {
  577    598   
    /// Creates a new builder-style object to manufacture [`SimpleStructOperationOutput`](crate::operation::simple_struct_operation::SimpleStructOperationOutput).
  578    599   
    pub fn builder() -> crate::operation::simple_struct_operation::builders::SimpleStructOperationOutputBuilder {
  579    600   
        crate::operation::simple_struct_operation::builders::SimpleStructOperationOutputBuilder::default()
  580    601   
    }
  581    602   
}
  582    603   
  583    604   
/// A builder for [`SimpleStructOperationOutput`](crate::operation::simple_struct_operation::SimpleStructOperationOutput).
  584    605   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  585    606   
#[non_exhaustive]