Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_traits_with_media_type/_http_payload_traits_with_media_type_input.rs

@@ -25,25 +135,159 @@
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_payload();
   48     48   
static HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO,
   53     53   
        &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB,
   54     54   
    ],
   55         -
);
          55  +
)
          56  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/HttpPayloadTraitsWithMediaType", None));
   56     57   
impl HttpPayloadTraitsWithMediaTypeInput {
   57     58   
    /// The schema for this shape.
   58     59   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA;
   59     60   
}
   60     61   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadTraitsWithMediaTypeInput {
   61     62   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     63   
    fn serialize_members(
   63     64   
        &self,
   64     65   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     66   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     67   
        if let Some(ref val) = self.foo {
   67     68   
            ser.write_string(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO, val)?;
   68     69   
        }
   69     70   
        if let Some(ref val) = self.blob {
   70     71   
            ser.write_blob(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB, val)?;
   71     72   
        }
   72     73   
        Ok(())
   73     74   
    }
   74     75   
}
   75     76   
impl HttpPayloadTraitsWithMediaTypeInput {
   76     77   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          78  +
    pub fn deserialize(
          79  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     80   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     81   
        #[allow(unused_variables, unused_mut)]
   81     82   
        let mut builder = Self::builder();
   82     83   
        #[allow(
   83     84   
            unused_variables,
   84     85   
            unreachable_code,
   85     86   
            clippy::single_match,
   86     87   
            clippy::match_single_binding,
   87     88   
            clippy::diverging_sub_expression
   88     89   
        )]
   89         -
        deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA, (), |_, member, deser| {
          90  +
        deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA, &mut |member, deser| {
   90     91   
            match member.member_index() {
   91     92   
                Some(0) => {
   92     93   
                    builder.foo = Some(deser.read_string(member)?);
   93     94   
                }
   94     95   
                Some(1) => {
   95     96   
                    builder.blob = Some(deser.read_blob(member)?);
   96     97   
                }
   97     98   
                _ => {}
   98     99   
            }
   99    100   
            Ok(())
  100    101   
        })?;
  101    102   
        builder
  102    103   
            .build()
  103    104   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    105   
    }
  105    106   
}
         107  +
impl HttpPayloadTraitsWithMediaTypeInput {
         108  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         109  +
    /// Header-bound members are read directly from headers, avoiding runtime
         110  +
    /// member iteration overhead. Body members are read via the deserializer.
         111  +
    pub fn deserialize_with_response(
         112  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         113  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         114  +
        _status: u16,
         115  +
        body: &[u8],
         116  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         117  +
        #[allow(unused_variables, unused_mut)]
         118  +
        let mut builder = Self::builder();
         119  +
        if let Some(val) = headers.get("X-Foo") {
         120  +
            builder.foo = Some(val.to_string());
         121  +
        }
         122  +
        if !body.is_empty() {
         123  +
            builder.blob = Some(::aws_smithy_types::Blob::new(body.to_vec()));
         124  +
        }
         125  +
        builder
         126  +
            .build()
         127  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         128  +
    }
         129  +
}
  106    130   
impl HttpPayloadTraitsWithMediaTypeInput {
  107    131   
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
  108    132   
    pub fn builder() -> crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
  109    133   
        crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder::default()
  110    134   
    }
  111    135   
}
  112    136   
  113    137   
/// A builder for [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
  114    138   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    139   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_traits_with_media_type/_http_payload_traits_with_media_type_output.rs

@@ -47,47 +133,154 @@
   67     67   
            ser.write_string(&HTTPPAYLOADTRAITSWITHMEDIATYPEOUTPUT_MEMBER_FOO, val)?;
   68     68   
        }
   69     69   
        if let Some(ref val) = self.blob {
   70     70   
            ser.write_blob(&HTTPPAYLOADTRAITSWITHMEDIATYPEOUTPUT_MEMBER_BLOB, val)?;
   71     71   
        }
   72     72   
        Ok(())
   73     73   
    }
   74     74   
}
   75     75   
impl HttpPayloadTraitsWithMediaTypeOutput {
   76     76   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          77  +
    pub fn deserialize(
          78  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     79   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     80   
        #[allow(unused_variables, unused_mut)]
   81     81   
        let mut builder = Self::builder();
   82     82   
        #[allow(
   83     83   
            unused_variables,
   84     84   
            unreachable_code,
   85     85   
            clippy::single_match,
   86     86   
            clippy::match_single_binding,
   87     87   
            clippy::diverging_sub_expression
   88     88   
        )]
   89         -
        deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEOUTPUT_SCHEMA, (), |_, member, deser| {
          89  +
        deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEOUTPUT_SCHEMA, &mut |member, deser| {
   90     90   
            match member.member_index() {
   91     91   
                Some(0) => {
   92     92   
                    builder.foo = Some(deser.read_string(member)?);
   93     93   
                }
   94     94   
                Some(1) => {
   95     95   
                    builder.blob = Some(deser.read_blob(member)?);
   96     96   
                }
   97     97   
                _ => {}
   98     98   
            }
   99     99   
            Ok(())
  100    100   
        })?;
  101    101   
        Ok(builder.build())
  102    102   
    }
  103    103   
}
         104  +
impl HttpPayloadTraitsWithMediaTypeOutput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         106  +
    /// Header-bound members are read directly from headers, avoiding runtime
         107  +
    /// member iteration overhead. Body members are read via the deserializer.
         108  +
    pub fn deserialize_with_response(
         109  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         110  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         111  +
        _status: u16,
         112  +
        body: &[u8],
         113  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         114  +
        #[allow(unused_variables, unused_mut)]
         115  +
        let mut builder = Self::builder();
         116  +
        if let Some(val) = headers.get("X-Foo") {
         117  +
            builder.foo = Some(val.to_string());
         118  +
        }
         119  +
        if !body.is_empty() {
         120  +
            builder.blob = Some(::aws_smithy_types::Blob::new(body.to_vec()));
         121  +
        }
         122  +
        Ok(builder.build())
         123  +
    }
         124  +
}
  104    125   
impl HttpPayloadTraitsWithMediaTypeOutput {
  105    126   
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
  106    127   
    pub fn builder() -> crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder {
  107    128   
        crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder::default()
  108    129   
    }
  109    130   
}
  110    131   
  111    132   
/// A builder for [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
  112    133   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  113    134   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_member_xml_name.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 `HttpPayloadWithMemberXmlName`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPayloadWithMemberXmlName;
    6      6   
impl HttpPayloadWithMemberXmlName {
    7      7   
    /// Creates a new `HttpPayloadWithMemberXmlName`
    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::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameOutput::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::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameError,
  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 HttpPayloadWithMemberXmlNameResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithMemberXmlNameResponseDeserializer {
  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_http_payload_with_member_xml_name::de_http_payload_with_member_xml_name_http_error(status, headers, body)
  152    159   
        } else {
@@ -293,300 +353,364 @@
  313    320   
            .expect("the config must have a deserializer");
  314    321   
  315    322   
        let parsed = de.deserialize_streaming(&mut http_response);
  316    323   
        let parsed = parsed.unwrap_or_else(|| {
  317    324   
            let http_response = http_response.map(|body| {
  318    325   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  319    326   
                    body.bytes().unwrap(),
  320    327   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  321    328   
                )))
  322    329   
            });
  323         -
            de.deserialize_nonstreaming(&http_response)
         330  +
            // Build a config bag with the protocol for schema-based deserialization
         331  +
            #[allow(unused_mut)]
         332  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         333  +
         334  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  324    335   
        });
  325    336   
        let parsed = parsed
  326    337   
            .expect("should be successful response")
  327    338   
            .downcast::<crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameOutput>()
  328    339   
            .unwrap();
  329    340   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  330    341   
    }
  331    342   
}
  332    343   
  333    344   
/// Error type for the `HttpPayloadWithMemberXmlNameError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_member_xml_name/_http_payload_with_member_xml_name_input.rs

@@ -6,6 +110,131 @@
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload()
   31     31   
.with_xml_name("Hola");
   32     32   
static HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_MEMBER_NESTED],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/HttpPayloadWithMemberXmlName", None));
   37     38   
impl HttpPayloadWithMemberXmlNameInput {
   38     39   
    /// The schema for this shape.
   39     40   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_SCHEMA;
   40     41   
}
   41     42   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithMemberXmlNameInput {
   42     43   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     44   
    fn serialize_members(
   44     45   
        &self,
   45     46   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     47   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     48   
        if let Some(ref val) = self.nested {
   48     49   
            ser.write_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_MEMBER_NESTED, val)?;
   49     50   
        }
   50     51   
        Ok(())
   51     52   
    }
   52     53   
}
   53     54   
impl HttpPayloadWithMemberXmlNameInput {
   54     55   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          56  +
    pub fn deserialize(
          57  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     58   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     59   
        #[allow(unused_variables, unused_mut)]
   59     60   
        let mut builder = Self::builder();
   60     61   
        #[allow(
   61     62   
            unused_variables,
   62     63   
            unreachable_code,
   63     64   
            clippy::single_match,
   64     65   
            clippy::match_single_binding,
   65     66   
            clippy::diverging_sub_expression
   66     67   
        )]
   67         -
        deserializer.read_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_SCHEMA, (), |_, member, deser| {
          68  +
        deserializer.read_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEINPUT_SCHEMA, &mut |member, deser| {
   68     69   
            match member.member_index() {
   69     70   
                Some(0) => {
   70     71   
                    builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deser)?);
   71     72   
                }
   72     73   
                _ => {}
   73     74   
            }
   74     75   
            Ok(())
   75     76   
        })?;
   76     77   
        builder
   77     78   
            .build()
   78     79   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     80   
    }
   80     81   
}
          82  +
impl HttpPayloadWithMemberXmlNameInput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          84  +
    /// Header-bound members are read directly from headers, avoiding runtime
          85  +
    /// member iteration overhead. Body members are read via the deserializer.
          86  +
    pub fn deserialize_with_response(
          87  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          88  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          89  +
        _status: u16,
          90  +
        body: &[u8],
          91  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          92  +
        #[allow(unused_variables, unused_mut)]
          93  +
        let mut builder = Self::builder();
          94  +
        if !body.is_empty() {
          95  +
            builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deserializer)?);
          96  +
        }
          97  +
        builder
          98  +
            .build()
          99  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         100  +
    }
         101  +
}
   81    102   
impl HttpPayloadWithMemberXmlNameInput {
   82    103   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithMemberXmlNameInput`](crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameInput).
   83    104   
    pub fn builder() -> crate::operation::http_payload_with_member_xml_name::builders::HttpPayloadWithMemberXmlNameInputBuilder {
   84    105   
        crate::operation::http_payload_with_member_xml_name::builders::HttpPayloadWithMemberXmlNameInputBuilder::default()
   85    106   
    }
   86    107   
}
   87    108   
   88    109   
/// A builder for [`HttpPayloadWithMemberXmlNameInput`](crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameInput).
   89    110   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    111   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_member_xml_name/_http_payload_with_member_xml_name_output.rs

@@ -25,25 +108,126 @@
   45     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     47   
        if let Some(ref val) = self.nested {
   48     48   
            ser.write_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEOUTPUT_MEMBER_NESTED, val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl HttpPayloadWithMemberXmlNameOutput {
   54     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     58   
        #[allow(unused_variables, unused_mut)]
   59     59   
        let mut builder = Self::builder();
   60     60   
        #[allow(
   61     61   
            unused_variables,
   62     62   
            unreachable_code,
   63     63   
            clippy::single_match,
   64     64   
            clippy::match_single_binding,
   65     65   
            clippy::diverging_sub_expression
   66     66   
        )]
   67         -
        deserializer.read_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEOUTPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPPAYLOADWITHMEMBERXMLNAMEOUTPUT_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deser)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
   76     76   
        Ok(builder.build())
   77     77   
    }
   78     78   
}
          79  +
impl HttpPayloadWithMemberXmlNameOutput {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          81  +
    /// Header-bound members are read directly from headers, avoiding runtime
          82  +
    /// member iteration overhead. Body members are read via the deserializer.
          83  +
    pub fn deserialize_with_response(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        #[allow(unused_variables, unused_mut)]
          90  +
        let mut builder = Self::builder();
          91  +
        if !body.is_empty() {
          92  +
            builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deserializer)?);
          93  +
        }
          94  +
        Ok(builder.build())
          95  +
    }
          96  +
}
   79     97   
impl HttpPayloadWithMemberXmlNameOutput {
   80     98   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithMemberXmlNameOutput`](crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameOutput).
   81     99   
    pub fn builder() -> crate::operation::http_payload_with_member_xml_name::builders::HttpPayloadWithMemberXmlNameOutputBuilder {
   82    100   
        crate::operation::http_payload_with_member_xml_name::builders::HttpPayloadWithMemberXmlNameOutputBuilder::default()
   83    101   
    }
   84    102   
}
   85    103   
   86    104   
/// A builder for [`HttpPayloadWithMemberXmlNameOutput`](crate::operation::http_payload_with_member_xml_name::HttpPayloadWithMemberXmlNameOutput).
   87    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    106   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_structure.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 `HttpPayloadWithStructure`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPayloadWithStructure;
    6      6   
impl HttpPayloadWithStructure {
    7      7   
    /// Creates a new `HttpPayloadWithStructure`
    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::http_payload_with_structure::HttpPayloadWithStructureInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput::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::http_payload_with_structure::HttpPayloadWithStructureInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
  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 HttpPayloadWithStructureResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithStructureResponseDeserializer {
  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_http_payload_with_structure::de_http_payload_with_structure_http_error(status, headers, body)
  152    159   
        } else {
@@ -297,304 +357,368 @@
  317    324   
            .expect("the config must have a deserializer");
  318    325   
  319    326   
        let parsed = de.deserialize_streaming(&mut http_response);
  320    327   
        let parsed = parsed.unwrap_or_else(|| {
  321    328   
            let http_response = http_response.map(|body| {
  322    329   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  323    330   
                    body.bytes().unwrap(),
  324    331   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  325    332   
                )))
  326    333   
            });
  327         -
            de.deserialize_nonstreaming(&http_response)
         334  +
            // Build a config bag with the protocol for schema-based deserialization
         335  +
            #[allow(unused_mut)]
         336  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         337  +
         338  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  328    339   
        });
  329    340   
        let parsed = parsed
  330    341   
            .expect("should be successful response")
  331    342   
            .downcast::<crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput>()
  332    343   
            .unwrap();
  333    344   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  334    345   
    }
  335    346   
}
  336    347   
  337    348   
/// Error type for the `HttpPayloadWithStructureError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_structure/_http_payload_with_structure_input.rs

@@ -5,5 +109,130 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload();
   31     31   
static HTTPPAYLOADWITHSTRUCTUREINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPPAYLOADWITHSTRUCTUREINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPPAYLOADWITHSTRUCTUREINPUT_MEMBER_NESTED],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/HttpPayloadWithStructure", None));
   36     37   
impl HttpPayloadWithStructureInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHSTRUCTUREINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithStructureInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.nested {
   47     48   
            ser.write_struct(&HTTPPAYLOADWITHSTRUCTUREINPUT_MEMBER_NESTED, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl HttpPayloadWithStructureInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHSTRUCTUREINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPPAYLOADWITHSTRUCTUREINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.nested = Some(crate::types::NestedPayload::deserialize(deser)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
   75     76   
        builder
   76     77   
            .build()
   77     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     79   
    }
   79     80   
}
          81  +
impl HttpPayloadWithStructureInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          83  +
    /// Header-bound members are read directly from headers, avoiding runtime
          84  +
    /// member iteration overhead. Body members are read via the deserializer.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        #[allow(unused_variables, unused_mut)]
          92  +
        let mut builder = Self::builder();
          93  +
        if !body.is_empty() {
          94  +
            builder.nested = Some(crate::types::NestedPayload::deserialize(deserializer)?);
          95  +
        }
          96  +
        builder
          97  +
            .build()
          98  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          99  +
    }
         100  +
}
   80    101   
impl HttpPayloadWithStructureInput {
   81    102   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithStructureInput`](crate::operation::http_payload_with_structure::HttpPayloadWithStructureInput).
   82    103   
    pub fn builder() -> crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder {
   83    104   
        crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder::default()
   84    105   
    }
   85    106   
}
   86    107   
   87    108   
/// A builder for [`HttpPayloadWithStructureInput`](crate::operation::http_payload_with_structure::HttpPayloadWithStructureInput).
   88    109   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    110   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_structure/_http_payload_with_structure_output.rs

@@ -24,24 +107,125 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.nested {
   47     47   
            ser.write_struct(&HTTPPAYLOADWITHSTRUCTUREOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpPayloadWithStructureOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHSTRUCTUREOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPPAYLOADWITHSTRUCTUREOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.nested = Some(crate::types::NestedPayload::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpPayloadWithStructureOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            builder.nested = Some(crate::types::NestedPayload::deserialize(deserializer)?);
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl HttpPayloadWithStructureOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithStructureOutput`](crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput).
   80     98   
    pub fn builder() -> crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureOutputBuilder {
   81     99   
        crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`HttpPayloadWithStructureOutput`](crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput).
   86    104   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    105   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_union.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 `HttpPayloadWithUnion`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPayloadWithUnion;
    6      6   
impl HttpPayloadWithUnion {
    7      7   
    /// Creates a new `HttpPayloadWithUnion`
    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::http_payload_with_union::HttpPayloadWithUnionInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput::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::http_payload_with_union::HttpPayloadWithUnionInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HttpPayloadWithUnionResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithUnionResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_http_error(status, headers, body)
  152    157   
        } else {
@@ -312,317 +412,425 @@
  332    337   
            .expect("the config must have a deserializer");
  333    338   
  334    339   
        let parsed = de.deserialize_streaming(&mut http_response);
  335    340   
        let parsed = parsed.unwrap_or_else(|| {
  336    341   
            let http_response = http_response.map(|body| {
  337    342   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  338    343   
                    body.bytes().unwrap(),
  339    344   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  340    345   
                )))
  341    346   
            });
  342         -
            de.deserialize_nonstreaming(&http_response)
         347  +
            // Build a config bag with the protocol for schema-based deserialization
         348  +
            #[allow(unused_mut)]
         349  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         350  +
         351  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  343    352   
        });
  344    353   
        let parsed = parsed
  345    354   
            .expect("should be successful response")
  346    355   
            .downcast::<crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput>()
  347    356   
            .unwrap();
  348    357   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  349    358   
    }
  350    359   
  351    360   
    /// No payload is sent if the union has no value.
  352    361   
    /// Test ID: RestXmlHttpPayloadWithUnsetUnion
  353    362   
    #[::tokio::test]
  354    363   
    #[::tracing_test::traced_test]
  355    364   
    async fn rest_xml_http_payload_with_unset_union_response() {
  356    365   
        let expected_output = crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput::builder().build();
  357    366   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  358    367   
            ::http_1x::response::Builder::new()
  359    368   
                .header("Content-Length", "0")
  360    369   
                .status(200)
  361    370   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  362    371   
                .unwrap(),
  363    372   
        )
  364    373   
        .unwrap();
  365    374   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  366    375   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  367    376   
  368    377   
        let op = crate::operation::http_payload_with_union::HttpPayloadWithUnion::new();
  369    378   
        let config = op.config().expect("the operation has config");
  370    379   
        let de = config
  371    380   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  372    381   
            .expect("the config must have a deserializer");
  373    382   
  374    383   
        let parsed = de.deserialize_streaming(&mut http_response);
  375    384   
        let parsed = parsed.unwrap_or_else(|| {
  376    385   
            let http_response = http_response.map(|body| {
  377    386   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  378    387   
                    body.bytes().unwrap(),
  379    388   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  380    389   
                )))
  381    390   
            });
  382         -
            de.deserialize_nonstreaming(&http_response)
         391  +
            // Build a config bag with the protocol for schema-based deserialization
         392  +
            #[allow(unused_mut)]
         393  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         394  +
         395  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  383    396   
        });
  384    397   
        let parsed = parsed
  385    398   
            .expect("should be successful response")
  386    399   
            .downcast::<crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput>()
  387    400   
            .unwrap();
  388    401   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  389    402   
    }
  390    403   
}
  391    404   
  392    405   
/// Error type for the `HttpPayloadWithUnionError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_union/_http_payload_with_union_input.rs

@@ -5,5 +112,130 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Union,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload();
   31     31   
static HTTPPAYLOADWITHUNIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPPAYLOADWITHUNIONINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPPAYLOADWITHUNIONINPUT_MEMBER_NESTED],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/HttpPayloadWithUnion", None));
   36     37   
impl HttpPayloadWithUnionInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHUNIONINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithUnionInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.nested {
   47         -
            ser.write_null(&HTTPPAYLOADWITHUNIONINPUT_MEMBER_NESTED)?;
          48  +
            ser.write_struct(&HTTPPAYLOADWITHUNIONINPUT_MEMBER_NESTED, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl HttpPayloadWithUnionInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHUNIONINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPPAYLOADWITHUNIONINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69         -
                    builder.nested = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          70  +
                    builder.nested = Some(crate::types::UnionPayload::deserialize(deser)?);
   73     71   
                }
   74     72   
                _ => {}
   75     73   
            }
   76     74   
            Ok(())
   77     75   
        })?;
   78     76   
        builder
   79     77   
            .build()
   80     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   81     79   
    }
   82     80   
}
          81  +
impl HttpPayloadWithUnionInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          83  +
    /// Header-bound members are read directly from headers, avoiding runtime
          84  +
    /// member iteration overhead. Body members are read via the deserializer.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        #[allow(unused_variables, unused_mut)]
          92  +
        let mut builder = Self::builder();
          93  +
        if !body.is_empty() {
          94  +
            builder.nested = Some(crate::types::UnionPayload::deserialize(deserializer)?);
          95  +
        }
          96  +
        builder
          97  +
            .build()
          98  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          99  +
    }
         100  +
}
   83    101   
impl HttpPayloadWithUnionInput {
   84    102   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithUnionInput`](crate::operation::http_payload_with_union::HttpPayloadWithUnionInput).
   85    103   
    pub fn builder() -> crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder {
   86    104   
        crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder::default()
   87    105   
    }
   88    106   
}
   89    107   
   90    108   
/// A builder for [`HttpPayloadWithUnionInput`](crate::operation::http_payload_with_union::HttpPayloadWithUnionInput).
   91    109   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   92    110   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_union/_http_payload_with_union_output.rs

@@ -17,17 +110,125 @@
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHUNIONOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithUnionOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.nested {
   47         -
            ser.write_null(&HTTPPAYLOADWITHUNIONOUTPUT_MEMBER_NESTED)?;
          47  +
            ser.write_struct(&HTTPPAYLOADWITHUNIONOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpPayloadWithUnionOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHUNIONOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPPAYLOADWITHUNIONOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69         -
                    builder.nested = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          69  +
                    builder.nested = Some(crate::types::UnionPayload::deserialize(deser)?);
   73     70   
                }
   74     71   
                _ => {}
   75     72   
            }
   76     73   
            Ok(())
   77     74   
        })?;
   78     75   
        Ok(builder.build())
   79     76   
    }
   80     77   
}
          78  +
impl HttpPayloadWithUnionOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            builder.nested = Some(crate::types::UnionPayload::deserialize(deserializer)?);
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   81     96   
impl HttpPayloadWithUnionOutput {
   82     97   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithUnionOutput`](crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput).
   83     98   
    pub fn builder() -> crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionOutputBuilder {
   84     99   
        crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionOutputBuilder::default()
   85    100   
    }
   86    101   
}
   87    102   
   88    103   
/// A builder for [`HttpPayloadWithUnionOutput`](crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput).
   89    104   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    105   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_name.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_name/_http_payload_with_xml_name_input.rs

@@ -5,5 +109,130 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload();
   31     31   
static HTTPPAYLOADWITHXMLNAMEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPPAYLOADWITHXMLNAMEINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPPAYLOADWITHXMLNAMEINPUT_MEMBER_NESTED],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/HttpPayloadWithXmlName", None));
   36     37   
impl HttpPayloadWithXmlNameInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHXMLNAMEINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithXmlNameInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.nested {
   47     48   
            ser.write_struct(&HTTPPAYLOADWITHXMLNAMEINPUT_MEMBER_NESTED, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl HttpPayloadWithXmlNameInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMEINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMEINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deser)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
   75     76   
        builder
   76     77   
            .build()
   77     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     79   
    }
   79     80   
}
          81  +
impl HttpPayloadWithXmlNameInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          83  +
    /// Header-bound members are read directly from headers, avoiding runtime
          84  +
    /// member iteration overhead. Body members are read via the deserializer.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        #[allow(unused_variables, unused_mut)]
          92  +
        let mut builder = Self::builder();
          93  +
        if !body.is_empty() {
          94  +
            builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deserializer)?);
          95  +
        }
          96  +
        builder
          97  +
            .build()
          98  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          99  +
    }
         100  +
}
   80    101   
impl HttpPayloadWithXmlNameInput {
   81    102   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithXmlNameInput`](crate::operation::http_payload_with_xml_name::HttpPayloadWithXmlNameInput).
   82    103   
    pub fn builder() -> crate::operation::http_payload_with_xml_name::builders::HttpPayloadWithXmlNameInputBuilder {
   83    104   
        crate::operation::http_payload_with_xml_name::builders::HttpPayloadWithXmlNameInputBuilder::default()
   84    105   
    }
   85    106   
}
   86    107   
   87    108   
/// A builder for [`HttpPayloadWithXmlNameInput`](crate::operation::http_payload_with_xml_name::HttpPayloadWithXmlNameInput).
   88    109   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    110   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_name/_http_payload_with_xml_name_output.rs

@@ -24,24 +107,125 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.nested {
   47     47   
            ser.write_struct(&HTTPPAYLOADWITHXMLNAMEOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpPayloadWithXmlNameOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMEOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMEOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpPayloadWithXmlNameOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            builder.nested = Some(crate::types::PayloadWithXmlName::deserialize(deserializer)?);
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl HttpPayloadWithXmlNameOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithXmlNameOutput`](crate::operation::http_payload_with_xml_name::HttpPayloadWithXmlNameOutput).
   80     98   
    pub fn builder() -> crate::operation::http_payload_with_xml_name::builders::HttpPayloadWithXmlNameOutputBuilder {
   81     99   
        crate::operation::http_payload_with_xml_name::builders::HttpPayloadWithXmlNameOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`HttpPayloadWithXmlNameOutput`](crate::operation::http_payload_with_xml_name::HttpPayloadWithXmlNameOutput).
   86    104   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    105   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace.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 `HttpPayloadWithXmlNamespace`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPayloadWithXmlNamespace;
    6      6   
impl HttpPayloadWithXmlNamespace {
    7      7   
    /// Creates a new `HttpPayloadWithXmlNamespace`
    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::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput::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::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceError,
  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 HttpPayloadWithXmlNamespaceResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithXmlNamespaceResponseDeserializer {
  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_http_payload_with_xml_namespace::de_http_payload_with_xml_namespace_http_error(status, headers, body)
  152    159   
        } else {
@@ -295,302 +355,366 @@
  315    322   
            .expect("the config must have a deserializer");
  316    323   
  317    324   
        let parsed = de.deserialize_streaming(&mut http_response);
  318    325   
        let parsed = parsed.unwrap_or_else(|| {
  319    326   
            let http_response = http_response.map(|body| {
  320    327   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  321    328   
                    body.bytes().unwrap(),
  322    329   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  323    330   
                )))
  324    331   
            });
  325         -
            de.deserialize_nonstreaming(&http_response)
         332  +
            // Build a config bag with the protocol for schema-based deserialization
         333  +
            #[allow(unused_mut)]
         334  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         335  +
         336  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  326    337   
        });
  327    338   
        let parsed = parsed
  328    339   
            .expect("should be successful response")
  329    340   
            .downcast::<crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput>()
  330    341   
            .unwrap();
  331    342   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  332    343   
    }
  333    344   
}
  334    345   
  335    346   
/// Error type for the `HttpPayloadWithXmlNamespaceError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace/_http_payload_with_xml_namespace_input.rs

@@ -5,5 +109,130 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload();
   31     31   
static HTTPPAYLOADWITHXMLNAMESPACEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPPAYLOADWITHXMLNAMESPACEINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPPAYLOADWITHXMLNAMESPACEINPUT_MEMBER_NESTED],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/HttpPayloadWithXmlNamespace", None));
   36     37   
impl HttpPayloadWithXmlNamespaceInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADWITHXMLNAMESPACEINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadWithXmlNamespaceInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.nested {
   47     48   
            ser.write_struct(&HTTPPAYLOADWITHXMLNAMESPACEINPUT_MEMBER_NESTED, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl HttpPayloadWithXmlNamespaceInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMESPACEINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMESPACEINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.nested = Some(crate::types::PayloadWithXmlNamespace::deserialize(deser)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
   75     76   
        builder
   76     77   
            .build()
   77     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     79   
    }
   79     80   
}
          81  +
impl HttpPayloadWithXmlNamespaceInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          83  +
    /// Header-bound members are read directly from headers, avoiding runtime
          84  +
    /// member iteration overhead. Body members are read via the deserializer.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        #[allow(unused_variables, unused_mut)]
          92  +
        let mut builder = Self::builder();
          93  +
        if !body.is_empty() {
          94  +
            builder.nested = Some(crate::types::PayloadWithXmlNamespace::deserialize(deserializer)?);
          95  +
        }
          96  +
        builder
          97  +
            .build()
          98  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          99  +
    }
         100  +
}
   80    101   
impl HttpPayloadWithXmlNamespaceInput {
   81    102   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithXmlNamespaceInput`](crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput).
   82    103   
    pub fn builder() -> crate::operation::http_payload_with_xml_namespace::builders::HttpPayloadWithXmlNamespaceInputBuilder {
   83    104   
        crate::operation::http_payload_with_xml_namespace::builders::HttpPayloadWithXmlNamespaceInputBuilder::default()
   84    105   
    }
   85    106   
}
   86    107   
   87    108   
/// A builder for [`HttpPayloadWithXmlNamespaceInput`](crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceInput).
   88    109   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    110   
#[non_exhaustive]