Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

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());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    160   
  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)
         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,239 @@
  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());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    160   
  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)
         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))
  193         -
            }
  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);
  204         -
        }
  205         -
        ::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, SimpleScalarProperties::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  206    210   
    }
  207    211   
}
  208    212   
#[derive(Debug)]
  209    213   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  210    214   
  211    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  212    216   
    fn name(&self) -> &'static str {
  213    217   
        "SimpleScalarPropertiesEndpointParamsInterceptor"
  214    218   
    }
  215    219   
@@ -451,455 +511,525 @@
  471    475   
            .expect("the config must have a deserializer");
  472    476   
  473    477   
        let parsed = de.deserialize_streaming(&mut http_response);
  474    478   
        let parsed = parsed.unwrap_or_else(|| {
  475    479   
            let http_response = http_response.map(|body| {
  476    480   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  477    481   
                    body.bytes().unwrap(),
  478    482   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  479    483   
                )))
  480    484   
            });
  481         -
            de.deserialize_nonstreaming(&http_response)
         485  +
            // Build a config bag with the protocol for schema-based deserialization
         486  +
            #[allow(unused_mut)]
         487  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         488  +
            {
         489  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         490  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         491  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         492  +
                ));
         493  +
                test_cfg.push_shared_layer(layer.freeze());
         494  +
            }
         495  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  482    496   
        });
  483    497   
        let parsed = parsed
  484    498   
            .expect("should be successful response")
  485    499   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  486    500   
            .unwrap();
  487    501   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  488    502   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  489    503   
        ::pretty_assertions::assert_eq!(
  490    504   
            parsed.true_boolean_value,
  491    505   
            expected_output.true_boolean_value,
@@ -522,536 +582,606 @@
  542    556   
            .expect("the config must have a deserializer");
  543    557   
  544    558   
        let parsed = de.deserialize_streaming(&mut http_response);
  545    559   
        let parsed = parsed.unwrap_or_else(|| {
  546    560   
            let http_response = http_response.map(|body| {
  547    561   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  548    562   
                    body.bytes().unwrap(),
  549    563   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  550    564   
                )))
  551    565   
            });
  552         -
            de.deserialize_nonstreaming(&http_response)
         566  +
            // Build a config bag with the protocol for schema-based deserialization
         567  +
            #[allow(unused_mut)]
         568  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         569  +
            {
         570  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         571  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         572  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         573  +
                ));
         574  +
                test_cfg.push_shared_layer(layer.freeze());
         575  +
            }
         576  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  553    577   
        });
  554    578   
        let parsed = parsed
  555    579   
            .expect("should be successful response")
  556    580   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  557    581   
            .unwrap();
  558    582   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  559    583   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  560    584   
        ::pretty_assertions::assert_eq!(
  561    585   
            parsed.true_boolean_value,
  562    586   
            expected_output.true_boolean_value,
@@ -602,626 +662,696 @@
  622    646   
            .expect("the config must have a deserializer");
  623    647   
  624    648   
        let parsed = de.deserialize_streaming(&mut http_response);
  625    649   
        let parsed = parsed.unwrap_or_else(|| {
  626    650   
            let http_response = http_response.map(|body| {
  627    651   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  628    652   
                    body.bytes().unwrap(),
  629    653   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  630    654   
                )))
  631    655   
            });
  632         -
            de.deserialize_nonstreaming(&http_response)
         656  +
            // Build a config bag with the protocol for schema-based deserialization
         657  +
            #[allow(unused_mut)]
         658  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         659  +
            {
         660  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         661  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         662  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         663  +
                ));
         664  +
                test_cfg.push_shared_layer(layer.freeze());
         665  +
            }
         666  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  633    667   
        });
  634    668   
        let parsed = parsed
  635    669   
            .expect("should be successful response")
  636    670   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  637    671   
            .unwrap();
  638    672   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  639    673   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  640    674   
        ::pretty_assertions::assert_eq!(
  641    675   
            parsed.true_boolean_value,
  642    676   
            expected_output.true_boolean_value,
@@ -682,716 +742,786 @@
  702    736   
            .expect("the config must have a deserializer");
  703    737   
  704    738   
        let parsed = de.deserialize_streaming(&mut http_response);
  705    739   
        let parsed = parsed.unwrap_or_else(|| {
  706    740   
            let http_response = http_response.map(|body| {
  707    741   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  708    742   
                    body.bytes().unwrap(),
  709    743   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  710    744   
                )))
  711    745   
            });
  712         -
            de.deserialize_nonstreaming(&http_response)
         746  +
            // Build a config bag with the protocol for schema-based deserialization
         747  +
            #[allow(unused_mut)]
         748  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         749  +
            {
         750  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         751  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         752  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         753  +
                ));
         754  +
                test_cfg.push_shared_layer(layer.freeze());
         755  +
            }
         756  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  713    757   
        });
  714    758   
        let parsed = parsed
  715    759   
            .expect("should be successful response")
  716    760   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  717    761   
            .unwrap();
  718    762   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  719    763   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  720    764   
        ::pretty_assertions::assert_eq!(
  721    765   
            parsed.true_boolean_value,
  722    766   
            expected_output.true_boolean_value,
@@ -762,806 +822,876 @@
  782    826   
            .expect("the config must have a deserializer");
  783    827   
  784    828   
        let parsed = de.deserialize_streaming(&mut http_response);
  785    829   
        let parsed = parsed.unwrap_or_else(|| {
  786    830   
            let http_response = http_response.map(|body| {
  787    831   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  788    832   
                    body.bytes().unwrap(),
  789    833   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  790    834   
                )))
  791    835   
            });
  792         -
            de.deserialize_nonstreaming(&http_response)
         836  +
            // Build a config bag with the protocol for schema-based deserialization
         837  +
            #[allow(unused_mut)]
         838  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         839  +
            {
         840  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         841  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         842  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         843  +
                ));
         844  +
                test_cfg.push_shared_layer(layer.freeze());
         845  +
            }
         846  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  793    847   
        });
  794    848   
        let parsed = parsed
  795    849   
            .expect("should be successful response")
  796    850   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  797    851   
            .unwrap();
  798    852   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  799    853   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  800    854   
        ::pretty_assertions::assert_eq!(
  801    855   
            parsed.true_boolean_value,
  802    856   
            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());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    160   
  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)
         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());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         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  +
            })?;
  143    154   
  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)
         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   
        );

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

@@ -30,30 +143,144 @@
   50     50   
    "aws.protocoltests.restjson.synthetic",
   51     51   
    "SparseJsonMapsInput",
   52     52   
);
   53     53   
static SPARSEJSONMAPSINPUT_MEMBER_SPARSE_STRUCT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   54     54   
    ::aws_smithy_schema::ShapeId::from_static(
   55     55   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsInput$sparseStructMap",
   56     56   
        "aws.protocoltests.restjson.synthetic",
   57     57   
        "SparseJsonMapsInput",
   58     58   
    ),
   59     59   
    ::aws_smithy_schema::ShapeType::Map,
   60         -
    "sparse_struct_map",
          60  +
    "sparseStructMap",
   61     61   
    0,
   62     62   
);
   63     63   
static SPARSEJSONMAPSINPUT_MEMBER_SPARSE_NUMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   64     64   
    ::aws_smithy_schema::ShapeId::from_static(
   65     65   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsInput$sparseNumberMap",
   66     66   
        "aws.protocoltests.restjson.synthetic",
   67     67   
        "SparseJsonMapsInput",
   68     68   
    ),
   69     69   
    ::aws_smithy_schema::ShapeType::Map,
   70         -
    "sparse_number_map",
          70  +
    "sparseNumberMap",
   71     71   
    1,
   72     72   
);
   73     73   
static SPARSEJSONMAPSINPUT_MEMBER_SPARSE_BOOLEAN_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   74     74   
    ::aws_smithy_schema::ShapeId::from_static(
   75     75   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsInput$sparseBooleanMap",
   76     76   
        "aws.protocoltests.restjson.synthetic",
   77     77   
        "SparseJsonMapsInput",
   78     78   
    ),
   79     79   
    ::aws_smithy_schema::ShapeType::Map,
   80         -
    "sparse_boolean_map",
          80  +
    "sparseBooleanMap",
   81     81   
    2,
   82     82   
);
   83     83   
static SPARSEJSONMAPSINPUT_MEMBER_SPARSE_STRING_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static(
   85     85   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsInput$sparseStringMap",
   86     86   
        "aws.protocoltests.restjson.synthetic",
   87     87   
        "SparseJsonMapsInput",
   88     88   
    ),
   89     89   
    ::aws_smithy_schema::ShapeType::Map,
   90         -
    "sparse_string_map",
          90  +
    "sparseStringMap",
   91     91   
    3,
   92     92   
);
   93     93   
static SPARSEJSONMAPSINPUT_MEMBER_SPARSE_SET_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   94     94   
    ::aws_smithy_schema::ShapeId::from_static(
   95     95   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsInput$sparseSetMap",
   96     96   
        "aws.protocoltests.restjson.synthetic",
   97     97   
        "SparseJsonMapsInput",
   98     98   
    ),
   99     99   
    ::aws_smithy_schema::ShapeType::Map,
  100         -
    "sparse_set_map",
         100  +
    "sparseSetMap",
  101    101   
    4,
  102    102   
);
  103    103   
static SPARSEJSONMAPSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  104    104   
    SPARSEJSONMAPSINPUT_SCHEMA_ID,
  105    105   
    ::aws_smithy_schema::ShapeType::Structure,
  106    106   
    &[
  107    107   
        &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_STRUCT_MAP,
  108    108   
        &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_NUMBER_MAP,
  109    109   
        &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_BOOLEAN_MAP,
  110    110   
        &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_STRING_MAP,
  111    111   
        &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_SET_MAP,
  112    112   
    ],
  113         -
);
         113  +
)
         114  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/SparseJsonMaps", None));
  114    115   
impl SparseJsonMapsInput {
  115    116   
    /// The schema for this shape.
  116    117   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SPARSEJSONMAPSINPUT_SCHEMA;
  117    118   
}
  118    119   
impl ::aws_smithy_schema::serde::SerializableStruct for SparseJsonMapsInput {
  119    120   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  120    121   
    fn serialize_members(
  121    122   
        &self,
  122    123   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  123    124   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -178,179 +381,393 @@
  198    199   
            )?;
  199    200   
        }
  200    201   
        if let Some(ref val) = self.sparse_set_map {
  201    202   
            ser.write_map(
  202    203   
                &SPARSEJSONMAPSINPUT_MEMBER_SPARSE_SET_MAP,
  203    204   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  204    205   
                    for (key, value) in val {
  205    206   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  206    207   
                        match value {
  207    208   
                            Some(value) => {
  208         -
                                todo!("schema: unsupported map value type");
         209  +
                                ser.write_list(
         210  +
                                    &::aws_smithy_schema::prelude::DOCUMENT,
         211  +
                                    &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         212  +
                                        for item in value {
         213  +
                                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         214  +
                                        }
         215  +
                                        Ok(())
         216  +
                                    },
         217  +
                                )?;
  209    218   
                            }
  210    219   
                            None => {
  211    220   
                                ser.write_null(&::aws_smithy_schema::prelude::STRING)?;
  212    221   
                            }
  213    222   
                        }
  214    223   
                    }
  215    224   
                    Ok(())
  216    225   
                },
  217    226   
            )?;
  218    227   
        }
  219    228   
        Ok(())
  220    229   
    }
  221    230   
}
  222    231   
impl SparseJsonMapsInput {
  223    232   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  224         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  225         -
        deserializer: &mut D,
         233  +
    pub fn deserialize(
         234  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  226    235   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  227    236   
        #[allow(unused_variables, unused_mut)]
  228    237   
        let mut builder = Self::builder();
  229    238   
        #[allow(
  230    239   
            unused_variables,
  231    240   
            unreachable_code,
  232    241   
            clippy::single_match,
  233    242   
            clippy::match_single_binding,
  234    243   
            clippy::diverging_sub_expression
  235    244   
        )]
  236         -
        deserializer.read_struct(&SPARSEJSONMAPSINPUT_SCHEMA, (), |_, member, deser| {
         245  +
        deserializer.read_struct(&SPARSEJSONMAPSINPUT_SCHEMA, &mut |member, deser| {
  237    246   
            match member.member_index() {
  238    247   
                Some(0) => {
  239    248   
                    builder.sparse_struct_map = Some({
  240         -
                        let container = if let Some(cap) = deser.container_size() {
  241         -
                            std::collections::HashMap::with_capacity(cap)
  242         -
                        } else {
  243         -
                            std::collections::HashMap::new()
  244         -
                        };
  245         -
                        deser.read_map(member, container, |mut map, key, deser| {
  246         -
                            map.insert(
         249  +
                        let mut container = std::collections::HashMap::new();
         250  +
                        deser.read_map(member, &mut |key, deser| {
         251  +
                            container.insert(
  247    252   
                                key,
  248    253   
                                if deser.is_null() {
  249         -
                                    deser.read_string(member).ok();
         254  +
                                    deser.read_null()?;
  250    255   
                                    None
  251    256   
                                } else {
  252    257   
                                    Some(crate::types::GreetingStruct::deserialize(deser)?)
  253    258   
                                },
  254    259   
                            );
  255         -
                            Ok(map)
  256         -
                        })?
         260  +
                            Ok(())
         261  +
                        })?;
         262  +
                        container
  257    263   
                    });
  258    264   
                }
  259    265   
                Some(1) => {
  260    266   
                    builder.sparse_number_map = Some({
  261         -
                        let container = if let Some(cap) = deser.container_size() {
  262         -
                            std::collections::HashMap::with_capacity(cap)
  263         -
                        } else {
  264         -
                            std::collections::HashMap::new()
  265         -
                        };
  266         -
                        deser.read_map(member, container, |mut map, key, deser| {
  267         -
                            map.insert(
         267  +
                        let mut container = std::collections::HashMap::new();
         268  +
                        deser.read_map(member, &mut |key, deser| {
         269  +
                            container.insert(
  268    270   
                                key,
  269    271   
                                if deser.is_null() {
  270         -
                                    deser.read_string(member).ok();
         272  +
                                    deser.read_null()?;
  271    273   
                                    None
  272    274   
                                } else {
  273    275   
                                    Some(deser.read_integer(member)?)
  274    276   
                                },
  275    277   
                            );
  276         -
                            Ok(map)
  277         -
                        })?
         278  +
                            Ok(())
         279  +
                        })?;
         280  +
                        container
  278    281   
                    });
  279    282   
                }
  280    283   
                Some(2) => {
  281    284   
                    builder.sparse_boolean_map = Some({
  282         -
                        let container = if let Some(cap) = deser.container_size() {
  283         -
                            std::collections::HashMap::with_capacity(cap)
  284         -
                        } else {
  285         -
                            std::collections::HashMap::new()
  286         -
                        };
  287         -
                        deser.read_map(member, container, |mut map, key, deser| {
  288         -
                            map.insert(
         285  +
                        let mut container = std::collections::HashMap::new();
         286  +
                        deser.read_map(member, &mut |key, deser| {
         287  +
                            container.insert(
  289    288   
                                key,
  290    289   
                                if deser.is_null() {
  291         -
                                    deser.read_string(member).ok();
         290  +
                                    deser.read_null()?;
  292    291   
                                    None
  293    292   
                                } else {
  294    293   
                                    Some(deser.read_boolean(member)?)
  295    294   
                                },
  296    295   
                            );
  297         -
                            Ok(map)
  298         -
                        })?
         296  +
                            Ok(())
         297  +
                        })?;
         298  +
                        container
  299    299   
                    });
  300    300   
                }
  301    301   
                Some(3) => {
  302    302   
                    builder.sparse_string_map = Some({
  303         -
                        let container = if let Some(cap) = deser.container_size() {
  304         -
                            std::collections::HashMap::with_capacity(cap)
  305         -
                        } else {
  306         -
                            std::collections::HashMap::new()
  307         -
                        };
  308         -
                        deser.read_map(member, container, |mut map, key, deser| {
  309         -
                            map.insert(
         303  +
                        let mut container = std::collections::HashMap::new();
         304  +
                        deser.read_map(member, &mut |key, deser| {
         305  +
                            container.insert(
  310    306   
                                key,
  311    307   
                                if deser.is_null() {
  312         -
                                    deser.read_string(member).ok();
         308  +
                                    deser.read_null()?;
  313    309   
                                    None
  314    310   
                                } else {
  315    311   
                                    Some(deser.read_string(member)?)
  316    312   
                                },
  317    313   
                            );
  318         -
                            Ok(map)
  319         -
                        })?
         314  +
                            Ok(())
         315  +
                        })?;
         316  +
                        container
  320    317   
                    });
  321    318   
                }
  322    319   
                Some(4) => {
  323    320   
                    builder.sparse_set_map = Some({
  324         -
                        let container = if let Some(cap) = deser.container_size() {
  325         -
                            std::collections::HashMap::with_capacity(cap)
  326         -
                        } else {
  327         -
                            std::collections::HashMap::new()
  328         -
                        };
  329         -
                        deser.read_map(member, container, |mut map, key, deser| {
  330         -
                            map.insert(
         321  +
                        let mut container = std::collections::HashMap::new();
         322  +
                        deser.read_map(member, &mut |key, deser| {
         323  +
                            container.insert(
  331    324   
                                key,
  332    325   
                                if deser.is_null() {
  333         -
                                    deser.read_string(member).ok();
         326  +
                                    deser.read_null()?;
  334    327   
                                    None
  335    328   
                                } else {
  336         -
                                    Some(todo!("deserialize nested aggregate"))
         329  +
                                    Some({
         330  +
                                        let mut list = Vec::new();
         331  +
                                        deser.read_list(member, &mut |deser| {
         332  +
                                            list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         333  +
                                            Ok(())
         334  +
                                        })?;
         335  +
                                        list
         336  +
                                    })
  337    337   
                                },
  338    338   
                            );
  339         -
                            Ok(map)
  340         -
                        })?
         339  +
                            Ok(())
         340  +
                        })?;
         341  +
                        container
  341    342   
                    });
  342    343   
                }
  343    344   
                _ => {}
  344    345   
            }
  345    346   
            Ok(())
  346    347   
        })?;
  347    348   
        builder
  348    349   
            .build()
  349    350   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  350    351   
    }
  351    352   
}
         353  +
impl SparseJsonMapsInput {
         354  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         355  +
    pub fn deserialize_with_response(
         356  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         357  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         358  +
        _status: u16,
         359  +
        _body: &[u8],
         360  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         361  +
        Self::deserialize(deserializer)
         362  +
    }
         363  +
}
  352    364   
impl SparseJsonMapsInput {
  353    365   
    /// Creates a new builder-style object to manufacture [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
  354    366   
    pub fn builder() -> crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder {
  355    367   
        crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder::default()
  356    368   
    }
  357    369   
}
  358    370   
  359    371   
/// A builder for [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
  360    372   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  361    373   
#[non_exhaustive]

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

@@ -30,30 +130,130 @@
   50     50   
    "aws.protocoltests.restjson.synthetic",
   51     51   
    "SparseJsonMapsOutput",
   52     52   
);
   53     53   
static SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_STRUCT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   54     54   
    ::aws_smithy_schema::ShapeId::from_static(
   55     55   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsOutput$sparseStructMap",
   56     56   
        "aws.protocoltests.restjson.synthetic",
   57     57   
        "SparseJsonMapsOutput",
   58     58   
    ),
   59     59   
    ::aws_smithy_schema::ShapeType::Map,
   60         -
    "sparse_struct_map",
          60  +
    "sparseStructMap",
   61     61   
    0,
   62     62   
);
   63     63   
static SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_NUMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   64     64   
    ::aws_smithy_schema::ShapeId::from_static(
   65     65   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsOutput$sparseNumberMap",
   66     66   
        "aws.protocoltests.restjson.synthetic",
   67     67   
        "SparseJsonMapsOutput",
   68     68   
    ),
   69     69   
    ::aws_smithy_schema::ShapeType::Map,
   70         -
    "sparse_number_map",
          70  +
    "sparseNumberMap",
   71     71   
    1,
   72     72   
);
   73     73   
static SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_BOOLEAN_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   74     74   
    ::aws_smithy_schema::ShapeId::from_static(
   75     75   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsOutput$sparseBooleanMap",
   76     76   
        "aws.protocoltests.restjson.synthetic",
   77     77   
        "SparseJsonMapsOutput",
   78     78   
    ),
   79     79   
    ::aws_smithy_schema::ShapeType::Map,
   80         -
    "sparse_boolean_map",
          80  +
    "sparseBooleanMap",
   81     81   
    2,
   82     82   
);
   83     83   
static SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_STRING_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static(
   85     85   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsOutput$sparseStringMap",
   86     86   
        "aws.protocoltests.restjson.synthetic",
   87     87   
        "SparseJsonMapsOutput",
   88     88   
    ),
   89     89   
    ::aws_smithy_schema::ShapeType::Map,
   90         -
    "sparse_string_map",
          90  +
    "sparseStringMap",
   91     91   
    3,
   92     92   
);
   93     93   
static SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_SET_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   94     94   
    ::aws_smithy_schema::ShapeId::from_static(
   95     95   
        "aws.protocoltests.restjson.synthetic#SparseJsonMapsOutput$sparseSetMap",
   96     96   
        "aws.protocoltests.restjson.synthetic",
   97     97   
        "SparseJsonMapsOutput",
   98     98   
    ),
   99     99   
    ::aws_smithy_schema::ShapeType::Map,
  100         -
    "sparse_set_map",
         100  +
    "sparseSetMap",
  101    101   
    4,
  102    102   
);
  103    103   
static SPARSEJSONMAPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  104    104   
    SPARSEJSONMAPSOUTPUT_SCHEMA_ID,
  105    105   
    ::aws_smithy_schema::ShapeType::Structure,
  106    106   
    &[
  107    107   
        &SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_STRUCT_MAP,
  108    108   
        &SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_NUMBER_MAP,
  109    109   
        &SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_BOOLEAN_MAP,
  110    110   
        &SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_STRING_MAP,
@@ -178,178 +379,390 @@
  198    198   
            )?;
  199    199   
        }
  200    200   
        if let Some(ref val) = self.sparse_set_map {
  201    201   
            ser.write_map(
  202    202   
                &SPARSEJSONMAPSOUTPUT_MEMBER_SPARSE_SET_MAP,
  203    203   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  204    204   
                    for (key, value) in val {
  205    205   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  206    206   
                        match value {
  207    207   
                            Some(value) => {
  208         -
                                todo!("schema: unsupported map value type");
         208  +
                                ser.write_list(
         209  +
                                    &::aws_smithy_schema::prelude::DOCUMENT,
         210  +
                                    &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         211  +
                                        for item in value {
         212  +
                                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         213  +
                                        }
         214  +
                                        Ok(())
         215  +
                                    },
         216  +
                                )?;
  209    217   
                            }
  210    218   
                            None => {
  211    219   
                                ser.write_null(&::aws_smithy_schema::prelude::STRING)?;
  212    220   
                            }
  213    221   
                        }
  214    222   
                    }
  215    223   
                    Ok(())
  216    224   
                },
  217    225   
            )?;
  218    226   
        }
  219    227   
        Ok(())
  220    228   
    }
  221    229   
}
  222    230   
impl SparseJsonMapsOutput {
  223    231   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  224         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  225         -
        deserializer: &mut D,
         232  +
    pub fn deserialize(
         233  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  226    234   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  227    235   
        #[allow(unused_variables, unused_mut)]
  228    236   
        let mut builder = Self::builder();
  229    237   
        #[allow(
  230    238   
            unused_variables,
  231    239   
            unreachable_code,
  232    240   
            clippy::single_match,
  233    241   
            clippy::match_single_binding,
  234    242   
            clippy::diverging_sub_expression
  235    243   
        )]
  236         -
        deserializer.read_struct(&SPARSEJSONMAPSOUTPUT_SCHEMA, (), |_, member, deser| {
         244  +
        deserializer.read_struct(&SPARSEJSONMAPSOUTPUT_SCHEMA, &mut |member, deser| {
  237    245   
            match member.member_index() {
  238    246   
                Some(0) => {
  239    247   
                    builder.sparse_struct_map = Some({
  240         -
                        let container = if let Some(cap) = deser.container_size() {
  241         -
                            std::collections::HashMap::with_capacity(cap)
  242         -
                        } else {
  243         -
                            std::collections::HashMap::new()
  244         -
                        };
  245         -
                        deser.read_map(member, container, |mut map, key, deser| {
  246         -
                            map.insert(
         248  +
                        let mut container = std::collections::HashMap::new();
         249  +
                        deser.read_map(member, &mut |key, deser| {
         250  +
                            container.insert(
  247    251   
                                key,
  248    252   
                                if deser.is_null() {
  249         -
                                    deser.read_string(member).ok();
         253  +
                                    deser.read_null()?;
  250    254   
                                    None
  251    255   
                                } else {
  252    256   
                                    Some(crate::types::GreetingStruct::deserialize(deser)?)
  253    257   
                                },
  254    258   
                            );
  255         -
                            Ok(map)
  256         -
                        })?
         259  +
                            Ok(())
         260  +
                        })?;
         261  +
                        container
  257    262   
                    });
  258    263   
                }
  259    264   
                Some(1) => {
  260    265   
                    builder.sparse_number_map = Some({
  261         -
                        let container = if let Some(cap) = deser.container_size() {
  262         -
                            std::collections::HashMap::with_capacity(cap)
  263         -
                        } else {
  264         -
                            std::collections::HashMap::new()
  265         -
                        };
  266         -
                        deser.read_map(member, container, |mut map, key, deser| {
  267         -
                            map.insert(
         266  +
                        let mut container = std::collections::HashMap::new();
         267  +
                        deser.read_map(member, &mut |key, deser| {
         268  +
                            container.insert(
  268    269   
                                key,
  269    270   
                                if deser.is_null() {
  270         -
                                    deser.read_string(member).ok();
         271  +
                                    deser.read_null()?;
  271    272   
                                    None
  272    273   
                                } else {
  273    274   
                                    Some(deser.read_integer(member)?)
  274    275   
                                },
  275    276   
                            );
  276         -
                            Ok(map)
  277         -
                        })?
         277  +
                            Ok(())
         278  +
                        })?;
         279  +
                        container
  278    280   
                    });
  279    281   
                }
  280    282   
                Some(2) => {
  281    283   
                    builder.sparse_boolean_map = Some({
  282         -
                        let container = if let Some(cap) = deser.container_size() {
  283         -
                            std::collections::HashMap::with_capacity(cap)
  284         -
                        } else {
  285         -
                            std::collections::HashMap::new()
  286         -
                        };
  287         -
                        deser.read_map(member, container, |mut map, key, deser| {
  288         -
                            map.insert(
         284  +
                        let mut container = std::collections::HashMap::new();
         285  +
                        deser.read_map(member, &mut |key, deser| {
         286  +
                            container.insert(
  289    287   
                                key,
  290    288   
                                if deser.is_null() {
  291         -
                                    deser.read_string(member).ok();
         289  +
                                    deser.read_null()?;
  292    290   
                                    None
  293    291   
                                } else {
  294    292   
                                    Some(deser.read_boolean(member)?)
  295    293   
                                },
  296    294   
                            );
  297         -
                            Ok(map)
  298         -
                        })?
         295  +
                            Ok(())
         296  +
                        })?;
         297  +
                        container
  299    298   
                    });
  300    299   
                }
  301    300   
                Some(3) => {
  302    301   
                    builder.sparse_string_map = Some({
  303         -
                        let container = if let Some(cap) = deser.container_size() {
  304         -
                            std::collections::HashMap::with_capacity(cap)
  305         -
                        } else {
  306         -
                            std::collections::HashMap::new()
  307         -
                        };
  308         -
                        deser.read_map(member, container, |mut map, key, deser| {
  309         -
                            map.insert(
         302  +
                        let mut container = std::collections::HashMap::new();
         303  +
                        deser.read_map(member, &mut |key, deser| {
         304  +
                            container.insert(
  310    305   
                                key,
  311    306   
                                if deser.is_null() {
  312         -
                                    deser.read_string(member).ok();
         307  +
                                    deser.read_null()?;
  313    308   
                                    None
  314    309   
                                } else {
  315    310   
                                    Some(deser.read_string(member)?)
  316    311   
                                },
  317    312   
                            );
  318         -
                            Ok(map)
  319         -
                        })?
         313  +
                            Ok(())
         314  +
                        })?;
         315  +
                        container
  320    316   
                    });
  321    317   
                }
  322    318   
                Some(4) => {
  323    319   
                    builder.sparse_set_map = Some({
  324         -
                        let container = if let Some(cap) = deser.container_size() {
  325         -
                            std::collections::HashMap::with_capacity(cap)
  326         -
                        } else {
  327         -
                            std::collections::HashMap::new()
  328         -
                        };
  329         -
                        deser.read_map(member, container, |mut map, key, deser| {
  330         -
                            map.insert(
         320  +
                        let mut container = std::collections::HashMap::new();
         321  +
                        deser.read_map(member, &mut |key, deser| {
         322  +
                            container.insert(
  331    323   
                                key,
  332    324   
                                if deser.is_null() {
  333         -
                                    deser.read_string(member).ok();
         325  +
                                    deser.read_null()?;
  334    326   
                                    None
  335    327   
                                } else {
  336         -
                                    Some(todo!("deserialize nested aggregate"))
         328  +
                                    Some({
         329  +
                                        let mut list = Vec::new();
         330  +
                                        deser.read_list(member, &mut |deser| {
         331  +
                                            list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         332  +
                                            Ok(())
         333  +
                                        })?;
         334  +
                                        list
         335  +
                                    })
  337    336   
                                },
  338    337   
                            );
  339         -
                            Ok(map)
  340         -
                        })?
         338  +
                            Ok(())
         339  +
                        })?;
         340  +
                        container
  341    341   
                    });
  342    342   
                }
  343    343   
                _ => {}
  344    344   
            }
  345    345   
            Ok(())
  346    346   
        })?;
  347    347   
        Ok(builder.build())
  348    348   
    }
  349    349   
}
         350  +
impl SparseJsonMapsOutput {
         351  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         352  +
    pub fn deserialize_with_response(
         353  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         354  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         355  +
        _status: u16,
         356  +
        _body: &[u8],
         357  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         358  +
        Self::deserialize(deserializer)
         359  +
    }
         360  +
}
  350    361   
impl SparseJsonMapsOutput {
  351    362   
    /// Creates a new builder-style object to manufacture [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
  352    363   
    pub fn builder() -> crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder {
  353    364   
        crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder::default()
  354    365   
    }
  355    366   
}
  356    367   
  357    368   
/// A builder for [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
  358    369   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  359    370   
#[non_exhaustive]