Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

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,

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_input.rs

@@ -68,68 +343,408 @@
   88     88   
    0,
   89     89   
)
   90     90   
.with_http_header("X-Foo");
   91     91   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_STRING_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   92     92   
    ::aws_smithy_schema::ShapeId::from_static(
   93     93   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$stringValue",
   94     94   
        "aws.protocoltests.restxml.xmlns.synthetic",
   95     95   
        "SimpleScalarPropertiesInput",
   96     96   
    ),
   97     97   
    ::aws_smithy_schema::ShapeType::String,
   98         -
    "string_value",
          98  +
    "stringValue",
   99     99   
    1,
  100    100   
);
  101    101   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_TRUE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  102    102   
    ::aws_smithy_schema::ShapeId::from_static(
  103    103   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$trueBooleanValue",
  104    104   
        "aws.protocoltests.restxml.xmlns.synthetic",
  105    105   
        "SimpleScalarPropertiesInput",
  106    106   
    ),
  107    107   
    ::aws_smithy_schema::ShapeType::Boolean,
  108         -
    "true_boolean_value",
         108  +
    "trueBooleanValue",
  109    109   
    2,
  110    110   
);
  111    111   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_FALSE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  112    112   
    ::aws_smithy_schema::ShapeId::from_static(
  113    113   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$falseBooleanValue",
  114    114   
        "aws.protocoltests.restxml.xmlns.synthetic",
  115    115   
        "SimpleScalarPropertiesInput",
  116    116   
    ),
  117    117   
    ::aws_smithy_schema::ShapeType::Boolean,
  118         -
    "false_boolean_value",
         118  +
    "falseBooleanValue",
  119    119   
    3,
  120    120   
);
  121    121   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_BYTE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  122    122   
    ::aws_smithy_schema::ShapeId::from_static(
  123    123   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$byteValue",
  124    124   
        "aws.protocoltests.restxml.xmlns.synthetic",
  125    125   
        "SimpleScalarPropertiesInput",
  126    126   
    ),
  127    127   
    ::aws_smithy_schema::ShapeType::Byte,
  128         -
    "byte_value",
         128  +
    "byteValue",
  129    129   
    4,
  130    130   
);
  131    131   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_SHORT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  132    132   
    ::aws_smithy_schema::ShapeId::from_static(
  133    133   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$shortValue",
  134    134   
        "aws.protocoltests.restxml.xmlns.synthetic",
  135    135   
        "SimpleScalarPropertiesInput",
  136    136   
    ),
  137    137   
    ::aws_smithy_schema::ShapeType::Short,
  138         -
    "short_value",
         138  +
    "shortValue",
  139    139   
    5,
  140    140   
);
  141    141   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_INTEGER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  142    142   
    ::aws_smithy_schema::ShapeId::from_static(
  143    143   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$integerValue",
  144    144   
        "aws.protocoltests.restxml.xmlns.synthetic",
  145    145   
        "SimpleScalarPropertiesInput",
  146    146   
    ),
  147    147   
    ::aws_smithy_schema::ShapeType::Integer,
  148         -
    "integer_value",
         148  +
    "integerValue",
  149    149   
    6,
  150    150   
);
  151    151   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_LONG_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  152    152   
    ::aws_smithy_schema::ShapeId::from_static(
  153    153   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$longValue",
  154    154   
        "aws.protocoltests.restxml.xmlns.synthetic",
  155    155   
        "SimpleScalarPropertiesInput",
  156    156   
    ),
  157    157   
    ::aws_smithy_schema::ShapeType::Long,
  158         -
    "long_value",
         158  +
    "longValue",
  159    159   
    7,
  160    160   
);
  161    161   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  162    162   
    ::aws_smithy_schema::ShapeId::from_static(
  163    163   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$floatValue",
  164    164   
        "aws.protocoltests.restxml.xmlns.synthetic",
  165    165   
        "SimpleScalarPropertiesInput",
  166    166   
    ),
  167    167   
    ::aws_smithy_schema::ShapeType::Float,
  168         -
    "float_value",
         168  +
    "floatValue",
  169    169   
    8,
  170    170   
);
  171    171   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  172    172   
    ::aws_smithy_schema::ShapeId::from_static(
  173    173   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$Nested",
  174    174   
        "aws.protocoltests.restxml.xmlns.synthetic",
  175    175   
        "SimpleScalarPropertiesInput",
  176    176   
    ),
  177    177   
    ::aws_smithy_schema::ShapeType::Structure,
  178         -
    "nested",
         178  +
    "Nested",
  179    179   
    9,
  180    180   
)
  181    181   
.with_xml_namespace();
  182    182   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static(
  184    184   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesInput$doubleValue",
  185    185   
        "aws.protocoltests.restxml.xmlns.synthetic",
  186    186   
        "SimpleScalarPropertiesInput",
  187    187   
    ),
  188    188   
    ::aws_smithy_schema::ShapeType::Double,
  189         -
    "double_value",
         189  +
    "doubleValue",
  190    190   
    10,
  191    191   
)
  192    192   
.with_xml_name("DoubleDribble");
  193    193   
static SIMPLESCALARPROPERTIESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  194    194   
    SIMPLESCALARPROPERTIESINPUT_SCHEMA_ID,
  195    195   
    ::aws_smithy_schema::ShapeType::Structure,
  196    196   
    &[
  197    197   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_FOO,
  198    198   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_STRING_VALUE,
  199    199   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_TRUE_BOOLEAN_VALUE,
  200    200   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_FALSE_BOOLEAN_VALUE,
  201    201   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_BYTE_VALUE,
  202    202   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_SHORT_VALUE,
  203    203   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_INTEGER_VALUE,
  204    204   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_LONG_VALUE,
  205    205   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE,
  206    206   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_NESTED,
  207    207   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE,
  208    208   
    ],
  209         -
);
         209  +
)
         210  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/SimpleScalarProperties", None));
  210    211   
impl SimpleScalarPropertiesInput {
  211    212   
    /// The schema for this shape.
  212    213   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLESCALARPROPERTIESINPUT_SCHEMA;
  213    214   
}
  214    215   
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleScalarPropertiesInput {
  215    216   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  216    217   
    fn serialize_members(
  217    218   
        &self,
  218    219   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  219    220   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  220    221   
        if let Some(ref val) = self.foo {
  221    222   
            ser.write_string(&SIMPLESCALARPROPERTIESINPUT_MEMBER_FOO, val)?;
  222    223   
        }
  223    224   
        if let Some(ref val) = self.string_value {
  224    225   
            ser.write_string(&SIMPLESCALARPROPERTIESINPUT_MEMBER_STRING_VALUE, val)?;
  225    226   
        }
  226    227   
        if let Some(ref val) = self.true_boolean_value {
  227    228   
            ser.write_boolean(&SIMPLESCALARPROPERTIESINPUT_MEMBER_TRUE_BOOLEAN_VALUE, *val)?;
  228    229   
        }
  229    230   
        if let Some(ref val) = self.false_boolean_value {
  230    231   
            ser.write_boolean(&SIMPLESCALARPROPERTIESINPUT_MEMBER_FALSE_BOOLEAN_VALUE, *val)?;
  231    232   
        }
  232    233   
        if let Some(ref val) = self.byte_value {
  233    234   
            ser.write_byte(&SIMPLESCALARPROPERTIESINPUT_MEMBER_BYTE_VALUE, *val)?;
  234    235   
        }
  235    236   
        if let Some(ref val) = self.short_value {
  236    237   
            ser.write_short(&SIMPLESCALARPROPERTIESINPUT_MEMBER_SHORT_VALUE, *val)?;
  237    238   
        }
  238    239   
        if let Some(ref val) = self.integer_value {
  239    240   
            ser.write_integer(&SIMPLESCALARPROPERTIESINPUT_MEMBER_INTEGER_VALUE, *val)?;
  240    241   
        }
  241    242   
        if let Some(ref val) = self.long_value {
  242    243   
            ser.write_long(&SIMPLESCALARPROPERTIESINPUT_MEMBER_LONG_VALUE, *val)?;
  243    244   
        }
  244    245   
        if let Some(ref val) = self.float_value {
  245    246   
            ser.write_float(&SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE, *val)?;
  246    247   
        }
  247    248   
        if let Some(ref val) = self.nested {
  248    249   
            ser.write_struct(&SIMPLESCALARPROPERTIESINPUT_MEMBER_NESTED, val)?;
  249    250   
        }
  250    251   
        if let Some(ref val) = self.double_value {
  251    252   
            ser.write_double(&SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE, *val)?;
  252    253   
        }
  253    254   
        Ok(())
  254    255   
    }
  255    256   
}
  256    257   
impl SimpleScalarPropertiesInput {
  257    258   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  258         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  259         -
        deserializer: &mut D,
         259  +
    pub fn deserialize(
         260  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  260    261   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  261    262   
        #[allow(unused_variables, unused_mut)]
  262    263   
        let mut builder = Self::builder();
  263    264   
        #[allow(
  264    265   
            unused_variables,
  265    266   
            unreachable_code,
  266    267   
            clippy::single_match,
  267    268   
            clippy::match_single_binding,
  268    269   
            clippy::diverging_sub_expression
  269    270   
        )]
  270         -
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, (), |_, member, deser| {
         271  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, &mut |member, deser| {
  271    272   
            match member.member_index() {
  272    273   
                Some(0) => {
  273    274   
                    builder.foo = Some(deser.read_string(member)?);
  274    275   
                }
  275    276   
                Some(1) => {
  276    277   
                    builder.string_value = Some(deser.read_string(member)?);
  277    278   
                }
  278    279   
                Some(2) => {
  279    280   
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
  280    281   
                }
  281    282   
                Some(3) => {
  282    283   
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
  283    284   
                }
  284    285   
                Some(4) => {
  285    286   
                    builder.byte_value = Some(deser.read_byte(member)?);
  286    287   
                }
  287    288   
                Some(5) => {
  288    289   
                    builder.short_value = Some(deser.read_short(member)?);
  289    290   
                }
  290    291   
                Some(6) => {
  291    292   
                    builder.integer_value = Some(deser.read_integer(member)?);
  292    293   
                }
  293    294   
                Some(7) => {
  294    295   
                    builder.long_value = Some(deser.read_long(member)?);
  295    296   
                }
  296    297   
                Some(8) => {
  297    298   
                    builder.float_value = Some(deser.read_float(member)?);
  298    299   
                }
  299    300   
                Some(9) => {
  300    301   
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
  301    302   
                }
  302    303   
                Some(10) => {
  303    304   
                    builder.double_value = Some(deser.read_double(member)?);
  304    305   
                }
  305    306   
                _ => {}
  306    307   
            }
  307    308   
            Ok(())
  308    309   
        })?;
  309    310   
        builder
  310    311   
            .build()
  311    312   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  312    313   
    }
  313    314   
}
         315  +
impl SimpleScalarPropertiesInput {
         316  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         317  +
    /// Header-bound members are read directly from headers, avoiding runtime
         318  +
    /// member iteration overhead. Body members are read via the deserializer.
         319  +
    pub fn deserialize_with_response(
         320  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         321  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         322  +
        _status: u16,
         323  +
        _body: &[u8],
         324  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         325  +
        #[allow(unused_variables, unused_mut)]
         326  +
        let mut builder = Self::builder();
         327  +
        if let Some(val) = headers.get("X-Foo") {
         328  +
            builder.foo = Some(val.to_string());
         329  +
        }
         330  +
        #[allow(
         331  +
            unused_variables,
         332  +
            unreachable_code,
         333  +
            clippy::single_match,
         334  +
            clippy::match_single_binding,
         335  +
            clippy::diverging_sub_expression
         336  +
        )]
         337  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, &mut |member, deser| {
         338  +
            match member.member_index() {
         339  +
                Some(0) => { /* read from headers above */ }
         340  +
                Some(1) => {
         341  +
                    builder.string_value = Some(deser.read_string(member)?);
         342  +
                }
         343  +
                Some(2) => {
         344  +
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
         345  +
                }
         346  +
                Some(3) => {
         347  +
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
         348  +
                }
         349  +
                Some(4) => {
         350  +
                    builder.byte_value = Some(deser.read_byte(member)?);
         351  +
                }
         352  +
                Some(5) => {
         353  +
                    builder.short_value = Some(deser.read_short(member)?);
         354  +
                }
         355  +
                Some(6) => {
         356  +
                    builder.integer_value = Some(deser.read_integer(member)?);
         357  +
                }
         358  +
                Some(7) => {
         359  +
                    builder.long_value = Some(deser.read_long(member)?);
         360  +
                }
         361  +
                Some(8) => {
         362  +
                    builder.float_value = Some(deser.read_float(member)?);
         363  +
                }
         364  +
                Some(9) => {
         365  +
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
         366  +
                }
         367  +
                Some(10) => {
         368  +
                    builder.double_value = Some(deser.read_double(member)?);
         369  +
                }
         370  +
                _ => {}
         371  +
            }
         372  +
            Ok(())
         373  +
        })?;
         374  +
        builder
         375  +
            .build()
         376  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         377  +
    }
         378  +
}
  314    379   
impl SimpleScalarPropertiesInput {
  315    380   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
  316    381   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
  317    382   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder::default()
  318    383   
    }
  319    384   
}
  320    385   
  321    386   
/// A builder for [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
  322    387   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  323    388   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_output.rs

@@ -68,68 +219,219 @@
   88     88   
    0,
   89     89   
)
   90     90   
.with_http_header("X-Foo");
   91     91   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_STRING_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   92     92   
    ::aws_smithy_schema::ShapeId::from_static(
   93     93   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$stringValue",
   94     94   
        "aws.protocoltests.restxml.xmlns.synthetic",
   95     95   
        "SimpleScalarPropertiesOutput",
   96     96   
    ),
   97     97   
    ::aws_smithy_schema::ShapeType::String,
   98         -
    "string_value",
          98  +
    "stringValue",
   99     99   
    1,
  100    100   
);
  101    101   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  102    102   
    ::aws_smithy_schema::ShapeId::from_static(
  103    103   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$trueBooleanValue",
  104    104   
        "aws.protocoltests.restxml.xmlns.synthetic",
  105    105   
        "SimpleScalarPropertiesOutput",
  106    106   
    ),
  107    107   
    ::aws_smithy_schema::ShapeType::Boolean,
  108         -
    "true_boolean_value",
         108  +
    "trueBooleanValue",
  109    109   
    2,
  110    110   
);
  111    111   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FALSE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  112    112   
    ::aws_smithy_schema::ShapeId::from_static(
  113    113   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$falseBooleanValue",
  114    114   
        "aws.protocoltests.restxml.xmlns.synthetic",
  115    115   
        "SimpleScalarPropertiesOutput",
  116    116   
    ),
  117    117   
    ::aws_smithy_schema::ShapeType::Boolean,
  118         -
    "false_boolean_value",
         118  +
    "falseBooleanValue",
  119    119   
    3,
  120    120   
);
  121    121   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_BYTE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  122    122   
    ::aws_smithy_schema::ShapeId::from_static(
  123    123   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$byteValue",
  124    124   
        "aws.protocoltests.restxml.xmlns.synthetic",
  125    125   
        "SimpleScalarPropertiesOutput",
  126    126   
    ),
  127    127   
    ::aws_smithy_schema::ShapeType::Byte,
  128         -
    "byte_value",
         128  +
    "byteValue",
  129    129   
    4,
  130    130   
);
  131    131   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_SHORT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  132    132   
    ::aws_smithy_schema::ShapeId::from_static(
  133    133   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$shortValue",
  134    134   
        "aws.protocoltests.restxml.xmlns.synthetic",
  135    135   
        "SimpleScalarPropertiesOutput",
  136    136   
    ),
  137    137   
    ::aws_smithy_schema::ShapeType::Short,
  138         -
    "short_value",
         138  +
    "shortValue",
  139    139   
    5,
  140    140   
);
  141    141   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_INTEGER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  142    142   
    ::aws_smithy_schema::ShapeId::from_static(
  143    143   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$integerValue",
  144    144   
        "aws.protocoltests.restxml.xmlns.synthetic",
  145    145   
        "SimpleScalarPropertiesOutput",
  146    146   
    ),
  147    147   
    ::aws_smithy_schema::ShapeType::Integer,
  148         -
    "integer_value",
         148  +
    "integerValue",
  149    149   
    6,
  150    150   
);
  151    151   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_LONG_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  152    152   
    ::aws_smithy_schema::ShapeId::from_static(
  153    153   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$longValue",
  154    154   
        "aws.protocoltests.restxml.xmlns.synthetic",
  155    155   
        "SimpleScalarPropertiesOutput",
  156    156   
    ),
  157    157   
    ::aws_smithy_schema::ShapeType::Long,
  158         -
    "long_value",
         158  +
    "longValue",
  159    159   
    7,
  160    160   
);
  161    161   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  162    162   
    ::aws_smithy_schema::ShapeId::from_static(
  163    163   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$floatValue",
  164    164   
        "aws.protocoltests.restxml.xmlns.synthetic",
  165    165   
        "SimpleScalarPropertiesOutput",
  166    166   
    ),
  167    167   
    ::aws_smithy_schema::ShapeType::Float,
  168         -
    "float_value",
         168  +
    "floatValue",
  169    169   
    8,
  170    170   
);
  171    171   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  172    172   
    ::aws_smithy_schema::ShapeId::from_static(
  173    173   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$Nested",
  174    174   
        "aws.protocoltests.restxml.xmlns.synthetic",
  175    175   
        "SimpleScalarPropertiesOutput",
  176    176   
    ),
  177    177   
    ::aws_smithy_schema::ShapeType::Structure,
  178         -
    "nested",
         178  +
    "Nested",
  179    179   
    9,
  180    180   
)
  181    181   
.with_xml_namespace();
  182    182   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static(
  184    184   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$doubleValue",
  185    185   
        "aws.protocoltests.restxml.xmlns.synthetic",
  186    186   
        "SimpleScalarPropertiesOutput",
  187    187   
    ),
  188    188   
    ::aws_smithy_schema::ShapeType::Double,
  189         -
    "double_value",
         189  +
    "doubleValue",
  190    190   
    10,
  191    191   
)
  192    192   
.with_xml_name("DoubleDribble");
  193    193   
static SIMPLESCALARPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  194    194   
    SIMPLESCALARPROPERTIESOUTPUT_SCHEMA_ID,
  195    195   
    ::aws_smithy_schema::ShapeType::Structure,
  196    196   
    &[
  197    197   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FOO,
  198    198   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_STRING_VALUE,
  199    199   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE,
@@ -228,228 +341,403 @@
  248    248   
            ser.write_struct(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_NESTED, val)?;
  249    249   
        }
  250    250   
        if let Some(ref val) = self.double_value {
  251    251   
            ser.write_double(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE, *val)?;
  252    252   
        }
  253    253   
        Ok(())
  254    254   
    }
  255    255   
}
  256    256   
impl SimpleScalarPropertiesOutput {
  257    257   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  258         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  259         -
        deserializer: &mut D,
         258  +
    pub fn deserialize(
         259  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  260    260   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  261    261   
        #[allow(unused_variables, unused_mut)]
  262    262   
        let mut builder = Self::builder();
  263    263   
        #[allow(
  264    264   
            unused_variables,
  265    265   
            unreachable_code,
  266    266   
            clippy::single_match,
  267    267   
            clippy::match_single_binding,
  268    268   
            clippy::diverging_sub_expression
  269    269   
        )]
  270         -
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, (), |_, member, deser| {
         270  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
  271    271   
            match member.member_index() {
  272    272   
                Some(0) => {
  273    273   
                    builder.foo = Some(deser.read_string(member)?);
  274    274   
                }
  275    275   
                Some(1) => {
  276    276   
                    builder.string_value = Some(deser.read_string(member)?);
  277    277   
                }
  278    278   
                Some(2) => {
  279    279   
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
  280    280   
                }
  281    281   
                Some(3) => {
  282    282   
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
  283    283   
                }
  284    284   
                Some(4) => {
  285    285   
                    builder.byte_value = Some(deser.read_byte(member)?);
  286    286   
                }
  287    287   
                Some(5) => {
  288    288   
                    builder.short_value = Some(deser.read_short(member)?);
  289    289   
                }
  290    290   
                Some(6) => {
  291    291   
                    builder.integer_value = Some(deser.read_integer(member)?);
  292    292   
                }
  293    293   
                Some(7) => {
  294    294   
                    builder.long_value = Some(deser.read_long(member)?);
  295    295   
                }
  296    296   
                Some(8) => {
  297    297   
                    builder.float_value = Some(deser.read_float(member)?);
  298    298   
                }
  299    299   
                Some(9) => {
  300    300   
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
  301    301   
                }
  302    302   
                Some(10) => {
  303    303   
                    builder.double_value = Some(deser.read_double(member)?);
  304    304   
                }
  305    305   
                _ => {}
  306    306   
            }
  307    307   
            Ok(())
  308    308   
        })?;
  309    309   
        Ok(builder.build())
  310    310   
    }
  311    311   
}
         312  +
impl SimpleScalarPropertiesOutput {
         313  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         314  +
    /// Header-bound members are read directly from headers, avoiding runtime
         315  +
    /// member iteration overhead. Body members are read via the deserializer.
         316  +
    pub fn deserialize_with_response(
         317  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         318  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         319  +
        _status: u16,
         320  +
        _body: &[u8],
         321  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         322  +
        #[allow(unused_variables, unused_mut)]
         323  +
        let mut builder = Self::builder();
         324  +
        if let Some(val) = headers.get("X-Foo") {
         325  +
            builder.foo = Some(val.to_string());
         326  +
        }
         327  +
        #[allow(
         328  +
            unused_variables,
         329  +
            unreachable_code,
         330  +
            clippy::single_match,
         331  +
            clippy::match_single_binding,
         332  +
            clippy::diverging_sub_expression
         333  +
        )]
         334  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
         335  +
            match member.member_index() {
         336  +
                Some(0) => { /* read from headers above */ }
         337  +
                Some(1) => {
         338  +
                    builder.string_value = Some(deser.read_string(member)?);
         339  +
                }
         340  +
                Some(2) => {
         341  +
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
         342  +
                }
         343  +
                Some(3) => {
         344  +
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
         345  +
                }
         346  +
                Some(4) => {
         347  +
                    builder.byte_value = Some(deser.read_byte(member)?);
         348  +
                }
         349  +
                Some(5) => {
         350  +
                    builder.short_value = Some(deser.read_short(member)?);
         351  +
                }
         352  +
                Some(6) => {
         353  +
                    builder.integer_value = Some(deser.read_integer(member)?);
         354  +
                }
         355  +
                Some(7) => {
         356  +
                    builder.long_value = Some(deser.read_long(member)?);
         357  +
                }
         358  +
                Some(8) => {
         359  +
                    builder.float_value = Some(deser.read_float(member)?);
         360  +
                }
         361  +
                Some(9) => {
         362  +
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
         363  +
                }
         364  +
                Some(10) => {
         365  +
                    builder.double_value = Some(deser.read_double(member)?);
         366  +
                }
         367  +
                _ => {}
         368  +
            }
         369  +
            Ok(())
         370  +
        })?;
         371  +
        Ok(builder.build())
         372  +
    }
         373  +
}
  312    374   
impl SimpleScalarPropertiesOutput {
  313    375   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  314    376   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder {
  315    377   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default()
  316    378   
    }
  317    379   
}
  318    380   
  319    381   
/// A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  320    382   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  321    383   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/types/_nested_with_namespace.rs

@@ -1,1 +108,119 @@
   17     17   
    "aws.protocoltests.restxml.xmlns",
   18     18   
    "NestedWithNamespace",
   19     19   
);
   20     20   
static NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.xmlns#NestedWithNamespace$attrField",
   23     23   
        "aws.protocoltests.restxml.xmlns",
   24     24   
        "NestedWithNamespace",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "attr_field",
          27  +
    "attrField",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_name("xsi:someName")
   31     31   
.with_xml_attribute();
   32     32   
static NESTEDWITHNAMESPACE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    NESTEDWITHNAMESPACE_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD],
   36     36   
);
   37     37   
impl NestedWithNamespace {
   38     38   
    /// The schema for this shape.
   39     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &NESTEDWITHNAMESPACE_SCHEMA;
   40     40   
}
   41     41   
impl ::aws_smithy_schema::serde::SerializableStruct for NestedWithNamespace {
   42     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     43   
    fn serialize_members(
   44     44   
        &self,
   45     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     47   
        if let Some(ref val) = self.attr_field {
   48     48   
            ser.write_string(&NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD, val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl NestedWithNamespace {
   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(&NESTEDWITHNAMESPACE_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&NESTEDWITHNAMESPACE_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.attr_field = Some(deser.read_string(member)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
   76     76   
        Ok(builder.build())
   77     77   
    }
   78     78   
}
          79  +
impl NestedWithNamespace {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          81  +
    pub fn deserialize_with_response(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          83  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          84  +
        _status: u16,
          85  +
        _body: &[u8],
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        Self::deserialize(deserializer)
          88  +
    }
          89  +
}
   79     90   
impl NestedWithNamespace {
   80     91   
    /// Creates a new builder-style object to manufacture [`NestedWithNamespace`](crate::types::NestedWithNamespace).
   81     92   
    pub fn builder() -> crate::types::builders::NestedWithNamespaceBuilder {
   82     93   
        crate::types::builders::NestedWithNamespaceBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`NestedWithNamespace`](crate::types::NestedWithNamespace).
   87     98   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88     99   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/empty_input_output.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 `EmptyInputOutput`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EmptyInputOutput;
    6      6   
impl EmptyInputOutput {
    7      7   
    /// Creates a new `EmptyInputOutput`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::empty_input_output::EmptyInputOutputInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::empty_input_output::EmptyInputOutputOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::empty_input_output::EmptyInputOutputInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::empty_input_output::EmptyInputOutputOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::empty_input_output::EmptyInputOutputError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::empty_input_output::EmptyInputOutputError,
  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 EmptyInputOutputResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyInputOutputResponseDeserializer {
  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_empty_input_output::de_empty_input_output_http_error(status, headers, body)
  146    151   
        } else {
@@ -285,290 +385,398 @@
  305    310   
            .expect("the config must have a deserializer");
  306    311   
  307    312   
        let parsed = de.deserialize_streaming(&mut http_response);
  308    313   
        let parsed = parsed.unwrap_or_else(|| {
  309    314   
            let http_response = http_response.map(|body| {
  310    315   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  311    316   
                    body.bytes().unwrap(),
  312    317   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  313    318   
                )))
  314    319   
            });
  315         -
            de.deserialize_nonstreaming(&http_response)
         320  +
            // Build a config bag with the protocol for schema-based deserialization
         321  +
            #[allow(unused_mut)]
         322  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         323  +
         324  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  316    325   
        });
  317    326   
        let parsed = parsed
  318    327   
            .expect("should be successful response")
  319    328   
            .downcast::<crate::operation::empty_input_output::EmptyInputOutputOutput>()
  320    329   
            .unwrap();
  321    330   
    }
  322    331   
  323    332   
    /// When output structure is empty the client should accept an empty body
  324    333   
    /// Test ID: empty_output_no_body
  325    334   
    #[::tokio::test]
  326    335   
    #[::tracing_test::traced_test]
  327    336   
    async fn empty_output_no_body_response() {
  328    337   
        let expected_output = crate::operation::empty_input_output::EmptyInputOutputOutput::builder().build();
  329    338   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  330    339   
            ::http_1x::response::Builder::new()
  331    340   
                .header("Content-Type", "application/cbor")
  332    341   
                .header("smithy-protocol", "rpc-v2-cbor")
  333    342   
                .status(200)
  334    343   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  335    344   
                .unwrap(),
  336    345   
        )
  337    346   
        .unwrap();
  338    347   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  339    348   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  340    349   
  341    350   
        let op = crate::operation::empty_input_output::EmptyInputOutput::new();
  342    351   
        let config = op.config().expect("the operation has config");
  343    352   
        let de = config
  344    353   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  345    354   
            .expect("the config must have a deserializer");
  346    355   
  347    356   
        let parsed = de.deserialize_streaming(&mut http_response);
  348    357   
        let parsed = parsed.unwrap_or_else(|| {
  349    358   
            let http_response = http_response.map(|body| {
  350    359   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  351    360   
                    body.bytes().unwrap(),
  352    361   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  353    362   
                )))
  354    363   
            });
  355         -
            de.deserialize_nonstreaming(&http_response)
         364  +
            // Build a config bag with the protocol for schema-based deserialization
         365  +
            #[allow(unused_mut)]
         366  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         367  +
         368  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  356    369   
        });
  357    370   
        let parsed = parsed
  358    371   
            .expect("should be successful response")
  359    372   
            .downcast::<crate::operation::empty_input_output::EmptyInputOutputOutput>()
  360    373   
            .unwrap();
  361    374   
    }
  362    375   
}
  363    376   
  364    377   
/// Error type for the `EmptyInputOutputError` operation.
  365    378   
#[non_exhaustive]