Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member/_required_member_input.rs

@@ -1,1 +108,121 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "RequiredMemberInput",
   19     19   
);
   20     20   
static REQUIREDMEMBERINPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#RequiredMemberInput$requiredString",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "RequiredMemberInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "required_string",
          27  +
    "requiredString",
   28     28   
    0,
   29     29   
);
   30     30   
static REQUIREDMEMBERINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    REQUIREDMEMBERINPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&REQUIREDMEMBERINPUT_MEMBER_REQUIRED_STRING],
   34         -
);
          34  +
)
          35  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/required-member", None));
   35     36   
impl RequiredMemberInput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDMEMBERINPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for RequiredMemberInput {
   40     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     42   
    fn serialize_members(
   42     43   
        &self,
   43     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     46   
        if let Some(ref val) = self.required_string {
   46     47   
            ser.write_string(&REQUIREDMEMBERINPUT_MEMBER_REQUIRED_STRING, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl RequiredMemberInput {
   52     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     57   
        #[allow(unused_variables, unused_mut)]
   57     58   
        let mut builder = Self::builder();
   58     59   
        #[allow(
   59     60   
            unused_variables,
   60     61   
            unreachable_code,
   61     62   
            clippy::single_match,
   62     63   
            clippy::match_single_binding,
   63     64   
            clippy::diverging_sub_expression
   64     65   
        )]
   65         -
        deserializer.read_struct(&REQUIREDMEMBERINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&REQUIREDMEMBERINPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.required_string = Some(deser.read_string(member)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
          75  +
        builder.required_string = builder.required_string.or(Some(String::new()));
   74     76   
        builder
   75     77   
            .build()
   76     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     79   
    }
   78     80   
}
          81  +
impl RequiredMemberInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          83  +
    pub fn deserialize_with_response(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        _body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        Self::deserialize(deserializer)
          90  +
    }
          91  +
}
   79     92   
impl RequiredMemberInput {
   80     93   
    /// Creates a new builder-style object to manufacture [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
   81     94   
    pub fn builder() -> crate::operation::required_member::builders::RequiredMemberInputBuilder {
   82     95   
        crate::operation::required_member::builders::RequiredMemberInputBuilder::default()
   83     96   
    }
   84     97   
}
   85     98   
   86     99   
/// A builder for [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
   87    100   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    101   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member/_required_member_output.rs

@@ -1,1 +110,122 @@
   18     18   
    "aws.protocoltests.restxml.synthetic",
   19     19   
    "RequiredMemberOutput",
   20     20   
);
   21     21   
static REQUIREDMEMBEROUTPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   22     22   
    ::aws_smithy_schema::ShapeId::from_static(
   23     23   
        "aws.protocoltests.restxml.synthetic#RequiredMemberOutput$requiredString",
   24     24   
        "aws.protocoltests.restxml.synthetic",
   25     25   
        "RequiredMemberOutput",
   26     26   
    ),
   27     27   
    ::aws_smithy_schema::ShapeType::String,
   28         -
    "required_string",
          28  +
    "requiredString",
   29     29   
    0,
   30     30   
);
   31     31   
static REQUIREDMEMBEROUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    REQUIREDMEMBEROUTPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&REQUIREDMEMBEROUTPUT_MEMBER_REQUIRED_STRING],
   35     35   
);
   36     36   
impl RequiredMemberOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDMEMBEROUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for RequiredMemberOutput {
   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   
        {
   47     47   
            let val = &self.required_string;
   48     48   
            ser.write_string(&REQUIREDMEMBEROUTPUT_MEMBER_REQUIRED_STRING, val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl RequiredMemberOutput {
   54     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     58   
        #[allow(unused_variables, unused_mut)]
   59     59   
        let mut builder = Self::builder();
   60     60   
        #[allow(
   61     61   
            unused_variables,
   62     62   
            unreachable_code,
   63     63   
            clippy::single_match,
   64     64   
            clippy::match_single_binding,
   65     65   
            clippy::diverging_sub_expression
   66     66   
        )]
   67         -
        deserializer.read_struct(&REQUIREDMEMBEROUTPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&REQUIREDMEMBEROUTPUT_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.required_string = Some(deser.read_string(member)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
          76  +
        builder.required_string = builder.required_string.or(Some(String::new()));
   76     77   
        builder
   77     78   
            .build()
   78     79   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     80   
    }
   80     81   
}
          82  +
impl RequiredMemberOutput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          84  +
    pub fn deserialize_with_response(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          87  +
        _status: u16,
          88  +
        _body: &[u8],
          89  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          90  +
        Self::deserialize(deserializer)
          91  +
    }
          92  +
}
   81     93   
impl RequiredMemberOutput {
   82     94   
    /// Creates a new builder-style object to manufacture [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
   83     95   
    pub fn builder() -> crate::operation::required_member::builders::RequiredMemberOutputBuilder {
   84     96   
        crate::operation::required_member::builders::RequiredMemberOutputBuilder::default()
   85     97   
    }
   86     98   
}
   87     99   
   88    100   
/// A builder for [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
   89    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    102   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/string_header.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 `StringHeader`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StringHeader;
    6      6   
impl StringHeader {
    7      7   
    /// Creates a new `StringHeader`
    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::string_header::StringHeaderInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::string_header::StringHeaderOutput::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::string_header::StringHeaderInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::string_header::StringHeaderOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::string_header::StringHeaderError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::string_header::StringHeaderError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct StringHeaderResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StringHeaderResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_string_header::de_string_header_http_error(status, headers, body)
  146    151   
        } else {
@@ -240,245 +300,309 @@
  260    265   
            .expect("the config must have a deserializer");
  261    266   
  262    267   
        let parsed = de.deserialize_streaming(&mut http_response);
  263    268   
        let parsed = parsed.unwrap_or_else(|| {
  264    269   
            let http_response = http_response.map(|body| {
  265    270   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  266    271   
                    body.bytes().unwrap(),
  267    272   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  268    273   
                )))
  269    274   
            });
  270         -
            de.deserialize_nonstreaming(&http_response)
         275  +
            // Build a config bag with the protocol for schema-based deserialization
         276  +
            #[allow(unused_mut)]
         277  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         278  +
         279  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  271    280   
        });
  272    281   
        let parsed = parsed
  273    282   
            .expect("should be successful response")
  274    283   
            .downcast::<crate::operation::string_header::StringHeaderOutput>()
  275    284   
            .unwrap();
  276    285   
        ::pretty_assertions::assert_eq!(parsed.field, expected_output.field, "Unexpected value for `field`");
  277    286   
        ::pretty_assertions::assert_eq!(parsed.enum_header, expected_output.enum_header, "Unexpected value for `enum_header`");
  278    287   
    }
  279    288   
}
  280    289   

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/string_header/_string_header_input.rs

@@ -1,1 +69,83 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct StringHeaderInput {}
    6      6   
static STRINGHEADERINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.restxml.synthetic#StringHeaderInput",
    8      8   
    "aws.protocoltests.restxml.synthetic",
    9      9   
    "StringHeaderInput",
   10     10   
);
   11     11   
static STRINGHEADERINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(STRINGHEADERINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(STRINGHEADERINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StringHeader", None));
   13     14   
impl StringHeaderInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STRINGHEADERINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for StringHeaderInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl StringHeaderInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&STRINGHEADERINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&STRINGHEADERINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl StringHeaderInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl StringHeaderInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`StringHeaderInput`](crate::operation::string_header::StringHeaderInput).
   53     67   
    pub fn builder() -> crate::operation::string_header::builders::StringHeaderInputBuilder {
   54     68   
        crate::operation::string_header::builders::StringHeaderInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`StringHeaderInput`](crate::operation::string_header::StringHeaderInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/string_header/_string_header_output.rs

@@ -14,14 +130,151 @@
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-field");
   37     37   
static STRINGHEADEROUTPUT_MEMBER_ENUM_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restxml.synthetic#StringHeaderOutput$enumHeader",
   40     40   
        "aws.protocoltests.restxml.synthetic",
   41     41   
        "StringHeaderOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::String,
   44         -
    "enum_header",
          44  +
    "enumHeader",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_header("x-enum");
   48     48   
static STRINGHEADEROUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    STRINGHEADEROUTPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&STRINGHEADEROUTPUT_MEMBER_FIELD, &STRINGHEADEROUTPUT_MEMBER_ENUM_HEADER],
   52     52   
);
   53     53   
impl StringHeaderOutput {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STRINGHEADEROUTPUT_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for StringHeaderOutput {
   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.field {
   64     64   
            ser.write_string(&STRINGHEADEROUTPUT_MEMBER_FIELD, val)?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.enum_header {
   67     67   
            ser.write_string(&STRINGHEADEROUTPUT_MEMBER_ENUM_HEADER, val.as_str())?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl StringHeaderOutput {
   73     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   74         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   75         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   76     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   77     77   
        #[allow(unused_variables, unused_mut)]
   78     78   
        let mut builder = Self::builder();
   79     79   
        #[allow(
   80     80   
            unused_variables,
   81     81   
            unreachable_code,
   82     82   
            clippy::single_match,
   83     83   
            clippy::match_single_binding,
   84     84   
            clippy::diverging_sub_expression
   85     85   
        )]
   86         -
        deserializer.read_struct(&STRINGHEADEROUTPUT_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&STRINGHEADEROUTPUT_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.field = Some(deser.read_string(member)?);
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.enum_header = Some(crate::types::StringEnum::from(deser.read_string(member)?.as_str()));
   93     93   
                }
   94     94   
                _ => {}
   95     95   
            }
   96     96   
            Ok(())
   97     97   
        })?;
   98     98   
        Ok(builder.build())
   99     99   
    }
  100    100   
}
         101  +
impl StringHeaderOutput {
         102  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         103  +
    /// Header-bound members are read directly from headers, avoiding runtime
         104  +
    /// member iteration overhead. Body members are read via the deserializer.
         105  +
    pub fn deserialize_with_response(
         106  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         107  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         108  +
        _status: u16,
         109  +
        _body: &[u8],
         110  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         111  +
        #[allow(unused_variables, unused_mut)]
         112  +
        let mut builder = Self::builder();
         113  +
        if let Some(val) = headers.get("x-field") {
         114  +
            builder.field = Some(val.to_string());
         115  +
        }
         116  +
        if let Some(val) = headers.get("x-enum") {
         117  +
            builder.enum_header = Some(crate::types::StringEnum::from(val));
         118  +
        }
         119  +
        Ok(builder.build())
         120  +
    }
         121  +
}
  101    122   
impl StringHeaderOutput {
  102    123   
    /// Creates a new builder-style object to manufacture [`StringHeaderOutput`](crate::operation::string_header::StringHeaderOutput).
  103    124   
    pub fn builder() -> crate::operation::string_header::builders::StringHeaderOutputBuilder {
  104    125   
        crate::operation::string_header::builders::StringHeaderOutputBuilder::default()
  105    126   
    }
  106    127   
}
  107    128   
  108    129   
/// A builder for [`StringHeaderOutput`](crate::operation::string_header::StringHeaderOutput).
  109    130   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  110    131   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/xml_maps_flattened_nested_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 `XmlMapsFlattenedNestedXmlNamespace`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlMapsFlattenedNestedXmlNamespace;
    6      6   
impl XmlMapsFlattenedNestedXmlNamespace {
    7      7   
    /// Creates a new `XmlMapsFlattenedNestedXmlNamespace`
    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::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceOutput::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::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceError,
  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 XmlMapsFlattenedNestedXmlNamespaceResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlMapsFlattenedNestedXmlNamespaceResponseDeserializer {
  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_xml_maps_flattened_nested_xml_namespace::de_xml_maps_flattened_nested_xml_namespace_http_error(
  152    159   
                status, headers, body,
@@ -264,271 +324,335 @@
  284    291   
            .expect("the config must have a deserializer");
  285    292   
  286    293   
        let parsed = de.deserialize_streaming(&mut http_response);
  287    294   
        let parsed = parsed.unwrap_or_else(|| {
  288    295   
            let http_response = http_response.map(|body| {
  289    296   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  290    297   
                    body.bytes().unwrap(),
  291    298   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  292    299   
                )))
  293    300   
            });
  294         -
            de.deserialize_nonstreaming(&http_response)
         301  +
            // Build a config bag with the protocol for schema-based deserialization
         302  +
            #[allow(unused_mut)]
         303  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         304  +
         305  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  295    306   
        });
  296    307   
        let parsed = parsed
  297    308   
            .expect("should be successful response")
  298    309   
            .downcast::<crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceOutput>()
  299    310   
            .unwrap();
  300    311   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  301    312   
    }
  302    313   
}
  303    314   
  304    315   
/// Error type for the `XmlMapsFlattenedNestedXmlNamespaceError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/xml_maps_flattened_nested_xml_namespace/_xml_maps_flattened_nested_xml_namespace_input.rs

@@ -3,3 +136,167 @@
   23     23   
    "aws.protocoltests.restxml.synthetic",
   24     24   
    "XmlMapsFlattenedNestedXmlNamespaceInput",
   25     25   
);
   26     26   
static XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.restxml.synthetic#XmlMapsFlattenedNestedXmlNamespaceInput$myMap",
   29     29   
        "aws.protocoltests.restxml.synthetic",
   30     30   
        "XmlMapsFlattenedNestedXmlNamespaceInput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::Map,
   33         -
    "my_map",
          33  +
    "myMap",
   34     34   
    0,
   35     35   
)
   36     36   
.with_xml_namespace()
   37     37   
.with_xml_flattened();
   38     38   
static XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   39     39   
    XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_SCHEMA_ID,
   40     40   
    ::aws_smithy_schema::ShapeType::Structure,
   41     41   
    &[&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_MEMBER_MY_MAP],
   42     42   
)
   43         -
.with_xml_namespace();
          43  +
.with_xml_namespace()
          44  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          45  +
    "POST",
          46  +
    "/XmlMapsFlattenedNestedXmlNamespace",
          47  +
    None,
          48  +
));
   44     49   
impl XmlMapsFlattenedNestedXmlNamespaceInput {
   45     50   
    /// The schema for this shape.
   46     51   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_SCHEMA;
   47     52   
}
   48     53   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlMapsFlattenedNestedXmlNamespaceInput {
   49     54   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   50     55   
    fn serialize_members(
   51     56   
        &self,
   52     57   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   53     58   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   54     59   
        if let Some(ref val) = self.my_map {
   55     60   
            ser.write_map(
   56     61   
                &XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_MEMBER_MY_MAP,
   57     62   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   58     63   
                    for (key, value) in val {
   59     64   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   60         -
                        todo!("schema: unsupported map value type");
          65  +
          66  +
                        ser.write_map(
          67  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
          68  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          69  +
                                for (key, value) in value {
          70  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
          71  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
          72  +
                                }
          73  +
                                Ok(())
          74  +
                            },
          75  +
                        )?;
   61     76   
                    }
   62     77   
                    Ok(())
   63     78   
                },
   64     79   
            )?;
   65     80   
        }
   66     81   
        Ok(())
   67     82   
    }
   68     83   
}
   69     84   
impl XmlMapsFlattenedNestedXmlNamespaceInput {
   70     85   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   71         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   72         -
        deserializer: &mut D,
          86  +
    pub fn deserialize(
          87  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   73     88   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   74     89   
        #[allow(unused_variables, unused_mut)]
   75     90   
        let mut builder = Self::builder();
   76     91   
        #[allow(
   77     92   
            unused_variables,
   78     93   
            unreachable_code,
   79     94   
            clippy::single_match,
   80     95   
            clippy::match_single_binding,
   81     96   
            clippy::diverging_sub_expression
   82     97   
        )]
   83         -
        deserializer.read_struct(&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_SCHEMA, (), |_, member, deser| {
          98  +
        deserializer.read_struct(&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEINPUT_SCHEMA, &mut |member, deser| {
   84     99   
            match member.member_index() {
   85    100   
                Some(0) => {
   86    101   
                    builder.my_map = Some({
   87         -
                        let container = if let Some(cap) = deser.container_size() {
   88         -
                            std::collections::HashMap::with_capacity(cap)
   89         -
                        } else {
   90         -
                            std::collections::HashMap::new()
   91         -
                        };
   92         -
                        deser.read_map(member, container, |mut map, key, deser| {
   93         -
                            map.insert(key, todo!("deserialize nested aggregate"));
   94         -
                            Ok(map)
   95         -
                        })?
         102  +
                        let mut container = std::collections::HashMap::new();
         103  +
                        deser.read_map(member, &mut |key, deser| {
         104  +
                            container.insert(key, {
         105  +
                                let mut map = ::std::collections::HashMap::new();
         106  +
                                deser.read_map(member, &mut |key, deser| {
         107  +
                                    let value = deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?;
         108  +
                                    map.insert(key, value);
         109  +
                                    Ok(())
         110  +
                                })?;
         111  +
                                map
         112  +
                            });
         113  +
                            Ok(())
         114  +
                        })?;
         115  +
                        container
   96    116   
                    });
   97    117   
                }
   98    118   
                _ => {}
   99    119   
            }
  100    120   
            Ok(())
  101    121   
        })?;
  102    122   
        builder
  103    123   
            .build()
  104    124   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  105    125   
    }
  106    126   
}
         127  +
impl XmlMapsFlattenedNestedXmlNamespaceInput {
         128  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         129  +
    pub fn deserialize_with_response(
         130  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         131  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         132  +
        _status: u16,
         133  +
        _body: &[u8],
         134  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         135  +
        Self::deserialize(deserializer)
         136  +
    }
         137  +
}
  107    138   
impl XmlMapsFlattenedNestedXmlNamespaceInput {
  108    139   
    /// Creates a new builder-style object to manufacture [`XmlMapsFlattenedNestedXmlNamespaceInput`](crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput).
  109    140   
    pub fn builder() -> crate::operation::xml_maps_flattened_nested_xml_namespace::builders::XmlMapsFlattenedNestedXmlNamespaceInputBuilder {
  110    141   
        crate::operation::xml_maps_flattened_nested_xml_namespace::builders::XmlMapsFlattenedNestedXmlNamespaceInputBuilder::default()
  111    142   
    }
  112    143   
}
  113    144   
  114    145   
/// A builder for [`XmlMapsFlattenedNestedXmlNamespaceInput`](crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput).
  115    146   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  116    147   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/xml_maps_flattened_nested_xml_namespace/_xml_maps_flattened_nested_xml_namespace_output.rs

@@ -3,3 +134,160 @@
   23     23   
    "aws.protocoltests.restxml.synthetic",
   24     24   
    "XmlMapsFlattenedNestedXmlNamespaceOutput",
   25     25   
);
   26     26   
static XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.restxml.synthetic#XmlMapsFlattenedNestedXmlNamespaceOutput$myMap",
   29     29   
        "aws.protocoltests.restxml.synthetic",
   30     30   
        "XmlMapsFlattenedNestedXmlNamespaceOutput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::Map,
   33         -
    "my_map",
          33  +
    "myMap",
   34     34   
    0,
   35     35   
)
   36     36   
.with_xml_namespace()
   37     37   
.with_xml_flattened();
   38     38   
static XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   39     39   
    XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_SCHEMA_ID,
   40     40   
    ::aws_smithy_schema::ShapeType::Structure,
   41     41   
    &[&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_MEMBER_MY_MAP],
   42     42   
)
   43     43   
.with_xml_namespace();
   44     44   
impl XmlMapsFlattenedNestedXmlNamespaceOutput {
   45     45   
    /// The schema for this shape.
   46     46   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_SCHEMA;
   47     47   
}
   48     48   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlMapsFlattenedNestedXmlNamespaceOutput {
   49     49   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   50     50   
    fn serialize_members(
   51     51   
        &self,
   52     52   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   53     53   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   54     54   
        if let Some(ref val) = self.my_map {
   55     55   
            ser.write_map(
   56     56   
                &XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_MEMBER_MY_MAP,
   57     57   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   58     58   
                    for (key, value) in val {
   59     59   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   60         -
                        todo!("schema: unsupported map value type");
          60  +
          61  +
                        ser.write_map(
          62  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
          63  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          64  +
                                for (key, value) in value {
          65  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
          66  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
          67  +
                                }
          68  +
                                Ok(())
          69  +
                            },
          70  +
                        )?;
   61     71   
                    }
   62     72   
                    Ok(())
   63     73   
                },
   64     74   
            )?;
   65     75   
        }
   66     76   
        Ok(())
   67     77   
    }
   68     78   
}
   69     79   
impl XmlMapsFlattenedNestedXmlNamespaceOutput {
   70     80   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   71         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   72         -
        deserializer: &mut D,
          81  +
    pub fn deserialize(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   73     83   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   74     84   
        #[allow(unused_variables, unused_mut)]
   75     85   
        let mut builder = Self::builder();
   76     86   
        #[allow(
   77     87   
            unused_variables,
   78     88   
            unreachable_code,
   79     89   
            clippy::single_match,
   80     90   
            clippy::match_single_binding,
   81     91   
            clippy::diverging_sub_expression
   82     92   
        )]
   83         -
        deserializer.read_struct(&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_SCHEMA, (), |_, member, deser| {
          93  +
        deserializer.read_struct(&XMLMAPSFLATTENEDNESTEDXMLNAMESPACEOUTPUT_SCHEMA, &mut |member, deser| {
   84     94   
            match member.member_index() {
   85     95   
                Some(0) => {
   86     96   
                    builder.my_map = Some({
   87         -
                        let container = if let Some(cap) = deser.container_size() {
   88         -
                            std::collections::HashMap::with_capacity(cap)
   89         -
                        } else {
   90         -
                            std::collections::HashMap::new()
   91         -
                        };
   92         -
                        deser.read_map(member, container, |mut map, key, deser| {
   93         -
                            map.insert(key, todo!("deserialize nested aggregate"));
   94         -
                            Ok(map)
   95         -
                        })?
          97  +
                        let mut container = std::collections::HashMap::new();
          98  +
                        deser.read_map(member, &mut |key, deser| {
          99  +
                            container.insert(key, {
         100  +
                                let mut map = ::std::collections::HashMap::new();
         101  +
                                deser.read_map(member, &mut |key, deser| {
         102  +
                                    let value = deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?;
         103  +
                                    map.insert(key, value);
         104  +
                                    Ok(())
         105  +
                                })?;
         106  +
                                map
         107  +
                            });
         108  +
                            Ok(())
         109  +
                        })?;
         110  +
                        container
   96    111   
                    });
   97    112   
                }
   98    113   
                _ => {}
   99    114   
            }
  100    115   
            Ok(())
  101    116   
        })?;
  102    117   
        Ok(builder.build())
  103    118   
    }
  104    119   
}
         120  +
impl XmlMapsFlattenedNestedXmlNamespaceOutput {
         121  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         122  +
    pub fn deserialize_with_response(
         123  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         124  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         125  +
        _status: u16,
         126  +
        _body: &[u8],
         127  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         128  +
        Self::deserialize(deserializer)
         129  +
    }
         130  +
}
  105    131   
impl XmlMapsFlattenedNestedXmlNamespaceOutput {
  106    132   
    /// Creates a new builder-style object to manufacture [`XmlMapsFlattenedNestedXmlNamespaceOutput`](crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceOutput).
  107    133   
    pub fn builder() -> crate::operation::xml_maps_flattened_nested_xml_namespace::builders::XmlMapsFlattenedNestedXmlNamespaceOutputBuilder {
  108    134   
        crate::operation::xml_maps_flattened_nested_xml_namespace::builders::XmlMapsFlattenedNestedXmlNamespaceOutputBuilder::default()
  109    135   
    }
  110    136   
}
  111    137   
  112    138   
/// A builder for [`XmlMapsFlattenedNestedXmlNamespaceOutput`](crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceOutput).
  113    139   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  114    140   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/types/_create_foo_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors.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 `GreetingWithUnwrappedErrors`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GreetingWithUnwrappedErrors;
    6      6   
impl GreetingWithUnwrappedErrors {
    7      7   
    /// Creates a new `GreetingWithUnwrappedErrors`
    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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput::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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
  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 GreetingWithUnwrappedErrorsResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithUnwrappedErrorsResponseDeserializer {
  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_greeting_with_unwrapped_errors::de_greeting_with_unwrapped_errors_http_error(status, headers, body)
  152    159   
        } else {
@@ -243,250 +391,410 @@
  263    270   
            .expect("the config must have a deserializer");
  264    271   
  265    272   
        let parsed = de.deserialize_streaming(&mut http_response);
  266    273   
        let parsed = parsed.unwrap_or_else(|| {
  267    274   
            let http_response = http_response.map(|body| {
  268    275   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  269    276   
                    body.bytes().unwrap(),
  270    277   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  271    278   
                )))
  272    279   
            });
  273         -
            de.deserialize_nonstreaming(&http_response)
         280  +
            // Build a config bag with the protocol for schema-based deserialization
         281  +
            #[allow(unused_mut)]
         282  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         283  +
         284  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  274    285   
        });
  275    286   
        let parsed = parsed
  276    287   
            .expect("should be successful response")
  277    288   
            .downcast::<crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput>()
  278    289   
            .unwrap();
  279    290   
        ::pretty_assertions::assert_eq!(parsed.greeting, expected_output.greeting, "Unexpected value for `greeting`");
  280    291   
    }
  281    292   
  282    293   
    /// Parses simple XML errors
  283    294   
    /// Test ID: InvalidGreetingErrorUnwrapped
  284    295   
    #[::tokio::test]
  285    296   
    #[::tracing_test::traced_test]
  286    297   
    async fn invalid_greeting_error_unwrapped_response() {
  287    298   
        let expected_output = crate::types::error::InvalidGreetingUnwrapped::builder()
  288    299   
            .set_message(::std::option::Option::Some("Hi".to_owned()))
  289    300   
            .build();
  290    301   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  291    302   
        .header("Content-Type", "application/xml")
  292    303   
        .status(400)
  293    304   
                    .body(::aws_smithy_types::body::SdkBody::from("   <Error>\n      <Type>Sender</Type>\n      <Code>InvalidGreetingUnwrapped</Code>\n      <Message>Hi</Message>\n      <AnotherSetting>setting</AnotherSetting>\n      <RequestId>foo-id</RequestId>\n   </Error>\n"))
  294    305   
                    .unwrap()
  295    306   
                    ).unwrap();
  296    307   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  297    308   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  298    309   
  299    310   
        let op = crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrors::new();
  300    311   
        let config = op.config().expect("the operation has config");
  301    312   
        let de = config
  302    313   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  303    314   
            .expect("the config must have a deserializer");
  304    315   
  305    316   
        let parsed = de.deserialize_streaming(&mut http_response);
  306    317   
        let parsed = parsed.unwrap_or_else(|| {
  307    318   
            let http_response = http_response.map(|body| {
  308    319   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  309    320   
                    body.bytes().unwrap(),
  310    321   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  311    322   
                )))
  312    323   
            });
  313         -
            de.deserialize_nonstreaming(&http_response)
         324  +
            // Build a config bag with the protocol for schema-based deserialization
         325  +
            #[allow(unused_mut)]
         326  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         327  +
         328  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  314    329   
        });
  315    330   
        let parsed = parsed.expect_err("should be error response");
  316    331   
        let parsed: &crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError =
  317    332   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  318    333   
        if let crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::InvalidGreetingUnwrapped(parsed) = parsed {
  319    334   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  320    335   
        } else {
  321    336   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  322    337   
        }
  323    338   
    }
  324    339   
    /// Test ID: ComplexErrorUnwrapped
  325    340   
    #[::tokio::test]
  326    341   
    #[::tracing_test::traced_test]
  327    342   
    async fn complex_error_unwrapped_response() {
  328    343   
        let expected_output = crate::types::error::ComplexErrorUnwrapped::builder()
  329    344   
            .set_header(::std::option::Option::Some("Header".to_owned()))
  330    345   
            .set_top_level(::std::option::Option::Some("Top level".to_owned()))
  331    346   
            .set_nested(::std::option::Option::Some(
  332    347   
                crate::types::ComplexNestedErrorData::builder()
  333    348   
                    .set_foo(::std::option::Option::Some("bar".to_owned()))
  334    349   
                    .build(),
  335    350   
            ))
  336    351   
            .build();
  337    352   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  338    353   
        .header("Content-Type", "application/xml")
  339    354   
        .header("X-Header", "Header")
  340    355   
        .status(400)
  341    356   
                    .body(::aws_smithy_types::body::SdkBody::from("   <Error>\n      <Type>Sender</Type>\n      <Code>ComplexErrorUnwrapped</Code>\n      <Message>Hi</Message>\n      <TopLevel>Top level</TopLevel>\n      <Nested>\n          <Foo>bar</Foo>\n      </Nested>\n   <RequestId>foo-id</RequestId>\n   </Error>\n"))
  342    357   
                    .unwrap()
  343    358   
                    ).unwrap();
  344    359   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  345    360   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  346    361   
  347    362   
        let op = crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrors::new();
  348    363   
        let config = op.config().expect("the operation has config");
  349    364   
        let de = config
  350    365   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  351    366   
            .expect("the config must have a deserializer");
  352    367   
  353    368   
        let parsed = de.deserialize_streaming(&mut http_response);
  354    369   
        let parsed = parsed.unwrap_or_else(|| {
  355    370   
            let http_response = http_response.map(|body| {
  356    371   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  357    372   
                    body.bytes().unwrap(),
  358    373   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  359    374   
                )))
  360    375   
            });
  361         -
            de.deserialize_nonstreaming(&http_response)
         376  +
            // Build a config bag with the protocol for schema-based deserialization
         377  +
            #[allow(unused_mut)]
         378  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         379  +
         380  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  362    381   
        });
  363    382   
        let parsed = parsed.expect_err("should be error response");
  364    383   
        let parsed: &crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError =
  365    384   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  366    385   
        if let crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::ComplexErrorUnwrapped(parsed) = parsed {
  367    386   
            ::pretty_assertions::assert_eq!(parsed.header, expected_output.header, "Unexpected value for `header`");
  368    387   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  369    388   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  370    389   
        } else {
  371    390   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors/_greeting_with_unwrapped_errors_input.rs

@@ -1,1 +72,86 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct GreetingWithUnwrappedErrorsInput {}
    6      6   
static GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.restxmlunwrapped.synthetic#GreetingWithUnwrappedErrorsInput",
    8      8   
    "aws.protocoltests.restxmlunwrapped.synthetic",
    9      9   
    "GreetingWithUnwrappedErrorsInput",
   10     10   
);
   11     11   
static GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/GreetingWithErrors", None));
   13     14   
impl GreetingWithUnwrappedErrorsInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for GreetingWithUnwrappedErrorsInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl GreetingWithUnwrappedErrorsInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&GREETINGWITHUNWRAPPEDERRORSINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl GreetingWithUnwrappedErrorsInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl GreetingWithUnwrappedErrorsInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`GreetingWithUnwrappedErrorsInput`](crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput).
   53     67   
    pub fn builder() -> crate::operation::greeting_with_unwrapped_errors::builders::GreetingWithUnwrappedErrorsInputBuilder {
   54     68   
        crate::operation::greeting_with_unwrapped_errors::builders::GreetingWithUnwrappedErrorsInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`GreetingWithUnwrappedErrorsInput`](crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors/_greeting_with_unwrapped_errors_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.greeting {
   47     47   
            ser.write_string(&GREETINGWITHUNWRAPPEDERRORSOUTPUT_MEMBER_GREETING, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl GreetingWithUnwrappedErrorsOutput {
   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(&GREETINGWITHUNWRAPPEDERRORSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&GREETINGWITHUNWRAPPEDERRORSOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.greeting = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl GreetingWithUnwrappedErrorsOutput {
          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 let Some(val) = headers.get("X-Greeting") {
          91  +
            builder.greeting = Some(val.to_string());
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl GreetingWithUnwrappedErrorsOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`GreetingWithUnwrappedErrorsOutput`](crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput).
   80     98   
    pub fn builder() -> crate::operation::greeting_with_unwrapped_errors::builders::GreetingWithUnwrappedErrorsOutputBuilder {
   81     99   
        crate::operation::greeting_with_unwrapped_errors::builders::GreetingWithUnwrappedErrorsOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`GreetingWithUnwrappedErrorsOutput`](crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput).
   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_extras_unwrapped/rust-client-codegen/src/types/_complex_nested_error_data.rs

@@ -1,1 +106,117 @@
   17     17   
    "aws.protocoltests.restxmlunwrapped",
   18     18   
    "ComplexNestedErrorData",
   19     19   
);
   20     20   
static COMPLEXNESTEDERRORDATA_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxmlunwrapped#ComplexNestedErrorData$Foo",
   23     23   
        "aws.protocoltests.restxmlunwrapped",
   24     24   
        "ComplexNestedErrorData",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "foo",
          27  +
    "Foo",
   28     28   
    0,
   29     29   
);
   30     30   
static COMPLEXNESTEDERRORDATA_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    COMPLEXNESTEDERRORDATA_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&COMPLEXNESTEDERRORDATA_MEMBER_FOO],
   34     34   
);
   35     35   
impl ComplexNestedErrorData {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXNESTEDERRORDATA_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexNestedErrorData {
   40     40   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     41   
    fn serialize_members(
   42     42   
        &self,
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.foo {
   46     46   
            ser.write_string(&COMPLEXNESTEDERRORDATA_MEMBER_FOO, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl ComplexNestedErrorData {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.foo = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl ComplexNestedErrorData {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl ComplexNestedErrorData {
   78     89   
    /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
   79     90   
    pub fn builder() -> crate::types::builders::ComplexNestedErrorDataBuilder {
   80     91   
        crate::types::builders::ComplexNestedErrorDataBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/types/error/_complex_error_unwrapped.rs

@@ -11,11 +157,195 @@
   31     31   
    "aws.protocoltests.restxmlunwrapped",
   32     32   
    "ComplexErrorUnwrapped",
   33     33   
);
   34     34   
static COMPLEXERRORUNWRAPPED_MEMBER_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   35     35   
    ::aws_smithy_schema::ShapeId::from_static(
   36     36   
        "aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$Header",
   37     37   
        "aws.protocoltests.restxmlunwrapped",
   38     38   
        "ComplexErrorUnwrapped",
   39     39   
    ),
   40     40   
    ::aws_smithy_schema::ShapeType::String,
   41         -
    "header",
          41  +
    "Header",
   42     42   
    0,
   43     43   
)
   44     44   
.with_http_header("X-Header");
   45     45   
static COMPLEXERRORUNWRAPPED_MEMBER_TOP_LEVEL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   46     46   
    ::aws_smithy_schema::ShapeId::from_static(
   47     47   
        "aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$TopLevel",
   48     48   
        "aws.protocoltests.restxmlunwrapped",
   49     49   
        "ComplexErrorUnwrapped",
   50     50   
    ),
   51     51   
    ::aws_smithy_schema::ShapeType::String,
   52         -
    "top_level",
          52  +
    "TopLevel",
   53     53   
    1,
   54     54   
);
   55     55   
static COMPLEXERRORUNWRAPPED_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   56     56   
    ::aws_smithy_schema::ShapeId::from_static(
   57     57   
        "aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$Nested",
   58     58   
        "aws.protocoltests.restxmlunwrapped",
   59     59   
        "ComplexErrorUnwrapped",
   60     60   
    ),
   61     61   
    ::aws_smithy_schema::ShapeType::Structure,
   62         -
    "nested",
          62  +
    "Nested",
   63     63   
    2,
   64     64   
);
   65     65   
static COMPLEXERRORUNWRAPPED_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   66     66   
    COMPLEXERRORUNWRAPPED_SCHEMA_ID,
   67     67   
    ::aws_smithy_schema::ShapeType::Structure,
   68     68   
    &[
   69     69   
        &COMPLEXERRORUNWRAPPED_MEMBER_HEADER,
   70     70   
        &COMPLEXERRORUNWRAPPED_MEMBER_TOP_LEVEL,
   71     71   
        &COMPLEXERRORUNWRAPPED_MEMBER_NESTED,
   72     72   
    ],
   73     73   
);
   74     74   
impl ComplexErrorUnwrapped {
   75     75   
    /// The schema for this shape.
   76     76   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXERRORUNWRAPPED_SCHEMA;
   77     77   
}
   78     78   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexErrorUnwrapped {
   79     79   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   80     80   
    fn serialize_members(
   81     81   
        &self,
   82     82   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   83     83   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   84     84   
        if let Some(ref val) = self.header {
   85     85   
            ser.write_string(&COMPLEXERRORUNWRAPPED_MEMBER_HEADER, val)?;
   86     86   
        }
   87     87   
        if let Some(ref val) = self.top_level {
   88     88   
            ser.write_string(&COMPLEXERRORUNWRAPPED_MEMBER_TOP_LEVEL, val)?;
   89     89   
        }
   90     90   
        if let Some(ref val) = self.nested {
   91     91   
            ser.write_struct(&COMPLEXERRORUNWRAPPED_MEMBER_NESTED, val)?;
   92     92   
        }
   93     93   
        Ok(())
   94     94   
    }
   95     95   
}
   96     96   
impl ComplexErrorUnwrapped {
   97     97   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   98         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   99         -
        deserializer: &mut D,
          98  +
    pub fn deserialize(
          99  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  100    100   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  101    101   
        #[allow(unused_variables, unused_mut)]
  102    102   
        let mut builder = Self::builder();
  103    103   
        #[allow(
  104    104   
            unused_variables,
  105    105   
            unreachable_code,
  106    106   
            clippy::single_match,
  107    107   
            clippy::match_single_binding,
  108    108   
            clippy::diverging_sub_expression
  109    109   
        )]
  110         -
        deserializer.read_struct(&COMPLEXERRORUNWRAPPED_SCHEMA, (), |_, member, deser| {
         110  +
        deserializer.read_struct(&COMPLEXERRORUNWRAPPED_SCHEMA, &mut |member, deser| {
  111    111   
            match member.member_index() {
  112    112   
                Some(0) => {
  113    113   
                    builder.header = Some(deser.read_string(member)?);
  114    114   
                }
  115    115   
                Some(1) => {
  116    116   
                    builder.top_level = Some(deser.read_string(member)?);
  117    117   
                }
  118    118   
                Some(2) => {
  119    119   
                    builder.nested = Some(crate::types::ComplexNestedErrorData::deserialize(deser)?);
  120    120   
                }
  121    121   
                _ => {}
  122    122   
            }
  123    123   
            Ok(())
  124    124   
        })?;
  125    125   
        Ok(builder.build())
  126    126   
    }
  127    127   
}
         128  +
impl ComplexErrorUnwrapped {
         129  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         130  +
    /// Header-bound members are read directly from headers, avoiding runtime
         131  +
    /// member iteration overhead. Body members are read via the deserializer.
         132  +
    pub fn deserialize_with_response(
         133  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         134  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         135  +
        _status: u16,
         136  +
        _body: &[u8],
         137  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         138  +
        #[allow(unused_variables, unused_mut)]
         139  +
        let mut builder = Self::builder();
         140  +
        if let Some(val) = headers.get("X-Header") {
         141  +
            builder.header = Some(val.to_string());
         142  +
        }
         143  +
        #[allow(
         144  +
            unused_variables,
         145  +
            unreachable_code,
         146  +
            clippy::single_match,
         147  +
            clippy::match_single_binding,
         148  +
            clippy::diverging_sub_expression
         149  +
        )]
         150  +
        deserializer.read_struct(&COMPLEXERRORUNWRAPPED_SCHEMA, &mut |member, deser| {
         151  +
            match member.member_index() {
         152  +
                Some(0) => { /* read from headers above */ }
         153  +
                Some(1) => {
         154  +
                    builder.top_level = Some(deser.read_string(member)?);
         155  +
                }
         156  +
                Some(2) => {
         157  +
                    builder.nested = Some(crate::types::ComplexNestedErrorData::deserialize(deser)?);
         158  +
                }
         159  +
                _ => {}
         160  +
            }
         161  +
            Ok(())
         162  +
        })?;
         163  +
        Ok(builder.build())
         164  +
    }
         165  +
}
  128    166   
impl ComplexErrorUnwrapped {}
  129    167   
impl ::std::fmt::Display for ComplexErrorUnwrapped {
  130    168   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  131    169   
        ::std::write!(f, "ComplexErrorUnwrapped")?;
  132    170   
        Ok(())
  133    171   
    }
  134    172   
}
  135    173   
impl ::std::error::Error for ComplexErrorUnwrapped {}
  136    174   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ComplexErrorUnwrapped {
  137    175   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/types/error/_invalid_greeting_unwrapped.rs

@@ -1,1 +102,113 @@
   13     13   
    "aws.protocoltests.restxmlunwrapped",
   14     14   
    "InvalidGreetingUnwrapped",
   15     15   
);
   16     16   
static INVALIDGREETINGUNWRAPPED_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   17     17   
    ::aws_smithy_schema::ShapeId::from_static(
   18     18   
        "aws.protocoltests.restxmlunwrapped#InvalidGreetingUnwrapped$Message",
   19     19   
        "aws.protocoltests.restxmlunwrapped",
   20     20   
        "InvalidGreetingUnwrapped",
   21     21   
    ),
   22     22   
    ::aws_smithy_schema::ShapeType::String,
   23         -
    "message",
          23  +
    "Message",
   24     24   
    0,
   25     25   
);
   26     26   
static INVALIDGREETINGUNWRAPPED_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   27     27   
    INVALIDGREETINGUNWRAPPED_SCHEMA_ID,
   28     28   
    ::aws_smithy_schema::ShapeType::Structure,
   29     29   
    &[&INVALIDGREETINGUNWRAPPED_MEMBER_MESSAGE],
   30     30   
);
   31     31   
impl InvalidGreetingUnwrapped {
   32     32   
    /// The schema for this shape.
   33     33   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INVALIDGREETINGUNWRAPPED_SCHEMA;
   34     34   
}
   35     35   
impl ::aws_smithy_schema::serde::SerializableStruct for InvalidGreetingUnwrapped {
   36     36   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   37     37   
    fn serialize_members(
   38     38   
        &self,
   39     39   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   40     40   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   41     41   
        if let Some(ref val) = self.message {
   42     42   
            ser.write_string(&INVALIDGREETINGUNWRAPPED_MEMBER_MESSAGE, val)?;
   43     43   
        }
   44     44   
        Ok(())
   45     45   
    }
   46     46   
}
   47     47   
impl InvalidGreetingUnwrapped {
   48     48   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   49         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   50         -
        deserializer: &mut D,
          49  +
    pub fn deserialize(
          50  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   51     51   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   52     52   
        #[allow(unused_variables, unused_mut)]
   53     53   
        let mut builder = Self::builder();
   54     54   
        #[allow(
   55     55   
            unused_variables,
   56     56   
            unreachable_code,
   57     57   
            clippy::single_match,
   58     58   
            clippy::match_single_binding,
   59     59   
            clippy::diverging_sub_expression
   60     60   
        )]
   61         -
        deserializer.read_struct(&INVALIDGREETINGUNWRAPPED_SCHEMA, (), |_, member, deser| {
          61  +
        deserializer.read_struct(&INVALIDGREETINGUNWRAPPED_SCHEMA, &mut |member, deser| {
   62     62   
            match member.member_index() {
   63     63   
                Some(0) => {
   64     64   
                    builder.message = Some(deser.read_string(member)?);
   65     65   
                }
   66     66   
                _ => {}
   67     67   
            }
   68     68   
            Ok(())
   69     69   
        })?;
   70     70   
        Ok(builder.build())
   71     71   
    }
   72     72   
}
          73  +
impl InvalidGreetingUnwrapped {
          74  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          75  +
    pub fn deserialize_with_response(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          77  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          78  +
        _status: u16,
          79  +
        _body: &[u8],
          80  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          81  +
        Self::deserialize(deserializer)
          82  +
    }
          83  +
}
   73     84   
impl InvalidGreetingUnwrapped {
   74     85   
    /// Returns the error message.
   75     86   
    pub fn message(&self) -> ::std::option::Option<&str> {
   76     87   
        self.message.as_deref()
   77     88   
    }
   78     89   
}
   79     90   
impl ::std::fmt::Display for InvalidGreetingUnwrapped {
   80     91   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   81     92   
        ::std::write!(f, "InvalidGreetingUnwrapped")?;
   82     93   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/operation/simple_scalar_properties.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 `SimpleScalarProperties`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleScalarProperties;
    6      6   
impl SimpleScalarProperties {
    7      7   
    /// Creates a new `SimpleScalarProperties`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
  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 SimpleScalarPropertiesResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarPropertiesResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_error(status, headers, body)
  152    157   
        } else {
@@ -310,315 +370,379 @@
  330    335   
            .expect("the config must have a deserializer");
  331    336   
  332    337   
        let parsed = de.deserialize_streaming(&mut http_response);
  333    338   
        let parsed = parsed.unwrap_or_else(|| {
  334    339   
            let http_response = http_response.map(|body| {
  335    340   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  336    341   
                    body.bytes().unwrap(),
  337    342   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  338    343   
                )))
  339    344   
            });
  340         -
            de.deserialize_nonstreaming(&http_response)
         345  +
            // Build a config bag with the protocol for schema-based deserialization
         346  +
            #[allow(unused_mut)]
         347  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         348  +
         349  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  341    350   
        });
  342    351   
        let parsed = parsed
  343    352   
            .expect("should be successful response")
  344    353   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  345    354   
            .unwrap();
  346    355   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  347    356   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  348    357   
        ::pretty_assertions::assert_eq!(
  349    358   
            parsed.true_boolean_value,
  350    359   
            expected_output.true_boolean_value,