Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/xml_maps_xml_name.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 `XmlMapsXmlName`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlMapsXmlName;
    6      6   
impl XmlMapsXmlName {
    7      7   
    /// Creates a new `XmlMapsXmlName`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_maps_xml_name::XmlMapsXmlNameInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_maps_xml_name::XmlMapsXmlNameOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::xml_maps_xml_name::XmlMapsXmlNameInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_maps_xml_name::XmlMapsXmlNameOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_maps_xml_name::XmlMapsXmlNameError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlMapsXmlNameResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlMapsXmlNameResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_maps_xml_name::de_xml_maps_xml_name_http_error(status, headers, body)
  146    151   
        } else {
@@ -301,306 +361,370 @@
  321    326   
            .expect("the config must have a deserializer");
  322    327   
  323    328   
        let parsed = de.deserialize_streaming(&mut http_response);
  324    329   
        let parsed = parsed.unwrap_or_else(|| {
  325    330   
            let http_response = http_response.map(|body| {
  326    331   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  327    332   
                    body.bytes().unwrap(),
  328    333   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  329    334   
                )))
  330    335   
            });
  331         -
            de.deserialize_nonstreaming(&http_response)
         336  +
            // Build a config bag with the protocol for schema-based deserialization
         337  +
            #[allow(unused_mut)]
         338  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         339  +
         340  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  332    341   
        });
  333    342   
        let parsed = parsed
  334    343   
            .expect("should be successful response")
  335    344   
            .downcast::<crate::operation::xml_maps_xml_name::XmlMapsXmlNameOutput>()
  336    345   
            .unwrap();
  337    346   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  338    347   
    }
  339    348   
}
  340    349   
  341    350   
/// Error type for the `XmlMapsXmlNameError` operation.

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/xml_namespaces.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 `XmlNamespaces`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlNamespaces;
    6      6   
impl XmlNamespaces {
    7      7   
    /// Creates a new `XmlNamespaces`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_namespaces::XmlNamespacesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_namespaces::XmlNamespacesOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::xml_namespaces::XmlNamespacesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_namespaces::XmlNamespacesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_namespaces::XmlNamespacesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlNamespacesResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlNamespacesResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_namespaces::de_xml_namespaces_http_error(status, headers, body)
  146    151   
        } else {
@@ -281,286 +341,350 @@
  301    306   
            .expect("the config must have a deserializer");
  302    307   
  303    308   
        let parsed = de.deserialize_streaming(&mut http_response);
  304    309   
        let parsed = parsed.unwrap_or_else(|| {
  305    310   
            let http_response = http_response.map(|body| {
  306    311   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  307    312   
                    body.bytes().unwrap(),
  308    313   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  309    314   
                )))
  310    315   
            });
  311         -
            de.deserialize_nonstreaming(&http_response)
         316  +
            // Build a config bag with the protocol for schema-based deserialization
         317  +
            #[allow(unused_mut)]
         318  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         319  +
         320  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  312    321   
        });
  313    322   
        let parsed = parsed
  314    323   
            .expect("should be successful response")
  315    324   
            .downcast::<crate::operation::xml_namespaces::XmlNamespacesOutput>()
  316    325   
            .unwrap();
  317    326   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  318    327   
    }
  319    328   
}
  320    329   
  321    330   
/// Error type for the `XmlNamespacesError` operation.

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

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

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

@@ -24,24 +107,118 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.nested {
   47     47   
            ser.write_struct(&XMLNAMESPACESOUTPUT_MEMBER_NESTED, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl XmlNamespacesOutput {
   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(&XMLNAMESPACESOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&XMLNAMESPACESOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.nested = Some(crate::types::XmlNamespaceNested::deserialize(deser)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl XmlNamespacesOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   78     89   
impl XmlNamespacesOutput {
   79     90   
    /// Creates a new builder-style object to manufacture [`XmlNamespacesOutput`](crate::operation::xml_namespaces::XmlNamespacesOutput).
   80     91   
    pub fn builder() -> crate::operation::xml_namespaces::builders::XmlNamespacesOutputBuilder {
   81     92   
        crate::operation::xml_namespaces::builders::XmlNamespacesOutputBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`XmlNamespacesOutput`](crate::operation::xml_namespaces::XmlNamespacesOutput).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/xml_timestamps.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 `XmlTimestamps`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlTimestamps;
    6      6   
impl XmlTimestamps {
    7      7   
    /// Creates a new `XmlTimestamps`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_timestamps::XmlTimestampsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_timestamps::XmlTimestampsOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::xml_timestamps::XmlTimestampsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_timestamps::XmlTimestampsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_timestamps::XmlTimestampsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlTimestampsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlTimestampsResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_timestamps::de_xml_timestamps_http_error(status, headers, body)
  146    151   
        } else {
@@ -497,502 +557,566 @@
  517    522   
            .expect("the config must have a deserializer");
  518    523   
  519    524   
        let parsed = de.deserialize_streaming(&mut http_response);
  520    525   
        let parsed = parsed.unwrap_or_else(|| {
  521    526   
            let http_response = http_response.map(|body| {
  522    527   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  523    528   
                    body.bytes().unwrap(),
  524    529   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  525    530   
                )))
  526    531   
            });
  527         -
            de.deserialize_nonstreaming(&http_response)
         532  +
            // Build a config bag with the protocol for schema-based deserialization
         533  +
            #[allow(unused_mut)]
         534  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         535  +
         536  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  528    537   
        });
  529    538   
        let parsed = parsed
  530    539   
            .expect("should be successful response")
  531    540   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  532    541   
            .unwrap();
  533    542   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  534    543   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  535    544   
        ::pretty_assertions::assert_eq!(
  536    545   
            parsed.date_time_on_target,
  537    546   
            expected_output.date_time_on_target,
@@ -565,574 +625,638 @@
  585    594   
            .expect("the config must have a deserializer");
  586    595   
  587    596   
        let parsed = de.deserialize_streaming(&mut http_response);
  588    597   
        let parsed = parsed.unwrap_or_else(|| {
  589    598   
            let http_response = http_response.map(|body| {
  590    599   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  591    600   
                    body.bytes().unwrap(),
  592    601   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  593    602   
                )))
  594    603   
            });
  595         -
            de.deserialize_nonstreaming(&http_response)
         604  +
            // Build a config bag with the protocol for schema-based deserialization
         605  +
            #[allow(unused_mut)]
         606  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         607  +
         608  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  596    609   
        });
  597    610   
        let parsed = parsed
  598    611   
            .expect("should be successful response")
  599    612   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  600    613   
            .unwrap();
  601    614   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  602    615   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  603    616   
        ::pretty_assertions::assert_eq!(
  604    617   
            parsed.date_time_on_target,
  605    618   
            expected_output.date_time_on_target,
@@ -633,646 +693,710 @@
  653    666   
            .expect("the config must have a deserializer");
  654    667   
  655    668   
        let parsed = de.deserialize_streaming(&mut http_response);
  656    669   
        let parsed = parsed.unwrap_or_else(|| {
  657    670   
            let http_response = http_response.map(|body| {
  658    671   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  659    672   
                    body.bytes().unwrap(),
  660    673   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  661    674   
                )))
  662    675   
            });
  663         -
            de.deserialize_nonstreaming(&http_response)
         676  +
            // Build a config bag with the protocol for schema-based deserialization
         677  +
            #[allow(unused_mut)]
         678  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         679  +
         680  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  664    681   
        });
  665    682   
        let parsed = parsed
  666    683   
            .expect("should be successful response")
  667    684   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  668    685   
            .unwrap();
  669    686   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  670    687   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  671    688   
        ::pretty_assertions::assert_eq!(
  672    689   
            parsed.date_time_on_target,
  673    690   
            expected_output.date_time_on_target,
@@ -701,718 +761,782 @@
  721    738   
            .expect("the config must have a deserializer");
  722    739   
  723    740   
        let parsed = de.deserialize_streaming(&mut http_response);
  724    741   
        let parsed = parsed.unwrap_or_else(|| {
  725    742   
            let http_response = http_response.map(|body| {
  726    743   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  727    744   
                    body.bytes().unwrap(),
  728    745   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  729    746   
                )))
  730    747   
            });
  731         -
            de.deserialize_nonstreaming(&http_response)
         748  +
            // Build a config bag with the protocol for schema-based deserialization
         749  +
            #[allow(unused_mut)]
         750  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         751  +
         752  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  732    753   
        });
  733    754   
        let parsed = parsed
  734    755   
            .expect("should be successful response")
  735    756   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  736    757   
            .unwrap();
  737    758   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  738    759   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  739    760   
        ::pretty_assertions::assert_eq!(
  740    761   
            parsed.date_time_on_target,
  741    762   
            expected_output.date_time_on_target,
@@ -769,790 +829,854 @@
  789    810   
            .expect("the config must have a deserializer");
  790    811   
  791    812   
        let parsed = de.deserialize_streaming(&mut http_response);
  792    813   
        let parsed = parsed.unwrap_or_else(|| {
  793    814   
            let http_response = http_response.map(|body| {
  794    815   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  795    816   
                    body.bytes().unwrap(),
  796    817   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  797    818   
                )))
  798    819   
            });
  799         -
            de.deserialize_nonstreaming(&http_response)
         820  +
            // Build a config bag with the protocol for schema-based deserialization
         821  +
            #[allow(unused_mut)]
         822  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         823  +
         824  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  800    825   
        });
  801    826   
        let parsed = parsed
  802    827   
            .expect("should be successful response")
  803    828   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  804    829   
            .unwrap();
  805    830   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  806    831   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  807    832   
        ::pretty_assertions::assert_eq!(
  808    833   
            parsed.date_time_on_target,
  809    834   
            expected_output.date_time_on_target,
@@ -837,862 +897,926 @@
  857    882   
            .expect("the config must have a deserializer");
  858    883   
  859    884   
        let parsed = de.deserialize_streaming(&mut http_response);
  860    885   
        let parsed = parsed.unwrap_or_else(|| {
  861    886   
            let http_response = http_response.map(|body| {
  862    887   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  863    888   
                    body.bytes().unwrap(),
  864    889   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  865    890   
                )))
  866    891   
            });
  867         -
            de.deserialize_nonstreaming(&http_response)
         892  +
            // Build a config bag with the protocol for schema-based deserialization
         893  +
            #[allow(unused_mut)]
         894  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         895  +
         896  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  868    897   
        });
  869    898   
        let parsed = parsed
  870    899   
            .expect("should be successful response")
  871    900   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  872    901   
            .unwrap();
  873    902   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  874    903   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  875    904   
        ::pretty_assertions::assert_eq!(
  876    905   
            parsed.date_time_on_target,
  877    906   
            expected_output.date_time_on_target,
@@ -905,934 +965,998 @@
  925    954   
            .expect("the config must have a deserializer");
  926    955   
  927    956   
        let parsed = de.deserialize_streaming(&mut http_response);
  928    957   
        let parsed = parsed.unwrap_or_else(|| {
  929    958   
            let http_response = http_response.map(|body| {
  930    959   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  931    960   
                    body.bytes().unwrap(),
  932    961   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  933    962   
                )))
  934    963   
            });
  935         -
            de.deserialize_nonstreaming(&http_response)
         964  +
            // Build a config bag with the protocol for schema-based deserialization
         965  +
            #[allow(unused_mut)]
         966  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         967  +
         968  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  936    969   
        });
  937    970   
        let parsed = parsed
  938    971   
            .expect("should be successful response")
  939    972   
            .downcast::<crate::operation::xml_timestamps::XmlTimestampsOutput>()
  940    973   
            .unwrap();
  941    974   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  942    975   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  943    976   
        ::pretty_assertions::assert_eq!(
  944    977   
            parsed.date_time_on_target,
  945    978   
            expected_output.date_time_on_target,

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

@@ -43,43 +251,266 @@
   63     63   
    "normal",
   64     64   
    0,
   65     65   
);
   66     66   
static XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$dateTime",
   69     69   
        "aws.protocoltests.restxml.synthetic",
   70     70   
        "XmlTimestampsInput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Timestamp,
   73         -
    "date_time",
          73  +
    "dateTime",
   74     74   
    1,
   75     75   
)
   76     76   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   77     77   
static XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$dateTimeOnTarget",
   80     80   
        "aws.protocoltests.restxml.synthetic",
   81     81   
        "XmlTimestampsInput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Timestamp,
   84         -
    "date_time_on_target",
          84  +
    "dateTimeOnTarget",
   85     85   
    2,
   86         -
);
          86  +
)
          87  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   87     88   
static XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     89   
    ::aws_smithy_schema::ShapeId::from_static(
   89     90   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$epochSeconds",
   90     91   
        "aws.protocoltests.restxml.synthetic",
   91     92   
        "XmlTimestampsInput",
   92     93   
    ),
   93     94   
    ::aws_smithy_schema::ShapeType::Timestamp,
   94         -
    "epoch_seconds",
          95  +
    "epochSeconds",
   95     96   
    3,
   96     97   
)
   97     98   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
   98     99   
static XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99    100   
    ::aws_smithy_schema::ShapeId::from_static(
  100    101   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$epochSecondsOnTarget",
  101    102   
        "aws.protocoltests.restxml.synthetic",
  102    103   
        "XmlTimestampsInput",
  103    104   
    ),
  104    105   
    ::aws_smithy_schema::ShapeType::Timestamp,
  105         -
    "epoch_seconds_on_target",
         106  +
    "epochSecondsOnTarget",
  106    107   
    4,
  107         -
);
         108  +
)
         109  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  108    110   
static XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    111   
    ::aws_smithy_schema::ShapeId::from_static(
  110    112   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$httpDate",
  111    113   
        "aws.protocoltests.restxml.synthetic",
  112    114   
        "XmlTimestampsInput",
  113    115   
    ),
  114    116   
    ::aws_smithy_schema::ShapeType::Timestamp,
  115         -
    "http_date",
         117  +
    "httpDate",
  116    118   
    5,
  117    119   
)
  118    120   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  119    121   
static XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  120    122   
    ::aws_smithy_schema::ShapeId::from_static(
  121    123   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsInput$httpDateOnTarget",
  122    124   
        "aws.protocoltests.restxml.synthetic",
  123    125   
        "XmlTimestampsInput",
  124    126   
    ),
  125    127   
    ::aws_smithy_schema::ShapeType::Timestamp,
  126         -
    "http_date_on_target",
         128  +
    "httpDateOnTarget",
  127    129   
    6,
  128         -
);
         130  +
)
         131  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  129    132   
static XMLTIMESTAMPSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  130    133   
    XMLTIMESTAMPSINPUT_SCHEMA_ID,
  131    134   
    ::aws_smithy_schema::ShapeType::Structure,
  132    135   
    &[
  133    136   
        &XMLTIMESTAMPSINPUT_MEMBER_NORMAL,
  134    137   
        &XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME,
  135    138   
        &XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET,
  136    139   
        &XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS,
  137    140   
        &XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET,
  138    141   
        &XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE,
  139    142   
        &XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET,
  140    143   
    ],
  141         -
);
         144  +
)
         145  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/XmlTimestamps", None));
  142    146   
impl XmlTimestampsInput {
  143    147   
    /// The schema for this shape.
  144    148   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLTIMESTAMPSINPUT_SCHEMA;
  145    149   
}
  146    150   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlTimestampsInput {
  147    151   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  148    152   
    fn serialize_members(
  149    153   
        &self,
  150    154   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  151    155   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  152    156   
        if let Some(ref val) = self.normal {
  153    157   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_NORMAL, val)?;
  154    158   
        }
  155    159   
        if let Some(ref val) = self.date_time {
  156    160   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME, val)?;
  157    161   
        }
  158    162   
        if let Some(ref val) = self.date_time_on_target {
  159    163   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET, val)?;
  160    164   
        }
  161    165   
        if let Some(ref val) = self.epoch_seconds {
  162    166   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS, val)?;
  163    167   
        }
  164    168   
        if let Some(ref val) = self.epoch_seconds_on_target {
  165    169   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET, val)?;
  166    170   
        }
  167    171   
        if let Some(ref val) = self.http_date {
  168    172   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE, val)?;
  169    173   
        }
  170    174   
        if let Some(ref val) = self.http_date_on_target {
  171    175   
            ser.write_timestamp(&XMLTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET, val)?;
  172    176   
        }
  173    177   
        Ok(())
  174    178   
    }
  175    179   
}
  176    180   
impl XmlTimestampsInput {
  177    181   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  178         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  179         -
        deserializer: &mut D,
         182  +
    pub fn deserialize(
         183  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  180    184   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  181    185   
        #[allow(unused_variables, unused_mut)]
  182    186   
        let mut builder = Self::builder();
  183    187   
        #[allow(
  184    188   
            unused_variables,
  185    189   
            unreachable_code,
  186    190   
            clippy::single_match,
  187    191   
            clippy::match_single_binding,
  188    192   
            clippy::diverging_sub_expression
  189    193   
        )]
  190         -
        deserializer.read_struct(&XMLTIMESTAMPSINPUT_SCHEMA, (), |_, member, deser| {
         194  +
        deserializer.read_struct(&XMLTIMESTAMPSINPUT_SCHEMA, &mut |member, deser| {
  191    195   
            match member.member_index() {
  192    196   
                Some(0) => {
  193    197   
                    builder.normal = Some(deser.read_timestamp(member)?);
  194    198   
                }
  195    199   
                Some(1) => {
  196    200   
                    builder.date_time = Some(deser.read_timestamp(member)?);
  197    201   
                }
  198    202   
                Some(2) => {
  199    203   
                    builder.date_time_on_target = Some(deser.read_timestamp(member)?);
  200    204   
                }
  201    205   
                Some(3) => {
  202    206   
                    builder.epoch_seconds = Some(deser.read_timestamp(member)?);
  203    207   
                }
  204    208   
                Some(4) => {
  205    209   
                    builder.epoch_seconds_on_target = Some(deser.read_timestamp(member)?);
  206    210   
                }
  207    211   
                Some(5) => {
  208    212   
                    builder.http_date = Some(deser.read_timestamp(member)?);
  209    213   
                }
  210    214   
                Some(6) => {
  211    215   
                    builder.http_date_on_target = Some(deser.read_timestamp(member)?);
  212    216   
                }
  213    217   
                _ => {}
  214    218   
            }
  215    219   
            Ok(())
  216    220   
        })?;
  217    221   
        builder
  218    222   
            .build()
  219    223   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  220    224   
    }
  221    225   
}
         226  +
impl XmlTimestampsInput {
         227  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         228  +
    pub fn deserialize_with_response(
         229  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         230  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         231  +
        _status: u16,
         232  +
        _body: &[u8],
         233  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         234  +
        Self::deserialize(deserializer)
         235  +
    }
         236  +
}
  222    237   
impl XmlTimestampsInput {
  223    238   
    /// Creates a new builder-style object to manufacture [`XmlTimestampsInput`](crate::operation::xml_timestamps::XmlTimestampsInput).
  224    239   
    pub fn builder() -> crate::operation::xml_timestamps::builders::XmlTimestampsInputBuilder {
  225    240   
        crate::operation::xml_timestamps::builders::XmlTimestampsInputBuilder::default()
  226    241   
    }
  227    242   
}
  228    243   
  229    244   
/// A builder for [`XmlTimestampsInput`](crate::operation::xml_timestamps::XmlTimestampsInput).
  230    245   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  231    246   
#[non_exhaustive]

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

@@ -43,43 +249,263 @@
   63     63   
    "normal",
   64     64   
    0,
   65     65   
);
   66     66   
static XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$dateTime",
   69     69   
        "aws.protocoltests.restxml.synthetic",
   70     70   
        "XmlTimestampsOutput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Timestamp,
   73         -
    "date_time",
          73  +
    "dateTime",
   74     74   
    1,
   75     75   
)
   76     76   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   77     77   
static XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$dateTimeOnTarget",
   80     80   
        "aws.protocoltests.restxml.synthetic",
   81     81   
        "XmlTimestampsOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Timestamp,
   84         -
    "date_time_on_target",
          84  +
    "dateTimeOnTarget",
   85     85   
    2,
   86         -
);
          86  +
)
          87  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   87     88   
static XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     89   
    ::aws_smithy_schema::ShapeId::from_static(
   89     90   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$epochSeconds",
   90     91   
        "aws.protocoltests.restxml.synthetic",
   91     92   
        "XmlTimestampsOutput",
   92     93   
    ),
   93     94   
    ::aws_smithy_schema::ShapeType::Timestamp,
   94         -
    "epoch_seconds",
          95  +
    "epochSeconds",
   95     96   
    3,
   96     97   
)
   97     98   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
   98     99   
static XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99    100   
    ::aws_smithy_schema::ShapeId::from_static(
  100    101   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$epochSecondsOnTarget",
  101    102   
        "aws.protocoltests.restxml.synthetic",
  102    103   
        "XmlTimestampsOutput",
  103    104   
    ),
  104    105   
    ::aws_smithy_schema::ShapeType::Timestamp,
  105         -
    "epoch_seconds_on_target",
         106  +
    "epochSecondsOnTarget",
  106    107   
    4,
  107         -
);
         108  +
)
         109  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  108    110   
static XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    111   
    ::aws_smithy_schema::ShapeId::from_static(
  110    112   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$httpDate",
  111    113   
        "aws.protocoltests.restxml.synthetic",
  112    114   
        "XmlTimestampsOutput",
  113    115   
    ),
  114    116   
    ::aws_smithy_schema::ShapeType::Timestamp,
  115         -
    "http_date",
         117  +
    "httpDate",
  116    118   
    5,
  117    119   
)
  118    120   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  119    121   
static XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  120    122   
    ::aws_smithy_schema::ShapeId::from_static(
  121    123   
        "aws.protocoltests.restxml.synthetic#XmlTimestampsOutput$httpDateOnTarget",
  122    124   
        "aws.protocoltests.restxml.synthetic",
  123    125   
        "XmlTimestampsOutput",
  124    126   
    ),
  125    127   
    ::aws_smithy_schema::ShapeType::Timestamp,
  126         -
    "http_date_on_target",
         128  +
    "httpDateOnTarget",
  127    129   
    6,
  128         -
);
         130  +
)
         131  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  129    132   
static XMLTIMESTAMPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  130    133   
    XMLTIMESTAMPSOUTPUT_SCHEMA_ID,
  131    134   
    ::aws_smithy_schema::ShapeType::Structure,
  132    135   
    &[
  133    136   
        &XMLTIMESTAMPSOUTPUT_MEMBER_NORMAL,
  134    137   
        &XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME,
  135    138   
        &XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET,
  136    139   
        &XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS,
  137    140   
        &XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET,
  138    141   
        &XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE,
  139    142   
        &XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET,
  140    143   
    ],
  141    144   
);
  142    145   
impl XmlTimestampsOutput {
  143    146   
    /// The schema for this shape.
  144    147   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLTIMESTAMPSOUTPUT_SCHEMA;
  145    148   
}
  146    149   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlTimestampsOutput {
  147    150   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  148    151   
    fn serialize_members(
  149    152   
        &self,
  150    153   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  151    154   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  152    155   
        if let Some(ref val) = self.normal {
  153    156   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_NORMAL, val)?;
  154    157   
        }
  155    158   
        if let Some(ref val) = self.date_time {
  156    159   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME, val)?;
  157    160   
        }
  158    161   
        if let Some(ref val) = self.date_time_on_target {
  159    162   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET, val)?;
  160    163   
        }
  161    164   
        if let Some(ref val) = self.epoch_seconds {
  162    165   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS, val)?;
  163    166   
        }
  164    167   
        if let Some(ref val) = self.epoch_seconds_on_target {
  165    168   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET, val)?;
  166    169   
        }
  167    170   
        if let Some(ref val) = self.http_date {
  168    171   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE, val)?;
  169    172   
        }
  170    173   
        if let Some(ref val) = self.http_date_on_target {
  171    174   
            ser.write_timestamp(&XMLTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET, val)?;
  172    175   
        }
  173    176   
        Ok(())
  174    177   
    }
  175    178   
}
  176    179   
impl XmlTimestampsOutput {
  177    180   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  178         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  179         -
        deserializer: &mut D,
         181  +
    pub fn deserialize(
         182  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  180    183   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  181    184   
        #[allow(unused_variables, unused_mut)]
  182    185   
        let mut builder = Self::builder();
  183    186   
        #[allow(
  184    187   
            unused_variables,
  185    188   
            unreachable_code,
  186    189   
            clippy::single_match,
  187    190   
            clippy::match_single_binding,
  188    191   
            clippy::diverging_sub_expression
  189    192   
        )]
  190         -
        deserializer.read_struct(&XMLTIMESTAMPSOUTPUT_SCHEMA, (), |_, member, deser| {
         193  +
        deserializer.read_struct(&XMLTIMESTAMPSOUTPUT_SCHEMA, &mut |member, deser| {
  191    194   
            match member.member_index() {
  192    195   
                Some(0) => {
  193    196   
                    builder.normal = Some(deser.read_timestamp(member)?);
  194    197   
                }
  195    198   
                Some(1) => {
  196    199   
                    builder.date_time = Some(deser.read_timestamp(member)?);
  197    200   
                }
  198    201   
                Some(2) => {
  199    202   
                    builder.date_time_on_target = Some(deser.read_timestamp(member)?);
  200    203   
                }
  201    204   
                Some(3) => {
  202    205   
                    builder.epoch_seconds = Some(deser.read_timestamp(member)?);
  203    206   
                }
  204    207   
                Some(4) => {
  205    208   
                    builder.epoch_seconds_on_target = Some(deser.read_timestamp(member)?);
  206    209   
                }
  207    210   
                Some(5) => {
  208    211   
                    builder.http_date = Some(deser.read_timestamp(member)?);
  209    212   
                }
  210    213   
                Some(6) => {
  211    214   
                    builder.http_date_on_target = Some(deser.read_timestamp(member)?);
  212    215   
                }
  213    216   
                _ => {}
  214    217   
            }
  215    218   
            Ok(())
  216    219   
        })?;
  217    220   
        Ok(builder.build())
  218    221   
    }
  219    222   
}
         223  +
impl XmlTimestampsOutput {
         224  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         225  +
    pub fn deserialize_with_response(
         226  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         227  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         228  +
        _status: u16,
         229  +
        _body: &[u8],
         230  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         231  +
        Self::deserialize(deserializer)
         232  +
    }
         233  +
}
  220    234   
impl XmlTimestampsOutput {
  221    235   
    /// Creates a new builder-style object to manufacture [`XmlTimestampsOutput`](crate::operation::xml_timestamps::XmlTimestampsOutput).
  222    236   
    pub fn builder() -> crate::operation::xml_timestamps::builders::XmlTimestampsOutputBuilder {
  223    237   
        crate::operation::xml_timestamps::builders::XmlTimestampsOutputBuilder::default()
  224    238   
    }
  225    239   
}
  226    240   
  227    241   
/// A builder for [`XmlTimestampsOutput`](crate::operation::xml_timestamps::XmlTimestampsOutput).
  228    242   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  229    243   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/xml_unions.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 `XmlUnions`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct XmlUnions;
    6      6   
impl XmlUnions {
    7      7   
    /// Creates a new `XmlUnions`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_unions::XmlUnionsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::xml_unions::XmlUnionsOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::xml_unions::XmlUnionsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::xml_unions::XmlUnionsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::xml_unions::XmlUnionsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct XmlUnionsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for XmlUnionsResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_xml_unions::de_xml_unions_http_error(status, headers, body)
  146    151   
        } else {
@@ -395,400 +587,608 @@
  415    420   
            .expect("the config must have a deserializer");
  416    421   
  417    422   
        let parsed = de.deserialize_streaming(&mut http_response);
  418    423   
        let parsed = parsed.unwrap_or_else(|| {
  419    424   
            let http_response = http_response.map(|body| {
  420    425   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  421    426   
                    body.bytes().unwrap(),
  422    427   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  423    428   
                )))
  424    429   
            });
  425         -
            de.deserialize_nonstreaming(&http_response)
         430  +
            // Build a config bag with the protocol for schema-based deserialization
         431  +
            #[allow(unused_mut)]
         432  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         433  +
         434  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  426    435   
        });
  427    436   
        let parsed = parsed
  428    437   
            .expect("should be successful response")
  429    438   
            .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
  430    439   
            .unwrap();
  431    440   
        ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
  432    441   
    }
  433    442   
  434    443   
    /// Serializes union string member
  435    444   
    /// Test ID: XmlUnionsWithStringMember
  436    445   
    #[::tokio::test]
  437    446   
    #[::tracing_test::traced_test]
  438    447   
    async fn xml_unions_with_string_member_response() {
  439    448   
        let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
  440    449   
            .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::StringValue(
  441    450   
                "some string".to_owned(),
  442    451   
            )))
  443    452   
            .build();
  444    453   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  445    454   
            ::http_1x::response::Builder::new()
  446    455   
                .header("Content-Type", "application/xml")
  447    456   
                .status(200)
  448    457   
                .body(::aws_smithy_types::body::SdkBody::from(
  449    458   
                    "<XmlUnionsResponse>\n   <unionValue>\n      <stringValue>some string</stringValue>\n   </unionValue>\n</XmlUnionsResponse>\n",
  450    459   
                ))
  451    460   
                .unwrap(),
  452    461   
        )
  453    462   
        .unwrap();
  454    463   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  455    464   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  456    465   
  457    466   
        let op = crate::operation::xml_unions::XmlUnions::new();
  458    467   
        let config = op.config().expect("the operation has config");
  459    468   
        let de = config
  460    469   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  461    470   
            .expect("the config must have a deserializer");
  462    471   
  463    472   
        let parsed = de.deserialize_streaming(&mut http_response);
  464    473   
        let parsed = parsed.unwrap_or_else(|| {
  465    474   
            let http_response = http_response.map(|body| {
  466    475   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  467    476   
                    body.bytes().unwrap(),
  468    477   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  469    478   
                )))
  470    479   
            });
  471         -
            de.deserialize_nonstreaming(&http_response)
         480  +
            // Build a config bag with the protocol for schema-based deserialization
         481  +
            #[allow(unused_mut)]
         482  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         483  +
         484  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  472    485   
        });
  473    486   
        let parsed = parsed
  474    487   
            .expect("should be successful response")
  475    488   
            .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
  476    489   
            .unwrap();
  477    490   
        ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
  478    491   
    }
  479    492   
  480    493   
    /// Serializes union boolean member
  481    494   
    /// Test ID: XmlUnionsWithBooleanMember
  482    495   
    #[::tokio::test]
  483    496   
    #[::tracing_test::traced_test]
  484    497   
    async fn xml_unions_with_boolean_member_response() {
  485    498   
        let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
  486    499   
            .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::BooleanValue(true)))
  487    500   
            .build();
  488    501   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  489    502   
            ::http_1x::response::Builder::new()
  490    503   
                .header("Content-Type", "application/xml")
  491    504   
                .status(200)
  492    505   
                .body(::aws_smithy_types::body::SdkBody::from(
  493    506   
                    "<XmlUnionsResponse>\n   <unionValue>\n      <booleanValue>true</booleanValue>\n   </unionValue>\n</XmlUnionsResponse>\n",
  494    507   
                ))
  495    508   
                .unwrap(),
  496    509   
        )
  497    510   
        .unwrap();
  498    511   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  499    512   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  500    513   
  501    514   
        let op = crate::operation::xml_unions::XmlUnions::new();
  502    515   
        let config = op.config().expect("the operation has config");
  503    516   
        let de = config
  504    517   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  505    518   
            .expect("the config must have a deserializer");
  506    519   
  507    520   
        let parsed = de.deserialize_streaming(&mut http_response);
  508    521   
        let parsed = parsed.unwrap_or_else(|| {
  509    522   
            let http_response = http_response.map(|body| {
  510    523   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  511    524   
                    body.bytes().unwrap(),
  512    525   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  513    526   
                )))
  514    527   
            });
  515         -
            de.deserialize_nonstreaming(&http_response)
         528  +
            // Build a config bag with the protocol for schema-based deserialization
         529  +
            #[allow(unused_mut)]
         530  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         531  +
         532  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  516    533   
        });
  517    534   
        let parsed = parsed
  518    535   
            .expect("should be successful response")
  519    536   
            .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
  520    537   
            .unwrap();
  521    538   
        ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
  522    539   
    }
  523    540   
  524    541   
    /// Serializes union member
  525    542   
    /// Test ID: XmlUnionsWithUnionMember
  526    543   
    #[::tokio::test]
  527    544   
    #[::tracing_test::traced_test]
  528    545   
    async fn xml_unions_with_union_member_response() {
  529    546   
        let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
  530    547   
            .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::UnionValue(
  531    548   
                ::std::boxed::Box::new(crate::types::XmlUnionShape::BooleanValue(true)),
  532    549   
            )))
  533    550   
            .build();
  534    551   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  535    552   
        .header("Content-Type", "application/xml")
  536    553   
        .status(200)
  537    554   
                    .body(::aws_smithy_types::body::SdkBody::from("<XmlUnionsResponse>\n   <unionValue>\n      <unionValue>\n         <booleanValue>true</booleanValue>\n      </unionValue>\n   </unionValue>\n</XmlUnionsResponse>\n"))
  538    555   
                    .unwrap()
  539    556   
                    ).unwrap();
  540    557   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  541    558   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  542    559   
  543    560   
        let op = crate::operation::xml_unions::XmlUnions::new();
  544    561   
        let config = op.config().expect("the operation has config");
  545    562   
        let de = config
  546    563   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  547    564   
            .expect("the config must have a deserializer");
  548    565   
  549    566   
        let parsed = de.deserialize_streaming(&mut http_response);
  550    567   
        let parsed = parsed.unwrap_or_else(|| {
  551    568   
            let http_response = http_response.map(|body| {
  552    569   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  553    570   
                    body.bytes().unwrap(),
  554    571   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  555    572   
                )))
  556    573   
            });
  557         -
            de.deserialize_nonstreaming(&http_response)
         574  +
            // Build a config bag with the protocol for schema-based deserialization
         575  +
            #[allow(unused_mut)]
         576  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         577  +
         578  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  558    579   
        });
  559    580   
        let parsed = parsed
  560    581   
            .expect("should be successful response")
  561    582   
            .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
  562    583   
            .unwrap();
  563    584   
        ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
  564    585   
    }
  565    586   
}
  566    587   
  567    588   
/// Error type for the `XmlUnionsError` operation.

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

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

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

@@ -1,1 +109,117 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "XmlUnionsOutput",
   19     19   
);
   20     20   
static XMLUNIONSOUTPUT_MEMBER_UNION_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#XmlUnionsOutput$unionValue",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "XmlUnionsOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Union,
   27         -
    "union_value",
          27  +
    "unionValue",
   28     28   
    0,
   29     29   
);
   30     30   
static XMLUNIONSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    XMLUNIONSOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&XMLUNIONSOUTPUT_MEMBER_UNION_VALUE],
   34     34   
);
   35     35   
impl XmlUnionsOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &XMLUNIONSOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for XmlUnionsOutput {
   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.union_value {
   46         -
            ser.write_null(&XMLUNIONSOUTPUT_MEMBER_UNION_VALUE)?;
          46  +
            ser.write_struct(&XMLUNIONSOUTPUT_MEMBER_UNION_VALUE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl XmlUnionsOutput {
   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(&XMLUNIONSOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&XMLUNIONSOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68         -
                    builder.union_value = Some({
   69         -
                        let _ = member;
   70         -
                        todo!("deserialize aggregate")
   71         -
                    });
          68  +
                    builder.union_value = Some(crate::types::XmlUnionShape::deserialize(deser)?);
   72     69   
                }
   73     70   
                _ => {}
   74     71   
            }
   75     72   
            Ok(())
   76     73   
        })?;
   77     74   
        Ok(builder.build())
   78     75   
    }
   79     76   
}
          77  +
impl XmlUnionsOutput {
          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  +
}
   80     88   
impl XmlUnionsOutput {
   81     89   
    /// Creates a new builder-style object to manufacture [`XmlUnionsOutput`](crate::operation::xml_unions::XmlUnionsOutput).
   82     90   
    pub fn builder() -> crate::operation::xml_unions::builders::XmlUnionsOutputBuilder {
   83     91   
        crate::operation::xml_unions::builders::XmlUnionsOutputBuilder::default()
   84     92   
    }
   85     93   
}
   86     94   
   87     95   
/// A builder for [`XmlUnionsOutput`](crate::operation::xml_unions::XmlUnionsOutput).
   88     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89     97   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_complex_nested_error_data.rs

@@ -1,1 +106,117 @@
   17     17   
    "aws.protocoltests.restxml",
   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.restxml#ComplexNestedErrorData$Foo",
   23     23   
        "aws.protocoltests.restxml",
   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/rust-client-codegen/src/types/_greeting_struct.rs

@@ -16,16 +99,110 @@
   36     36   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   37     37   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   38     38   
        if let Some(ref val) = self.hi {
   39     39   
            ser.write_string(&GREETINGSTRUCT_MEMBER_HI, val)?;
   40     40   
        }
   41     41   
        Ok(())
   42     42   
    }
   43     43   
}
   44     44   
impl GreetingStruct {
   45     45   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   46         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   47         -
        deserializer: &mut D,
          46  +
    pub fn deserialize(
          47  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   48     48   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        #[allow(unused_variables, unused_mut)]
   50     50   
        let mut builder = Self::builder();
   51     51   
        #[allow(
   52     52   
            unused_variables,
   53     53   
            unreachable_code,
   54     54   
            clippy::single_match,
   55     55   
            clippy::match_single_binding,
   56     56   
            clippy::diverging_sub_expression
   57     57   
        )]
   58         -
        deserializer.read_struct(&GREETINGSTRUCT_SCHEMA, (), |_, member, deser| {
          58  +
        deserializer.read_struct(&GREETINGSTRUCT_SCHEMA, &mut |member, deser| {
   59     59   
            match member.member_index() {
   60     60   
                Some(0) => {
   61     61   
                    builder.hi = Some(deser.read_string(member)?);
   62     62   
                }
   63     63   
                _ => {}
   64     64   
            }
   65     65   
            Ok(())
   66     66   
        })?;
   67     67   
        Ok(builder.build())
   68     68   
    }
   69     69   
}
          70  +
impl GreetingStruct {
          71  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          72  +
    pub fn deserialize_with_response(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          74  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          75  +
        _status: u16,
          76  +
        _body: &[u8],
          77  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          78  +
        Self::deserialize(deserializer)
          79  +
    }
          80  +
}
   70     81   
impl GreetingStruct {
   71     82   
    /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::types::GreetingStruct).
   72     83   
    pub fn builder() -> crate::types::builders::GreetingStructBuilder {
   73     84   
        crate::types::builders::GreetingStructBuilder::default()
   74     85   
    }
   75     86   
}
   76     87   
   77     88   
/// A builder for [`GreetingStruct`](crate::types::GreetingStruct).
   78     89   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   79     90   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_nested_payload.rs

@@ -39,39 +125,136 @@
   59     59   
            ser.write_string(&NESTEDPAYLOAD_MEMBER_GREETING, val)?;
   60     60   
        }
   61     61   
        if let Some(ref val) = self.name {
   62     62   
            ser.write_string(&NESTEDPAYLOAD_MEMBER_NAME, val)?;
   63     63   
        }
   64     64   
        Ok(())
   65     65   
    }
   66     66   
}
   67     67   
impl NestedPayload {
   68     68   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   69         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   70         -
        deserializer: &mut D,
          69  +
    pub fn deserialize(
          70  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   71     71   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   72     72   
        #[allow(unused_variables, unused_mut)]
   73     73   
        let mut builder = Self::builder();
   74     74   
        #[allow(
   75     75   
            unused_variables,
   76     76   
            unreachable_code,
   77     77   
            clippy::single_match,
   78     78   
            clippy::match_single_binding,
   79     79   
            clippy::diverging_sub_expression
   80     80   
        )]
   81         -
        deserializer.read_struct(&NESTEDPAYLOAD_SCHEMA, (), |_, member, deser| {
          81  +
        deserializer.read_struct(&NESTEDPAYLOAD_SCHEMA, &mut |member, deser| {
   82     82   
            match member.member_index() {
   83     83   
                Some(0) => {
   84     84   
                    builder.greeting = Some(deser.read_string(member)?);
   85     85   
                }
   86     86   
                Some(1) => {
   87     87   
                    builder.name = Some(deser.read_string(member)?);
   88     88   
                }
   89     89   
                _ => {}
   90     90   
            }
   91     91   
            Ok(())
   92     92   
        })?;
   93     93   
        Ok(builder.build())
   94     94   
    }
   95     95   
}
          96  +
impl NestedPayload {
          97  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          98  +
    pub fn deserialize_with_response(
          99  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         100  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         101  +
        _status: u16,
         102  +
        _body: &[u8],
         103  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         104  +
        Self::deserialize(deserializer)
         105  +
    }
         106  +
}
   96    107   
impl NestedPayload {
   97    108   
    /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::types::NestedPayload).
   98    109   
    pub fn builder() -> crate::types::builders::NestedPayloadBuilder {
   99    110   
        crate::types::builders::NestedPayloadBuilder::default()
  100    111   
    }
  101    112   
}
  102    113   
  103    114   
/// A builder for [`NestedPayload`](crate::types::NestedPayload).
  104    115   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  105    116   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/types/_payload_with_xml_name.rs

@@ -24,24 +107,118 @@
   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.name {
   47     47   
            ser.write_string(&PAYLOADWITHXMLNAME_MEMBER_NAME, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl PayloadWithXmlName {
   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(&PAYLOADWITHXMLNAME_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&PAYLOADWITHXMLNAME_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.name = 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 PayloadWithXmlName {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   78     89   
impl PayloadWithXmlName {
   79     90   
    /// Creates a new builder-style object to manufacture [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
   80     91   
    pub fn builder() -> crate::types::builders::PayloadWithXmlNameBuilder {
   81     92   
        crate::types::builders::PayloadWithXmlNameBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`PayloadWithXmlName`](crate::types::PayloadWithXmlName).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]