Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes/_recursive_shapes_input.rs

@@ -4,4 +108,120 @@
   24     24   
        "RecursiveShapesInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27     27   
    "nested",
   28     28   
    0,
   29     29   
);
   30     30   
static RECURSIVESHAPESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    RECURSIVESHAPESINPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&RECURSIVESHAPESINPUT_MEMBER_NESTED],
   34         -
);
          34  +
)
          35  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/RecursiveShapes", None));
   35     36   
impl RecursiveShapesInput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RECURSIVESHAPESINPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for RecursiveShapesInput {
   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.nested {
   46     47   
            ser.write_struct(&RECURSIVESHAPESINPUT_MEMBER_NESTED, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl RecursiveShapesInput {
   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(&RECURSIVESHAPESINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&RECURSIVESHAPESINPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.nested = Some(crate::types::RecursiveShapesInputOutputNested1::deserialize(deser)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
   74     75   
        builder
   75     76   
            .build()
   76     77   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     78   
    }
   78     79   
}
          80  +
impl RecursiveShapesInput {
          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  +
}
   79     91   
impl RecursiveShapesInput {
   80     92   
    /// Creates a new builder-style object to manufacture [`RecursiveShapesInput`](crate::operation::recursive_shapes::RecursiveShapesInput).
   81     93   
    pub fn builder() -> crate::operation::recursive_shapes::builders::RecursiveShapesInputBuilder {
   82     94   
        crate::operation::recursive_shapes::builders::RecursiveShapesInputBuilder::default()
   83     95   
    }
   84     96   
}
   85     97   
   86     98   
/// A builder for [`RecursiveShapesInput`](crate::operation::recursive_shapes::RecursiveShapesInput).
   87     99   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    100   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes/_recursive_shapes_output.rs

@@ -23,23 +106,117 @@
   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.nested {
   46     46   
            ser.write_struct(&RECURSIVESHAPESOUTPUT_MEMBER_NESTED, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RecursiveShapesOutput {
   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(&RECURSIVESHAPESOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&RECURSIVESHAPESOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.nested = Some(crate::types::RecursiveShapesInputOutputNested1::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl RecursiveShapesOutput {
          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 RecursiveShapesOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`RecursiveShapesOutput`](crate::operation::recursive_shapes::RecursiveShapesOutput).
   79     90   
    pub fn builder() -> crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder {
   80     91   
        crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`RecursiveShapesOutput`](crate::operation::recursive_shapes::RecursiveShapesOutput).
   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_json/rust-client-codegen/src/operation/response_code_http_fallback.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 `ResponseCodeHttpFallback`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ResponseCodeHttpFallback;
    6      6   
impl ResponseCodeHttpFallback {
    7      7   
    /// Creates a new `ResponseCodeHttpFallback`
    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::response_code_http_fallback::ResponseCodeHttpFallbackInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackOutput::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::response_code_http_fallback::ResponseCodeHttpFallbackInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError,
  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 ResponseCodeHttpFallbackResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeHttpFallbackResponseDeserializer {
  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         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 201 || force_error {
  151         -
            crate::protocol_serde::shape_response_code_http_fallback::de_response_code_http_fallback_http_error(status, headers, body)
         155  +
        if !success && status != 201 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_response_code_http_fallback::de_response_code_http_fallback_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, ResponseCodeHttpFallback::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct ResponseCodeHttpFallbackRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeHttpFallbackRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/responseCodeHttpFallback").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, ResponseCodeHttpFallback::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    210   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  199    212   
    }
  200    213   
}
  201    214   
#[derive(Debug)]
  202    215   
struct ResponseCodeHttpFallbackEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeHttpFallbackEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "ResponseCodeHttpFallbackEndpointParamsInterceptor"
  207    220   
    }
  208    221   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/response_code_http_fallback/_response_code_http_fallback_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/response_code_http_fallback/_response_code_http_fallback_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 ResponseCodeHttpFallbackOutput {
   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(&RESPONSECODEHTTPFALLBACKOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&RESPONSECODEHTTPFALLBACKOUTPUT_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 ResponseCodeHttpFallbackOutput {
          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 ResponseCodeHttpFallbackOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOutput`](crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackOutput).
   51     62   
    pub fn builder() -> crate::operation::response_code_http_fallback::builders::ResponseCodeHttpFallbackOutputBuilder {
   52     63   
        crate::operation::response_code_http_fallback::builders::ResponseCodeHttpFallbackOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`ResponseCodeHttpFallbackOutput`](crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackOutput).
   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_json/rust-client-codegen/src/operation/response_code_required.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 `ResponseCodeRequired`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ResponseCodeRequired;
    6      6   
impl ResponseCodeRequired {
    7      7   
    /// Creates a new `ResponseCodeRequired`
    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::response_code_required::ResponseCodeRequiredInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::response_code_required::ResponseCodeRequiredOutput::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::response_code_required::ResponseCodeRequiredInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::response_code_required::ResponseCodeRequiredOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::response_code_required::ResponseCodeRequiredError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +228,239 @@
  130    134   
                crate::operation::response_code_required::ResponseCodeRequiredError,
  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 ResponseCodeRequiredResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeRequiredResponseDeserializer {
  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         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_response_code_required::de_response_code_required_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::response_code_required::ResponseCodeRequiredError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_response_code_required::de_response_code_required_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, ResponseCodeRequired::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::response_code_required::ResponseCodeRequiredOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct ResponseCodeRequiredRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeRequiredRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::response_code_required::ResponseCodeRequiredInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::response_code_required::ResponseCodeRequiredInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/responseCodeRequired").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::response_code_required::ResponseCodeRequiredInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, ResponseCodeRequired::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    208   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         209  +
        return ::std::result::Result::Ok(request);
  199    210   
    }
  200    211   
}
  201    212   
#[derive(Debug)]
  202    213   
struct ResponseCodeRequiredEndpointParamsInterceptor;
  203    214   
  204    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeRequiredEndpointParamsInterceptor {
  205    216   
    fn name(&self) -> &'static str {
  206    217   
        "ResponseCodeRequiredEndpointParamsInterceptor"
  207    218   
    }
  208    219   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/response_code_required/_response_code_required_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/response_code_required/_response_code_required_output.rs

@@ -1,1 +105,124 @@
   17     17   
    "aws.protocoltests.restjson.synthetic",
   18     18   
    "ResponseCodeRequiredOutput",
   19     19   
);
   20     20   
static RESPONSECODEREQUIREDOUTPUT_MEMBER_RESPONSE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restjson.synthetic#ResponseCodeRequiredOutput$responseCode",
   23     23   
        "aws.protocoltests.restjson.synthetic",
   24     24   
        "ResponseCodeRequiredOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Integer,
   27         -
    "response_code",
          27  +
    "responseCode",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_response_code();
   31     31   
static RESPONSECODEREQUIREDOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    RESPONSECODEREQUIREDOUTPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&RESPONSECODEREQUIREDOUTPUT_MEMBER_RESPONSE_CODE],
   35     35   
);
   36     36   
impl ResponseCodeRequiredOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESPONSECODEREQUIREDOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for ResponseCodeRequiredOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        {
   47     47   
            let val = &self.response_code;
   48     48   
            ser.write_integer(&RESPONSECODEREQUIREDOUTPUT_MEMBER_RESPONSE_CODE, *val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl ResponseCodeRequiredOutput {
   54     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     58   
        #[allow(unused_variables, unused_mut)]
   59     59   
        let mut builder = Self::builder();
   60     60   
        #[allow(
   61     61   
            unused_variables,
   62     62   
            unreachable_code,
   63     63   
            clippy::single_match,
   64     64   
            clippy::match_single_binding,
   65     65   
            clippy::diverging_sub_expression
   66     66   
        )]
   67         -
        deserializer.read_struct(&RESPONSECODEREQUIREDOUTPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&RESPONSECODEREQUIREDOUTPUT_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.response_code = Some(deser.read_integer(member)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
          76  +
        builder.response_code = builder.response_code.or(Some(0i32));
          77  +
        builder
          78  +
            .build()
          79  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          80  +
    }
          81  +
}
          82  +
impl ResponseCodeRequiredOutput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          84  +
    /// Header-bound members are read directly from headers, avoiding runtime
          85  +
    /// member iteration overhead. Body members are read via the deserializer.
          86  +
    pub fn deserialize_with_response(
          87  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          88  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          89  +
        _status: u16,
          90  +
        _body: &[u8],
          91  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          92  +
        #[allow(unused_variables, unused_mut)]
          93  +
        let mut builder = Self::builder();
          94  +
        builder.response_code = Some(_status as i32);
   76     95   
        builder
   77     96   
            .build()
   78     97   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     98   
    }
   80     99   
}
   81    100   
impl ResponseCodeRequiredOutput {
   82    101   
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOutput`](crate::operation::response_code_required::ResponseCodeRequiredOutput).
   83    102   
    pub fn builder() -> crate::operation::response_code_required::builders::ResponseCodeRequiredOutputBuilder {
   84    103   
        crate::operation::response_code_required::builders::ResponseCodeRequiredOutputBuilder::default()
   85    104   
    }

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `SimpleScalarProperties`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleScalarProperties;
    6      6   
impl SimpleScalarProperties {
    7      7   
    /// Creates a new `SimpleScalarProperties`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +235,269 @@
  130    134   
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct SimpleScalarPropertiesResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarPropertiesResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, SimpleScalarProperties::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct SimpleScalarPropertiesRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SimpleScalarPropertiesRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/SimpleScalarProperties").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                let builder = crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_headers(input, builder)?;
  192         -
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        if protocol.supports_http_bindings() {
         206  +
            let mut request = protocol
         207  +
                .serialize_body(&input, SimpleScalarProperties::INPUT_SCHEMA, "", _cfg)
         208  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         209  +
            {
         210  +
                let mut uri = "/SimpleScalarProperties".to_string();
         211  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         212  +
                if let Some(ref val) = input.foo {
         213  +
                    request.headers_mut().insert("X-Foo", val.to_string());
         214  +
                }
         215  +
                if !query_params.is_empty() {
         216  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         217  +
                    let pairs: Vec<String> = query_params
         218  +
                        .iter()
         219  +
                        .map(|(k, v)| {
         220  +
                            format!(
         221  +
                                "{}={}",
         222  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         223  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         224  +
                            )
         225  +
                        })
         226  +
                        .collect();
         227  +
                    uri.push_str(&pairs.join("&"));
         228  +
                }
         229  +
                request.set_uri(uri.as_str()).expect("valid URI");
  193    230   
            }
  194         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  195         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  196         -
            builder
  197         -
        };
  198         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  199         -
            crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_input(&input)?,
  200         -
        );
  201         -
        if let Some(content_length) = body.content_length() {
  202         -
            let content_length = content_length.to_string();
  203         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         231  +
         232  +
            return ::std::result::Result::Ok(request);
         233  +
        } else {
         234  +
            let mut request = protocol
         235  +
                .serialize_request(&input, SimpleScalarProperties::INPUT_SCHEMA, "", _cfg)
         236  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         237  +
         238  +
            return ::std::result::Result::Ok(request);
  204    239   
        }
  205         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  206    240   
    }
  207    241   
}
  208    242   
#[derive(Debug)]
  209    243   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  210    244   
  211    245   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  212    246   
    fn name(&self) -> &'static str {
  213    247   
        "SimpleScalarPropertiesEndpointParamsInterceptor"
  214    248   
    }
  215    249   
@@ -451,485 +511,555 @@
  471    505   
            .expect("the config must have a deserializer");
  472    506   
  473    507   
        let parsed = de.deserialize_streaming(&mut http_response);
  474    508   
        let parsed = parsed.unwrap_or_else(|| {
  475    509   
            let http_response = http_response.map(|body| {
  476    510   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  477    511   
                    body.bytes().unwrap(),
  478    512   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  479    513   
                )))
  480    514   
            });
  481         -
            de.deserialize_nonstreaming(&http_response)
         515  +
            // Build a config bag with the protocol for schema-based deserialization
         516  +
            #[allow(unused_mut)]
         517  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         518  +
            {
         519  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         520  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         521  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         522  +
                ));
         523  +
                test_cfg.push_shared_layer(layer.freeze());
         524  +
            }
         525  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  482    526   
        });
  483    527   
        let parsed = parsed
  484    528   
            .expect("should be successful response")
  485    529   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  486    530   
            .unwrap();
  487    531   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  488    532   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  489    533   
        ::pretty_assertions::assert_eq!(
  490    534   
            parsed.true_boolean_value,
  491    535   
            expected_output.true_boolean_value,
@@ -522,566 +582,636 @@
  542    586   
            .expect("the config must have a deserializer");
  543    587   
  544    588   
        let parsed = de.deserialize_streaming(&mut http_response);
  545    589   
        let parsed = parsed.unwrap_or_else(|| {
  546    590   
            let http_response = http_response.map(|body| {
  547    591   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  548    592   
                    body.bytes().unwrap(),
  549    593   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  550    594   
                )))
  551    595   
            });
  552         -
            de.deserialize_nonstreaming(&http_response)
         596  +
            // Build a config bag with the protocol for schema-based deserialization
         597  +
            #[allow(unused_mut)]
         598  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         599  +
            {
         600  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         601  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         602  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         603  +
                ));
         604  +
                test_cfg.push_shared_layer(layer.freeze());
         605  +
            }
         606  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  553    607   
        });
  554    608   
        let parsed = parsed
  555    609   
            .expect("should be successful response")
  556    610   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  557    611   
            .unwrap();
  558    612   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  559    613   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  560    614   
        ::pretty_assertions::assert_eq!(
  561    615   
            parsed.true_boolean_value,
  562    616   
            expected_output.true_boolean_value,
@@ -602,656 +662,726 @@
  622    676   
            .expect("the config must have a deserializer");
  623    677   
  624    678   
        let parsed = de.deserialize_streaming(&mut http_response);
  625    679   
        let parsed = parsed.unwrap_or_else(|| {
  626    680   
            let http_response = http_response.map(|body| {
  627    681   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  628    682   
                    body.bytes().unwrap(),
  629    683   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  630    684   
                )))
  631    685   
            });
  632         -
            de.deserialize_nonstreaming(&http_response)
         686  +
            // Build a config bag with the protocol for schema-based deserialization
         687  +
            #[allow(unused_mut)]
         688  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         689  +
            {
         690  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         691  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         692  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         693  +
                ));
         694  +
                test_cfg.push_shared_layer(layer.freeze());
         695  +
            }
         696  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  633    697   
        });
  634    698   
        let parsed = parsed
  635    699   
            .expect("should be successful response")
  636    700   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  637    701   
            .unwrap();
  638    702   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  639    703   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  640    704   
        ::pretty_assertions::assert_eq!(
  641    705   
            parsed.true_boolean_value,
  642    706   
            expected_output.true_boolean_value,
@@ -682,746 +742,816 @@
  702    766   
            .expect("the config must have a deserializer");
  703    767   
  704    768   
        let parsed = de.deserialize_streaming(&mut http_response);
  705    769   
        let parsed = parsed.unwrap_or_else(|| {
  706    770   
            let http_response = http_response.map(|body| {
  707    771   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  708    772   
                    body.bytes().unwrap(),
  709    773   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  710    774   
                )))
  711    775   
            });
  712         -
            de.deserialize_nonstreaming(&http_response)
         776  +
            // Build a config bag with the protocol for schema-based deserialization
         777  +
            #[allow(unused_mut)]
         778  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         779  +
            {
         780  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         781  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         782  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         783  +
                ));
         784  +
                test_cfg.push_shared_layer(layer.freeze());
         785  +
            }
         786  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  713    787   
        });
  714    788   
        let parsed = parsed
  715    789   
            .expect("should be successful response")
  716    790   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  717    791   
            .unwrap();
  718    792   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  719    793   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  720    794   
        ::pretty_assertions::assert_eq!(
  721    795   
            parsed.true_boolean_value,
  722    796   
            expected_output.true_boolean_value,
@@ -762,836 +822,906 @@
  782    856   
            .expect("the config must have a deserializer");
  783    857   
  784    858   
        let parsed = de.deserialize_streaming(&mut http_response);
  785    859   
        let parsed = parsed.unwrap_or_else(|| {
  786    860   
            let http_response = http_response.map(|body| {
  787    861   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  788    862   
                    body.bytes().unwrap(),
  789    863   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  790    864   
                )))
  791    865   
            });
  792         -
            de.deserialize_nonstreaming(&http_response)
         866  +
            // Build a config bag with the protocol for schema-based deserialization
         867  +
            #[allow(unused_mut)]
         868  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         869  +
            {
         870  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         871  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         872  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         873  +
                ));
         874  +
                test_cfg.push_shared_layer(layer.freeze());
         875  +
            }
         876  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  793    877   
        });
  794    878   
        let parsed = parsed
  795    879   
            .expect("should be successful response")
  796    880   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  797    881   
            .unwrap();
  798    882   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  799    883   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  800    884   
        ::pretty_assertions::assert_eq!(
  801    885   
            parsed.true_boolean_value,
  802    886   
            expected_output.true_boolean_value,

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/sparse_json_lists.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 `SparseJsonLists`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SparseJsonLists;
    6      6   
impl SparseJsonLists {
    7      7   
    /// Creates a new `SparseJsonLists`
    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::sparse_json_lists::SparseJsonListsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::sparse_json_lists::SparseJsonListsOutput::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::sparse_json_lists::SparseJsonListsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::sparse_json_lists::SparseJsonListsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::sparse_json_lists::SparseJsonListsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +232,239 @@
  130    134   
                crate::operation::sparse_json_lists::SparseJsonListsError,
  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 SparseJsonListsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SparseJsonListsResponseDeserializer {
  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         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::sparse_json_lists::SparseJsonListsError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, SparseJsonLists::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::sparse_json_lists::SparseJsonListsOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct SparseJsonListsRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SparseJsonListsRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::sparse_json_lists::SparseJsonListsInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::sparse_json_lists::SparseJsonListsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/SparseJsonLists").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::sparse_json_lists::SparseJsonListsInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_sparse_json_lists::ser_sparse_json_lists_input(&input)?);
  198         -
        if let Some(content_length) = body.content_length() {
  199         -
            let content_length = content_length.to_string();
  200         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  201         -
        }
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, SparseJsonLists::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  203    210   
    }
  204    211   
}
  205    212   
#[derive(Debug)]
  206    213   
struct SparseJsonListsEndpointParamsInterceptor;
  207    214   
  208    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SparseJsonListsEndpointParamsInterceptor {
  209    216   
    fn name(&self) -> &'static str {
  210    217   
        "SparseJsonListsEndpointParamsInterceptor"
  211    218   
    }
  212    219   
@@ -293,300 +353,370 @@
  313    320   
            .expect("the config must have a deserializer");
  314    321   
  315    322   
        let parsed = de.deserialize_streaming(&mut http_response);
  316    323   
        let parsed = parsed.unwrap_or_else(|| {
  317    324   
            let http_response = http_response.map(|body| {
  318    325   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  319    326   
                    body.bytes().unwrap(),
  320    327   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  321    328   
                )))
  322    329   
            });
  323         -
            de.deserialize_nonstreaming(&http_response)
         330  +
            // Build a config bag with the protocol for schema-based deserialization
         331  +
            #[allow(unused_mut)]
         332  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         333  +
            {
         334  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         335  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         336  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         337  +
                ));
         338  +
                test_cfg.push_shared_layer(layer.freeze());
         339  +
            }
         340  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  324    341   
        });
  325    342   
        let parsed = parsed
  326    343   
            .expect("should be successful response")
  327    344   
            .downcast::<crate::operation::sparse_json_lists::SparseJsonListsOutput>()
  328    345   
            .unwrap();
  329    346   
        ::pretty_assertions::assert_eq!(
  330    347   
            parsed.sparse_string_list,
  331    348   
            expected_output.sparse_string_list,
  332    349   
            "Unexpected value for `sparse_string_list`"
  333    350   
        );

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/sparse_json_lists/_sparse_json_lists_input.rs

@@ -7,7 +197,203 @@
   27     27   
    "aws.protocoltests.restjson.synthetic",
   28     28   
    "SparseJsonListsInput",
   29     29   
);
   30     30   
static SPARSEJSONLISTSINPUT_MEMBER_SPARSE_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   31     31   
    ::aws_smithy_schema::ShapeId::from_static(
   32     32   
        "aws.protocoltests.restjson.synthetic#SparseJsonListsInput$sparseStringList",
   33     33   
        "aws.protocoltests.restjson.synthetic",
   34     34   
        "SparseJsonListsInput",
   35     35   
    ),
   36     36   
    ::aws_smithy_schema::ShapeType::List,
   37         -
    "sparse_string_list",
          37  +
    "sparseStringList",
   38     38   
    0,
   39     39   
);
   40     40   
static SPARSEJSONLISTSINPUT_MEMBER_SPARSE_SHORT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   41     41   
    ::aws_smithy_schema::ShapeId::from_static(
   42     42   
        "aws.protocoltests.restjson.synthetic#SparseJsonListsInput$sparseShortList",
   43     43   
        "aws.protocoltests.restjson.synthetic",
   44     44   
        "SparseJsonListsInput",
   45     45   
    ),
   46     46   
    ::aws_smithy_schema::ShapeType::List,
   47         -
    "sparse_short_list",
          47  +
    "sparseShortList",
   48     48   
    1,
   49     49   
);
   50     50   
static SPARSEJSONLISTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   51     51   
    SPARSEJSONLISTSINPUT_SCHEMA_ID,
   52     52   
    ::aws_smithy_schema::ShapeType::Structure,
   53     53   
    &[
   54     54   
        &SPARSEJSONLISTSINPUT_MEMBER_SPARSE_STRING_LIST,
   55     55   
        &SPARSEJSONLISTSINPUT_MEMBER_SPARSE_SHORT_LIST,
   56     56   
    ],
   57         -
);
          57  +
)
          58  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/SparseJsonLists", None));
   58     59   
impl SparseJsonListsInput {
   59     60   
    /// The schema for this shape.
   60     61   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SPARSEJSONLISTSINPUT_SCHEMA;
   61     62   
}
   62     63   
impl ::aws_smithy_schema::serde::SerializableStruct for SparseJsonListsInput {
   63     64   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   64     65   
    fn serialize_members(
   65     66   
        &self,
   66     67   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   67     68   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   68     69   
        if let Some(ref val) = self.sparse_string_list {
   69     70   
            ser.write_list(
   70     71   
                &SPARSEJSONLISTSINPUT_MEMBER_SPARSE_STRING_LIST,
   71     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   72     73   
                    for item in val {
   73     74   
                        match item {
   74     75   
                            Some(item) => {
   75     76   
                                ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   76     77   
                            }
   77     78   
                            None => {
   78     79   
                                ser.write_null(&aws_smithy_schema::prelude::STRING)?;
   79     80   
                            }
   80     81   
                        }
   81     82   
                    }
   82     83   
                    Ok(())
   83     84   
                },
   84     85   
            )?;
   85     86   
        }
   86     87   
        if let Some(ref val) = self.sparse_short_list {
   87     88   
            ser.write_list(
   88     89   
                &SPARSEJSONLISTSINPUT_MEMBER_SPARSE_SHORT_LIST,
   89     90   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   90     91   
                    for item in val {
   91     92   
                        match item {
   92     93   
                            Some(item) => {
   93     94   
                                ser.write_short(&aws_smithy_schema::prelude::SHORT, *item)?;
   94     95   
                            }
   95     96   
                            None => {
   96     97   
                                ser.write_null(&aws_smithy_schema::prelude::STRING)?;
   97     98   
                            }
   98     99   
                        }
   99    100   
                    }
  100    101   
                    Ok(())
  101    102   
                },
  102    103   
            )?;
  103    104   
        }
  104    105   
        Ok(())
  105    106   
    }
  106    107   
}
  107    108   
impl SparseJsonListsInput {
  108    109   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  109         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  110         -
        deserializer: &mut D,
         110  +
    pub fn deserialize(
         111  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  111    112   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  112    113   
        #[allow(unused_variables, unused_mut)]
  113    114   
        let mut builder = Self::builder();
  114    115   
        #[allow(
  115    116   
            unused_variables,
  116    117   
            unreachable_code,
  117    118   
            clippy::single_match,
  118    119   
            clippy::match_single_binding,
  119    120   
            clippy::diverging_sub_expression
  120    121   
        )]
  121         -
        deserializer.read_struct(&SPARSEJSONLISTSINPUT_SCHEMA, (), |_, member, deser| {
         122  +
        deserializer.read_struct(&SPARSEJSONLISTSINPUT_SCHEMA, &mut |member, deser| {
  122    123   
            match member.member_index() {
  123    124   
                Some(0) => {
  124    125   
                    builder.sparse_string_list = Some({
  125         -
                        let container = if let Some(cap) = deser.container_size() {
  126         -
                            Vec::with_capacity(cap)
  127         -
                        } else {
  128         -
                            Vec::new()
  129         -
                        };
  130         -
                        deser.read_list(member, container, |mut list, deser| {
  131         -
                            list.push(if deser.is_null() {
  132         -
                                deser.read_string(member).ok();
         126  +
                        let mut container = Vec::new();
         127  +
                        deser.read_list(member, &mut |deser| {
         128  +
                            container.push(if deser.is_null() {
         129  +
                                deser.read_null()?;
  133    130   
                                None
  134    131   
                            } else {
  135    132   
                                Some(deser.read_string(member)?)
  136    133   
                            });
  137         -
                            Ok(list)
  138         -
                        })?
         134  +
                            Ok(())
         135  +
                        })?;
         136  +
                        container
  139    137   
                    });
  140    138   
                }
  141    139   
                Some(1) => {
  142    140   
                    builder.sparse_short_list = Some({
  143         -
                        let container = if let Some(cap) = deser.container_size() {
  144         -
                            Vec::with_capacity(cap)
  145         -
                        } else {
  146         -
                            Vec::new()
  147         -
                        };
  148         -
                        deser.read_list(member, container, |mut list, deser| {
  149         -
                            list.push(if deser.is_null() {
  150         -
                                deser.read_string(member).ok();
         141  +
                        let mut container = Vec::new();
         142  +
                        deser.read_list(member, &mut |deser| {
         143  +
                            container.push(if deser.is_null() {
         144  +
                                deser.read_null()?;
  151    145   
                                None
  152    146   
                            } else {
  153    147   
                                Some(deser.read_short(member)?)
  154    148   
                            });
  155         -
                            Ok(list)
  156         -
                        })?
         149  +
                            Ok(())
         150  +
                        })?;
         151  +
                        container
  157    152   
                    });
  158    153   
                }
  159    154   
                _ => {}
  160    155   
            }
  161    156   
            Ok(())
  162    157   
        })?;
  163    158   
        builder
  164    159   
            .build()
  165    160   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  166    161   
    }
  167    162   
}
         163  +
impl SparseJsonListsInput {
         164  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         165  +
    pub fn deserialize_with_response(
         166  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         167  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         168  +
        _status: u16,
         169  +
        _body: &[u8],
         170  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         171  +
        Self::deserialize(deserializer)
         172  +
    }
         173  +
}
  168    174   
impl SparseJsonListsInput {
  169    175   
    /// Creates a new builder-style object to manufacture [`SparseJsonListsInput`](crate::operation::sparse_json_lists::SparseJsonListsInput).
  170    176   
    pub fn builder() -> crate::operation::sparse_json_lists::builders::SparseJsonListsInputBuilder {
  171    177   
        crate::operation::sparse_json_lists::builders::SparseJsonListsInputBuilder::default()
  172    178   
    }
  173    179   
}
  174    180   
  175    181   
/// A builder for [`SparseJsonListsInput`](crate::operation::sparse_json_lists::SparseJsonListsInput).
  176    182   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  177    183   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/sparse_json_lists/_sparse_json_lists_output.rs

@@ -7,7 +77,77 @@
   27     27   
    "aws.protocoltests.restjson.synthetic",
   28     28   
    "SparseJsonListsOutput",
   29     29   
);
   30     30   
static SPARSEJSONLISTSOUTPUT_MEMBER_SPARSE_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   31     31   
    ::aws_smithy_schema::ShapeId::from_static(
   32     32   
        "aws.protocoltests.restjson.synthetic#SparseJsonListsOutput$sparseStringList",
   33     33   
        "aws.protocoltests.restjson.synthetic",
   34     34   
        "SparseJsonListsOutput",
   35     35   
    ),
   36     36   
    ::aws_smithy_schema::ShapeType::List,
   37         -
    "sparse_string_list",
          37  +
    "sparseStringList",
   38     38   
    0,
   39     39   
);
   40     40   
static SPARSEJSONLISTSOUTPUT_MEMBER_SPARSE_SHORT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   41     41   
    ::aws_smithy_schema::ShapeId::from_static(
   42     42   
        "aws.protocoltests.restjson.synthetic#SparseJsonListsOutput$sparseShortList",
   43     43   
        "aws.protocoltests.restjson.synthetic",
   44     44   
        "SparseJsonListsOutput",
   45     45   
    ),
   46     46   
    ::aws_smithy_schema::ShapeType::List,
   47         -
    "sparse_short_list",
          47  +
    "sparseShortList",
   48     48   
    1,
   49     49   
);
   50     50   
static SPARSEJSONLISTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   51     51   
    SPARSEJSONLISTSOUTPUT_SCHEMA_ID,
   52     52   
    ::aws_smithy_schema::ShapeType::Structure,
   53     53   
    &[
   54     54   
        &SPARSEJSONLISTSOUTPUT_MEMBER_SPARSE_STRING_LIST,
   55     55   
        &SPARSEJSONLISTSOUTPUT_MEMBER_SPARSE_SHORT_LIST,
   56     56   
    ],
   57     57   
);
@@ -79,79 +195,200 @@
   99     99   
                    }
  100    100   
                    Ok(())
  101    101   
                },
  102    102   
            )?;
  103    103   
        }
  104    104   
        Ok(())
  105    105   
    }
  106    106   
}
  107    107   
impl SparseJsonListsOutput {
  108    108   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  109         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  110         -
        deserializer: &mut D,
         109  +
    pub fn deserialize(
         110  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  111    111   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  112    112   
        #[allow(unused_variables, unused_mut)]
  113    113   
        let mut builder = Self::builder();
  114    114   
        #[allow(
  115    115   
            unused_variables,
  116    116   
            unreachable_code,
  117    117   
            clippy::single_match,
  118    118   
            clippy::match_single_binding,
  119    119   
            clippy::diverging_sub_expression
  120    120   
        )]
  121         -
        deserializer.read_struct(&SPARSEJSONLISTSOUTPUT_SCHEMA, (), |_, member, deser| {
         121  +
        deserializer.read_struct(&SPARSEJSONLISTSOUTPUT_SCHEMA, &mut |member, deser| {
  122    122   
            match member.member_index() {
  123    123   
                Some(0) => {
  124    124   
                    builder.sparse_string_list = Some({
  125         -
                        let container = if let Some(cap) = deser.container_size() {
  126         -
                            Vec::with_capacity(cap)
  127         -
                        } else {
  128         -
                            Vec::new()
  129         -
                        };
  130         -
                        deser.read_list(member, container, |mut list, deser| {
  131         -
                            list.push(if deser.is_null() {
  132         -
                                deser.read_string(member).ok();
         125  +
                        let mut container = Vec::new();
         126  +
                        deser.read_list(member, &mut |deser| {
         127  +
                            container.push(if deser.is_null() {
         128  +
                                deser.read_null()?;
  133    129   
                                None
  134    130   
                            } else {
  135    131   
                                Some(deser.read_string(member)?)
  136    132   
                            });
  137         -
                            Ok(list)
  138         -
                        })?
         133  +
                            Ok(())
         134  +
                        })?;
         135  +
                        container
  139    136   
                    });
  140    137   
                }
  141    138   
                Some(1) => {
  142    139   
                    builder.sparse_short_list = Some({
  143         -
                        let container = if let Some(cap) = deser.container_size() {
  144         -
                            Vec::with_capacity(cap)
  145         -
                        } else {
  146         -
                            Vec::new()
  147         -
                        };
  148         -
                        deser.read_list(member, container, |mut list, deser| {
  149         -
                            list.push(if deser.is_null() {
  150         -
                                deser.read_string(member).ok();
         140  +
                        let mut container = Vec::new();
         141  +
                        deser.read_list(member, &mut |deser| {
         142  +
                            container.push(if deser.is_null() {
         143  +
                                deser.read_null()?;
  151    144   
                                None
  152    145   
                            } else {
  153    146   
                                Some(deser.read_short(member)?)
  154    147   
                            });
  155         -
                            Ok(list)
  156         -
                        })?
         148  +
                            Ok(())
         149  +
                        })?;
         150  +
                        container
  157    151   
                    });
  158    152   
                }
  159    153   
                _ => {}
  160    154   
            }
  161    155   
            Ok(())
  162    156   
        })?;
  163    157   
        Ok(builder.build())
  164    158   
    }
  165    159   
}
         160  +
impl SparseJsonListsOutput {
         161  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         162  +
    pub fn deserialize_with_response(
         163  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         164  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         165  +
        _status: u16,
         166  +
        _body: &[u8],
         167  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         168  +
        Self::deserialize(deserializer)
         169  +
    }
         170  +
}
  166    171   
impl SparseJsonListsOutput {
  167    172   
    /// Creates a new builder-style object to manufacture [`SparseJsonListsOutput`](crate::operation::sparse_json_lists::SparseJsonListsOutput).
  168    173   
    pub fn builder() -> crate::operation::sparse_json_lists::builders::SparseJsonListsOutputBuilder {
  169    174   
        crate::operation::sparse_json_lists::builders::SparseJsonListsOutputBuilder::default()
  170    175   
    }
  171    176   
}
  172    177   
  173    178   
/// A builder for [`SparseJsonListsOutput`](crate::operation::sparse_json_lists::SparseJsonListsOutput).
  174    179   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  175    180   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/sparse_json_maps.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 `SparseJsonMaps`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SparseJsonMaps;
    6      6   
impl SparseJsonMaps {
    7      7   
    /// Creates a new `SparseJsonMaps`
    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::sparse_json_maps::SparseJsonMapsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::sparse_json_maps::SparseJsonMapsOutput::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::sparse_json_maps::SparseJsonMapsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::sparse_json_maps::SparseJsonMapsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::sparse_json_maps::SparseJsonMapsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +226,233 @@
  124    128   
                crate::operation::sparse_json_maps::SparseJsonMapsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct SparseJsonMapsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SparseJsonMapsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::sparse_json_maps::SparseJsonMapsError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, SparseJsonMaps::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::sparse_json_maps::SparseJsonMapsOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct SparseJsonMapsRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SparseJsonMapsRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/SparseJsonMaps").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  189         -
            builder
  190         -
        };
  191         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_input(&input)?);
  192         -
        if let Some(content_length) = body.content_length() {
  193         -
            let content_length = content_length.to_string();
  194         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  195         -
        }
  196         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, SparseJsonMaps::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         202  +
         203  +
        return ::std::result::Result::Ok(request);
  197    204   
    }
  198    205   
}
  199    206   
#[derive(Debug)]
  200    207   
struct SparseJsonMapsEndpointParamsInterceptor;
  201    208   
  202    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SparseJsonMapsEndpointParamsInterceptor {
  203    210   
    fn name(&self) -> &'static str {
  204    211   
        "SparseJsonMapsEndpointParamsInterceptor"
  205    212   
    }
  206    213   
@@ -482,489 +542,559 @@
  502    509   
            .expect("the config must have a deserializer");
  503    510   
  504    511   
        let parsed = de.deserialize_streaming(&mut http_response);
  505    512   
        let parsed = parsed.unwrap_or_else(|| {
  506    513   
            let http_response = http_response.map(|body| {
  507    514   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  508    515   
                    body.bytes().unwrap(),
  509    516   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  510    517   
                )))
  511    518   
            });
  512         -
            de.deserialize_nonstreaming(&http_response)
         519  +
            // Build a config bag with the protocol for schema-based deserialization
         520  +
            #[allow(unused_mut)]
         521  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         522  +
            {
         523  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         524  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         525  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         526  +
                ));
         527  +
                test_cfg.push_shared_layer(layer.freeze());
         528  +
            }
         529  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  513    530   
        });
  514    531   
        let parsed = parsed
  515    532   
            .expect("should be successful response")
  516    533   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsOutput>()
  517    534   
            .unwrap();
  518    535   
        ::pretty_assertions::assert_eq!(
  519    536   
            parsed.sparse_struct_map,
  520    537   
            expected_output.sparse_struct_map,
  521    538   
            "Unexpected value for `sparse_struct_map`"
  522    539   
        );
@@ -565,582 +625,652 @@
  585    602   
            .expect("the config must have a deserializer");
  586    603   
  587    604   
        let parsed = de.deserialize_streaming(&mut http_response);
  588    605   
        let parsed = parsed.unwrap_or_else(|| {
  589    606   
            let http_response = http_response.map(|body| {
  590    607   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  591    608   
                    body.bytes().unwrap(),
  592    609   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  593    610   
                )))
  594    611   
            });
  595         -
            de.deserialize_nonstreaming(&http_response)
         612  +
            // Build a config bag with the protocol for schema-based deserialization
         613  +
            #[allow(unused_mut)]
         614  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         615  +
            {
         616  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         617  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         618  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         619  +
                ));
         620  +
                test_cfg.push_shared_layer(layer.freeze());
         621  +
            }
         622  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  596    623   
        });
  597    624   
        let parsed = parsed
  598    625   
            .expect("should be successful response")
  599    626   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsOutput>()
  600    627   
            .unwrap();
  601    628   
        ::pretty_assertions::assert_eq!(
  602    629   
            parsed.sparse_struct_map,
  603    630   
            expected_output.sparse_struct_map,
  604    631   
            "Unexpected value for `sparse_struct_map`"
  605    632   
        );
@@ -642,669 +702,739 @@
  662    689   
            .expect("the config must have a deserializer");
  663    690   
  664    691   
        let parsed = de.deserialize_streaming(&mut http_response);
  665    692   
        let parsed = parsed.unwrap_or_else(|| {
  666    693   
            let http_response = http_response.map(|body| {
  667    694   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  668    695   
                    body.bytes().unwrap(),
  669    696   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  670    697   
                )))
  671    698   
            });
  672         -
            de.deserialize_nonstreaming(&http_response)
         699  +
            // Build a config bag with the protocol for schema-based deserialization
         700  +
            #[allow(unused_mut)]
         701  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         702  +
            {
         703  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         704  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         705  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         706  +
                ));
         707  +
                test_cfg.push_shared_layer(layer.freeze());
         708  +
            }
         709  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  673    710   
        });
  674    711   
        let parsed = parsed
  675    712   
            .expect("should be successful response")
  676    713   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsOutput>()
  677    714   
            .unwrap();
  678    715   
        ::pretty_assertions::assert_eq!(
  679    716   
            parsed.sparse_struct_map,
  680    717   
            expected_output.sparse_struct_map,
  681    718   
            "Unexpected value for `sparse_struct_map`"
  682    719   
        );
@@ -715,752 +775,822 @@
  735    772   
            .expect("the config must have a deserializer");
  736    773   
  737    774   
        let parsed = de.deserialize_streaming(&mut http_response);
  738    775   
        let parsed = parsed.unwrap_or_else(|| {
  739    776   
            let http_response = http_response.map(|body| {
  740    777   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  741    778   
                    body.bytes().unwrap(),
  742    779   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  743    780   
                )))
  744    781   
            });
  745         -
            de.deserialize_nonstreaming(&http_response)
         782  +
            // Build a config bag with the protocol for schema-based deserialization
         783  +
            #[allow(unused_mut)]
         784  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         785  +
            {
         786  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         787  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         788  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         789  +
                ));
         790  +
                test_cfg.push_shared_layer(layer.freeze());
         791  +
            }
         792  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  746    793   
        });
  747    794   
        let parsed = parsed
  748    795   
            .expect("should be successful response")
  749    796   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsOutput>()
  750    797   
            .unwrap();
  751    798   
        ::pretty_assertions::assert_eq!(
  752    799   
            parsed.sparse_struct_map,
  753    800   
            expected_output.sparse_struct_map,
  754    801   
            "Unexpected value for `sparse_struct_map`"
  755    802   
        );
@@ -789,836 +849,906 @@
  809    856   
            .expect("the config must have a deserializer");
  810    857   
  811    858   
        let parsed = de.deserialize_streaming(&mut http_response);
  812    859   
        let parsed = parsed.unwrap_or_else(|| {
  813    860   
            let http_response = http_response.map(|body| {
  814    861   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  815    862   
                    body.bytes().unwrap(),
  816    863   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  817    864   
                )))
  818    865   
            });
  819         -
            de.deserialize_nonstreaming(&http_response)
         866  +
            // Build a config bag with the protocol for schema-based deserialization
         867  +
            #[allow(unused_mut)]
         868  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         869  +
            {
         870  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         871  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         872  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         873  +
                ));
         874  +
                test_cfg.push_shared_layer(layer.freeze());
         875  +
            }
         876  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  820    877   
        });
  821    878   
        let parsed = parsed
  822    879   
            .expect("should be successful response")
  823    880   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsOutput>()
  824    881   
            .unwrap();
  825    882   
        ::pretty_assertions::assert_eq!(
  826    883   
            parsed.sparse_struct_map,
  827    884   
            expected_output.sparse_struct_map,
  828    885   
            "Unexpected value for `sparse_struct_map`"
  829    886   
        );