Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

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

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

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

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

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

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

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

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `HttpPrefixHeaders`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpPrefixHeaders;
    6      6   
impl HttpPrefixHeaders {
    7      7   
    /// Creates a new `HttpPrefixHeaders`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_prefix_headers::HttpPrefixHeadersInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_prefix_headers::HttpPrefixHeadersOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::http_prefix_headers::HttpPrefixHeadersInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_prefix_headers::HttpPrefixHeadersOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_prefix_headers::HttpPrefixHeadersError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::http_prefix_headers::HttpPrefixHeadersError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HttpPrefixHeadersResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPrefixHeadersResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_http_error(status, headers, body)
  152    157   
        } else {
@@ -356,361 +460,473 @@
  376    381   
            .expect("the config must have a deserializer");
  377    382   
  378    383   
        let parsed = de.deserialize_streaming(&mut http_response);
  379    384   
        let parsed = parsed.unwrap_or_else(|| {
  380    385   
            let http_response = http_response.map(|body| {
  381    386   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  382    387   
                    body.bytes().unwrap(),
  383    388   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  384    389   
                )))
  385    390   
            });
  386         -
            de.deserialize_nonstreaming(&http_response)
         391  +
            // Build a config bag with the protocol for schema-based deserialization
         392  +
            #[allow(unused_mut)]
         393  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         394  +
         395  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  387    396   
        });
  388    397   
        let parsed = parsed
  389    398   
            .expect("should be successful response")
  390    399   
            .downcast::<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput>()
  391    400   
            .unwrap();
  392    401   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  393    402   
        ::pretty_assertions::assert_eq!(parsed.foo_map, expected_output.foo_map, "Unexpected value for `foo_map`");
  394    403   
    }
  395    404   
  396    405   
    /// No prefix headers are serialized because the value is empty
  397    406   
    /// Test ID: HttpPrefixHeadersAreNotPresent
  398    407   
    #[::tokio::test]
  399    408   
    #[::tracing_test::traced_test]
  400    409   
    async fn http_prefix_headers_are_not_present_response() {
  401    410   
        let expected_output = crate::operation::http_prefix_headers::HttpPrefixHeadersOutput::builder()
  402    411   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  403    412   
            .set_foo_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  404    413   
            .build();
  405    414   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  406    415   
            ::http_1x::response::Builder::new()
  407    416   
                .header("x-foo", "Foo")
  408    417   
                .status(200)
  409    418   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  410    419   
                .unwrap(),
  411    420   
        )
  412    421   
        .unwrap();
  413    422   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  414    423   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  415    424   
  416    425   
        let op = crate::operation::http_prefix_headers::HttpPrefixHeaders::new();
  417    426   
        let config = op.config().expect("the operation has config");
  418    427   
        let de = config
  419    428   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  420    429   
            .expect("the config must have a deserializer");
  421    430   
  422    431   
        let parsed = de.deserialize_streaming(&mut http_response);
  423    432   
        let parsed = parsed.unwrap_or_else(|| {
  424    433   
            let http_response = http_response.map(|body| {
  425    434   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  426    435   
                    body.bytes().unwrap(),
  427    436   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  428    437   
                )))
  429    438   
            });
  430         -
            de.deserialize_nonstreaming(&http_response)
         439  +
            // Build a config bag with the protocol for schema-based deserialization
         440  +
            #[allow(unused_mut)]
         441  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         442  +
         443  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  431    444   
        });
  432    445   
        let parsed = parsed
  433    446   
            .expect("should be successful response")
  434    447   
            .downcast::<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput>()
  435    448   
            .unwrap();
  436    449   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  437    450   
        ::pretty_assertions::assert_eq!(parsed.foo_map, expected_output.foo_map, "Unexpected value for `foo_map`");
  438    451   
    }
  439    452   
}
  440    453   

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

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

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

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

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `HttpRequestWithFloatLabels`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithFloatLabels;
    6      6   
impl HttpRequestWithFloatLabels {
    7      7   
    /// Creates a new `HttpRequestWithFloatLabels`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct HttpRequestWithFloatLabelsResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithFloatLabelsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_http_error(status, headers, body)
  152    159   
        } else {

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

@@ -25,25 +135,153 @@
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_label();
   48     48   
static HTTPREQUESTWITHFLOATLABELSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPREQUESTWITHFLOATLABELSINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &HTTPREQUESTWITHFLOATLABELSINPUT_MEMBER_FLOAT,
   53     53   
        &HTTPREQUESTWITHFLOATLABELSINPUT_MEMBER_DOUBLE,
   54     54   
    ],
   55         -
);
          55  +
)
          56  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          57  +
    "GET",
          58  +
    "/FloatHttpLabels/{float}/{double}",
          59  +
    None,
          60  +
));
   56     61   
impl HttpRequestWithFloatLabelsInput {
   57     62   
    /// The schema for this shape.
   58     63   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHFLOATLABELSINPUT_SCHEMA;
   59     64   
}
   60     65   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithFloatLabelsInput {
   61     66   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     67   
    fn serialize_members(
   63     68   
        &self,
   64     69   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     70   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     71   
        if let Some(ref val) = self.float {
   67     72   
            ser.write_float(&HTTPREQUESTWITHFLOATLABELSINPUT_MEMBER_FLOAT, *val)?;
   68     73   
        }
   69     74   
        if let Some(ref val) = self.double {
   70     75   
            ser.write_double(&HTTPREQUESTWITHFLOATLABELSINPUT_MEMBER_DOUBLE, *val)?;
   71     76   
        }
   72     77   
        Ok(())
   73     78   
    }
   74     79   
}
   75     80   
impl HttpRequestWithFloatLabelsInput {
   76     81   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          82  +
    pub fn deserialize(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     84   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     85   
        #[allow(unused_variables, unused_mut)]
   81     86   
        let mut builder = Self::builder();
   82     87   
        #[allow(
   83     88   
            unused_variables,
   84     89   
            unreachable_code,
   85     90   
            clippy::single_match,
   86     91   
            clippy::match_single_binding,
   87     92   
            clippy::diverging_sub_expression
   88     93   
        )]
   89         -
        deserializer.read_struct(&HTTPREQUESTWITHFLOATLABELSINPUT_SCHEMA, (), |_, member, deser| {
          94  +
        deserializer.read_struct(&HTTPREQUESTWITHFLOATLABELSINPUT_SCHEMA, &mut |member, deser| {
   90     95   
            match member.member_index() {
   91     96   
                Some(0) => {
   92     97   
                    builder.float = Some(deser.read_float(member)?);
   93     98   
                }
   94     99   
                Some(1) => {
   95    100   
                    builder.double = Some(deser.read_double(member)?);
   96    101   
                }
   97    102   
                _ => {}
   98    103   
            }
   99    104   
            Ok(())
  100    105   
        })?;
         106  +
        builder.float = builder.float.or(Some(0.0f32));
         107  +
        builder.double = builder.double.or(Some(0.0f64));
  101    108   
        builder
  102    109   
            .build()
  103    110   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    111   
    }
  105    112   
}
         113  +
impl HttpRequestWithFloatLabelsInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         115  +
    pub fn deserialize_with_response(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         118  +
        _status: u16,
         119  +
        _body: &[u8],
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        Self::deserialize(deserializer)
         122  +
    }
         123  +
}
  106    124   
impl HttpRequestWithFloatLabelsInput {
  107    125   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithFloatLabelsInput`](crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsInput).
  108    126   
    pub fn builder() -> crate::operation::http_request_with_float_labels::builders::HttpRequestWithFloatLabelsInputBuilder {
  109    127   
        crate::operation::http_request_with_float_labels::builders::HttpRequestWithFloatLabelsInputBuilder::default()
  110    128   
    }
  111    129   
}
  112    130   
  113    131   
/// A builder for [`HttpRequestWithFloatLabelsInput`](crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsInput).
  114    132   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    133   
#[non_exhaustive]

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

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

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `HttpRequestWithGreedyLabelInPath`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithGreedyLabelInPath;
    6      6   
impl HttpRequestWithGreedyLabelInPath {
    7      7   
    /// Creates a new `HttpRequestWithGreedyLabelInPath`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct HttpRequestWithGreedyLabelInPathResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithGreedyLabelInPathResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_error(
  152    159   
                status, headers, body,

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

@@ -25,25 +135,153 @@
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_label();
   48     48   
static HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_FOO,
   53     53   
        &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_BAZ,
   54     54   
    ],
   55         -
);
          55  +
)
          56  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          57  +
    "GET",
          58  +
    "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}",
          59  +
    None,
          60  +
));
   56     61   
impl HttpRequestWithGreedyLabelInPathInput {
   57     62   
    /// The schema for this shape.
   58     63   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA;
   59     64   
}
   60     65   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithGreedyLabelInPathInput {
   61     66   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     67   
    fn serialize_members(
   63     68   
        &self,
   64     69   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     70   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     71   
        if let Some(ref val) = self.foo {
   67     72   
            ser.write_string(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_FOO, val)?;
   68     73   
        }
   69     74   
        if let Some(ref val) = self.baz {
   70     75   
            ser.write_string(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_BAZ, val)?;
   71     76   
        }
   72     77   
        Ok(())
   73     78   
    }
   74     79   
}
   75     80   
impl HttpRequestWithGreedyLabelInPathInput {
   76     81   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          82  +
    pub fn deserialize(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     84   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     85   
        #[allow(unused_variables, unused_mut)]
   81     86   
        let mut builder = Self::builder();
   82     87   
        #[allow(
   83     88   
            unused_variables,
   84     89   
            unreachable_code,
   85     90   
            clippy::single_match,
   86     91   
            clippy::match_single_binding,
   87     92   
            clippy::diverging_sub_expression
   88     93   
        )]
   89         -
        deserializer.read_struct(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA, (), |_, member, deser| {
          94  +
        deserializer.read_struct(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA, &mut |member, deser| {
   90     95   
            match member.member_index() {
   91     96   
                Some(0) => {
   92     97   
                    builder.foo = Some(deser.read_string(member)?);
   93     98   
                }
   94     99   
                Some(1) => {
   95    100   
                    builder.baz = Some(deser.read_string(member)?);
   96    101   
                }
   97    102   
                _ => {}
   98    103   
            }
   99    104   
            Ok(())
  100    105   
        })?;
         106  +
        builder.foo = builder.foo.or(Some(String::new()));
         107  +
        builder.baz = builder.baz.or(Some(String::new()));
  101    108   
        builder
  102    109   
            .build()
  103    110   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    111   
    }
  105    112   
}
         113  +
impl HttpRequestWithGreedyLabelInPathInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         115  +
    pub fn deserialize_with_response(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         118  +
        _status: u16,
         119  +
        _body: &[u8],
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        Self::deserialize(deserializer)
         122  +
    }
         123  +
}
  106    124   
impl HttpRequestWithGreedyLabelInPathInput {
  107    125   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithGreedyLabelInPathInput`](crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput).
  108    126   
    pub fn builder() -> crate::operation::http_request_with_greedy_label_in_path::builders::HttpRequestWithGreedyLabelInPathInputBuilder {
  109    127   
        crate::operation::http_request_with_greedy_label_in_path::builders::HttpRequestWithGreedyLabelInPathInputBuilder::default()
  110    128   
    }
  111    129   
}
  112    130   
  113    131   
/// A builder for [`HttpRequestWithGreedyLabelInPathInput`](crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput).
  114    132   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    133   
#[non_exhaustive]

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_request_with_labels.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 `HttpRequestWithLabels`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithLabels;
    6      6   
impl HttpRequestWithLabels {
    7      7   
    /// Creates a new `HttpRequestWithLabels`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_request_with_labels::HttpRequestWithLabelsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::http_request_with_labels::HttpRequestWithLabelsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_request_with_labels::HttpRequestWithLabelsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +172,177 @@
  130    134   
                crate::operation::http_request_with_labels::HttpRequestWithLabelsError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HttpRequestWithLabelsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithLabelsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    150   
        let headers = response.headers();
  146    151   
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150    155   
        let parse_result = if !success && status != 200 || force_error {
  151    156   
            crate::protocol_serde::shape_http_request_with_labels::de_http_request_with_labels_http_error(status, headers, body)
  152    157   
        } else {

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

@@ -133,133 +279,303 @@
  153    153   
    &[
  154    154   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_STRING,
  155    155   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_SHORT,
  156    156   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_INTEGER,
  157    157   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_LONG,
  158    158   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_FLOAT,
  159    159   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_DOUBLE,
  160    160   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_BOOLEAN,
  161    161   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_TIMESTAMP,
  162    162   
    ],
  163         -
);
         163  +
)
         164  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         165  +
    "GET",
         166  +
    "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}",
         167  +
    None,
         168  +
));
  164    169   
impl HttpRequestWithLabelsInput {
  165    170   
    /// The schema for this shape.
  166    171   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHLABELSINPUT_SCHEMA;
  167    172   
}
  168    173   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithLabelsInput {
  169    174   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  170    175   
    fn serialize_members(
  171    176   
        &self,
  172    177   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  173    178   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  174    179   
        if let Some(ref val) = self.string {
  175    180   
            ser.write_string(&HTTPREQUESTWITHLABELSINPUT_MEMBER_STRING, val)?;
  176    181   
        }
  177    182   
        if let Some(ref val) = self.short {
  178    183   
            ser.write_short(&HTTPREQUESTWITHLABELSINPUT_MEMBER_SHORT, *val)?;
  179    184   
        }
  180    185   
        if let Some(ref val) = self.integer {
  181    186   
            ser.write_integer(&HTTPREQUESTWITHLABELSINPUT_MEMBER_INTEGER, *val)?;
  182    187   
        }
  183    188   
        if let Some(ref val) = self.long {
  184    189   
            ser.write_long(&HTTPREQUESTWITHLABELSINPUT_MEMBER_LONG, *val)?;
  185    190   
        }
  186    191   
        if let Some(ref val) = self.float {
  187    192   
            ser.write_float(&HTTPREQUESTWITHLABELSINPUT_MEMBER_FLOAT, *val)?;
  188    193   
        }
  189    194   
        if let Some(ref val) = self.double {
  190    195   
            ser.write_double(&HTTPREQUESTWITHLABELSINPUT_MEMBER_DOUBLE, *val)?;
  191    196   
        }
  192    197   
        if let Some(ref val) = self.boolean {
  193    198   
            ser.write_boolean(&HTTPREQUESTWITHLABELSINPUT_MEMBER_BOOLEAN, *val)?;
  194    199   
        }
  195    200   
        if let Some(ref val) = self.timestamp {
  196    201   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSINPUT_MEMBER_TIMESTAMP, val)?;
  197    202   
        }
  198    203   
        Ok(())
  199    204   
    }
  200    205   
}
  201    206   
impl HttpRequestWithLabelsInput {
  202    207   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  203         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  204         -
        deserializer: &mut D,
         208  +
    pub fn deserialize(
         209  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  205    210   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  206    211   
        #[allow(unused_variables, unused_mut)]
  207    212   
        let mut builder = Self::builder();
  208    213   
        #[allow(
  209    214   
            unused_variables,
  210    215   
            unreachable_code,
  211    216   
            clippy::single_match,
  212    217   
            clippy::match_single_binding,
  213    218   
            clippy::diverging_sub_expression
  214    219   
        )]
  215         -
        deserializer.read_struct(&HTTPREQUESTWITHLABELSINPUT_SCHEMA, (), |_, member, deser| {
         220  +
        deserializer.read_struct(&HTTPREQUESTWITHLABELSINPUT_SCHEMA, &mut |member, deser| {
  216    221   
            match member.member_index() {
  217    222   
                Some(0) => {
  218    223   
                    builder.string = Some(deser.read_string(member)?);
  219    224   
                }
  220    225   
                Some(1) => {
  221    226   
                    builder.short = Some(deser.read_short(member)?);
  222    227   
                }
  223    228   
                Some(2) => {
  224    229   
                    builder.integer = Some(deser.read_integer(member)?);
  225    230   
                }
  226    231   
                Some(3) => {
  227    232   
                    builder.long = Some(deser.read_long(member)?);
  228    233   
                }
  229    234   
                Some(4) => {
  230    235   
                    builder.float = Some(deser.read_float(member)?);
  231    236   
                }
  232    237   
                Some(5) => {
  233    238   
                    builder.double = Some(deser.read_double(member)?);
  234    239   
                }
  235    240   
                Some(6) => {
  236    241   
                    builder.boolean = Some(deser.read_boolean(member)?);
  237    242   
                }
  238    243   
                Some(7) => {
  239    244   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
  240    245   
                }
  241    246   
                _ => {}
  242    247   
            }
  243    248   
            Ok(())
  244    249   
        })?;
         250  +
        builder.string = builder.string.or(Some(String::new()));
         251  +
        builder.short = builder.short.or(Some(0i16));
         252  +
        builder.integer = builder.integer.or(Some(0i32));
         253  +
        builder.long = builder.long.or(Some(0i64));
         254  +
        builder.float = builder.float.or(Some(0.0f32));
         255  +
        builder.double = builder.double.or(Some(0.0f64));
         256  +
        builder.boolean = builder.boolean.or(Some(false));
         257  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  245    258   
        builder
  246    259   
            .build()
  247    260   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  248    261   
    }
  249    262   
}
         263  +
impl HttpRequestWithLabelsInput {
         264  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         265  +
    pub fn deserialize_with_response(
         266  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         267  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         268  +
        _status: u16,
         269  +
        _body: &[u8],
         270  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         271  +
        Self::deserialize(deserializer)
         272  +
    }
         273  +
}
  250    274   
impl HttpRequestWithLabelsInput {
  251    275   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithLabelsInput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsInput).
  252    276   
    pub fn builder() -> crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsInputBuilder {
  253    277   
        crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsInputBuilder::default()
  254    278   
    }
  255    279   
}
  256    280   
  257    281   
/// A builder for [`HttpRequestWithLabelsInput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsInput).
  258    282   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  259    283   
#[non_exhaustive]

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

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