Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/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 `JsonLists`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonLists;
    6      6   
impl JsonLists {
    7      7   
    /// Creates a new `JsonLists`
    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::json_lists::JsonListsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_lists::JsonListsOutput::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::json_lists::JsonListsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_lists::JsonListsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_lists::JsonListsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +224,227 @@
  124    128   
                crate::operation::json_lists::JsonListsError,
  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 JsonListsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonListsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_lists::de_json_lists_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_lists::JsonListsError::generic(generic)),
         158  +
            ))
  146    159   
        } else {
  147         -
            crate::protocol_serde::shape_json_lists::de_json_lists_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         160  +
            let protocol = _cfg
         161  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         162  +
                .expect("a SharedClientProtocol is required");
         163  +
            let mut deser = protocol.deserialize_response(response, JsonLists::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         164  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         165  +
            })?;
         166  +
            let body = response.body().bytes().expect("body loaded");
         167  +
            let output = crate::operation::json_lists::JsonListsOutput::deserialize_with_response(
         168  +
                &mut *deser,
         169  +
                response.headers(),
         170  +
                response.status().into(),
         171  +
                body,
         172  +
            )
         173  +
            .map_err(|e| {
         174  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
            })?;
         176  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         177  +
        }
  150    178   
    }
  151    179   
}
  152    180   
#[derive(Debug)]
  153    181   
struct JsonListsRequestSerializer;
  154    182   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonListsRequestSerializer {
  155    183   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    184   
    fn serialize_input(
  157    185   
        &self,
  158    186   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    187   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    188   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    189   
        let input = input.downcast::<crate::operation::json_lists::JsonListsInput>().expect("correct type");
  162         -
        let _header_serialization_settings = _cfg
  163         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  164         -
            .cloned()
  165         -
            .unwrap_or_default();
  166         -
        let mut request_builder = {
  167         -
            #[allow(clippy::uninlined_format_args)]
  168         -
            fn uri_base(
  169         -
                _input: &crate::operation::json_lists::JsonListsInput,
  170         -
                output: &mut ::std::string::String,
  171         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172         -
                use ::std::fmt::Write as _;
  173         -
                ::std::write!(output, "/JsonLists").expect("formatting should succeed");
  174         -
                ::std::result::Result::Ok(())
  175         -
            }
  176         -
            #[allow(clippy::unnecessary_wraps)]
  177         -
            fn update_http_builder(
  178         -
                input: &crate::operation::json_lists::JsonListsInput,
  179         -
                builder: ::http_1x::request::Builder,
  180         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181         -
                let mut uri = ::std::string::String::new();
  182         -
                uri_base(input, &mut uri)?;
  183         -
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  184         -
            }
  185         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  186         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  187         -
            builder
  188         -
        };
  189         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_lists::ser_json_lists_input(&input)?);
  190         -
        if let Some(content_length) = body.content_length() {
  191         -
            let content_length = content_length.to_string();
  192         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  193         -
        }
  194         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         190  +
        let protocol = _cfg
         191  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         192  +
            .expect("a SharedClientProtocol is required");
         193  +
        let mut request = protocol
         194  +
            .serialize_request(&input, JsonLists::INPUT_SCHEMA, "", _cfg)
         195  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         196  +
         197  +
        return ::std::result::Result::Ok(request);
  195    198   
    }
  196    199   
}
  197    200   
#[derive(Debug)]
  198    201   
struct JsonListsEndpointParamsInterceptor;
  199    202   
  200    203   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonListsEndpointParamsInterceptor {
  201    204   
    fn name(&self) -> &'static str {
  202    205   
        "JsonListsEndpointParamsInterceptor"
  203    206   
    }
  204    207   
@@ -351,354 +411,424 @@
  371    374   
            .expect("the config must have a deserializer");
  372    375   
  373    376   
        let parsed = de.deserialize_streaming(&mut http_response);
  374    377   
        let parsed = parsed.unwrap_or_else(|| {
  375    378   
            let http_response = http_response.map(|body| {
  376    379   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  377    380   
                    body.bytes().unwrap(),
  378    381   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  379    382   
                )))
  380    383   
            });
  381         -
            de.deserialize_nonstreaming(&http_response)
         384  +
            // Build a config bag with the protocol for schema-based deserialization
         385  +
            #[allow(unused_mut)]
         386  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         387  +
            {
         388  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         389  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         390  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         391  +
                ));
         392  +
                test_cfg.push_shared_layer(layer.freeze());
         393  +
            }
         394  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  382    395   
        });
  383    396   
        let parsed = parsed
  384    397   
            .expect("should be successful response")
  385    398   
            .downcast::<crate::operation::json_lists::JsonListsOutput>()
  386    399   
            .unwrap();
  387    400   
        ::pretty_assertions::assert_eq!(parsed.string_list, expected_output.string_list, "Unexpected value for `string_list`");
  388    401   
        ::pretty_assertions::assert_eq!(parsed.string_set, expected_output.string_set, "Unexpected value for `string_set`");
  389    402   
        ::pretty_assertions::assert_eq!(parsed.integer_list, expected_output.integer_list, "Unexpected value for `integer_list`");
  390    403   
        ::pretty_assertions::assert_eq!(parsed.boolean_list, expected_output.boolean_list, "Unexpected value for `boolean_list`");
  391    404   
        ::pretty_assertions::assert_eq!(
@@ -417,430 +477,500 @@
  437    450   
            .expect("the config must have a deserializer");
  438    451   
  439    452   
        let parsed = de.deserialize_streaming(&mut http_response);
  440    453   
        let parsed = parsed.unwrap_or_else(|| {
  441    454   
            let http_response = http_response.map(|body| {
  442    455   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  443    456   
                    body.bytes().unwrap(),
  444    457   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  445    458   
                )))
  446    459   
            });
  447         -
            de.deserialize_nonstreaming(&http_response)
         460  +
            // Build a config bag with the protocol for schema-based deserialization
         461  +
            #[allow(unused_mut)]
         462  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         463  +
            {
         464  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         465  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         466  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         467  +
                ));
         468  +
                test_cfg.push_shared_layer(layer.freeze());
         469  +
            }
         470  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  448    471   
        });
  449    472   
        let parsed = parsed
  450    473   
            .expect("should be successful response")
  451    474   
            .downcast::<crate::operation::json_lists::JsonListsOutput>()
  452    475   
            .unwrap();
  453    476   
        ::pretty_assertions::assert_eq!(parsed.string_list, expected_output.string_list, "Unexpected value for `string_list`");
  454    477   
        ::pretty_assertions::assert_eq!(parsed.string_set, expected_output.string_set, "Unexpected value for `string_set`");
  455    478   
        ::pretty_assertions::assert_eq!(parsed.integer_list, expected_output.integer_list, "Unexpected value for `integer_list`");
  456    479   
        ::pretty_assertions::assert_eq!(parsed.boolean_list, expected_output.boolean_list, "Unexpected value for `boolean_list`");
  457    480   
        ::pretty_assertions::assert_eq!(

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

@@ -63,63 +221,222 @@
   83     83   
    "aws.protocoltests.restjson.synthetic",
   84     84   
    "JsonListsInput",
   85     85   
);
   86     86   
static JSONLISTSINPUT_MEMBER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   87     87   
    ::aws_smithy_schema::ShapeId::from_static(
   88     88   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$stringList",
   89     89   
        "aws.protocoltests.restjson.synthetic",
   90     90   
        "JsonListsInput",
   91     91   
    ),
   92     92   
    ::aws_smithy_schema::ShapeType::List,
   93         -
    "string_list",
          93  +
    "stringList",
   94     94   
    0,
   95     95   
);
   96     96   
static JSONLISTSINPUT_MEMBER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   97     97   
    ::aws_smithy_schema::ShapeId::from_static(
   98     98   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$stringSet",
   99     99   
        "aws.protocoltests.restjson.synthetic",
  100    100   
        "JsonListsInput",
  101    101   
    ),
  102    102   
    ::aws_smithy_schema::ShapeType::List,
  103         -
    "string_set",
         103  +
    "stringSet",
  104    104   
    1,
  105    105   
);
  106    106   
static JSONLISTSINPUT_MEMBER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  107    107   
    ::aws_smithy_schema::ShapeId::from_static(
  108    108   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$integerList",
  109    109   
        "aws.protocoltests.restjson.synthetic",
  110    110   
        "JsonListsInput",
  111    111   
    ),
  112    112   
    ::aws_smithy_schema::ShapeType::List,
  113         -
    "integer_list",
         113  +
    "integerList",
  114    114   
    2,
  115    115   
);
  116    116   
static JSONLISTSINPUT_MEMBER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    117   
    ::aws_smithy_schema::ShapeId::from_static(
  118    118   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$booleanList",
  119    119   
        "aws.protocoltests.restjson.synthetic",
  120    120   
        "JsonListsInput",
  121    121   
    ),
  122    122   
    ::aws_smithy_schema::ShapeType::List,
  123         -
    "boolean_list",
         123  +
    "booleanList",
  124    124   
    3,
  125    125   
);
  126    126   
static JSONLISTSINPUT_MEMBER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  127    127   
    ::aws_smithy_schema::ShapeId::from_static(
  128    128   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$timestampList",
  129    129   
        "aws.protocoltests.restjson.synthetic",
  130    130   
        "JsonListsInput",
  131    131   
    ),
  132    132   
    ::aws_smithy_schema::ShapeType::List,
  133         -
    "timestamp_list",
         133  +
    "timestampList",
  134    134   
    4,
  135    135   
);
  136    136   
static JSONLISTSINPUT_MEMBER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$enumList",
  139    139   
        "aws.protocoltests.restjson.synthetic",
  140    140   
        "JsonListsInput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::List,
  143         -
    "enum_list",
         143  +
    "enumList",
  144    144   
    5,
  145    145   
);
  146    146   
static JSONLISTSINPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  147    147   
    ::aws_smithy_schema::ShapeId::from_static(
  148    148   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$intEnumList",
  149    149   
        "aws.protocoltests.restjson.synthetic",
  150    150   
        "JsonListsInput",
  151    151   
    ),
  152    152   
    ::aws_smithy_schema::ShapeType::List,
  153         -
    "int_enum_list",
         153  +
    "intEnumList",
  154    154   
    6,
  155    155   
);
  156    156   
static JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  157    157   
    ::aws_smithy_schema::ShapeId::from_static(
  158    158   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$nestedStringList",
  159    159   
        "aws.protocoltests.restjson.synthetic",
  160    160   
        "JsonListsInput",
  161    161   
    ),
  162    162   
    ::aws_smithy_schema::ShapeType::List,
  163         -
    "nested_string_list",
         163  +
    "nestedStringList",
  164    164   
    7,
  165    165   
);
  166    166   
static JSONLISTSINPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  167    167   
    ::aws_smithy_schema::ShapeId::from_static(
  168    168   
        "aws.protocoltests.restjson.synthetic#JsonListsInput$structureList",
  169    169   
        "aws.protocoltests.restjson.synthetic",
  170    170   
        "JsonListsInput",
  171    171   
    ),
  172    172   
    ::aws_smithy_schema::ShapeType::List,
  173         -
    "structure_list",
         173  +
    "structureList",
  174    174   
    8,
  175    175   
)
  176    176   
.with_json_name("myStructureList");
  177    177   
static JSONLISTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  178    178   
    JSONLISTSINPUT_SCHEMA_ID,
  179    179   
    ::aws_smithy_schema::ShapeType::Structure,
  180    180   
    &[
  181    181   
        &JSONLISTSINPUT_MEMBER_STRING_LIST,
  182    182   
        &JSONLISTSINPUT_MEMBER_STRING_SET,
  183    183   
        &JSONLISTSINPUT_MEMBER_INTEGER_LIST,
  184    184   
        &JSONLISTSINPUT_MEMBER_BOOLEAN_LIST,
  185    185   
        &JSONLISTSINPUT_MEMBER_TIMESTAMP_LIST,
  186    186   
        &JSONLISTSINPUT_MEMBER_ENUM_LIST,
  187    187   
        &JSONLISTSINPUT_MEMBER_INT_ENUM_LIST,
  188    188   
        &JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST,
  189    189   
        &JSONLISTSINPUT_MEMBER_STRUCTURE_LIST,
  190    190   
    ],
  191         -
);
         191  +
)
         192  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/JsonLists", None));
  192    193   
impl JsonListsInput {
  193    194   
    /// The schema for this shape.
  194    195   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONLISTSINPUT_SCHEMA;
  195    196   
}
  196    197   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonListsInput {
  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> {
@@ -254,255 +475,447 @@
  274    275   
                    }
  275    276   
                    Ok(())
  276    277   
                },
  277    278   
            )?;
  278    279   
        }
  279    280   
        if let Some(ref val) = self.nested_string_list {
  280    281   
            ser.write_list(
  281    282   
                &JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST,
  282    283   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  283    284   
                    for item in val {
  284         -
                        todo!("schema: unsupported list element type");
         285  +
                        ser.write_list(
         286  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         287  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         288  +
                                for item in item {
         289  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         290  +
                                }
         291  +
                                Ok(())
         292  +
                            },
         293  +
                        )?;
  285    294   
                    }
  286    295   
                    Ok(())
  287    296   
                },
  288    297   
            )?;
  289    298   
        }
  290    299   
        if let Some(ref val) = self.structure_list {
  291    300   
            ser.write_list(
  292    301   
                &JSONLISTSINPUT_MEMBER_STRUCTURE_LIST,
  293    302   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  294    303   
                    for item in val {
  295    304   
                        ser.write_struct(crate::types::StructureListMember::SCHEMA, item)?;
  296    305   
                    }
  297    306   
                    Ok(())
  298    307   
                },
  299    308   
            )?;
  300    309   
        }
  301    310   
        Ok(())
  302    311   
    }
  303    312   
}
  304    313   
impl JsonListsInput {
  305    314   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  306         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  307         -
        deserializer: &mut D,
         315  +
    pub fn deserialize(
         316  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  308    317   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  309    318   
        #[allow(unused_variables, unused_mut)]
  310    319   
        let mut builder = Self::builder();
  311    320   
        #[allow(
  312    321   
            unused_variables,
  313    322   
            unreachable_code,
  314    323   
            clippy::single_match,
  315    324   
            clippy::match_single_binding,
  316    325   
            clippy::diverging_sub_expression
  317    326   
        )]
  318         -
        deserializer.read_struct(&JSONLISTSINPUT_SCHEMA, (), |_, member, deser| {
         327  +
        deserializer.read_struct(&JSONLISTSINPUT_SCHEMA, &mut |member, deser| {
  319    328   
            match member.member_index() {
  320    329   
                Some(0) => {
  321         -
                    builder.string_list = Some({
  322         -
                        let container = if let Some(cap) = deser.container_size() {
  323         -
                            Vec::with_capacity(cap)
  324         -
                        } else {
  325         -
                            Vec::new()
  326         -
                        };
  327         -
                        deser.read_list(member, container, |mut list, deser| {
  328         -
                            list.push(deser.read_string(member)?);
  329         -
                            Ok(list)
  330         -
                        })?
  331         -
                    });
         330  +
                    builder.string_list = Some(deser.read_string_list(member)?);
  332    331   
                }
  333    332   
                Some(1) => {
  334         -
                    builder.string_set = Some({
  335         -
                        let container = if let Some(cap) = deser.container_size() {
  336         -
                            Vec::with_capacity(cap)
  337         -
                        } else {
  338         -
                            Vec::new()
  339         -
                        };
  340         -
                        deser.read_list(member, container, |mut list, deser| {
  341         -
                            list.push(deser.read_string(member)?);
  342         -
                            Ok(list)
  343         -
                        })?
  344         -
                    });
         333  +
                    builder.string_set = Some(deser.read_string_list(member)?);
  345    334   
                }
  346    335   
                Some(2) => {
  347         -
                    builder.integer_list = Some({
  348         -
                        let container = if let Some(cap) = deser.container_size() {
  349         -
                            Vec::with_capacity(cap)
  350         -
                        } else {
  351         -
                            Vec::new()
  352         -
                        };
  353         -
                        deser.read_list(member, container, |mut list, deser| {
  354         -
                            list.push(deser.read_integer(member)?);
  355         -
                            Ok(list)
  356         -
                        })?
  357         -
                    });
         336  +
                    builder.integer_list = Some(deser.read_integer_list(member)?);
  358    337   
                }
  359    338   
                Some(3) => {
  360    339   
                    builder.boolean_list = Some({
  361         -
                        let container = if let Some(cap) = deser.container_size() {
  362         -
                            Vec::with_capacity(cap)
  363         -
                        } else {
  364         -
                            Vec::new()
  365         -
                        };
  366         -
                        deser.read_list(member, container, |mut list, deser| {
  367         -
                            list.push(deser.read_boolean(member)?);
  368         -
                            Ok(list)
  369         -
                        })?
         340  +
                        let mut container = Vec::new();
         341  +
                        deser.read_list(member, &mut |deser| {
         342  +
                            container.push(deser.read_boolean(member)?);
         343  +
                            Ok(())
         344  +
                        })?;
         345  +
                        container
  370    346   
                    });
  371    347   
                }
  372    348   
                Some(4) => {
  373    349   
                    builder.timestamp_list = Some({
  374         -
                        let container = if let Some(cap) = deser.container_size() {
  375         -
                            Vec::with_capacity(cap)
  376         -
                        } else {
  377         -
                            Vec::new()
  378         -
                        };
  379         -
                        deser.read_list(member, container, |mut list, deser| {
  380         -
                            list.push(deser.read_timestamp(member)?);
  381         -
                            Ok(list)
  382         -
                        })?
         350  +
                        let mut container = Vec::new();
         351  +
                        deser.read_list(member, &mut |deser| {
         352  +
                            container.push(deser.read_timestamp(member)?);
         353  +
                            Ok(())
         354  +
                        })?;
         355  +
                        container
  383    356   
                    });
  384    357   
                }
  385    358   
                Some(5) => {
  386    359   
                    builder.enum_list = Some({
  387         -
                        let container = if let Some(cap) = deser.container_size() {
  388         -
                            Vec::with_capacity(cap)
  389         -
                        } else {
  390         -
                            Vec::new()
  391         -
                        };
  392         -
                        deser.read_list(member, container, |mut list, deser| {
  393         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  394         -
                            Ok(list)
  395         -
                        })?
         360  +
                        let mut container = Vec::new();
         361  +
                        deser.read_list(member, &mut |deser| {
         362  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         363  +
                            Ok(())
         364  +
                        })?;
         365  +
                        container
  396    366   
                    });
  397    367   
                }
  398    368   
                Some(6) => {
  399         -
                    builder.int_enum_list = Some({
  400         -
                        let container = if let Some(cap) = deser.container_size() {
  401         -
                            Vec::with_capacity(cap)
  402         -
                        } else {
  403         -
                            Vec::new()
  404         -
                        };
  405         -
                        deser.read_list(member, container, |mut list, deser| {
  406         -
                            list.push(deser.read_integer(member)?);
  407         -
                            Ok(list)
  408         -
                        })?
  409         -
                    });
         369  +
                    builder.int_enum_list = Some(deser.read_integer_list(member)?);
  410    370   
                }
  411    371   
                Some(7) => {
  412    372   
                    builder.nested_string_list = Some({
  413         -
                        let container = if let Some(cap) = deser.container_size() {
  414         -
                            Vec::with_capacity(cap)
  415         -
                        } else {
  416         -
                            Vec::new()
  417         -
                        };
  418         -
                        deser.read_list(member, container, |mut list, deser| {
  419         -
                            list.push(todo!("deserialize nested aggregate"));
  420         -
                            Ok(list)
  421         -
                        })?
         373  +
                        let mut container = Vec::new();
         374  +
                        deser.read_list(member, &mut |deser| {
         375  +
                            container.push({
         376  +
                                let mut list = Vec::new();
         377  +
                                deser.read_list(member, &mut |deser| {
         378  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         379  +
                                    Ok(())
         380  +
                                })?;
         381  +
                                list
         382  +
                            });
         383  +
                            Ok(())
         384  +
                        })?;
         385  +
                        container
  422    386   
                    });
  423    387   
                }
  424    388   
                Some(8) => {
  425    389   
                    builder.structure_list = Some({
  426         -
                        let container = if let Some(cap) = deser.container_size() {
  427         -
                            Vec::with_capacity(cap)
  428         -
                        } else {
  429         -
                            Vec::new()
  430         -
                        };
  431         -
                        deser.read_list(member, container, |mut list, deser| {
  432         -
                            list.push(crate::types::StructureListMember::deserialize(deser)?);
  433         -
                            Ok(list)
  434         -
                        })?
         390  +
                        let mut container = Vec::new();
         391  +
                        deser.read_list(member, &mut |deser| {
         392  +
                            container.push(crate::types::StructureListMember::deserialize(deser)?);
         393  +
                            Ok(())
         394  +
                        })?;
         395  +
                        container
  435    396   
                    });
  436    397   
                }
  437    398   
                _ => {}
  438    399   
            }
  439    400   
            Ok(())
  440    401   
        })?;
  441    402   
        builder
  442    403   
            .build()
  443    404   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  444    405   
    }
  445    406   
}
         407  +
impl JsonListsInput {
         408  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         409  +
    pub fn deserialize_with_response(
         410  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         411  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         412  +
        _status: u16,
         413  +
        _body: &[u8],
         414  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         415  +
        Self::deserialize(deserializer)
         416  +
    }
         417  +
}
  446    418   
impl JsonListsInput {
  447    419   
    /// Creates a new builder-style object to manufacture [`JsonListsInput`](crate::operation::json_lists::JsonListsInput).
  448    420   
    pub fn builder() -> crate::operation::json_lists::builders::JsonListsInputBuilder {
  449    421   
        crate::operation::json_lists::builders::JsonListsInputBuilder::default()
  450    422   
    }
  451    423   
}
  452    424   
  453    425   
/// A builder for [`JsonListsInput`](crate::operation::json_lists::JsonListsInput).
  454    426   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  455    427   
#[non_exhaustive]

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

@@ -63,63 +203,203 @@
   83     83   
    "aws.protocoltests.restjson.synthetic",
   84     84   
    "JsonListsOutput",
   85     85   
);
   86     86   
static JSONLISTSOUTPUT_MEMBER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   87     87   
    ::aws_smithy_schema::ShapeId::from_static(
   88     88   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$stringList",
   89     89   
        "aws.protocoltests.restjson.synthetic",
   90     90   
        "JsonListsOutput",
   91     91   
    ),
   92     92   
    ::aws_smithy_schema::ShapeType::List,
   93         -
    "string_list",
          93  +
    "stringList",
   94     94   
    0,
   95     95   
);
   96     96   
static JSONLISTSOUTPUT_MEMBER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   97     97   
    ::aws_smithy_schema::ShapeId::from_static(
   98     98   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$stringSet",
   99     99   
        "aws.protocoltests.restjson.synthetic",
  100    100   
        "JsonListsOutput",
  101    101   
    ),
  102    102   
    ::aws_smithy_schema::ShapeType::List,
  103         -
    "string_set",
         103  +
    "stringSet",
  104    104   
    1,
  105    105   
);
  106    106   
static JSONLISTSOUTPUT_MEMBER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  107    107   
    ::aws_smithy_schema::ShapeId::from_static(
  108    108   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$integerList",
  109    109   
        "aws.protocoltests.restjson.synthetic",
  110    110   
        "JsonListsOutput",
  111    111   
    ),
  112    112   
    ::aws_smithy_schema::ShapeType::List,
  113         -
    "integer_list",
         113  +
    "integerList",
  114    114   
    2,
  115    115   
);
  116    116   
static JSONLISTSOUTPUT_MEMBER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    117   
    ::aws_smithy_schema::ShapeId::from_static(
  118    118   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$booleanList",
  119    119   
        "aws.protocoltests.restjson.synthetic",
  120    120   
        "JsonListsOutput",
  121    121   
    ),
  122    122   
    ::aws_smithy_schema::ShapeType::List,
  123         -
    "boolean_list",
         123  +
    "booleanList",
  124    124   
    3,
  125    125   
);
  126    126   
static JSONLISTSOUTPUT_MEMBER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  127    127   
    ::aws_smithy_schema::ShapeId::from_static(
  128    128   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$timestampList",
  129    129   
        "aws.protocoltests.restjson.synthetic",
  130    130   
        "JsonListsOutput",
  131    131   
    ),
  132    132   
    ::aws_smithy_schema::ShapeType::List,
  133         -
    "timestamp_list",
         133  +
    "timestampList",
  134    134   
    4,
  135    135   
);
  136    136   
static JSONLISTSOUTPUT_MEMBER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$enumList",
  139    139   
        "aws.protocoltests.restjson.synthetic",
  140    140   
        "JsonListsOutput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::List,
  143         -
    "enum_list",
         143  +
    "enumList",
  144    144   
    5,
  145    145   
);
  146    146   
static JSONLISTSOUTPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  147    147   
    ::aws_smithy_schema::ShapeId::from_static(
  148    148   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$intEnumList",
  149    149   
        "aws.protocoltests.restjson.synthetic",
  150    150   
        "JsonListsOutput",
  151    151   
    ),
  152    152   
    ::aws_smithy_schema::ShapeType::List,
  153         -
    "int_enum_list",
         153  +
    "intEnumList",
  154    154   
    6,
  155    155   
);
  156    156   
static JSONLISTSOUTPUT_MEMBER_NESTED_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  157    157   
    ::aws_smithy_schema::ShapeId::from_static(
  158    158   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$nestedStringList",
  159    159   
        "aws.protocoltests.restjson.synthetic",
  160    160   
        "JsonListsOutput",
  161    161   
    ),
  162    162   
    ::aws_smithy_schema::ShapeType::List,
  163         -
    "nested_string_list",
         163  +
    "nestedStringList",
  164    164   
    7,
  165    165   
);
  166    166   
static JSONLISTSOUTPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  167    167   
    ::aws_smithy_schema::ShapeId::from_static(
  168    168   
        "aws.protocoltests.restjson.synthetic#JsonListsOutput$structureList",
  169    169   
        "aws.protocoltests.restjson.synthetic",
  170    170   
        "JsonListsOutput",
  171    171   
    ),
  172    172   
    ::aws_smithy_schema::ShapeType::List,
  173         -
    "structure_list",
         173  +
    "structureList",
  174    174   
    8,
  175    175   
)
  176    176   
.with_json_name("myStructureList");
  177    177   
static JSONLISTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  178    178   
    JSONLISTSOUTPUT_SCHEMA_ID,
  179    179   
    ::aws_smithy_schema::ShapeType::Structure,
  180    180   
    &[
  181    181   
        &JSONLISTSOUTPUT_MEMBER_STRING_LIST,
  182    182   
        &JSONLISTSOUTPUT_MEMBER_STRING_SET,
  183    183   
        &JSONLISTSOUTPUT_MEMBER_INTEGER_LIST,
@@ -254,254 +473,444 @@
  274    274   
                    }
  275    275   
                    Ok(())
  276    276   
                },
  277    277   
            )?;
  278    278   
        }
  279    279   
        if let Some(ref val) = self.nested_string_list {
  280    280   
            ser.write_list(
  281    281   
                &JSONLISTSOUTPUT_MEMBER_NESTED_STRING_LIST,
  282    282   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  283    283   
                    for item in val {
  284         -
                        todo!("schema: unsupported list element type");
         284  +
                        ser.write_list(
         285  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         286  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         287  +
                                for item in item {
         288  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         289  +
                                }
         290  +
                                Ok(())
         291  +
                            },
         292  +
                        )?;
  285    293   
                    }
  286    294   
                    Ok(())
  287    295   
                },
  288    296   
            )?;
  289    297   
        }
  290    298   
        if let Some(ref val) = self.structure_list {
  291    299   
            ser.write_list(
  292    300   
                &JSONLISTSOUTPUT_MEMBER_STRUCTURE_LIST,
  293    301   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  294    302   
                    for item in val {
  295    303   
                        ser.write_struct(crate::types::StructureListMember::SCHEMA, item)?;
  296    304   
                    }
  297    305   
                    Ok(())
  298    306   
                },
  299    307   
            )?;
  300    308   
        }
  301    309   
        Ok(())
  302    310   
    }
  303    311   
}
  304    312   
impl JsonListsOutput {
  305    313   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  306         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  307         -
        deserializer: &mut D,
         314  +
    pub fn deserialize(
         315  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  308    316   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  309    317   
        #[allow(unused_variables, unused_mut)]
  310    318   
        let mut builder = Self::builder();
  311    319   
        #[allow(
  312    320   
            unused_variables,
  313    321   
            unreachable_code,
  314    322   
            clippy::single_match,
  315    323   
            clippy::match_single_binding,
  316    324   
            clippy::diverging_sub_expression
  317    325   
        )]
  318         -
        deserializer.read_struct(&JSONLISTSOUTPUT_SCHEMA, (), |_, member, deser| {
         326  +
        deserializer.read_struct(&JSONLISTSOUTPUT_SCHEMA, &mut |member, deser| {
  319    327   
            match member.member_index() {
  320    328   
                Some(0) => {
  321         -
                    builder.string_list = Some({
  322         -
                        let container = if let Some(cap) = deser.container_size() {
  323         -
                            Vec::with_capacity(cap)
  324         -
                        } else {
  325         -
                            Vec::new()
  326         -
                        };
  327         -
                        deser.read_list(member, container, |mut list, deser| {
  328         -
                            list.push(deser.read_string(member)?);
  329         -
                            Ok(list)
  330         -
                        })?
  331         -
                    });
         329  +
                    builder.string_list = Some(deser.read_string_list(member)?);
  332    330   
                }
  333    331   
                Some(1) => {
  334         -
                    builder.string_set = Some({
  335         -
                        let container = if let Some(cap) = deser.container_size() {
  336         -
                            Vec::with_capacity(cap)
  337         -
                        } else {
  338         -
                            Vec::new()
  339         -
                        };
  340         -
                        deser.read_list(member, container, |mut list, deser| {
  341         -
                            list.push(deser.read_string(member)?);
  342         -
                            Ok(list)
  343         -
                        })?
  344         -
                    });
         332  +
                    builder.string_set = Some(deser.read_string_list(member)?);
  345    333   
                }
  346    334   
                Some(2) => {
  347         -
                    builder.integer_list = Some({
  348         -
                        let container = if let Some(cap) = deser.container_size() {
  349         -
                            Vec::with_capacity(cap)
  350         -
                        } else {
  351         -
                            Vec::new()
  352         -
                        };
  353         -
                        deser.read_list(member, container, |mut list, deser| {
  354         -
                            list.push(deser.read_integer(member)?);
  355         -
                            Ok(list)
  356         -
                        })?
  357         -
                    });
         335  +
                    builder.integer_list = Some(deser.read_integer_list(member)?);
  358    336   
                }
  359    337   
                Some(3) => {
  360    338   
                    builder.boolean_list = Some({
  361         -
                        let container = if let Some(cap) = deser.container_size() {
  362         -
                            Vec::with_capacity(cap)
  363         -
                        } else {
  364         -
                            Vec::new()
  365         -
                        };
  366         -
                        deser.read_list(member, container, |mut list, deser| {
  367         -
                            list.push(deser.read_boolean(member)?);
  368         -
                            Ok(list)
  369         -
                        })?
         339  +
                        let mut container = Vec::new();
         340  +
                        deser.read_list(member, &mut |deser| {
         341  +
                            container.push(deser.read_boolean(member)?);
         342  +
                            Ok(())
         343  +
                        })?;
         344  +
                        container
  370    345   
                    });
  371    346   
                }
  372    347   
                Some(4) => {
  373    348   
                    builder.timestamp_list = Some({
  374         -
                        let container = if let Some(cap) = deser.container_size() {
  375         -
                            Vec::with_capacity(cap)
  376         -
                        } else {
  377         -
                            Vec::new()
  378         -
                        };
  379         -
                        deser.read_list(member, container, |mut list, deser| {
  380         -
                            list.push(deser.read_timestamp(member)?);
  381         -
                            Ok(list)
  382         -
                        })?
         349  +
                        let mut container = Vec::new();
         350  +
                        deser.read_list(member, &mut |deser| {
         351  +
                            container.push(deser.read_timestamp(member)?);
         352  +
                            Ok(())
         353  +
                        })?;
         354  +
                        container
  383    355   
                    });
  384    356   
                }
  385    357   
                Some(5) => {
  386    358   
                    builder.enum_list = Some({
  387         -
                        let container = if let Some(cap) = deser.container_size() {
  388         -
                            Vec::with_capacity(cap)
  389         -
                        } else {
  390         -
                            Vec::new()
  391         -
                        };
  392         -
                        deser.read_list(member, container, |mut list, deser| {
  393         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  394         -
                            Ok(list)
  395         -
                        })?
         359  +
                        let mut container = Vec::new();
         360  +
                        deser.read_list(member, &mut |deser| {
         361  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         362  +
                            Ok(())
         363  +
                        })?;
         364  +
                        container
  396    365   
                    });
  397    366   
                }
  398    367   
                Some(6) => {
  399         -
                    builder.int_enum_list = Some({
  400         -
                        let container = if let Some(cap) = deser.container_size() {
  401         -
                            Vec::with_capacity(cap)
  402         -
                        } else {
  403         -
                            Vec::new()
  404         -
                        };
  405         -
                        deser.read_list(member, container, |mut list, deser| {
  406         -
                            list.push(deser.read_integer(member)?);
  407         -
                            Ok(list)
  408         -
                        })?
  409         -
                    });
         368  +
                    builder.int_enum_list = Some(deser.read_integer_list(member)?);
  410    369   
                }
  411    370   
                Some(7) => {
  412    371   
                    builder.nested_string_list = Some({
  413         -
                        let container = if let Some(cap) = deser.container_size() {
  414         -
                            Vec::with_capacity(cap)
  415         -
                        } else {
  416         -
                            Vec::new()
  417         -
                        };
  418         -
                        deser.read_list(member, container, |mut list, deser| {
  419         -
                            list.push(todo!("deserialize nested aggregate"));
  420         -
                            Ok(list)
  421         -
                        })?
         372  +
                        let mut container = Vec::new();
         373  +
                        deser.read_list(member, &mut |deser| {
         374  +
                            container.push({
         375  +
                                let mut list = Vec::new();
         376  +
                                deser.read_list(member, &mut |deser| {
         377  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         378  +
                                    Ok(())
         379  +
                                })?;
         380  +
                                list
         381  +
                            });
         382  +
                            Ok(())
         383  +
                        })?;
         384  +
                        container
  422    385   
                    });
  423    386   
                }
  424    387   
                Some(8) => {
  425    388   
                    builder.structure_list = Some({
  426         -
                        let container = if let Some(cap) = deser.container_size() {
  427         -
                            Vec::with_capacity(cap)
  428         -
                        } else {
  429         -
                            Vec::new()
  430         -
                        };
  431         -
                        deser.read_list(member, container, |mut list, deser| {
  432         -
                            list.push(crate::types::StructureListMember::deserialize(deser)?);
  433         -
                            Ok(list)
  434         -
                        })?
         389  +
                        let mut container = Vec::new();
         390  +
                        deser.read_list(member, &mut |deser| {
         391  +
                            container.push(crate::types::StructureListMember::deserialize(deser)?);
         392  +
                            Ok(())
         393  +
                        })?;
         394  +
                        container
  435    395   
                    });
  436    396   
                }
  437    397   
                _ => {}
  438    398   
            }
  439    399   
            Ok(())
  440    400   
        })?;
  441    401   
        Ok(builder.build())
  442    402   
    }
  443    403   
}
         404  +
impl JsonListsOutput {
         405  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         406  +
    pub fn deserialize_with_response(
         407  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         408  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         409  +
        _status: u16,
         410  +
        _body: &[u8],
         411  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         412  +
        Self::deserialize(deserializer)
         413  +
    }
         414  +
}
  444    415   
impl JsonListsOutput {
  445    416   
    /// Creates a new builder-style object to manufacture [`JsonListsOutput`](crate::operation::json_lists::JsonListsOutput).
  446    417   
    pub fn builder() -> crate::operation::json_lists::builders::JsonListsOutputBuilder {
  447    418   
        crate::operation::json_lists::builders::JsonListsOutputBuilder::default()
  448    419   
    }
  449    420   
}
  450    421   
  451    422   
/// A builder for [`JsonListsOutput`](crate::operation::json_lists::JsonListsOutput).
  452    423   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  453    424   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/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 `JsonMaps`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonMaps;
    6      6   
impl JsonMaps {
    7      7   
    /// Creates a new `JsonMaps`
    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::json_maps::JsonMapsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_maps::JsonMapsOutput::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::json_maps::JsonMapsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_maps::JsonMapsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_maps::JsonMapsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -100,104 +220,223 @@
  120    124   
                crate::operation::json_maps::JsonMapsError,
  121    125   
            >::new());
  122    126   
  123    127   
        ::std::borrow::Cow::Owned(rcb)
  124    128   
    }
  125    129   
}
  126    130   
  127    131   
#[derive(Debug)]
  128    132   
struct JsonMapsResponseDeserializer;
  129    133   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonMapsResponseDeserializer {
  130         -
    fn deserialize_nonstreaming(
         134  +
    fn deserialize_nonstreaming_with_config(
  131    135   
        &self,
  132    136   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         137  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  133    138   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  134    139   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  135         -
        let headers = response.headers();
  136         -
        let body = response.body().bytes().expect("body loaded");
  137    140   
        #[allow(unused_mut)]
  138    141   
        let mut force_error = false;
  139    142   
  140         -
        let parse_result = if !success && status != 200 || force_error {
  141         -
            crate::protocol_serde::shape_json_maps::de_json_maps_http_error(status, headers, body)
         143  +
        if !success && status != 200 || force_error {
         144  +
            let headers = response.headers();
         145  +
            let body = response.body().bytes().expect("body loaded");
         146  +
            #[allow(unused_mut)]
         147  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         148  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         149  +
            })?;
         150  +
         151  +
            let generic = generic_builder.build();
         152  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         153  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_maps::JsonMapsError::generic(generic)),
         154  +
            ))
  142    155   
        } else {
  143         -
            crate::protocol_serde::shape_json_maps::de_json_maps_http_response(status, headers, body)
  144         -
        };
  145         -
        crate::protocol_serde::type_erase_result(parse_result)
         156  +
            let protocol = _cfg
         157  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         158  +
                .expect("a SharedClientProtocol is required");
         159  +
            let mut deser = protocol.deserialize_response(response, JsonMaps::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
            let body = response.body().bytes().expect("body loaded");
         163  +
            let output = crate::operation::json_maps::JsonMapsOutput::deserialize_with_response(
         164  +
                &mut *deser,
         165  +
                response.headers(),
         166  +
                response.status().into(),
         167  +
                body,
         168  +
            )
         169  +
            .map_err(|e| {
         170  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         171  +
            })?;
         172  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         173  +
        }
  146    174   
    }
  147    175   
}
  148    176   
#[derive(Debug)]
  149    177   
struct JsonMapsRequestSerializer;
  150    178   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonMapsRequestSerializer {
  151    179   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  152    180   
    fn serialize_input(
  153    181   
        &self,
  154    182   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  155    183   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  156    184   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  157    185   
        let input = input.downcast::<crate::operation::json_maps::JsonMapsInput>().expect("correct type");
  158         -
        let _header_serialization_settings = _cfg
  159         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  160         -
            .cloned()
  161         -
            .unwrap_or_default();
  162         -
        let mut request_builder = {
  163         -
            #[allow(clippy::uninlined_format_args)]
  164         -
            fn uri_base(
  165         -
                _input: &crate::operation::json_maps::JsonMapsInput,
  166         -
                output: &mut ::std::string::String,
  167         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  168         -
                use ::std::fmt::Write as _;
  169         -
                ::std::write!(output, "/JsonMaps").expect("formatting should succeed");
  170         -
                ::std::result::Result::Ok(())
  171         -
            }
  172         -
            #[allow(clippy::unnecessary_wraps)]
  173         -
            fn update_http_builder(
  174         -
                input: &crate::operation::json_maps::JsonMapsInput,
  175         -
                builder: ::http_1x::request::Builder,
  176         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  177         -
                let mut uri = ::std::string::String::new();
  178         -
                uri_base(input, &mut uri)?;
  179         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  180         -
            }
  181         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  182         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  183         -
            builder
  184         -
        };
  185         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_maps::ser_json_maps_input(&input)?);
  186         -
        if let Some(content_length) = body.content_length() {
  187         -
            let content_length = content_length.to_string();
  188         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  189         -
        }
  190         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         186  +
        let protocol = _cfg
         187  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         188  +
            .expect("a SharedClientProtocol is required");
         189  +
        let mut request = protocol
         190  +
            .serialize_request(&input, JsonMaps::INPUT_SCHEMA, "", _cfg)
         191  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         192  +
         193  +
        return ::std::result::Result::Ok(request);
  191    194   
    }
  192    195   
}
  193    196   
#[derive(Debug)]
  194    197   
struct JsonMapsEndpointParamsInterceptor;
  195    198   
  196    199   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonMapsEndpointParamsInterceptor {
  197    200   
    fn name(&self) -> &'static str {
  198    201   
        "JsonMapsEndpointParamsInterceptor"
  199    202   
    }
  200    203   
@@ -377,380 +437,450 @@
  397    400   
            .expect("the config must have a deserializer");
  398    401   
  399    402   
        let parsed = de.deserialize_streaming(&mut http_response);
  400    403   
        let parsed = parsed.unwrap_or_else(|| {
  401    404   
            let http_response = http_response.map(|body| {
  402    405   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  403    406   
                    body.bytes().unwrap(),
  404    407   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  405    408   
                )))
  406    409   
            });
  407         -
            de.deserialize_nonstreaming(&http_response)
         410  +
            // Build a config bag with the protocol for schema-based deserialization
         411  +
            #[allow(unused_mut)]
         412  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         413  +
            {
         414  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         415  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         416  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         417  +
                ));
         418  +
                test_cfg.push_shared_layer(layer.freeze());
         419  +
            }
         420  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  408    421   
        });
  409    422   
        let parsed = parsed
  410    423   
            .expect("should be successful response")
  411    424   
            .downcast::<crate::operation::json_maps::JsonMapsOutput>()
  412    425   
            .unwrap();
  413    426   
        ::pretty_assertions::assert_eq!(
  414    427   
            parsed.dense_struct_map,
  415    428   
            expected_output.dense_struct_map,
  416    429   
            "Unexpected value for `dense_struct_map`"
  417    430   
        );
@@ -454,467 +514,537 @@
  474    487   
            .expect("the config must have a deserializer");
  475    488   
  476    489   
        let parsed = de.deserialize_streaming(&mut http_response);
  477    490   
        let parsed = parsed.unwrap_or_else(|| {
  478    491   
            let http_response = http_response.map(|body| {
  479    492   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  480    493   
                    body.bytes().unwrap(),
  481    494   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  482    495   
                )))
  483    496   
            });
  484         -
            de.deserialize_nonstreaming(&http_response)
         497  +
            // Build a config bag with the protocol for schema-based deserialization
         498  +
            #[allow(unused_mut)]
         499  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         500  +
            {
         501  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         502  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         503  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         504  +
                ));
         505  +
                test_cfg.push_shared_layer(layer.freeze());
         506  +
            }
         507  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  485    508   
        });
  486    509   
        let parsed = parsed
  487    510   
            .expect("should be successful response")
  488    511   
            .downcast::<crate::operation::json_maps::JsonMapsOutput>()
  489    512   
            .unwrap();
  490    513   
        ::pretty_assertions::assert_eq!(
  491    514   
            parsed.dense_struct_map,
  492    515   
            expected_output.dense_struct_map,
  493    516   
            "Unexpected value for `dense_struct_map`"
  494    517   
        );
@@ -527,550 +587,620 @@
  547    570   
            .expect("the config must have a deserializer");
  548    571   
  549    572   
        let parsed = de.deserialize_streaming(&mut http_response);
  550    573   
        let parsed = parsed.unwrap_or_else(|| {
  551    574   
            let http_response = http_response.map(|body| {
  552    575   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  553    576   
                    body.bytes().unwrap(),
  554    577   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  555    578   
                )))
  556    579   
            });
  557         -
            de.deserialize_nonstreaming(&http_response)
         580  +
            // Build a config bag with the protocol for schema-based deserialization
         581  +
            #[allow(unused_mut)]
         582  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         583  +
            {
         584  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         585  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         586  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         587  +
                ));
         588  +
                test_cfg.push_shared_layer(layer.freeze());
         589  +
            }
         590  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  558    591   
        });
  559    592   
        let parsed = parsed
  560    593   
            .expect("should be successful response")
  561    594   
            .downcast::<crate::operation::json_maps::JsonMapsOutput>()
  562    595   
            .unwrap();
  563    596   
        ::pretty_assertions::assert_eq!(
  564    597   
            parsed.dense_struct_map,
  565    598   
            expected_output.dense_struct_map,
  566    599   
            "Unexpected value for `dense_struct_map`"
  567    600   
        );
@@ -602,635 +662,705 @@
  622    655   
            .expect("the config must have a deserializer");
  623    656   
  624    657   
        let parsed = de.deserialize_streaming(&mut http_response);
  625    658   
        let parsed = parsed.unwrap_or_else(|| {
  626    659   
            let http_response = http_response.map(|body| {
  627    660   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  628    661   
                    body.bytes().unwrap(),
  629    662   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  630    663   
                )))
  631    664   
            });
  632         -
            de.deserialize_nonstreaming(&http_response)
         665  +
            // Build a config bag with the protocol for schema-based deserialization
         666  +
            #[allow(unused_mut)]
         667  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         668  +
            {
         669  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         670  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         671  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         672  +
                ));
         673  +
                test_cfg.push_shared_layer(layer.freeze());
         674  +
            }
         675  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  633    676   
        });
  634    677   
        let parsed = parsed
  635    678   
            .expect("should be successful response")
  636    679   
            .downcast::<crate::operation::json_maps::JsonMapsOutput>()
  637    680   
            .unwrap();
  638    681   
        ::pretty_assertions::assert_eq!(
  639    682   
            parsed.dense_struct_map,
  640    683   
            expected_output.dense_struct_map,
  641    684   
            "Unexpected value for `dense_struct_map`"
  642    685   
        );

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

@@ -23,23 +136,137 @@
   43     43   
    "aws.protocoltests.restjson.synthetic",
   44     44   
    "JsonMapsInput",
   45     45   
);
   46     46   
static JSONMAPSINPUT_MEMBER_DENSE_STRUCT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   47     47   
    ::aws_smithy_schema::ShapeId::from_static(
   48     48   
        "aws.protocoltests.restjson.synthetic#JsonMapsInput$denseStructMap",
   49     49   
        "aws.protocoltests.restjson.synthetic",
   50     50   
        "JsonMapsInput",
   51     51   
    ),
   52     52   
    ::aws_smithy_schema::ShapeType::Map,
   53         -
    "dense_struct_map",
          53  +
    "denseStructMap",
   54     54   
    0,
   55     55   
);
   56     56   
static JSONMAPSINPUT_MEMBER_DENSE_NUMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   57     57   
    ::aws_smithy_schema::ShapeId::from_static(
   58     58   
        "aws.protocoltests.restjson.synthetic#JsonMapsInput$denseNumberMap",
   59     59   
        "aws.protocoltests.restjson.synthetic",
   60     60   
        "JsonMapsInput",
   61     61   
    ),
   62     62   
    ::aws_smithy_schema::ShapeType::Map,
   63         -
    "dense_number_map",
          63  +
    "denseNumberMap",
   64     64   
    1,
   65     65   
);
   66     66   
static JSONMAPSINPUT_MEMBER_DENSE_BOOLEAN_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restjson.synthetic#JsonMapsInput$denseBooleanMap",
   69     69   
        "aws.protocoltests.restjson.synthetic",
   70     70   
        "JsonMapsInput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Map,
   73         -
    "dense_boolean_map",
          73  +
    "denseBooleanMap",
   74     74   
    2,
   75     75   
);
   76     76   
static JSONMAPSINPUT_MEMBER_DENSE_STRING_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   77     77   
    ::aws_smithy_schema::ShapeId::from_static(
   78     78   
        "aws.protocoltests.restjson.synthetic#JsonMapsInput$denseStringMap",
   79     79   
        "aws.protocoltests.restjson.synthetic",
   80     80   
        "JsonMapsInput",
   81     81   
    ),
   82     82   
    ::aws_smithy_schema::ShapeType::Map,
   83         -
    "dense_string_map",
          83  +
    "denseStringMap",
   84     84   
    3,
   85     85   
);
   86     86   
static JSONMAPSINPUT_MEMBER_DENSE_SET_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   87     87   
    ::aws_smithy_schema::ShapeId::from_static(
   88     88   
        "aws.protocoltests.restjson.synthetic#JsonMapsInput$denseSetMap",
   89     89   
        "aws.protocoltests.restjson.synthetic",
   90     90   
        "JsonMapsInput",
   91     91   
    ),
   92     92   
    ::aws_smithy_schema::ShapeType::Map,
   93         -
    "dense_set_map",
          93  +
    "denseSetMap",
   94     94   
    4,
   95     95   
);
   96     96   
static JSONMAPSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   97     97   
    JSONMAPSINPUT_SCHEMA_ID,
   98     98   
    ::aws_smithy_schema::ShapeType::Structure,
   99     99   
    &[
  100    100   
        &JSONMAPSINPUT_MEMBER_DENSE_STRUCT_MAP,
  101    101   
        &JSONMAPSINPUT_MEMBER_DENSE_NUMBER_MAP,
  102    102   
        &JSONMAPSINPUT_MEMBER_DENSE_BOOLEAN_MAP,
  103    103   
        &JSONMAPSINPUT_MEMBER_DENSE_STRING_MAP,
  104    104   
        &JSONMAPSINPUT_MEMBER_DENSE_SET_MAP,
  105    105   
    ],
  106         -
);
         106  +
)
         107  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/JsonMaps", None));
  107    108   
impl JsonMapsInput {
  108    109   
    /// The schema for this shape.
  109    110   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONMAPSINPUT_SCHEMA;
  110    111   
}
  111    112   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonMapsInput {
  112    113   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  113    114   
    fn serialize_members(
  114    115   
        &self,
  115    116   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  116    117   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -141,142 +299,305 @@
  161    162   
                    Ok(())
  162    163   
                },
  163    164   
            )?;
  164    165   
        }
  165    166   
        if let Some(ref val) = self.dense_set_map {
  166    167   
            ser.write_map(
  167    168   
                &JSONMAPSINPUT_MEMBER_DENSE_SET_MAP,
  168    169   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  169    170   
                    for (key, value) in val {
  170    171   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  171         -
                        todo!("schema: unsupported map value type");
         172  +
         173  +
                        ser.write_list(
         174  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         175  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         176  +
                                for item in value {
         177  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         178  +
                                }
         179  +
                                Ok(())
         180  +
                            },
         181  +
                        )?;
  172    182   
                    }
  173    183   
                    Ok(())
  174    184   
                },
  175    185   
            )?;
  176    186   
        }
  177    187   
        Ok(())
  178    188   
    }
  179    189   
}
  180    190   
impl JsonMapsInput {
  181    191   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  182         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  183         -
        deserializer: &mut D,
         192  +
    pub fn deserialize(
         193  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  184    194   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  185    195   
        #[allow(unused_variables, unused_mut)]
  186    196   
        let mut builder = Self::builder();
  187    197   
        #[allow(
  188    198   
            unused_variables,
  189    199   
            unreachable_code,
  190    200   
            clippy::single_match,
  191    201   
            clippy::match_single_binding,
  192    202   
            clippy::diverging_sub_expression
  193    203   
        )]
  194         -
        deserializer.read_struct(&JSONMAPSINPUT_SCHEMA, (), |_, member, deser| {
         204  +
        deserializer.read_struct(&JSONMAPSINPUT_SCHEMA, &mut |member, deser| {
  195    205   
            match member.member_index() {
  196    206   
                Some(0) => {
  197    207   
                    builder.dense_struct_map = Some({
  198         -
                        let container = if let Some(cap) = deser.container_size() {
  199         -
                            std::collections::HashMap::with_capacity(cap)
  200         -
                        } else {
  201         -
                            std::collections::HashMap::new()
  202         -
                        };
  203         -
                        deser.read_map(member, container, |mut map, key, deser| {
  204         -
                            map.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
  205         -
                            Ok(map)
  206         -
                        })?
         208  +
                        let mut container = std::collections::HashMap::new();
         209  +
                        deser.read_map(member, &mut |key, deser| {
         210  +
                            container.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
         211  +
                            Ok(())
         212  +
                        })?;
         213  +
                        container
  207    214   
                    });
  208    215   
                }
  209    216   
                Some(1) => {
  210    217   
                    builder.dense_number_map = Some({
  211         -
                        let container = if let Some(cap) = deser.container_size() {
  212         -
                            std::collections::HashMap::with_capacity(cap)
  213         -
                        } else {
  214         -
                            std::collections::HashMap::new()
  215         -
                        };
  216         -
                        deser.read_map(member, container, |mut map, key, deser| {
  217         -
                            map.insert(key, deser.read_integer(member)?);
  218         -
                            Ok(map)
  219         -
                        })?
         218  +
                        let mut container = std::collections::HashMap::new();
         219  +
                        deser.read_map(member, &mut |key, deser| {
         220  +
                            container.insert(key, deser.read_integer(member)?);
         221  +
                            Ok(())
         222  +
                        })?;
         223  +
                        container
  220    224   
                    });
  221    225   
                }
  222    226   
                Some(2) => {
  223    227   
                    builder.dense_boolean_map = Some({
  224         -
                        let container = if let Some(cap) = deser.container_size() {
  225         -
                            std::collections::HashMap::with_capacity(cap)
  226         -
                        } else {
  227         -
                            std::collections::HashMap::new()
  228         -
                        };
  229         -
                        deser.read_map(member, container, |mut map, key, deser| {
  230         -
                            map.insert(key, deser.read_boolean(member)?);
  231         -
                            Ok(map)
  232         -
                        })?
         228  +
                        let mut container = std::collections::HashMap::new();
         229  +
                        deser.read_map(member, &mut |key, deser| {
         230  +
                            container.insert(key, deser.read_boolean(member)?);
         231  +
                            Ok(())
         232  +
                        })?;
         233  +
                        container
  233    234   
                    });
  234    235   
                }
  235    236   
                Some(3) => {
  236         -
                    builder.dense_string_map = Some({
  237         -
                        let container = if let Some(cap) = deser.container_size() {
  238         -
                            std::collections::HashMap::with_capacity(cap)
  239         -
                        } else {
  240         -
                            std::collections::HashMap::new()
  241         -
                        };
  242         -
                        deser.read_map(member, container, |mut map, key, deser| {
  243         -
                            map.insert(key, deser.read_string(member)?);
  244         -
                            Ok(map)
  245         -
                        })?
  246         -
                    });
         237  +
                    builder.dense_string_map = Some(deser.read_string_string_map(member)?);
  247    238   
                }
  248    239   
                Some(4) => {
  249    240   
                    builder.dense_set_map = Some({
  250         -
                        let container = if let Some(cap) = deser.container_size() {
  251         -
                            std::collections::HashMap::with_capacity(cap)
  252         -
                        } else {
  253         -
                            std::collections::HashMap::new()
  254         -
                        };
  255         -
                        deser.read_map(member, container, |mut map, key, deser| {
  256         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  257         -
                            Ok(map)
  258         -
                        })?
         241  +
                        let mut container = std::collections::HashMap::new();
         242  +
                        deser.read_map(member, &mut |key, deser| {
         243  +
                            container.insert(key, {
         244  +
                                let mut list = Vec::new();
         245  +
                                deser.read_list(member, &mut |deser| {
         246  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         247  +
                                    Ok(())
         248  +
                                })?;
         249  +
                                list
         250  +
                            });
         251  +
                            Ok(())
         252  +
                        })?;
         253  +
                        container
  259    254   
                    });
  260    255   
                }
  261    256   
                _ => {}
  262    257   
            }
  263    258   
            Ok(())
  264    259   
        })?;
  265    260   
        builder
  266    261   
            .build()
  267    262   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  268    263   
    }
  269    264   
}
         265  +
impl JsonMapsInput {
         266  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         267  +
    pub fn deserialize_with_response(
         268  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         269  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         270  +
        _status: u16,
         271  +
        _body: &[u8],
         272  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         273  +
        Self::deserialize(deserializer)
         274  +
    }
         275  +
}
  270    276   
impl JsonMapsInput {
  271    277   
    /// Creates a new builder-style object to manufacture [`JsonMapsInput`](crate::operation::json_maps::JsonMapsInput).
  272    278   
    pub fn builder() -> crate::operation::json_maps::builders::JsonMapsInputBuilder {
  273    279   
        crate::operation::json_maps::builders::JsonMapsInputBuilder::default()
  274    280   
    }
  275    281   
}
  276    282   
  277    283   
/// A builder for [`JsonMapsInput`](crate::operation::json_maps::JsonMapsInput).
  278    284   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  279    285   
#[non_exhaustive]

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

@@ -23,23 +123,123 @@
   43     43   
    "aws.protocoltests.restjson.synthetic",
   44     44   
    "JsonMapsOutput",
   45     45   
);
   46     46   
static JSONMAPSOUTPUT_MEMBER_DENSE_STRUCT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   47     47   
    ::aws_smithy_schema::ShapeId::from_static(
   48     48   
        "aws.protocoltests.restjson.synthetic#JsonMapsOutput$denseStructMap",
   49     49   
        "aws.protocoltests.restjson.synthetic",
   50     50   
        "JsonMapsOutput",
   51     51   
    ),
   52     52   
    ::aws_smithy_schema::ShapeType::Map,
   53         -
    "dense_struct_map",
          53  +
    "denseStructMap",
   54     54   
    0,
   55     55   
);
   56     56   
static JSONMAPSOUTPUT_MEMBER_DENSE_NUMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   57     57   
    ::aws_smithy_schema::ShapeId::from_static(
   58     58   
        "aws.protocoltests.restjson.synthetic#JsonMapsOutput$denseNumberMap",
   59     59   
        "aws.protocoltests.restjson.synthetic",
   60     60   
        "JsonMapsOutput",
   61     61   
    ),
   62     62   
    ::aws_smithy_schema::ShapeType::Map,
   63         -
    "dense_number_map",
          63  +
    "denseNumberMap",
   64     64   
    1,
   65     65   
);
   66     66   
static JSONMAPSOUTPUT_MEMBER_DENSE_BOOLEAN_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restjson.synthetic#JsonMapsOutput$denseBooleanMap",
   69     69   
        "aws.protocoltests.restjson.synthetic",
   70     70   
        "JsonMapsOutput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Map,
   73         -
    "dense_boolean_map",
          73  +
    "denseBooleanMap",
   74     74   
    2,
   75     75   
);
   76     76   
static JSONMAPSOUTPUT_MEMBER_DENSE_STRING_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   77     77   
    ::aws_smithy_schema::ShapeId::from_static(
   78     78   
        "aws.protocoltests.restjson.synthetic#JsonMapsOutput$denseStringMap",
   79     79   
        "aws.protocoltests.restjson.synthetic",
   80     80   
        "JsonMapsOutput",
   81     81   
    ),
   82     82   
    ::aws_smithy_schema::ShapeType::Map,
   83         -
    "dense_string_map",
          83  +
    "denseStringMap",
   84     84   
    3,
   85     85   
);
   86     86   
static JSONMAPSOUTPUT_MEMBER_DENSE_SET_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   87     87   
    ::aws_smithy_schema::ShapeId::from_static(
   88     88   
        "aws.protocoltests.restjson.synthetic#JsonMapsOutput$denseSetMap",
   89     89   
        "aws.protocoltests.restjson.synthetic",
   90     90   
        "JsonMapsOutput",
   91     91   
    ),
   92     92   
    ::aws_smithy_schema::ShapeType::Map,
   93         -
    "dense_set_map",
          93  +
    "denseSetMap",
   94     94   
    4,
   95     95   
);
   96     96   
static JSONMAPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   97     97   
    JSONMAPSOUTPUT_SCHEMA_ID,
   98     98   
    ::aws_smithy_schema::ShapeType::Structure,
   99     99   
    &[
  100    100   
        &JSONMAPSOUTPUT_MEMBER_DENSE_STRUCT_MAP,
  101    101   
        &JSONMAPSOUTPUT_MEMBER_DENSE_NUMBER_MAP,
  102    102   
        &JSONMAPSOUTPUT_MEMBER_DENSE_BOOLEAN_MAP,
  103    103   
        &JSONMAPSOUTPUT_MEMBER_DENSE_STRING_MAP,
@@ -141,141 +297,302 @@
  161    161   
                    Ok(())
  162    162   
                },
  163    163   
            )?;
  164    164   
        }
  165    165   
        if let Some(ref val) = self.dense_set_map {
  166    166   
            ser.write_map(
  167    167   
                &JSONMAPSOUTPUT_MEMBER_DENSE_SET_MAP,
  168    168   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  169    169   
                    for (key, value) in val {
  170    170   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  171         -
                        todo!("schema: unsupported map value type");
         171  +
         172  +
                        ser.write_list(
         173  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         174  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         175  +
                                for item in value {
         176  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         177  +
                                }
         178  +
                                Ok(())
         179  +
                            },
         180  +
                        )?;
  172    181   
                    }
  173    182   
                    Ok(())
  174    183   
                },
  175    184   
            )?;
  176    185   
        }
  177    186   
        Ok(())
  178    187   
    }
  179    188   
}
  180    189   
impl JsonMapsOutput {
  181    190   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  182         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  183         -
        deserializer: &mut D,
         191  +
    pub fn deserialize(
         192  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  184    193   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  185    194   
        #[allow(unused_variables, unused_mut)]
  186    195   
        let mut builder = Self::builder();
  187    196   
        #[allow(
  188    197   
            unused_variables,
  189    198   
            unreachable_code,
  190    199   
            clippy::single_match,
  191    200   
            clippy::match_single_binding,
  192    201   
            clippy::diverging_sub_expression
  193    202   
        )]
  194         -
        deserializer.read_struct(&JSONMAPSOUTPUT_SCHEMA, (), |_, member, deser| {
         203  +
        deserializer.read_struct(&JSONMAPSOUTPUT_SCHEMA, &mut |member, deser| {
  195    204   
            match member.member_index() {
  196    205   
                Some(0) => {
  197    206   
                    builder.dense_struct_map = Some({
  198         -
                        let container = if let Some(cap) = deser.container_size() {
  199         -
                            std::collections::HashMap::with_capacity(cap)
  200         -
                        } else {
  201         -
                            std::collections::HashMap::new()
  202         -
                        };
  203         -
                        deser.read_map(member, container, |mut map, key, deser| {
  204         -
                            map.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
  205         -
                            Ok(map)
  206         -
                        })?
         207  +
                        let mut container = std::collections::HashMap::new();
         208  +
                        deser.read_map(member, &mut |key, deser| {
         209  +
                            container.insert(key, crate::types::GreetingStruct::deserialize(deser)?);
         210  +
                            Ok(())
         211  +
                        })?;
         212  +
                        container
  207    213   
                    });
  208    214   
                }
  209    215   
                Some(1) => {
  210    216   
                    builder.dense_number_map = Some({
  211         -
                        let container = if let Some(cap) = deser.container_size() {
  212         -
                            std::collections::HashMap::with_capacity(cap)
  213         -
                        } else {
  214         -
                            std::collections::HashMap::new()
  215         -
                        };
  216         -
                        deser.read_map(member, container, |mut map, key, deser| {
  217         -
                            map.insert(key, deser.read_integer(member)?);
  218         -
                            Ok(map)
  219         -
                        })?
         217  +
                        let mut container = std::collections::HashMap::new();
         218  +
                        deser.read_map(member, &mut |key, deser| {
         219  +
                            container.insert(key, deser.read_integer(member)?);
         220  +
                            Ok(())
         221  +
                        })?;
         222  +
                        container
  220    223   
                    });
  221    224   
                }
  222    225   
                Some(2) => {
  223    226   
                    builder.dense_boolean_map = Some({
  224         -
                        let container = if let Some(cap) = deser.container_size() {
  225         -
                            std::collections::HashMap::with_capacity(cap)
  226         -
                        } else {
  227         -
                            std::collections::HashMap::new()
  228         -
                        };
  229         -
                        deser.read_map(member, container, |mut map, key, deser| {
  230         -
                            map.insert(key, deser.read_boolean(member)?);
  231         -
                            Ok(map)
  232         -
                        })?
         227  +
                        let mut container = std::collections::HashMap::new();
         228  +
                        deser.read_map(member, &mut |key, deser| {
         229  +
                            container.insert(key, deser.read_boolean(member)?);
         230  +
                            Ok(())
         231  +
                        })?;
         232  +
                        container
  233    233   
                    });
  234    234   
                }
  235    235   
                Some(3) => {
  236         -
                    builder.dense_string_map = Some({
  237         -
                        let container = if let Some(cap) = deser.container_size() {
  238         -
                            std::collections::HashMap::with_capacity(cap)
  239         -
                        } else {
  240         -
                            std::collections::HashMap::new()
  241         -
                        };
  242         -
                        deser.read_map(member, container, |mut map, key, deser| {
  243         -
                            map.insert(key, deser.read_string(member)?);
  244         -
                            Ok(map)
  245         -
                        })?
  246         -
                    });
         236  +
                    builder.dense_string_map = Some(deser.read_string_string_map(member)?);
  247    237   
                }
  248    238   
                Some(4) => {
  249    239   
                    builder.dense_set_map = Some({
  250         -
                        let container = if let Some(cap) = deser.container_size() {
  251         -
                            std::collections::HashMap::with_capacity(cap)
  252         -
                        } else {
  253         -
                            std::collections::HashMap::new()
  254         -
                        };
  255         -
                        deser.read_map(member, container, |mut map, key, deser| {
  256         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  257         -
                            Ok(map)
  258         -
                        })?
         240  +
                        let mut container = std::collections::HashMap::new();
         241  +
                        deser.read_map(member, &mut |key, deser| {
         242  +
                            container.insert(key, {
         243  +
                                let mut list = Vec::new();
         244  +
                                deser.read_list(member, &mut |deser| {
         245  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         246  +
                                    Ok(())
         247  +
                                })?;
         248  +
                                list
         249  +
                            });
         250  +
                            Ok(())
         251  +
                        })?;
         252  +
                        container
  259    253   
                    });
  260    254   
                }
  261    255   
                _ => {}
  262    256   
            }
  263    257   
            Ok(())
  264    258   
        })?;
  265    259   
        Ok(builder.build())
  266    260   
    }
  267    261   
}
         262  +
impl JsonMapsOutput {
         263  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         264  +
    pub fn deserialize_with_response(
         265  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         266  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         267  +
        _status: u16,
         268  +
        _body: &[u8],
         269  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         270  +
        Self::deserialize(deserializer)
         271  +
    }
         272  +
}
  268    273   
impl JsonMapsOutput {
  269    274   
    /// Creates a new builder-style object to manufacture [`JsonMapsOutput`](crate::operation::json_maps::JsonMapsOutput).
  270    275   
    pub fn builder() -> crate::operation::json_maps::builders::JsonMapsOutputBuilder {
  271    276   
        crate::operation::json_maps::builders::JsonMapsOutputBuilder::default()
  272    277   
    }
  273    278   
}
  274    279   
  275    280   
/// A builder for [`JsonMapsOutput`](crate::operation::json_maps::JsonMapsOutput).
  276    281   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  277    282   
#[non_exhaustive]

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `JsonTimestamps`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonTimestamps;
    6      6   
impl JsonTimestamps {
    7      7   
    /// Creates a new `JsonTimestamps`
    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::json_timestamps::JsonTimestampsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_timestamps::JsonTimestampsOutput::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::json_timestamps::JsonTimestampsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_timestamps::JsonTimestampsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_timestamps::JsonTimestampsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +226,233 @@
  124    128   
                crate::operation::json_timestamps::JsonTimestampsError,
  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 JsonTimestampsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonTimestampsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::json_timestamps::JsonTimestampsError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_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, JsonTimestamps::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::json_timestamps::JsonTimestampsOutput::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 JsonTimestampsRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonTimestampsRequestSerializer {
  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::json_timestamps::JsonTimestampsInput>()
  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::json_timestamps::JsonTimestampsInput,
  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, "/JsonTimestamps").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::json_timestamps::JsonTimestampsInput,
  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_json_timestamps::ser_json_timestamps_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, JsonTimestamps::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 JsonTimestampsEndpointParamsInterceptor;
  201    208   
  202    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonTimestampsEndpointParamsInterceptor {
  203    210   
    fn name(&self) -> &'static str {
  204    211   
        "JsonTimestampsEndpointParamsInterceptor"
  205    212   
    }
  206    213   
@@ -495,502 +555,572 @@
  515    522   
            .expect("the config must have a deserializer");
  516    523   
  517    524   
        let parsed = de.deserialize_streaming(&mut http_response);
  518    525   
        let parsed = parsed.unwrap_or_else(|| {
  519    526   
            let http_response = http_response.map(|body| {
  520    527   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  521    528   
                    body.bytes().unwrap(),
  522    529   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  523    530   
                )))
  524    531   
            });
  525         -
            de.deserialize_nonstreaming(&http_response)
         532  +
            // Build a config bag with the protocol for schema-based deserialization
         533  +
            #[allow(unused_mut)]
         534  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         535  +
            {
         536  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         537  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         538  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         539  +
                ));
         540  +
                test_cfg.push_shared_layer(layer.freeze());
         541  +
            }
         542  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  526    543   
        });
  527    544   
        let parsed = parsed
  528    545   
            .expect("should be successful response")
  529    546   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  530    547   
            .unwrap();
  531    548   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  532    549   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  533    550   
        ::pretty_assertions::assert_eq!(
  534    551   
            parsed.date_time_on_target,
  535    552   
            expected_output.date_time_on_target,
@@ -563,580 +623,650 @@
  583    600   
            .expect("the config must have a deserializer");
  584    601   
  585    602   
        let parsed = de.deserialize_streaming(&mut http_response);
  586    603   
        let parsed = parsed.unwrap_or_else(|| {
  587    604   
            let http_response = http_response.map(|body| {
  588    605   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  589    606   
                    body.bytes().unwrap(),
  590    607   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  591    608   
                )))
  592    609   
            });
  593         -
            de.deserialize_nonstreaming(&http_response)
         610  +
            // Build a config bag with the protocol for schema-based deserialization
         611  +
            #[allow(unused_mut)]
         612  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         613  +
            {
         614  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         615  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         616  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         617  +
                ));
         618  +
                test_cfg.push_shared_layer(layer.freeze());
         619  +
            }
         620  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  594    621   
        });
  595    622   
        let parsed = parsed
  596    623   
            .expect("should be successful response")
  597    624   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  598    625   
            .unwrap();
  599    626   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  600    627   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  601    628   
        ::pretty_assertions::assert_eq!(
  602    629   
            parsed.date_time_on_target,
  603    630   
            expected_output.date_time_on_target,
@@ -631,658 +691,728 @@
  651    678   
            .expect("the config must have a deserializer");
  652    679   
  653    680   
        let parsed = de.deserialize_streaming(&mut http_response);
  654    681   
        let parsed = parsed.unwrap_or_else(|| {
  655    682   
            let http_response = http_response.map(|body| {
  656    683   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  657    684   
                    body.bytes().unwrap(),
  658    685   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  659    686   
                )))
  660    687   
            });
  661         -
            de.deserialize_nonstreaming(&http_response)
         688  +
            // Build a config bag with the protocol for schema-based deserialization
         689  +
            #[allow(unused_mut)]
         690  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         691  +
            {
         692  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         693  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         694  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         695  +
                ));
         696  +
                test_cfg.push_shared_layer(layer.freeze());
         697  +
            }
         698  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  662    699   
        });
  663    700   
        let parsed = parsed
  664    701   
            .expect("should be successful response")
  665    702   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  666    703   
            .unwrap();
  667    704   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  668    705   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  669    706   
        ::pretty_assertions::assert_eq!(
  670    707   
            parsed.date_time_on_target,
  671    708   
            expected_output.date_time_on_target,
@@ -697,734 +757,804 @@
  717    754   
            .expect("the config must have a deserializer");
  718    755   
  719    756   
        let parsed = de.deserialize_streaming(&mut http_response);
  720    757   
        let parsed = parsed.unwrap_or_else(|| {
  721    758   
            let http_response = http_response.map(|body| {
  722    759   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  723    760   
                    body.bytes().unwrap(),
  724    761   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  725    762   
                )))
  726    763   
            });
  727         -
            de.deserialize_nonstreaming(&http_response)
         764  +
            // Build a config bag with the protocol for schema-based deserialization
         765  +
            #[allow(unused_mut)]
         766  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         767  +
            {
         768  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         769  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         770  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         771  +
                ));
         772  +
                test_cfg.push_shared_layer(layer.freeze());
         773  +
            }
         774  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  728    775   
        });
  729    776   
        let parsed = parsed
  730    777   
            .expect("should be successful response")
  731    778   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  732    779   
            .unwrap();
  733    780   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  734    781   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  735    782   
        ::pretty_assertions::assert_eq!(
  736    783   
            parsed.date_time_on_target,
  737    784   
            expected_output.date_time_on_target,
@@ -763,810 +823,880 @@
  783    830   
            .expect("the config must have a deserializer");
  784    831   
  785    832   
        let parsed = de.deserialize_streaming(&mut http_response);
  786    833   
        let parsed = parsed.unwrap_or_else(|| {
  787    834   
            let http_response = http_response.map(|body| {
  788    835   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  789    836   
                    body.bytes().unwrap(),
  790    837   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  791    838   
                )))
  792    839   
            });
  793         -
            de.deserialize_nonstreaming(&http_response)
         840  +
            // Build a config bag with the protocol for schema-based deserialization
         841  +
            #[allow(unused_mut)]
         842  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         843  +
            {
         844  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         845  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         846  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         847  +
                ));
         848  +
                test_cfg.push_shared_layer(layer.freeze());
         849  +
            }
         850  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  794    851   
        });
  795    852   
        let parsed = parsed
  796    853   
            .expect("should be successful response")
  797    854   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  798    855   
            .unwrap();
  799    856   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  800    857   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  801    858   
        ::pretty_assertions::assert_eq!(
  802    859   
            parsed.date_time_on_target,
  803    860   
            expected_output.date_time_on_target,
@@ -831,888 +891,958 @@
  851    908   
            .expect("the config must have a deserializer");
  852    909   
  853    910   
        let parsed = de.deserialize_streaming(&mut http_response);
  854    911   
        let parsed = parsed.unwrap_or_else(|| {
  855    912   
            let http_response = http_response.map(|body| {
  856    913   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  857    914   
                    body.bytes().unwrap(),
  858    915   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  859    916   
                )))
  860    917   
            });
  861         -
            de.deserialize_nonstreaming(&http_response)
         918  +
            // Build a config bag with the protocol for schema-based deserialization
         919  +
            #[allow(unused_mut)]
         920  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         921  +
            {
         922  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         923  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         924  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         925  +
                ));
         926  +
                test_cfg.push_shared_layer(layer.freeze());
         927  +
            }
         928  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  862    929   
        });
  863    930   
        let parsed = parsed
  864    931   
            .expect("should be successful response")
  865    932   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  866    933   
            .unwrap();
  867    934   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  868    935   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  869    936   
        ::pretty_assertions::assert_eq!(
  870    937   
            parsed.date_time_on_target,
  871    938   
            expected_output.date_time_on_target,
@@ -899,966 +959,1036 @@
  919    986   
            .expect("the config must have a deserializer");
  920    987   
  921    988   
        let parsed = de.deserialize_streaming(&mut http_response);
  922    989   
        let parsed = parsed.unwrap_or_else(|| {
  923    990   
            let http_response = http_response.map(|body| {
  924    991   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  925    992   
                    body.bytes().unwrap(),
  926    993   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  927    994   
                )))
  928    995   
            });
  929         -
            de.deserialize_nonstreaming(&http_response)
         996  +
            // Build a config bag with the protocol for schema-based deserialization
         997  +
            #[allow(unused_mut)]
         998  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         999  +
            {
        1000  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1001  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1002  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1003  +
                ));
        1004  +
                test_cfg.push_shared_layer(layer.freeze());
        1005  +
            }
        1006  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  930   1007   
        });
  931   1008   
        let parsed = parsed
  932   1009   
            .expect("should be successful response")
  933   1010   
            .downcast::<crate::operation::json_timestamps::JsonTimestampsOutput>()
  934   1011   
            .unwrap();
  935   1012   
        ::pretty_assertions::assert_eq!(parsed.normal, expected_output.normal, "Unexpected value for `normal`");
  936   1013   
        ::pretty_assertions::assert_eq!(parsed.date_time, expected_output.date_time, "Unexpected value for `date_time`");
  937   1014   
        ::pretty_assertions::assert_eq!(
  938   1015   
            parsed.date_time_on_target,
  939   1016   
            expected_output.date_time_on_target,