Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/simple_input_params/_simple_input_params_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 SimpleInputParamsOutput {
   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(&SIMPLEINPUTPARAMSOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&SIMPLEINPUTPARAMSOUTPUT_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 SimpleInputParamsOutput {
          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 SimpleInputParamsOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`SimpleInputParamsOutput`](crate::operation::simple_input_params::SimpleInputParamsOutput).
   51     62   
    pub fn builder() -> crate::operation::simple_input_params::builders::SimpleInputParamsOutputBuilder {
   52     63   
        crate::operation::simple_input_params::builders::SimpleInputParamsOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`SimpleInputParamsOutput`](crate::operation::simple_input_params::SimpleInputParamsOutput).
   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/aws_query/rust-client-codegen/src/operation/simple_scalar_xml_properties.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 `SimpleScalarXmlProperties`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleScalarXmlProperties;
    6      6   
impl SimpleScalarXmlProperties {
    7      7   
    /// Creates a new `SimpleScalarXmlProperties`
    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::simple_scalar_xml_properties::SimpleScalarXmlPropertiesInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput::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::simple_scalar_xml_properties::SimpleScalarXmlPropertiesInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesError,
  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 SimpleScalarXmlPropertiesResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarXmlPropertiesResponseDeserializer {
  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_simple_scalar_xml_properties::de_simple_scalar_xml_properties_http_error(status, headers, body)
  152    159   
        } else {
@@ -255,262 +315,326 @@
  275    282   
            .expect("the config must have a deserializer");
  276    283   
  277    284   
        let parsed = de.deserialize_streaming(&mut http_response);
  278    285   
        let parsed = parsed.unwrap_or_else(|| {
  279    286   
            let http_response = http_response.map(|body| {
  280    287   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  281    288   
                    body.bytes().unwrap(),
  282    289   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  283    290   
                )))
  284    291   
            });
  285         -
            de.deserialize_nonstreaming(&http_response)
         292  +
            // Build a config bag with the protocol for schema-based deserialization
         293  +
            #[allow(unused_mut)]
         294  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         295  +
         296  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  286    297   
        });
  287    298   
        let parsed = parsed
  288    299   
            .expect("should be successful response")
  289    300   
            .downcast::<crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput>()
  290    301   
            .unwrap();
  291    302   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  292    303   
        ::pretty_assertions::assert_eq!(
  293    304   
            parsed.empty_string_value,
  294    305   
            expected_output.empty_string_value,
  295    306   
            "Unexpected value for `empty_string_value`"
@@ -335,346 +395,410 @@
  355    366   
            .expect("the config must have a deserializer");
  356    367   
  357    368   
        let parsed = de.deserialize_streaming(&mut http_response);
  358    369   
        let parsed = parsed.unwrap_or_else(|| {
  359    370   
            let http_response = http_response.map(|body| {
  360    371   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  361    372   
                    body.bytes().unwrap(),
  362    373   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  363    374   
                )))
  364    375   
            });
  365         -
            de.deserialize_nonstreaming(&http_response)
         376  +
            // Build a config bag with the protocol for schema-based deserialization
         377  +
            #[allow(unused_mut)]
         378  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         379  +
         380  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  366    381   
        });
  367    382   
        let parsed = parsed
  368    383   
            .expect("should be successful response")
  369    384   
            .downcast::<crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput>()
  370    385   
            .unwrap();
  371    386   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  372    387   
        ::pretty_assertions::assert_eq!(
  373    388   
            parsed.empty_string_value,
  374    389   
            expected_output.empty_string_value,
  375    390   
            "Unexpected value for `empty_string_value`"
@@ -415,430 +475,494 @@
  435    450   
            .expect("the config must have a deserializer");
  436    451   
  437    452   
        let parsed = de.deserialize_streaming(&mut http_response);
  438    453   
        let parsed = parsed.unwrap_or_else(|| {
  439    454   
            let http_response = http_response.map(|body| {
  440    455   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  441    456   
                    body.bytes().unwrap(),
  442    457   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  443    458   
                )))
  444    459   
            });
  445         -
            de.deserialize_nonstreaming(&http_response)
         460  +
            // Build a config bag with the protocol for schema-based deserialization
         461  +
            #[allow(unused_mut)]
         462  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         463  +
         464  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  446    465   
        });
  447    466   
        let parsed = parsed
  448    467   
            .expect("should be successful response")
  449    468   
            .downcast::<crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput>()
  450    469   
            .unwrap();
  451    470   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  452    471   
        ::pretty_assertions::assert_eq!(
  453    472   
            parsed.empty_string_value,
  454    473   
            expected_output.empty_string_value,
  455    474   
            "Unexpected value for `empty_string_value`"
@@ -495,514 +555,578 @@
  515    534   
            .expect("the config must have a deserializer");
  516    535   
  517    536   
        let parsed = de.deserialize_streaming(&mut http_response);
  518    537   
        let parsed = parsed.unwrap_or_else(|| {
  519    538   
            let http_response = http_response.map(|body| {
  520    539   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  521    540   
                    body.bytes().unwrap(),
  522    541   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  523    542   
                )))
  524    543   
            });
  525         -
            de.deserialize_nonstreaming(&http_response)
         544  +
            // Build a config bag with the protocol for schema-based deserialization
         545  +
            #[allow(unused_mut)]
         546  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         547  +
         548  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  526    549   
        });
  527    550   
        let parsed = parsed
  528    551   
            .expect("should be successful response")
  529    552   
            .downcast::<crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput>()
  530    553   
            .unwrap();
  531    554   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  532    555   
        ::pretty_assertions::assert_eq!(
  533    556   
            parsed.empty_string_value,
  534    557   
            expected_output.empty_string_value,
  535    558   
            "Unexpected value for `empty_string_value`"

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/simple_scalar_xml_properties/_simple_scalar_xml_properties_input.rs

@@ -1,1 +72,85 @@
   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 SimpleScalarXmlPropertiesInput {
   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(&SIMPLESCALARXMLPROPERTIESINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&SIMPLESCALARXMLPROPERTIESINPUT_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 SimpleScalarXmlPropertiesInput {
          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 SimpleScalarXmlPropertiesInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`SimpleScalarXmlPropertiesInput`](crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesInput).
   53     66   
    pub fn builder() -> crate::operation::simple_scalar_xml_properties::builders::SimpleScalarXmlPropertiesInputBuilder {
   54     67   
        crate::operation::simple_scalar_xml_properties::builders::SimpleScalarXmlPropertiesInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`SimpleScalarXmlPropertiesInput`](crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesInput).
   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/aws_query/rust-client-codegen/src/operation/simple_scalar_xml_properties/_simple_scalar_xml_properties_output.rs

@@ -51,51 +201,201 @@
   71     71   
    "aws.protocoltests.query.synthetic",
   72     72   
    "SimpleScalarXmlPropertiesOutput",
   73     73   
);
   74     74   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_STRING_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   75     75   
    ::aws_smithy_schema::ShapeId::from_static(
   76     76   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$stringValue",
   77     77   
        "aws.protocoltests.query.synthetic",
   78     78   
        "SimpleScalarXmlPropertiesOutput",
   79     79   
    ),
   80     80   
    ::aws_smithy_schema::ShapeType::String,
   81         -
    "string_value",
          81  +
    "stringValue",
   82     82   
    0,
   83     83   
);
   84     84   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_EMPTY_STRING_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   85     85   
    ::aws_smithy_schema::ShapeId::from_static(
   86     86   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$emptyStringValue",
   87     87   
        "aws.protocoltests.query.synthetic",
   88     88   
        "SimpleScalarXmlPropertiesOutput",
   89     89   
    ),
   90     90   
    ::aws_smithy_schema::ShapeType::String,
   91         -
    "empty_string_value",
          91  +
    "emptyStringValue",
   92     92   
    1,
   93     93   
);
   94     94   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$trueBooleanValue",
   97     97   
        "aws.protocoltests.query.synthetic",
   98     98   
        "SimpleScalarXmlPropertiesOutput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::Boolean,
  101         -
    "true_boolean_value",
         101  +
    "trueBooleanValue",
  102    102   
    2,
  103    103   
);
  104    104   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_FALSE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$falseBooleanValue",
  107    107   
        "aws.protocoltests.query.synthetic",
  108    108   
        "SimpleScalarXmlPropertiesOutput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Boolean,
  111         -
    "false_boolean_value",
         111  +
    "falseBooleanValue",
  112    112   
    3,
  113    113   
);
  114    114   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_BYTE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  115    115   
    ::aws_smithy_schema::ShapeId::from_static(
  116    116   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$byteValue",
  117    117   
        "aws.protocoltests.query.synthetic",
  118    118   
        "SimpleScalarXmlPropertiesOutput",
  119    119   
    ),
  120    120   
    ::aws_smithy_schema::ShapeType::Byte,
  121         -
    "byte_value",
         121  +
    "byteValue",
  122    122   
    4,
  123    123   
);
  124    124   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_SHORT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  125    125   
    ::aws_smithy_schema::ShapeId::from_static(
  126    126   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$shortValue",
  127    127   
        "aws.protocoltests.query.synthetic",
  128    128   
        "SimpleScalarXmlPropertiesOutput",
  129    129   
    ),
  130    130   
    ::aws_smithy_schema::ShapeType::Short,
  131         -
    "short_value",
         131  +
    "shortValue",
  132    132   
    5,
  133    133   
);
  134    134   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_INTEGER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  135    135   
    ::aws_smithy_schema::ShapeId::from_static(
  136    136   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$integerValue",
  137    137   
        "aws.protocoltests.query.synthetic",
  138    138   
        "SimpleScalarXmlPropertiesOutput",
  139    139   
    ),
  140    140   
    ::aws_smithy_schema::ShapeType::Integer,
  141         -
    "integer_value",
         141  +
    "integerValue",
  142    142   
    6,
  143    143   
);
  144    144   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_LONG_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  145    145   
    ::aws_smithy_schema::ShapeId::from_static(
  146    146   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$longValue",
  147    147   
        "aws.protocoltests.query.synthetic",
  148    148   
        "SimpleScalarXmlPropertiesOutput",
  149    149   
    ),
  150    150   
    ::aws_smithy_schema::ShapeType::Long,
  151         -
    "long_value",
         151  +
    "longValue",
  152    152   
    7,
  153    153   
);
  154    154   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  155    155   
    ::aws_smithy_schema::ShapeId::from_static(
  156    156   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$floatValue",
  157    157   
        "aws.protocoltests.query.synthetic",
  158    158   
        "SimpleScalarXmlPropertiesOutput",
  159    159   
    ),
  160    160   
    ::aws_smithy_schema::ShapeType::Float,
  161         -
    "float_value",
         161  +
    "floatValue",
  162    162   
    8,
  163    163   
);
  164    164   
static SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  165    165   
    ::aws_smithy_schema::ShapeId::from_static(
  166    166   
        "aws.protocoltests.query.synthetic#SimpleScalarXmlPropertiesOutput$doubleValue",
  167    167   
        "aws.protocoltests.query.synthetic",
  168    168   
        "SimpleScalarXmlPropertiesOutput",
  169    169   
    ),
  170    170   
    ::aws_smithy_schema::ShapeType::Double,
  171         -
    "double_value",
         171  +
    "doubleValue",
  172    172   
    9,
  173    173   
)
  174    174   
.with_xml_name("DoubleDribble");
  175    175   
static SIMPLESCALARXMLPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  176    176   
    SIMPLESCALARXMLPROPERTIESOUTPUT_SCHEMA_ID,
  177    177   
    ::aws_smithy_schema::ShapeType::Structure,
  178    178   
    &[
  179    179   
        &SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_STRING_VALUE,
  180    180   
        &SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_EMPTY_STRING_VALUE,
  181    181   
        &SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE,
@@ -206,206 +316,327 @@
  226    226   
            ser.write_float(&SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE, *val)?;
  227    227   
        }
  228    228   
        if let Some(ref val) = self.double_value {
  229    229   
            ser.write_double(&SIMPLESCALARXMLPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE, *val)?;
  230    230   
        }
  231    231   
        Ok(())
  232    232   
    }
  233    233   
}
  234    234   
impl SimpleScalarXmlPropertiesOutput {
  235    235   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  236         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  237         -
        deserializer: &mut D,
         236  +
    pub fn deserialize(
         237  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  238    238   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  239    239   
        #[allow(unused_variables, unused_mut)]
  240    240   
        let mut builder = Self::builder();
  241    241   
        #[allow(
  242    242   
            unused_variables,
  243    243   
            unreachable_code,
  244    244   
            clippy::single_match,
  245    245   
            clippy::match_single_binding,
  246    246   
            clippy::diverging_sub_expression
  247    247   
        )]
  248         -
        deserializer.read_struct(&SIMPLESCALARXMLPROPERTIESOUTPUT_SCHEMA, (), |_, member, deser| {
         248  +
        deserializer.read_struct(&SIMPLESCALARXMLPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
  249    249   
            match member.member_index() {
  250    250   
                Some(0) => {
  251    251   
                    builder.string_value = Some(deser.read_string(member)?);
  252    252   
                }
  253    253   
                Some(1) => {
  254    254   
                    builder.empty_string_value = Some(deser.read_string(member)?);
  255    255   
                }
  256    256   
                Some(2) => {
  257    257   
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
  258    258   
                }
  259    259   
                Some(3) => {
  260    260   
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
  261    261   
                }
  262    262   
                Some(4) => {
  263    263   
                    builder.byte_value = Some(deser.read_byte(member)?);
  264    264   
                }
  265    265   
                Some(5) => {
  266    266   
                    builder.short_value = Some(deser.read_short(member)?);
  267    267   
                }
  268    268   
                Some(6) => {
  269    269   
                    builder.integer_value = Some(deser.read_integer(member)?);
  270    270   
                }
  271    271   
                Some(7) => {
  272    272   
                    builder.long_value = Some(deser.read_long(member)?);
  273    273   
                }
  274    274   
                Some(8) => {
  275    275   
                    builder.float_value = Some(deser.read_float(member)?);
  276    276   
                }
  277    277   
                Some(9) => {
  278    278   
                    builder.double_value = Some(deser.read_double(member)?);
  279    279   
                }
  280    280   
                _ => {}
  281    281   
            }
  282    282   
            Ok(())
  283    283   
        })?;
  284    284   
        Ok(builder.build())
  285    285   
    }
  286    286   
}
         287  +
impl SimpleScalarXmlPropertiesOutput {
         288  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         289  +
    pub fn deserialize_with_response(
         290  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         291  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         292  +
        _status: u16,
         293  +
        _body: &[u8],
         294  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         295  +
        Self::deserialize(deserializer)
         296  +
    }
         297  +
}
  287    298   
impl SimpleScalarXmlPropertiesOutput {
  288    299   
    /// Creates a new builder-style object to manufacture [`SimpleScalarXmlPropertiesOutput`](crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput).
  289    300   
    pub fn builder() -> crate::operation::simple_scalar_xml_properties::builders::SimpleScalarXmlPropertiesOutputBuilder {
  290    301   
        crate::operation::simple_scalar_xml_properties::builders::SimpleScalarXmlPropertiesOutputBuilder::default()
  291    302   
    }
  292    303   
}
  293    304   
  294    305   
/// A builder for [`SimpleScalarXmlPropertiesOutput`](crate::operation::simple_scalar_xml_properties::SimpleScalarXmlPropertiesOutput).
  295    306   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  296    307   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_blobs.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 `XmlBlobs`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlBlobs;
    6      6   
impl XmlBlobs {
    7      7   
    /// Creates a new `XmlBlobs`
    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::xml_blobs::XmlBlobsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_blobs::XmlBlobsOutput::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::xml_blobs::XmlBlobsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_blobs::XmlBlobsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_blobs::XmlBlobsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -100,104 +162,167 @@
  120    124   
                crate::operation::xml_blobs::XmlBlobsError,
  121    125   
            >::new());
  122    126   
  123    127   
        ::std::borrow::Cow::Owned(rcb)
  124    128   
    }
  125    129   
}
  126    130   
  127    131   
#[derive(Debug)]
  128    132   
struct XmlBlobsResponseDeserializer;
  129    133   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlBlobsResponseDeserializer {
  130         -
    fn deserialize_nonstreaming(
         134  +
    fn deserialize_nonstreaming_with_config(
  131    135   
        &self,
  132    136   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         137  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  133    138   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  134    139   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  135    140   
        let headers = response.headers();
  136    141   
        let body = response.body().bytes().expect("body loaded");
  137    142   
        #[allow(unused_mut)]
  138    143   
        let mut force_error = false;
  139    144   
  140    145   
        let parse_result = if !success && status != 200 || force_error {
  141    146   
            crate::protocol_serde::shape_xml_blobs::de_xml_blobs_http_error(status, headers, body)
  142    147   
        } else {
@@ -231,236 +291,300 @@
  251    256   
            .expect("the config must have a deserializer");
  252    257   
  253    258   
        let parsed = de.deserialize_streaming(&mut http_response);
  254    259   
        let parsed = parsed.unwrap_or_else(|| {
  255    260   
            let http_response = http_response.map(|body| {
  256    261   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  257    262   
                    body.bytes().unwrap(),
  258    263   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  259    264   
                )))
  260    265   
            });
  261         -
            de.deserialize_nonstreaming(&http_response)
         266  +
            // Build a config bag with the protocol for schema-based deserialization
         267  +
            #[allow(unused_mut)]
         268  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         269  +
         270  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  262    271   
        });
  263    272   
        let parsed = parsed
  264    273   
            .expect("should be successful response")
  265    274   
            .downcast::<crate::operation::xml_blobs::XmlBlobsOutput>()
  266    275   
            .unwrap();
  267    276   
        ::pretty_assertions::assert_eq!(parsed.data, expected_output.data, "Unexpected value for `data`");
  268    277   
    }
  269    278   
}
  270    279   
  271    280   
/// Error type for the `XmlBlobsError` operation.

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_blobs/_xml_blobs_input.rs

@@ -1,1 +67,80 @@
   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 XmlBlobsInput {
   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(&XMLBLOBSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&XMLBLOBSINPUT_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 XmlBlobsInput {
          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 XmlBlobsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`XmlBlobsInput`](crate::operation::xml_blobs::XmlBlobsInput).
   53     66   
    pub fn builder() -> crate::operation::xml_blobs::builders::XmlBlobsInputBuilder {
   54     67   
        crate::operation::xml_blobs::builders::XmlBlobsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`XmlBlobsInput`](crate::operation::xml_blobs::XmlBlobsInput).
   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/aws_query/rust-client-codegen/src/operation/xml_blobs/_xml_blobs_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.data {
   46     46   
            ser.write_blob(&XMLBLOBSOUTPUT_MEMBER_DATA, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl XmlBlobsOutput {
   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(&XMLBLOBSOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&XMLBLOBSOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.data = Some(deser.read_blob(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl XmlBlobsOutput {
          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 XmlBlobsOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`XmlBlobsOutput`](crate::operation::xml_blobs::XmlBlobsOutput).
   79     90   
    pub fn builder() -> crate::operation::xml_blobs::builders::XmlBlobsOutputBuilder {
   80     91   
        crate::operation::xml_blobs::builders::XmlBlobsOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`XmlBlobsOutput`](crate::operation::xml_blobs::XmlBlobsOutput).
   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/aws_query/rust-client-codegen/src/operation/xml_empty_blobs.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 `XmlEmptyBlobs`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlEmptyBlobs;
    6      6   
impl XmlEmptyBlobs {
    7      7   
    /// Creates a new `XmlEmptyBlobs`
    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::xml_empty_blobs::XmlEmptyBlobsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput::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::xml_empty_blobs::XmlEmptyBlobsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_empty_blobs::XmlEmptyBlobsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::xml_empty_blobs::XmlEmptyBlobsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlEmptyBlobsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlEmptyBlobsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_empty_blobs::de_xml_empty_blobs_http_error(status, headers, body)
  146    151   
        } else {
@@ -239,244 +339,352 @@
  259    264   
            .expect("the config must have a deserializer");
  260    265   
  261    266   
        let parsed = de.deserialize_streaming(&mut http_response);
  262    267   
        let parsed = parsed.unwrap_or_else(|| {
  263    268   
            let http_response = http_response.map(|body| {
  264    269   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  265    270   
                    body.bytes().unwrap(),
  266    271   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  267    272   
                )))
  268    273   
            });
  269         -
            de.deserialize_nonstreaming(&http_response)
         274  +
            // Build a config bag with the protocol for schema-based deserialization
         275  +
            #[allow(unused_mut)]
         276  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         277  +
         278  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  270    279   
        });
  271    280   
        let parsed = parsed
  272    281   
            .expect("should be successful response")
  273    282   
            .downcast::<crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput>()
  274    283   
            .unwrap();
  275    284   
        ::pretty_assertions::assert_eq!(parsed.data, expected_output.data, "Unexpected value for `data`");
  276    285   
    }
  277    286   
  278    287   
    /// Empty self closed blobs are deserialized as empty string
  279    288   
    /// Test ID: QueryXmlEmptySelfClosedBlobs
  280    289   
    #[::tokio::test]
  281    290   
    #[::tracing_test::traced_test]
  282    291   
    async fn query_xml_empty_self_closed_blobs_response() {
  283    292   
        let expected_output = crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput::builder()
  284    293   
            .set_data(::std::option::Option::Some(::aws_smithy_types::Blob::new("")))
  285    294   
            .build();
  286    295   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  287    296   
        .header("Content-Type", "text/xml")
  288    297   
        .status(200)
  289    298   
                    .body(::aws_smithy_types::body::SdkBody::from("<XmlEmptyBlobsResponse xmlns=\"https://example.com/\">\n    <XmlEmptyBlobsResult>\n        <data/>\n    </XmlEmptyBlobsResult>\n</XmlEmptyBlobsResponse>\n"))
  290    299   
                    .unwrap()
  291    300   
                    ).unwrap();
  292    301   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  293    302   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  294    303   
  295    304   
        let op = crate::operation::xml_empty_blobs::XmlEmptyBlobs::new();
  296    305   
        let config = op.config().expect("the operation has config");
  297    306   
        let de = config
  298    307   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  299    308   
            .expect("the config must have a deserializer");
  300    309   
  301    310   
        let parsed = de.deserialize_streaming(&mut http_response);
  302    311   
        let parsed = parsed.unwrap_or_else(|| {
  303    312   
            let http_response = http_response.map(|body| {
  304    313   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  305    314   
                    body.bytes().unwrap(),
  306    315   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  307    316   
                )))
  308    317   
            });
  309         -
            de.deserialize_nonstreaming(&http_response)
         318  +
            // Build a config bag with the protocol for schema-based deserialization
         319  +
            #[allow(unused_mut)]
         320  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         321  +
         322  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  310    323   
        });
  311    324   
        let parsed = parsed
  312    325   
            .expect("should be successful response")
  313    326   
            .downcast::<crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput>()
  314    327   
            .unwrap();
  315    328   
        ::pretty_assertions::assert_eq!(parsed.data, expected_output.data, "Unexpected value for `data`");
  316    329   
    }
  317    330   
}
  318    331   
  319    332   
/// Error type for the `XmlEmptyBlobsError` operation.

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_empty_blobs/_xml_empty_blobs_input.rs

@@ -1,1 +69,82 @@
   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 XmlEmptyBlobsInput {
   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(&XMLEMPTYBLOBSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&XMLEMPTYBLOBSINPUT_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 XmlEmptyBlobsInput {
          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 XmlEmptyBlobsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`XmlEmptyBlobsInput`](crate::operation::xml_empty_blobs::XmlEmptyBlobsInput).
   53     66   
    pub fn builder() -> crate::operation::xml_empty_blobs::builders::XmlEmptyBlobsInputBuilder {
   54     67   
        crate::operation::xml_empty_blobs::builders::XmlEmptyBlobsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`XmlEmptyBlobsInput`](crate::operation::xml_empty_blobs::XmlEmptyBlobsInput).
   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/aws_query/rust-client-codegen/src/operation/xml_empty_blobs/_xml_empty_blobs_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.data {
   46     46   
            ser.write_blob(&XMLEMPTYBLOBSOUTPUT_MEMBER_DATA, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl XmlEmptyBlobsOutput {
   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(&XMLEMPTYBLOBSOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&XMLEMPTYBLOBSOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.data = Some(deser.read_blob(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl XmlEmptyBlobsOutput {
          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 XmlEmptyBlobsOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`XmlEmptyBlobsOutput`](crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput).
   79     90   
    pub fn builder() -> crate::operation::xml_empty_blobs::builders::XmlEmptyBlobsOutputBuilder {
   80     91   
        crate::operation::xml_empty_blobs::builders::XmlEmptyBlobsOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`XmlEmptyBlobsOutput`](crate::operation::xml_empty_blobs::XmlEmptyBlobsOutput).
   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/aws_query/rust-client-codegen/src/operation/xml_empty_lists.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 `XmlEmptyLists`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlEmptyLists;
    6      6   
impl XmlEmptyLists {
    7      7   
    /// Creates a new `XmlEmptyLists`
    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::xml_empty_lists::XmlEmptyListsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_empty_lists::XmlEmptyListsOutput::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::xml_empty_lists::XmlEmptyListsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_empty_lists::XmlEmptyListsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_empty_lists::XmlEmptyListsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::xml_empty_lists::XmlEmptyListsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlEmptyListsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlEmptyListsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_empty_lists::de_xml_empty_lists_http_error(status, headers, body)
  146    151   
        } else {
@@ -240,245 +300,309 @@
  260    265   
            .expect("the config must have a deserializer");
  261    266   
  262    267   
        let parsed = de.deserialize_streaming(&mut http_response);
  263    268   
        let parsed = parsed.unwrap_or_else(|| {
  264    269   
            let http_response = http_response.map(|body| {
  265    270   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  266    271   
                    body.bytes().unwrap(),
  267    272   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  268    273   
                )))
  269    274   
            });
  270         -
            de.deserialize_nonstreaming(&http_response)
         275  +
            // Build a config bag with the protocol for schema-based deserialization
         276  +
            #[allow(unused_mut)]
         277  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         278  +
         279  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  271    280   
        });
  272    281   
        let parsed = parsed
  273    282   
            .expect("should be successful response")
  274    283   
            .downcast::<crate::operation::xml_empty_lists::XmlEmptyListsOutput>()
  275    284   
            .unwrap();
  276    285   
        ::pretty_assertions::assert_eq!(parsed.string_list, expected_output.string_list, "Unexpected value for `string_list`");
  277    286   
        ::pretty_assertions::assert_eq!(parsed.string_set, expected_output.string_set, "Unexpected value for `string_set`");
  278    287   
        ::pretty_assertions::assert_eq!(parsed.integer_list, expected_output.integer_list, "Unexpected value for `integer_list`");
  279    288   
        ::pretty_assertions::assert_eq!(parsed.boolean_list, expected_output.boolean_list, "Unexpected value for `boolean_list`");
  280    289   
        ::pretty_assertions::assert_eq!(

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_empty_lists/_xml_empty_lists_input.rs

@@ -1,1 +69,82 @@
   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 XmlEmptyListsInput {
   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(&XMLEMPTYLISTSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&XMLEMPTYLISTSINPUT_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 XmlEmptyListsInput {
          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 XmlEmptyListsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`XmlEmptyListsInput`](crate::operation::xml_empty_lists::XmlEmptyListsInput).
   53     66   
    pub fn builder() -> crate::operation::xml_empty_lists::builders::XmlEmptyListsInputBuilder {
   54     67   
        crate::operation::xml_empty_lists::builders::XmlEmptyListsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`XmlEmptyListsInput`](crate::operation::xml_empty_lists::XmlEmptyListsInput).
   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/aws_query/rust-client-codegen/src/operation/xml_empty_lists/_xml_empty_lists_output.rs

@@ -103,103 +299,299 @@
  123    123   
    "aws.protocoltests.query.synthetic",
  124    124   
    "XmlEmptyListsOutput",
  125    125   
);
  126    126   
static XMLEMPTYLISTSOUTPUT_MEMBER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  127    127   
    ::aws_smithy_schema::ShapeId::from_static(
  128    128   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$stringList",
  129    129   
        "aws.protocoltests.query.synthetic",
  130    130   
        "XmlEmptyListsOutput",
  131    131   
    ),
  132    132   
    ::aws_smithy_schema::ShapeType::List,
  133         -
    "string_list",
         133  +
    "stringList",
  134    134   
    0,
  135    135   
);
  136    136   
static XMLEMPTYLISTSOUTPUT_MEMBER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$stringSet",
  139    139   
        "aws.protocoltests.query.synthetic",
  140    140   
        "XmlEmptyListsOutput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::List,
  143         -
    "string_set",
         143  +
    "stringSet",
  144    144   
    1,
  145    145   
);
  146    146   
static XMLEMPTYLISTSOUTPUT_MEMBER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  147    147   
    ::aws_smithy_schema::ShapeId::from_static(
  148    148   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$integerList",
  149    149   
        "aws.protocoltests.query.synthetic",
  150    150   
        "XmlEmptyListsOutput",
  151    151   
    ),
  152    152   
    ::aws_smithy_schema::ShapeType::List,
  153         -
    "integer_list",
         153  +
    "integerList",
  154    154   
    2,
  155    155   
);
  156    156   
static XMLEMPTYLISTSOUTPUT_MEMBER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  157    157   
    ::aws_smithy_schema::ShapeId::from_static(
  158    158   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$booleanList",
  159    159   
        "aws.protocoltests.query.synthetic",
  160    160   
        "XmlEmptyListsOutput",
  161    161   
    ),
  162    162   
    ::aws_smithy_schema::ShapeType::List,
  163         -
    "boolean_list",
         163  +
    "booleanList",
  164    164   
    3,
  165    165   
);
  166    166   
static XMLEMPTYLISTSOUTPUT_MEMBER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  167    167   
    ::aws_smithy_schema::ShapeId::from_static(
  168    168   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$timestampList",
  169    169   
        "aws.protocoltests.query.synthetic",
  170    170   
        "XmlEmptyListsOutput",
  171    171   
    ),
  172    172   
    ::aws_smithy_schema::ShapeType::List,
  173         -
    "timestamp_list",
         173  +
    "timestampList",
  174    174   
    4,
  175    175   
);
  176    176   
static XMLEMPTYLISTSOUTPUT_MEMBER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  177    177   
    ::aws_smithy_schema::ShapeId::from_static(
  178    178   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$enumList",
  179    179   
        "aws.protocoltests.query.synthetic",
  180    180   
        "XmlEmptyListsOutput",
  181    181   
    ),
  182    182   
    ::aws_smithy_schema::ShapeType::List,
  183         -
    "enum_list",
         183  +
    "enumList",
  184    184   
    5,
  185    185   
);
  186    186   
static XMLEMPTYLISTSOUTPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  187    187   
    ::aws_smithy_schema::ShapeId::from_static(
  188    188   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$intEnumList",
  189    189   
        "aws.protocoltests.query.synthetic",
  190    190   
        "XmlEmptyListsOutput",
  191    191   
    ),
  192    192   
    ::aws_smithy_schema::ShapeType::List,
  193         -
    "int_enum_list",
         193  +
    "intEnumList",
  194    194   
    6,
  195    195   
);
  196    196   
static XMLEMPTYLISTSOUTPUT_MEMBER_NESTED_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  197    197   
    ::aws_smithy_schema::ShapeId::from_static(
  198    198   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$nestedStringList",
  199    199   
        "aws.protocoltests.query.synthetic",
  200    200   
        "XmlEmptyListsOutput",
  201    201   
    ),
  202    202   
    ::aws_smithy_schema::ShapeType::List,
  203         -
    "nested_string_list",
         203  +
    "nestedStringList",
  204    204   
    7,
  205    205   
);
  206    206   
static XMLEMPTYLISTSOUTPUT_MEMBER_RENAMED_LIST_MEMBERS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  207    207   
    ::aws_smithy_schema::ShapeId::from_static(
  208    208   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$renamedListMembers",
  209    209   
        "aws.protocoltests.query.synthetic",
  210    210   
        "XmlEmptyListsOutput",
  211    211   
    ),
  212    212   
    ::aws_smithy_schema::ShapeType::List,
  213         -
    "renamed_list_members",
         213  +
    "renamedListMembers",
  214    214   
    8,
  215    215   
)
  216    216   
.with_xml_name("renamed");
  217    217   
static XMLEMPTYLISTSOUTPUT_MEMBER_FLATTENED_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  218    218   
    ::aws_smithy_schema::ShapeId::from_static(
  219    219   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$flattenedList",
  220    220   
        "aws.protocoltests.query.synthetic",
  221    221   
        "XmlEmptyListsOutput",
  222    222   
    ),
  223    223   
    ::aws_smithy_schema::ShapeType::List,
  224         -
    "flattened_list",
         224  +
    "flattenedList",
  225    225   
    9,
  226    226   
)
  227    227   
.with_xml_flattened();
  228    228   
static XMLEMPTYLISTSOUTPUT_MEMBER_FLATTENED_LIST2: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  229    229   
    ::aws_smithy_schema::ShapeId::from_static(
  230    230   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$flattenedList2",
  231    231   
        "aws.protocoltests.query.synthetic",
  232    232   
        "XmlEmptyListsOutput",
  233    233   
    ),
  234    234   
    ::aws_smithy_schema::ShapeType::List,
  235         -
    "flattened_list2",
         235  +
    "flattenedList2",
  236    236   
    10,
  237    237   
)
  238    238   
.with_xml_name("customName")
  239    239   
.with_xml_flattened();
  240    240   
static XMLEMPTYLISTSOUTPUT_MEMBER_FLATTENED_LIST_WITH_MEMBER_NAMESPACE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  241    241   
    ::aws_smithy_schema::ShapeId::from_static(
  242    242   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$flattenedListWithMemberNamespace",
  243    243   
        "aws.protocoltests.query.synthetic",
  244    244   
        "XmlEmptyListsOutput",
  245    245   
    ),
  246    246   
    ::aws_smithy_schema::ShapeType::List,
  247         -
    "flattened_list_with_member_namespace",
         247  +
    "flattenedListWithMemberNamespace",
  248    248   
    11,
  249    249   
)
  250    250   
.with_xml_flattened();
  251    251   
static XMLEMPTYLISTSOUTPUT_MEMBER_FLATTENED_LIST_WITH_NAMESPACE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  252    252   
    ::aws_smithy_schema::ShapeId::from_static(
  253    253   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$flattenedListWithNamespace",
  254    254   
        "aws.protocoltests.query.synthetic",
  255    255   
        "XmlEmptyListsOutput",
  256    256   
    ),
  257    257   
    ::aws_smithy_schema::ShapeType::List,
  258         -
    "flattened_list_with_namespace",
         258  +
    "flattenedListWithNamespace",
  259    259   
    12,
  260    260   
)
  261    261   
.with_xml_flattened();
  262    262   
static XMLEMPTYLISTSOUTPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  263    263   
    ::aws_smithy_schema::ShapeId::from_static(
  264    264   
        "aws.protocoltests.query.synthetic#XmlEmptyListsOutput$structureList",
  265    265   
        "aws.protocoltests.query.synthetic",
  266    266   
        "XmlEmptyListsOutput",
  267    267   
    ),
  268    268   
    ::aws_smithy_schema::ShapeType::List,
  269         -
    "structure_list",
         269  +
    "structureList",
  270    270   
    13,
  271    271   
)
  272    272   
.with_xml_name("myStructureList");
  273    273   
static XMLEMPTYLISTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  274    274   
    XMLEMPTYLISTSOUTPUT_SCHEMA_ID,
  275    275   
    ::aws_smithy_schema::ShapeType::Structure,
  276    276   
    &[
  277    277   
        &XMLEMPTYLISTSOUTPUT_MEMBER_STRING_LIST,
  278    278   
        &XMLEMPTYLISTSOUTPUT_MEMBER_STRING_SET,
  279    279   
        &XMLEMPTYLISTSOUTPUT_MEMBER_INTEGER_LIST,
@@ -355,355 +415,423 @@
  375    375   
                    }
  376    376   
                    Ok(())
  377    377   
                },
  378    378   
            )?;
  379    379   
        }
  380    380   
        if let Some(ref val) = self.nested_string_list {
  381    381   
            ser.write_list(
  382    382   
                &XMLEMPTYLISTSOUTPUT_MEMBER_NESTED_STRING_LIST,
  383    383   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  384    384   
                    for item in val {
  385         -
                        todo!("schema: unsupported list element type");
         385  +
                        ser.write_list(
         386  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         387  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         388  +
                                for item in item {
         389  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         390  +
                                }
         391  +
                                Ok(())
         392  +
                            },
         393  +
                        )?;
  386    394   
                    }
  387    395   
                    Ok(())
  388    396   
                },
  389    397   
            )?;
  390    398   
        }
  391    399   
        if let Some(ref val) = self.renamed_list_members {
  392    400   
            ser.write_list(
  393    401   
                &XMLEMPTYLISTSOUTPUT_MEMBER_RENAMED_LIST_MEMBERS,
  394    402   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  395    403   
                    for item in val {
@@ -432,440 +694,615 @@
  452    460   
                    }
  453    461   
                    Ok(())
  454    462   
                },
  455    463   
            )?;
  456    464   
        }
  457    465   
        Ok(())
  458    466   
    }
  459    467   
}
  460    468   
impl XmlEmptyListsOutput {
  461    469   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  462         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  463         -
        deserializer: &mut D,
         470  +
    pub fn deserialize(
         471  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  464    472   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  465    473   
        #[allow(unused_variables, unused_mut)]
  466    474   
        let mut builder = Self::builder();
  467    475   
        #[allow(
  468    476   
            unused_variables,
  469    477   
            unreachable_code,
  470    478   
            clippy::single_match,
  471    479   
            clippy::match_single_binding,
  472    480   
            clippy::diverging_sub_expression
  473    481   
        )]
  474         -
        deserializer.read_struct(&XMLEMPTYLISTSOUTPUT_SCHEMA, (), |_, member, deser| {
         482  +
        deserializer.read_struct(&XMLEMPTYLISTSOUTPUT_SCHEMA, &mut |member, deser| {
  475    483   
            match member.member_index() {
  476    484   
                Some(0) => {
  477         -
                    builder.string_list = Some({
  478         -
                        let container = if let Some(cap) = deser.container_size() {
  479         -
                            Vec::with_capacity(cap)
  480         -
                        } else {
  481         -
                            Vec::new()
  482         -
                        };
  483         -
                        deser.read_list(member, container, |mut list, deser| {
  484         -
                            list.push(deser.read_string(member)?);
  485         -
                            Ok(list)
  486         -
                        })?
  487         -
                    });
         485  +
                    builder.string_list = Some(deser.read_string_list(member)?);
  488    486   
                }
  489    487   
                Some(1) => {
  490         -
                    builder.string_set = Some({
  491         -
                        let container = if let Some(cap) = deser.container_size() {
  492         -
                            Vec::with_capacity(cap)
  493         -
                        } else {
  494         -
                            Vec::new()
  495         -
                        };
  496         -
                        deser.read_list(member, container, |mut list, deser| {
  497         -
                            list.push(deser.read_string(member)?);
  498         -
                            Ok(list)
  499         -
                        })?
  500         -
                    });
         488  +
                    builder.string_set = Some(deser.read_string_list(member)?);
  501    489   
                }
  502    490   
                Some(2) => {
  503         -
                    builder.integer_list = Some({
  504         -
                        let container = if let Some(cap) = deser.container_size() {
  505         -
                            Vec::with_capacity(cap)
  506         -
                        } else {
  507         -
                            Vec::new()
  508         -
                        };
  509         -
                        deser.read_list(member, container, |mut list, deser| {
  510         -
                            list.push(deser.read_integer(member)?);
  511         -
                            Ok(list)
  512         -
                        })?
  513         -
                    });
         491  +
                    builder.integer_list = Some(deser.read_integer_list(member)?);
  514    492   
                }
  515    493   
                Some(3) => {
  516    494   
                    builder.boolean_list = Some({
  517         -
                        let container = if let Some(cap) = deser.container_size() {
  518         -
                            Vec::with_capacity(cap)
  519         -
                        } else {
  520         -
                            Vec::new()
  521         -
                        };
  522         -
                        deser.read_list(member, container, |mut list, deser| {
  523         -
                            list.push(deser.read_boolean(member)?);
  524         -
                            Ok(list)
  525         -
                        })?
         495  +
                        let mut container = Vec::new();
         496  +
                        deser.read_list(member, &mut |deser| {
         497  +
                            container.push(deser.read_boolean(member)?);
         498  +
                            Ok(())
         499  +
                        })?;
         500  +
                        container
  526    501   
                    });
  527    502   
                }
  528    503   
                Some(4) => {
  529    504   
                    builder.timestamp_list = Some({
  530         -
                        let container = if let Some(cap) = deser.container_size() {
  531         -
                            Vec::with_capacity(cap)
  532         -
                        } else {
  533         -
                            Vec::new()
  534         -
                        };
  535         -
                        deser.read_list(member, container, |mut list, deser| {
  536         -
                            list.push(deser.read_timestamp(member)?);
  537         -
                            Ok(list)
  538         -
                        })?
         505  +
                        let mut container = Vec::new();
         506  +
                        deser.read_list(member, &mut |deser| {
         507  +
                            container.push(deser.read_timestamp(member)?);
         508  +
                            Ok(())
         509  +
                        })?;
         510  +
                        container
  539    511   
                    });
  540    512   
                }
  541    513   
                Some(5) => {
  542    514   
                    builder.enum_list = Some({
  543         -
                        let container = if let Some(cap) = deser.container_size() {
  544         -
                            Vec::with_capacity(cap)
  545         -
                        } else {
  546         -
                            Vec::new()
  547         -
                        };
  548         -
                        deser.read_list(member, container, |mut list, deser| {
  549         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  550         -
                            Ok(list)
  551         -
                        })?
         515  +
                        let mut container = Vec::new();
         516  +
                        deser.read_list(member, &mut |deser| {
         517  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         518  +
                            Ok(())
         519  +
                        })?;
         520  +
                        container
  552    521   
                    });
  553    522   
                }
  554    523   
                Some(6) => {
  555         -
                    builder.int_enum_list = Some({
  556         -
                        let container = if let Some(cap) = deser.container_size() {
  557         -
                            Vec::with_capacity(cap)
  558         -
                        } else {
  559         -
                            Vec::new()
  560         -
                        };
  561         -
                        deser.read_list(member, container, |mut list, deser| {
  562         -
                            list.push(deser.read_integer(member)?);
  563         -
                            Ok(list)
  564         -
                        })?
  565         -
                    });
         524  +
                    builder.int_enum_list = Some(deser.read_integer_list(member)?);
  566    525   
                }
  567    526   
                Some(7) => {
  568    527   
                    builder.nested_string_list = Some({
  569         -
                        let container = if let Some(cap) = deser.container_size() {
  570         -
                            Vec::with_capacity(cap)
  571         -
                        } else {
  572         -
                            Vec::new()
  573         -
                        };
  574         -
                        deser.read_list(member, container, |mut list, deser| {
  575         -
                            list.push(todo!("deserialize nested aggregate"));
  576         -
                            Ok(list)
  577         -
                        })?
         528  +
                        let mut container = Vec::new();
         529  +
                        deser.read_list(member, &mut |deser| {
         530  +
                            container.push({
         531  +
                                let mut list = Vec::new();
         532  +
                                deser.read_list(member, &mut |deser| {
         533  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         534  +
                                    Ok(())
         535  +
                                })?;
         536  +
                                list
         537  +
                            });
         538  +
                            Ok(())
         539  +
                        })?;
         540  +
                        container
  578    541   
                    });
  579    542   
                }
  580    543   
                Some(8) => {
  581         -
                    builder.renamed_list_members = Some({
  582         -
                        let container = if let Some(cap) = deser.container_size() {
  583         -
                            Vec::with_capacity(cap)
  584         -
                        } else {
  585         -
                            Vec::new()
  586         -
                        };
  587         -
                        deser.read_list(member, container, |mut list, deser| {
  588         -
                            list.push(deser.read_string(member)?);
  589         -
                            Ok(list)
  590         -
                        })?
  591         -
                    });
         544  +
                    builder.renamed_list_members = Some(deser.read_string_list(member)?);
  592    545   
                }
  593    546   
                Some(9) => {
  594         -
                    builder.flattened_list = Some({
  595         -
                        let container = if let Some(cap) = deser.container_size() {
  596         -
                            Vec::with_capacity(cap)
  597         -
                        } else {
  598         -
                            Vec::new()
  599         -
                        };
  600         -
                        deser.read_list(member, container, |mut list, deser| {
  601         -
                            list.push(deser.read_string(member)?);
  602         -
                            Ok(list)
  603         -
                        })?
  604         -
                    });
         547  +
                    builder.flattened_list = Some(deser.read_string_list(member)?);
  605    548   
                }
  606    549   
                Some(10) => {
  607         -
                    builder.flattened_list2 = Some({
  608         -
                        let container = if let Some(cap) = deser.container_size() {
  609         -
                            Vec::with_capacity(cap)
  610         -
                        } else {
  611         -
                            Vec::new()
  612         -
                        };
  613         -
                        deser.read_list(member, container, |mut list, deser| {
  614         -
                            list.push(deser.read_string(member)?);
  615         -
                            Ok(list)
  616         -
                        })?
  617         -
                    });
         550  +
                    builder.flattened_list2 = Some(deser.read_string_list(member)?);
  618    551   
                }
  619    552   
                Some(11) => {
  620         -
                    builder.flattened_list_with_member_namespace = Some({
  621         -
                        let container = if let Some(cap) = deser.container_size() {
  622         -
                            Vec::with_capacity(cap)
  623         -
                        } else {
  624         -
                            Vec::new()
  625         -
                        };
  626         -
                        deser.read_list(member, container, |mut list, deser| {
  627         -
                            list.push(deser.read_string(member)?);
  628         -
                            Ok(list)
  629         -
                        })?
  630         -
                    });
         553  +
                    builder.flattened_list_with_member_namespace = Some(deser.read_string_list(member)?);
  631    554   
                }
  632    555   
                Some(12) => {
  633         -
                    builder.flattened_list_with_namespace = Some({
  634         -
                        let container = if let Some(cap) = deser.container_size() {
  635         -
                            Vec::with_capacity(cap)
  636         -
                        } else {
  637         -
                            Vec::new()
  638         -
                        };
  639         -
                        deser.read_list(member, container, |mut list, deser| {
  640         -
                            list.push(deser.read_string(member)?);
  641         -
                            Ok(list)
  642         -
                        })?
  643         -
                    });
         556  +
                    builder.flattened_list_with_namespace = Some(deser.read_string_list(member)?);
  644    557   
                }
  645    558   
                Some(13) => {
  646    559   
                    builder.structure_list = Some({
  647         -
                        let container = if let Some(cap) = deser.container_size() {
  648         -
                            Vec::with_capacity(cap)
  649         -
                        } else {
  650         -
                            Vec::new()
  651         -
                        };
  652         -
                        deser.read_list(member, container, |mut list, deser| {
  653         -
                            list.push(crate::types::StructureListMember::deserialize(deser)?);
  654         -
                            Ok(list)
  655         -
                        })?
         560  +
                        let mut container = Vec::new();
         561  +
                        deser.read_list(member, &mut |deser| {
         562  +
                            container.push(crate::types::StructureListMember::deserialize(deser)?);
         563  +
                            Ok(())
         564  +
                        })?;
         565  +
                        container
  656    566   
                    });
  657    567   
                }
  658    568   
                _ => {}
  659    569   
            }
  660    570   
            Ok(())
  661    571   
        })?;
  662    572   
        Ok(builder.build())
  663    573   
    }
  664    574   
}
         575  +
impl XmlEmptyListsOutput {
         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  +
}
  665    586   
impl XmlEmptyListsOutput {
  666    587   
    /// Creates a new builder-style object to manufacture [`XmlEmptyListsOutput`](crate::operation::xml_empty_lists::XmlEmptyListsOutput).
  667    588   
    pub fn builder() -> crate::operation::xml_empty_lists::builders::XmlEmptyListsOutputBuilder {
  668    589   
        crate::operation::xml_empty_lists::builders::XmlEmptyListsOutputBuilder::default()
  669    590   
    }
  670    591   
}
  671    592   
  672    593   
/// A builder for [`XmlEmptyListsOutput`](crate::operation::xml_empty_lists::XmlEmptyListsOutput).
  673    594   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  674    595   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_empty_maps.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 `XmlEmptyMaps`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlEmptyMaps;
    6      6   
impl XmlEmptyMaps {
    7      7   
    /// Creates a new `XmlEmptyMaps`
    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::xml_empty_maps::XmlEmptyMapsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_empty_maps::XmlEmptyMapsOutput::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::xml_empty_maps::XmlEmptyMapsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_empty_maps::XmlEmptyMapsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_empty_maps::XmlEmptyMapsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::xml_empty_maps::XmlEmptyMapsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlEmptyMapsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlEmptyMapsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_empty_maps::de_xml_empty_maps_http_error(status, headers, body)
  146    151   
        } else {
@@ -239,244 +339,352 @@
  259    264   
            .expect("the config must have a deserializer");
  260    265   
  261    266   
        let parsed = de.deserialize_streaming(&mut http_response);
  262    267   
        let parsed = parsed.unwrap_or_else(|| {
  263    268   
            let http_response = http_response.map(|body| {
  264    269   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  265    270   
                    body.bytes().unwrap(),
  266    271   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  267    272   
                )))
  268    273   
            });
  269         -
            de.deserialize_nonstreaming(&http_response)
         274  +
            // Build a config bag with the protocol for schema-based deserialization
         275  +
            #[allow(unused_mut)]
         276  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         277  +
         278  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  270    279   
        });
  271    280   
        let parsed = parsed
  272    281   
            .expect("should be successful response")
  273    282   
            .downcast::<crate::operation::xml_empty_maps::XmlEmptyMapsOutput>()
  274    283   
            .unwrap();
  275    284   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  276    285   
    }
  277    286   
  278    287   
    /// Deserializes Self-Closed XML maps
  279    288   
    /// Test ID: QueryXmlEmptySelfClosedMaps
  280    289   
    #[::tokio::test]
  281    290   
    #[::tracing_test::traced_test]
  282    291   
    async fn query_xml_empty_self_closed_maps_response() {
  283    292   
        let expected_output = crate::operation::xml_empty_maps::XmlEmptyMapsOutput::builder()
  284    293   
            .set_my_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  285    294   
            .build();
  286    295   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  287    296   
        .header("Content-Type", "text/xml")
  288    297   
        .status(200)
  289    298   
                    .body(::aws_smithy_types::body::SdkBody::from("<XmlEmptyMapsResponse xmlns=\"https://example.com/\">\n    <XmlEmptyMapsResult>\n        <myMap/>\n    </XmlEmptyMapsResult>\n</XmlEmptyMapsResponse>\n"))
  290    299   
                    .unwrap()
  291    300   
                    ).unwrap();
  292    301   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  293    302   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  294    303   
  295    304   
        let op = crate::operation::xml_empty_maps::XmlEmptyMaps::new();
  296    305   
        let config = op.config().expect("the operation has config");
  297    306   
        let de = config
  298    307   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  299    308   
            .expect("the config must have a deserializer");
  300    309   
  301    310   
        let parsed = de.deserialize_streaming(&mut http_response);
  302    311   
        let parsed = parsed.unwrap_or_else(|| {
  303    312   
            let http_response = http_response.map(|body| {
  304    313   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  305    314   
                    body.bytes().unwrap(),
  306    315   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  307    316   
                )))
  308    317   
            });
  309         -
            de.deserialize_nonstreaming(&http_response)
         318  +
            // Build a config bag with the protocol for schema-based deserialization
         319  +
            #[allow(unused_mut)]
         320  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         321  +
         322  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  310    323   
        });
  311    324   
        let parsed = parsed
  312    325   
            .expect("should be successful response")
  313    326   
            .downcast::<crate::operation::xml_empty_maps::XmlEmptyMapsOutput>()
  314    327   
            .unwrap();
  315    328   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  316    329   
    }
  317    330   
}
  318    331   
  319    332   
/// Error type for the `XmlEmptyMapsError` operation.

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/operation/xml_empty_maps/_xml_empty_maps_input.rs

@@ -1,1 +69,82 @@
   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 XmlEmptyMapsInput {
   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(&XMLEMPTYMAPSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&XMLEMPTYMAPSINPUT_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 XmlEmptyMapsInput {
          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 XmlEmptyMapsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`XmlEmptyMapsInput`](crate::operation::xml_empty_maps::XmlEmptyMapsInput).
   53     66   
    pub fn builder() -> crate::operation::xml_empty_maps::builders::XmlEmptyMapsInputBuilder {
   54     67   
        crate::operation::xml_empty_maps::builders::XmlEmptyMapsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`XmlEmptyMapsInput`](crate::operation::xml_empty_maps::XmlEmptyMapsInput).
   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/aws_query/rust-client-codegen/src/operation/xml_empty_maps/_xml_empty_maps_output.rs

@@ -1,1 +125,133 @@
   17     17   
    "aws.protocoltests.query.synthetic",
   18     18   
    "XmlEmptyMapsOutput",
   19     19   
);
   20     20   
static XMLEMPTYMAPSOUTPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.query.synthetic#XmlEmptyMapsOutput$myMap",
   23     23   
        "aws.protocoltests.query.synthetic",
   24     24   
        "XmlEmptyMapsOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Map,
   27         -
    "my_map",
          27  +
    "myMap",
   28     28   
    0,
   29     29   
);
   30     30   
static XMLEMPTYMAPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    XMLEMPTYMAPSOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&XMLEMPTYMAPSOUTPUT_MEMBER_MY_MAP],
   34     34   
);
   35     35   
impl XmlEmptyMapsOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLEMPTYMAPSOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlEmptyMapsOutput {
   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.my_map {
   46     46   
            ser.write_map(
   47     47   
                &XMLEMPTYMAPSOUTPUT_MEMBER_MY_MAP,
   48     48   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   49     49   
                    for (key, value) in val {
   50     50   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   51     51   
                        ser.write_struct(crate::types::GreetingStruct::SCHEMA, value)?;
   52     52   
                    }
   53     53   
                    Ok(())
   54     54   
                },
   55     55   
            )?;
   56     56   
        }
   57     57   
        Ok(())
   58     58   
    }
   59     59   
}
   60     60   
impl XmlEmptyMapsOutput {
   61     61   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   62         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   63         -
        deserializer: &mut D,
          62  +
    pub fn deserialize(
          63  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   64     64   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   65     65   
        #[allow(unused_variables, unused_mut)]
   66     66   
        let mut builder = Self::builder();
   67     67   
        #[allow(
   68     68   
            unused_variables,
   69     69   
            unreachable_code,
   70     70   
            clippy::single_match,
   71     71   
            clippy::match_single_binding,
   72     72   
            clippy::diverging_sub_expression
   73     73   
        )]
   74         -
        deserializer.read_struct(&XMLEMPTYMAPSOUTPUT_SCHEMA, (), |_, member, deser| {
          74  +
        deserializer.read_struct(&XMLEMPTYMAPSOUTPUT_SCHEMA, &mut |member, deser| {
   75     75   
            match member.member_index() {
   76     76   
                Some(0) => {
   77     77   
                    builder.my_map = Some({
   78         -
                        let container = if let Some(cap) = deser.container_size() {
   79         -
                            std::collections::HashMap::with_capacity(cap)
   80         -
                        } else {
   81         -
                            std::collections::HashMap::new()
   82         -
                        };
   83         -
                        deser.read_map(member, container, |mut map, key, deser| {
   84         -
                            map.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
   85         -
                            Ok(map)
   86         -
                        })?
          78  +
                        let mut container = std::collections::HashMap::new();
          79  +
                        deser.read_map(member, &mut |key, deser| {
          80  +
                            container.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
          81  +
                            Ok(())
          82  +
                        })?;
          83  +
                        container
   87     84   
                    });
   88     85   
                }
   89     86   
                _ => {}
   90     87   
            }
   91     88   
            Ok(())
   92     89   
        })?;
   93     90   
        Ok(builder.build())
   94     91   
    }
   95     92   
}
          93  +
impl XmlEmptyMapsOutput {
          94  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          95  +
    pub fn deserialize_with_response(
          96  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          97  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          98  +
        _status: u16,
          99  +
        _body: &[u8],
         100  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         101  +
        Self::deserialize(deserializer)
         102  +
    }
         103  +
}
   96    104   
impl XmlEmptyMapsOutput {
   97    105   
    /// Creates a new builder-style object to manufacture [`XmlEmptyMapsOutput`](crate::operation::xml_empty_maps::XmlEmptyMapsOutput).
   98    106   
    pub fn builder() -> crate::operation::xml_empty_maps::builders::XmlEmptyMapsOutputBuilder {
   99    107   
        crate::operation::xml_empty_maps::builders::XmlEmptyMapsOutputBuilder::default()
  100    108   
    }
  101    109   
}
  102    110   
  103    111   
/// A builder for [`XmlEmptyMapsOutput`](crate::operation::xml_empty_maps::XmlEmptyMapsOutput).
  104    112   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  105    113   
#[non_exhaustive]