Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

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]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace/_http_payload_with_xml_namespace_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(&HTTPPAYLOADWITHXMLNAMESPACEOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpPayloadWithXmlNamespaceOutput {
   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(&HTTPPAYLOADWITHXMLNAMESPACEOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMESPACEOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.nested = Some(crate::types::PayloadWithXmlNamespace::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpPayloadWithXmlNamespaceOutput {
          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::PayloadWithXmlNamespace::deserialize(deserializer)?);
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl HttpPayloadWithXmlNamespaceOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithXmlNamespaceOutput`](crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput).
   80     98   
    pub fn builder() -> crate::operation::http_payload_with_xml_namespace::builders::HttpPayloadWithXmlNamespaceOutputBuilder {
   81     99   
        crate::operation::http_payload_with_xml_namespace::builders::HttpPayloadWithXmlNamespaceOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`HttpPayloadWithXmlNamespaceOutput`](crate::operation::http_payload_with_xml_namespace::HttpPayloadWithXmlNamespaceOutput).
   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_and_prefix.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 `HttpPayloadWithXmlNamespaceAndPrefix`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPayloadWithXmlNamespaceAndPrefix;
    6      6   
impl HttpPayloadWithXmlNamespaceAndPrefix {
    7      7   
    /// Creates a new `HttpPayloadWithXmlNamespaceAndPrefix`
    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_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixInput::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_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixOutput::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_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_payload_with_xml_namespace_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_payload_with_xml_namespace_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixError,
   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_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixError,
  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 HttpPayloadWithXmlNamespaceAndPrefixResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithXmlNamespaceAndPrefixResponseDeserializer {
  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_and_prefix::de_http_payload_with_xml_namespace_and_prefix_http_error(
  152    159   
                status, headers, body,
@@ -299,306 +359,370 @@
  319    326   
            .expect("the config must have a deserializer");
  320    327   
  321    328   
        let parsed = de.deserialize_streaming(&mut http_response);
  322    329   
        let parsed = parsed.unwrap_or_else(|| {
  323    330   
            let http_response = http_response.map(|body| {
  324    331   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  325    332   
                    body.bytes().unwrap(),
  326    333   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  327    334   
                )))
  328    335   
            });
  329         -
            de.deserialize_nonstreaming(&http_response)
         336  +
            // Build a config bag with the protocol for schema-based deserialization
         337  +
            #[allow(unused_mut)]
         338  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         339  +
         340  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  330    341   
        });
  331    342   
        let parsed = parsed
  332    343   
            .expect("should be successful response")
  333    344   
            .downcast::<crate::operation::http_payload_with_xml_namespace_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixOutput>()
  334    345   
            .unwrap();
  335    346   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  336    347   
    }
  337    348   
}
  338    349   
  339    350   
/// Error type for the `HttpPayloadWithXmlNamespaceAndPrefixError` operation.

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace_and_prefix/_http_payload_with_xml_namespace_and_prefix_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(&HTTPPAYLOADWITHXMLNAMESPACEANDPREFIXOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpPayloadWithXmlNamespaceAndPrefixOutput {
   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(&HTTPPAYLOADWITHXMLNAMESPACEANDPREFIXOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPPAYLOADWITHXMLNAMESPACEANDPREFIXOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.nested = Some(crate::types::PayloadWithXmlNamespaceAndPrefix::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpPayloadWithXmlNamespaceAndPrefixOutput {
          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::PayloadWithXmlNamespaceAndPrefix::deserialize(deserializer)?);
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl HttpPayloadWithXmlNamespaceAndPrefixOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`HttpPayloadWithXmlNamespaceAndPrefixOutput`](crate::operation::http_payload_with_xml_namespace_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixOutput).
   80     98   
    pub fn builder() -> crate::operation::http_payload_with_xml_namespace_and_prefix::builders::HttpPayloadWithXmlNamespaceAndPrefixOutputBuilder {
   81     99   
        crate::operation::http_payload_with_xml_namespace_and_prefix::builders::HttpPayloadWithXmlNamespaceAndPrefixOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`HttpPayloadWithXmlNamespaceAndPrefixOutput`](crate::operation::http_payload_with_xml_namespace_and_prefix::HttpPayloadWithXmlNamespaceAndPrefixOutput).
   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_prefix_headers.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 `HttpPrefixHeaders`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPrefixHeaders;
    6      6   
impl HttpPrefixHeaders {
    7      7   
    /// Creates a new `HttpPrefixHeaders`
    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_prefix_headers::HttpPrefixHeadersInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_prefix_headers::HttpPrefixHeadersOutput::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_prefix_headers::HttpPrefixHeadersInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_prefix_headers::HttpPrefixHeadersOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_prefix_headers::HttpPrefixHeadersError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::http_prefix_headers::HttpPrefixHeadersError,
  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 HttpPrefixHeadersResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPrefixHeadersResponseDeserializer {
  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_prefix_headers::de_http_prefix_headers_http_error(status, headers, body)
  152    157   
        } else {
@@ -356,361 +460,473 @@
  376    381   
            .expect("the config must have a deserializer");
  377    382   
  378    383   
        let parsed = de.deserialize_streaming(&mut http_response);
  379    384   
        let parsed = parsed.unwrap_or_else(|| {
  380    385   
            let http_response = http_response.map(|body| {
  381    386   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  382    387   
                    body.bytes().unwrap(),
  383    388   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  384    389   
                )))
  385    390   
            });
  386         -
            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)
  387    396   
        });
  388    397   
        let parsed = parsed
  389    398   
            .expect("should be successful response")
  390    399   
            .downcast::<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput>()
  391    400   
            .unwrap();
  392    401   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  393    402   
        ::pretty_assertions::assert_eq!(parsed.foo_map, expected_output.foo_map, "Unexpected value for `foo_map`");
  394    403   
    }
  395    404   
  396    405   
    /// No prefix headers are serialized because the value is empty
  397    406   
    /// Test ID: HttpPrefixHeadersAreNotPresent
  398    407   
    #[::tokio::test]
  399    408   
    #[::tracing_test::traced_test]
  400    409   
    async fn http_prefix_headers_are_not_present_response() {
  401    410   
        let expected_output = crate::operation::http_prefix_headers::HttpPrefixHeadersOutput::builder()
  402    411   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  403    412   
            .set_foo_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  404    413   
            .build();
  405    414   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  406    415   
            ::http_1x::response::Builder::new()
  407    416   
                .header("x-foo", "Foo")
  408    417   
                .status(200)
  409    418   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  410    419   
                .unwrap(),
  411    420   
        )
  412    421   
        .unwrap();
  413    422   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  414    423   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  415    424   
  416    425   
        let op = crate::operation::http_prefix_headers::HttpPrefixHeaders::new();
  417    426   
        let config = op.config().expect("the operation has config");
  418    427   
        let de = config
  419    428   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  420    429   
            .expect("the config must have a deserializer");
  421    430   
  422    431   
        let parsed = de.deserialize_streaming(&mut http_response);
  423    432   
        let parsed = parsed.unwrap_or_else(|| {
  424    433   
            let http_response = http_response.map(|body| {
  425    434   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  426    435   
                    body.bytes().unwrap(),
  427    436   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  428    437   
                )))
  429    438   
            });
  430         -
            de.deserialize_nonstreaming(&http_response)
         439  +
            // Build a config bag with the protocol for schema-based deserialization
         440  +
            #[allow(unused_mut)]
         441  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         442  +
         443  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  431    444   
        });
  432    445   
        let parsed = parsed
  433    446   
            .expect("should be successful response")
  434    447   
            .downcast::<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput>()
  435    448   
            .unwrap();
  436    449   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  437    450   
        ::pretty_assertions::assert_eq!(parsed.foo_map, expected_output.foo_map, "Unexpected value for `foo_map`");
  438    451   
    }
  439    452   
}
  440    453   

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

@@ -14,14 +151,173 @@
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-foo");
   37     37   
static HTTPPREFIXHEADERSINPUT_MEMBER_FOO_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restxml.synthetic#HttpPrefixHeadersInput$fooMap",
   40     40   
        "aws.protocoltests.restxml.synthetic",
   41     41   
        "HttpPrefixHeadersInput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Map,
   44         -
    "foo_map",
          44  +
    "fooMap",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_prefix_headers("x-foo-");
   48     48   
static HTTPPREFIXHEADERSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPPREFIXHEADERSINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&HTTPPREFIXHEADERSINPUT_MEMBER_FOO, &HTTPPREFIXHEADERSINPUT_MEMBER_FOO_MAP],
   52         -
);
          52  +
)
          53  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/HttpPrefixHeaders", None));
   53     54   
impl HttpPrefixHeadersInput {
   54     55   
    /// The schema for this shape.
   55     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPREFIXHEADERSINPUT_SCHEMA;
   56     57   
}
   57     58   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPrefixHeadersInput {
   58     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     60   
    fn serialize_members(
   60     61   
        &self,
   61     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     64   
        if let Some(ref val) = self.foo {
   64     65   
            ser.write_string(&HTTPPREFIXHEADERSINPUT_MEMBER_FOO, val)?;
   65     66   
        }
   66     67   
        if let Some(ref val) = self.foo_map {
   67     68   
            ser.write_map(
   68     69   
                &HTTPPREFIXHEADERSINPUT_MEMBER_FOO_MAP,
   69     70   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     71   
                    for (key, value) in val {
   71     72   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   72     73   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   73     74   
                    }
   74     75   
                    Ok(())
   75     76   
                },
   76     77   
            )?;
   77     78   
        }
   78     79   
        Ok(())
   79     80   
    }
   80     81   
}
   81     82   
impl HttpPrefixHeadersInput {
   82     83   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   83         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   84         -
        deserializer: &mut D,
          84  +
    pub fn deserialize(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   85     86   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   86     87   
        #[allow(unused_variables, unused_mut)]
   87     88   
        let mut builder = Self::builder();
   88     89   
        #[allow(
   89     90   
            unused_variables,
   90     91   
            unreachable_code,
   91     92   
            clippy::single_match,
   92     93   
            clippy::match_single_binding,
   93     94   
            clippy::diverging_sub_expression
   94     95   
        )]
   95         -
        deserializer.read_struct(&HTTPPREFIXHEADERSINPUT_SCHEMA, (), |_, member, deser| {
          96  +
        deserializer.read_struct(&HTTPPREFIXHEADERSINPUT_SCHEMA, &mut |member, deser| {
   96     97   
            match member.member_index() {
   97     98   
                Some(0) => {
   98     99   
                    builder.foo = Some(deser.read_string(member)?);
   99    100   
                }
  100    101   
                Some(1) => {
  101         -
                    builder.foo_map = Some({
  102         -
                        let container = if let Some(cap) = deser.container_size() {
  103         -
                            std::collections::HashMap::with_capacity(cap)
  104         -
                        } else {
  105         -
                            std::collections::HashMap::new()
  106         -
                        };
  107         -
                        deser.read_map(member, container, |mut map, key, deser| {
  108         -
                            map.insert(key, deser.read_string(member)?);
  109         -
                            Ok(map)
  110         -
                        })?
  111         -
                    });
         102  +
                    builder.foo_map = Some(deser.read_string_string_map(member)?);
  112    103   
                }
  113    104   
                _ => {}
  114    105   
            }
  115    106   
            Ok(())
  116    107   
        })?;
  117    108   
        builder
  118    109   
            .build()
  119    110   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  120    111   
    }
  121    112   
}
         113  +
impl HttpPrefixHeadersInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         115  +
    /// Header-bound members are read directly from headers, avoiding runtime
         116  +
    /// member iteration overhead. Body members are read via the deserializer.
         117  +
    pub fn deserialize_with_response(
         118  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         119  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         120  +
        _status: u16,
         121  +
        _body: &[u8],
         122  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         123  +
        #[allow(unused_variables, unused_mut)]
         124  +
        let mut builder = Self::builder();
         125  +
        if let Some(val) = headers.get("x-foo") {
         126  +
            builder.foo = Some(val.to_string());
         127  +
        }
         128  +
        {
         129  +
            let mut map = ::std::collections::HashMap::new();
         130  +
            for (key, val) in headers.iter() {
         131  +
                if let Some(suffix) = key.strip_prefix("x-foo-") {
         132  +
                    map.insert(suffix.to_string(), val.to_string());
         133  +
                }
         134  +
            }
         135  +
            if !map.is_empty() {
         136  +
                builder.foo_map = Some(map);
         137  +
            }
         138  +
        }
         139  +
        builder
         140  +
            .build()
         141  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         142  +
    }
         143  +
}
  122    144   
impl HttpPrefixHeadersInput {
  123    145   
    /// Creates a new builder-style object to manufacture [`HttpPrefixHeadersInput`](crate::operation::http_prefix_headers::HttpPrefixHeadersInput).
  124    146   
    pub fn builder() -> crate::operation::http_prefix_headers::builders::HttpPrefixHeadersInputBuilder {
  125    147   
        crate::operation::http_prefix_headers::builders::HttpPrefixHeadersInputBuilder::default()
  126    148   
    }
  127    149   
}
  128    150   
  129    151   
/// A builder for [`HttpPrefixHeadersInput`](crate::operation::http_prefix_headers::HttpPrefixHeadersInput).
  130    152   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  131    153   
#[non_exhaustive]

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

@@ -14,14 +149,168 @@
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-foo");
   37     37   
static HTTPPREFIXHEADERSOUTPUT_MEMBER_FOO_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restxml.synthetic#HttpPrefixHeadersOutput$fooMap",
   40     40   
        "aws.protocoltests.restxml.synthetic",
   41     41   
        "HttpPrefixHeadersOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Map,
   44         -
    "foo_map",
          44  +
    "fooMap",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_prefix_headers("x-foo-");
   48     48   
static HTTPPREFIXHEADERSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPPREFIXHEADERSOUTPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&HTTPPREFIXHEADERSOUTPUT_MEMBER_FOO, &HTTPPREFIXHEADERSOUTPUT_MEMBER_FOO_MAP],
   52     52   
);
   53     53   
impl HttpPrefixHeadersOutput {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPREFIXHEADERSOUTPUT_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpPrefixHeadersOutput {
   58     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     59   
    fn serialize_members(
   60     60   
        &self,
   61     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     63   
        if let Some(ref val) = self.foo {
   64     64   
            ser.write_string(&HTTPPREFIXHEADERSOUTPUT_MEMBER_FOO, val)?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.foo_map {
   67     67   
            ser.write_map(
   68     68   
                &HTTPPREFIXHEADERSOUTPUT_MEMBER_FOO_MAP,
   69     69   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     70   
                    for (key, value) in val {
   71     71   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   72     72   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   73     73   
                    }
   74     74   
                    Ok(())
   75     75   
                },
   76     76   
            )?;
   77     77   
        }
   78     78   
        Ok(())
   79     79   
    }
   80     80   
}
   81     81   
impl HttpPrefixHeadersOutput {
   82     82   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   83         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   84         -
        deserializer: &mut D,
          83  +
    pub fn deserialize(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   85     85   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   86     86   
        #[allow(unused_variables, unused_mut)]
   87     87   
        let mut builder = Self::builder();
   88     88   
        #[allow(
   89     89   
            unused_variables,
   90     90   
            unreachable_code,
   91     91   
            clippy::single_match,
   92     92   
            clippy::match_single_binding,
   93     93   
            clippy::diverging_sub_expression
   94     94   
        )]
   95         -
        deserializer.read_struct(&HTTPPREFIXHEADERSOUTPUT_SCHEMA, (), |_, member, deser| {
          95  +
        deserializer.read_struct(&HTTPPREFIXHEADERSOUTPUT_SCHEMA, &mut |member, deser| {
   96     96   
            match member.member_index() {
   97     97   
                Some(0) => {
   98     98   
                    builder.foo = Some(deser.read_string(member)?);
   99     99   
                }
  100    100   
                Some(1) => {
  101         -
                    builder.foo_map = Some({
  102         -
                        let container = if let Some(cap) = deser.container_size() {
  103         -
                            std::collections::HashMap::with_capacity(cap)
  104         -
                        } else {
  105         -
                            std::collections::HashMap::new()
  106         -
                        };
  107         -
                        deser.read_map(member, container, |mut map, key, deser| {
  108         -
                            map.insert(key, deser.read_string(member)?);
  109         -
                            Ok(map)
  110         -
                        })?
  111         -
                    });
         101  +
                    builder.foo_map = Some(deser.read_string_string_map(member)?);
  112    102   
                }
  113    103   
                _ => {}
  114    104   
            }
  115    105   
            Ok(())
  116    106   
        })?;
  117    107   
        Ok(builder.build())
  118    108   
    }
  119    109   
}
         110  +
impl HttpPrefixHeadersOutput {
         111  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         112  +
    /// Header-bound members are read directly from headers, avoiding runtime
         113  +
    /// member iteration overhead. Body members are read via the deserializer.
         114  +
    pub fn deserialize_with_response(
         115  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         116  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         117  +
        _status: u16,
         118  +
        _body: &[u8],
         119  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         120  +
        #[allow(unused_variables, unused_mut)]
         121  +
        let mut builder = Self::builder();
         122  +
        if let Some(val) = headers.get("x-foo") {
         123  +
            builder.foo = Some(val.to_string());
         124  +
        }
         125  +
        {
         126  +
            let mut map = ::std::collections::HashMap::new();
         127  +
            for (key, val) in headers.iter() {
         128  +
                if let Some(suffix) = key.strip_prefix("x-foo-") {
         129  +
                    map.insert(suffix.to_string(), val.to_string());
         130  +
                }
         131  +
            }
         132  +
            if !map.is_empty() {
         133  +
                builder.foo_map = Some(map);
         134  +
            }
         135  +
        }
         136  +
        Ok(builder.build())
         137  +
    }
         138  +
}
  120    139   
impl HttpPrefixHeadersOutput {
  121    140   
    /// Creates a new builder-style object to manufacture [`HttpPrefixHeadersOutput`](crate::operation::http_prefix_headers::HttpPrefixHeadersOutput).
  122    141   
    pub fn builder() -> crate::operation::http_prefix_headers::builders::HttpPrefixHeadersOutputBuilder {
  123    142   
        crate::operation::http_prefix_headers::builders::HttpPrefixHeadersOutputBuilder::default()
  124    143   
    }
  125    144   
}
  126    145   
  127    146   
/// A builder for [`HttpPrefixHeadersOutput`](crate::operation::http_prefix_headers::HttpPrefixHeadersOutput).
  128    147   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  129    148   
#[non_exhaustive]