Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/host_with_path_operation.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 `HostWithPathOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HostWithPathOperation;
    6      6   
impl HostWithPathOperation {
    7      7   
    /// Creates a new `HostWithPathOperation`
    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::host_with_path_operation::HostWithPathOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::host_with_path_operation::HostWithPathOperationOutput::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::host_with_path_operation::HostWithPathOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::host_with_path_operation::HostWithPathOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::host_with_path_operation::HostWithPathOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +236,239 @@
  130    134   
                crate::operation::host_with_path_operation::HostWithPathOperationError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HostWithPathOperationResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HostWithPathOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::host_with_path_operation::HostWithPathOperationError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, HostWithPathOperation::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::host_with_path_operation::HostWithPathOperationOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct HostWithPathOperationRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HostWithPathOperationRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::host_with_path_operation::HostWithPathOperationInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonProtocol.HostWithPathOperation",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_input(&input)?,
  204         -
        );
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, HostWithPathOperation::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  205    208   
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         209  +
        return ::std::result::Result::Ok(request);
  207    210   
    }
  208    211   
}
  209    212   
#[derive(Debug)]
  210    213   
struct HostWithPathOperationEndpointParamsInterceptor;
  211    214   
  212    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HostWithPathOperationEndpointParamsInterceptor {
  213    216   
    fn name(&self) -> &'static str {
  214    217   
        "HostWithPathOperationEndpointParamsInterceptor"
  215    218   
    }
  216    219   

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/host_with_path_operation/_host_with_path_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/host_with_path_operation/_host_with_path_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_enums.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 `JsonEnums`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonEnums;
    6      6   
impl JsonEnums {
    7      7   
    /// Creates a new `JsonEnums`
    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_enums::JsonEnumsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_enums::JsonEnumsOutput::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_enums::JsonEnumsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_enums::JsonEnumsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_enums::JsonEnumsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +229,227 @@
  124    128   
                crate::operation::json_enums::JsonEnumsError,
  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 JsonEnumsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonEnumsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_enums::de_json_enums_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_enums::JsonEnumsError::generic(generic)),
         158  +
            ))
  146    159   
        } else {
  147         -
            crate::protocol_serde::shape_json_enums::de_json_enums_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, JsonEnums::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_enums::JsonEnumsOutput::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 JsonEnumsRequestSerializer;
  154    182   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonEnumsRequestSerializer {
  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_enums::JsonEnumsInput>().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_enums::JsonEnumsInput,
  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, "/").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_enums::JsonEnumsInput,
  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("POST").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/x-amz-json-1.1");
  187         -
            builder = _header_serialization_settings.set_default_header(
  188         -
                builder,
  189         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  190         -
                "JsonProtocol.JsonEnums",
  191         -
            );
  192         -
            builder
  193         -
        };
  194         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_enums::ser_json_enums_input(&input)?);
  195         -
        if let Some(content_length) = body.content_length() {
  196         -
            let content_length = content_length.to_string();
  197         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  198         -
        }
  199         -
        ::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, JsonEnums::INPUT_SCHEMA, "", _cfg)
         195  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         196  +
         197  +
        return ::std::result::Result::Ok(request);
  200    198   
    }
  201    199   
}
  202    200   
#[derive(Debug)]
  203    201   
struct JsonEnumsEndpointParamsInterceptor;
  204    202   
  205    203   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonEnumsEndpointParamsInterceptor {
  206    204   
    fn name(&self) -> &'static str {
  207    205   
        "JsonEnumsEndpointParamsInterceptor"
  208    206   
    }
  209    207   
@@ -386,384 +446,454 @@
  406    404   
            .expect("the config must have a deserializer");
  407    405   
  408    406   
        let parsed = de.deserialize_streaming(&mut http_response);
  409    407   
        let parsed = parsed.unwrap_or_else(|| {
  410    408   
            let http_response = http_response.map(|body| {
  411    409   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  412    410   
                    body.bytes().unwrap(),
  413    411   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  414    412   
                )))
  415    413   
            });
  416         -
            de.deserialize_nonstreaming(&http_response)
         414  +
            // Build a config bag with the protocol for schema-based deserialization
         415  +
            #[allow(unused_mut)]
         416  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         417  +
            {
         418  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         419  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         420  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         421  +
                ));
         422  +
                test_cfg.push_shared_layer(layer.freeze());
         423  +
            }
         424  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  417    425   
        });
  418    426   
        let parsed = parsed
  419    427   
            .expect("should be successful response")
  420    428   
            .downcast::<crate::operation::json_enums::JsonEnumsOutput>()
  421    429   
            .unwrap();
  422    430   
        ::pretty_assertions::assert_eq!(parsed.foo_enum1, expected_output.foo_enum1, "Unexpected value for `foo_enum1`");
  423    431   
        ::pretty_assertions::assert_eq!(parsed.foo_enum2, expected_output.foo_enum2, "Unexpected value for `foo_enum2`");
  424    432   
        ::pretty_assertions::assert_eq!(parsed.foo_enum3, expected_output.foo_enum3, "Unexpected value for `foo_enum3`");
  425    433   
        ::pretty_assertions::assert_eq!(
  426    434   
            parsed.foo_enum_list,

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_enums/_json_enums_input.rs

@@ -31,31 +141,141 @@
   51     51   
    "aws.protocoltests.json.synthetic",
   52     52   
    "JsonEnumsInput",
   53     53   
);
   54     54   
static JSONENUMSINPUT_MEMBER_FOO_ENUM1: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnum1",
   57     57   
        "aws.protocoltests.json.synthetic",
   58     58   
        "JsonEnumsInput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::String,
   61         -
    "foo_enum1",
          61  +
    "fooEnum1",
   62     62   
    0,
   63     63   
);
   64     64   
static JSONENUMSINPUT_MEMBER_FOO_ENUM2: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   65     65   
    ::aws_smithy_schema::ShapeId::from_static(
   66     66   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnum2",
   67     67   
        "aws.protocoltests.json.synthetic",
   68     68   
        "JsonEnumsInput",
   69     69   
    ),
   70     70   
    ::aws_smithy_schema::ShapeType::String,
   71         -
    "foo_enum2",
          71  +
    "fooEnum2",
   72     72   
    1,
   73     73   
);
   74     74   
static JSONENUMSINPUT_MEMBER_FOO_ENUM3: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   75     75   
    ::aws_smithy_schema::ShapeId::from_static(
   76     76   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnum3",
   77     77   
        "aws.protocoltests.json.synthetic",
   78     78   
        "JsonEnumsInput",
   79     79   
    ),
   80     80   
    ::aws_smithy_schema::ShapeType::String,
   81         -
    "foo_enum3",
          81  +
    "fooEnum3",
   82     82   
    2,
   83     83   
);
   84     84   
static JSONENUMSINPUT_MEMBER_FOO_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   85     85   
    ::aws_smithy_schema::ShapeId::from_static(
   86     86   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnumList",
   87     87   
        "aws.protocoltests.json.synthetic",
   88     88   
        "JsonEnumsInput",
   89     89   
    ),
   90     90   
    ::aws_smithy_schema::ShapeType::List,
   91         -
    "foo_enum_list",
          91  +
    "fooEnumList",
   92     92   
    3,
   93     93   
);
   94     94   
static JSONENUMSINPUT_MEMBER_FOO_ENUM_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnumSet",
   97     97   
        "aws.protocoltests.json.synthetic",
   98     98   
        "JsonEnumsInput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::List,
  101         -
    "foo_enum_set",
         101  +
    "fooEnumSet",
  102    102   
    4,
  103    103   
);
  104    104   
static JSONENUMSINPUT_MEMBER_FOO_ENUM_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "aws.protocoltests.json.synthetic#JsonEnumsInput$fooEnumMap",
  107    107   
        "aws.protocoltests.json.synthetic",
  108    108   
        "JsonEnumsInput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Map,
  111         -
    "foo_enum_map",
         111  +
    "fooEnumMap",
  112    112   
    5,
  113    113   
);
  114    114   
static JSONENUMSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  115    115   
    JSONENUMSINPUT_SCHEMA_ID,
  116    116   
    ::aws_smithy_schema::ShapeType::Structure,
  117    117   
    &[
  118    118   
        &JSONENUMSINPUT_MEMBER_FOO_ENUM1,
  119    119   
        &JSONENUMSINPUT_MEMBER_FOO_ENUM2,
  120    120   
        &JSONENUMSINPUT_MEMBER_FOO_ENUM3,
  121    121   
        &JSONENUMSINPUT_MEMBER_FOO_ENUM_LIST,
@@ -154,154 +284,286 @@
  174    174   
                    }
  175    175   
                    Ok(())
  176    176   
                },
  177    177   
            )?;
  178    178   
        }
  179    179   
        Ok(())
  180    180   
    }
  181    181   
}
  182    182   
impl JsonEnumsInput {
  183    183   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  184         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  185         -
        deserializer: &mut D,
         184  +
    pub fn deserialize(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  186    186   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  187    187   
        #[allow(unused_variables, unused_mut)]
  188    188   
        let mut builder = Self::builder();
  189    189   
        #[allow(
  190    190   
            unused_variables,
  191    191   
            unreachable_code,
  192    192   
            clippy::single_match,
  193    193   
            clippy::match_single_binding,
  194    194   
            clippy::diverging_sub_expression
  195    195   
        )]
  196         -
        deserializer.read_struct(&JSONENUMSINPUT_SCHEMA, (), |_, member, deser| {
         196  +
        deserializer.read_struct(&JSONENUMSINPUT_SCHEMA, &mut |member, deser| {
  197    197   
            match member.member_index() {
  198    198   
                Some(0) => {
  199    199   
                    builder.foo_enum1 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  200    200   
                }
  201    201   
                Some(1) => {
  202    202   
                    builder.foo_enum2 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  203    203   
                }
  204    204   
                Some(2) => {
  205    205   
                    builder.foo_enum3 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  206    206   
                }
  207    207   
                Some(3) => {
  208    208   
                    builder.foo_enum_list = Some({
  209         -
                        let container = if let Some(cap) = deser.container_size() {
  210         -
                            Vec::with_capacity(cap)
  211         -
                        } else {
  212         -
                            Vec::new()
  213         -
                        };
  214         -
                        deser.read_list(member, container, |mut list, deser| {
  215         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  216         -
                            Ok(list)
  217         -
                        })?
         209  +
                        let mut container = Vec::new();
         210  +
                        deser.read_list(member, &mut |deser| {
         211  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         212  +
                            Ok(())
         213  +
                        })?;
         214  +
                        container
  218    215   
                    });
  219    216   
                }
  220    217   
                Some(4) => {
  221    218   
                    builder.foo_enum_set = Some({
  222         -
                        let container = if let Some(cap) = deser.container_size() {
  223         -
                            Vec::with_capacity(cap)
  224         -
                        } else {
  225         -
                            Vec::new()
  226         -
                        };
  227         -
                        deser.read_list(member, container, |mut list, deser| {
  228         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  229         -
                            Ok(list)
  230         -
                        })?
         219  +
                        let mut container = Vec::new();
         220  +
                        deser.read_list(member, &mut |deser| {
         221  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         222  +
                            Ok(())
         223  +
                        })?;
         224  +
                        container
  231    225   
                    });
  232    226   
                }
  233    227   
                Some(5) => {
  234    228   
                    builder.foo_enum_map = Some({
  235         -
                        let container = if let Some(cap) = deser.container_size() {
  236         -
                            std::collections::HashMap::with_capacity(cap)
  237         -
                        } else {
  238         -
                            std::collections::HashMap::new()
  239         -
                        };
  240         -
                        deser.read_map(member, container, |mut map, key, deser| {
  241         -
                            map.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  242         -
                            Ok(map)
  243         -
                        })?
         229  +
                        let mut container = std::collections::HashMap::new();
         230  +
                        deser.read_map(member, &mut |key, deser| {
         231  +
                            container.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         232  +
                            Ok(())
         233  +
                        })?;
         234  +
                        container
  244    235   
                    });
  245    236   
                }
  246    237   
                _ => {}
  247    238   
            }
  248    239   
            Ok(())
  249    240   
        })?;
  250    241   
        builder
  251    242   
            .build()
  252    243   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  253    244   
    }
  254    245   
}
         246  +
impl JsonEnumsInput {
         247  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         248  +
    pub fn deserialize_with_response(
         249  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         250  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         251  +
        _status: u16,
         252  +
        _body: &[u8],
         253  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         254  +
        Self::deserialize(deserializer)
         255  +
    }
         256  +
}
  255    257   
impl JsonEnumsInput {
  256    258   
    /// Creates a new builder-style object to manufacture [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
  257    259   
    pub fn builder() -> crate::operation::json_enums::builders::JsonEnumsInputBuilder {
  258    260   
        crate::operation::json_enums::builders::JsonEnumsInputBuilder::default()
  259    261   
    }
  260    262   
}
  261    263   
  262    264   
/// A builder for [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
  263    265   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  264    266   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_enums/_json_enums_output.rs

@@ -31,31 +141,141 @@
   51     51   
    "aws.protocoltests.json.synthetic",
   52     52   
    "JsonEnumsOutput",
   53     53   
);
   54     54   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM1: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnum1",
   57     57   
        "aws.protocoltests.json.synthetic",
   58     58   
        "JsonEnumsOutput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::String,
   61         -
    "foo_enum1",
          61  +
    "fooEnum1",
   62     62   
    0,
   63     63   
);
   64     64   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM2: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   65     65   
    ::aws_smithy_schema::ShapeId::from_static(
   66     66   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnum2",
   67     67   
        "aws.protocoltests.json.synthetic",
   68     68   
        "JsonEnumsOutput",
   69     69   
    ),
   70     70   
    ::aws_smithy_schema::ShapeType::String,
   71         -
    "foo_enum2",
          71  +
    "fooEnum2",
   72     72   
    1,
   73     73   
);
   74     74   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM3: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   75     75   
    ::aws_smithy_schema::ShapeId::from_static(
   76     76   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnum3",
   77     77   
        "aws.protocoltests.json.synthetic",
   78     78   
        "JsonEnumsOutput",
   79     79   
    ),
   80     80   
    ::aws_smithy_schema::ShapeType::String,
   81         -
    "foo_enum3",
          81  +
    "fooEnum3",
   82     82   
    2,
   83     83   
);
   84     84   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   85     85   
    ::aws_smithy_schema::ShapeId::from_static(
   86     86   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnumList",
   87     87   
        "aws.protocoltests.json.synthetic",
   88     88   
        "JsonEnumsOutput",
   89     89   
    ),
   90     90   
    ::aws_smithy_schema::ShapeType::List,
   91         -
    "foo_enum_list",
          91  +
    "fooEnumList",
   92     92   
    3,
   93     93   
);
   94     94   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnumSet",
   97     97   
        "aws.protocoltests.json.synthetic",
   98     98   
        "JsonEnumsOutput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::List,
  101         -
    "foo_enum_set",
         101  +
    "fooEnumSet",
  102    102   
    4,
  103    103   
);
  104    104   
static JSONENUMSOUTPUT_MEMBER_FOO_ENUM_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "aws.protocoltests.json.synthetic#JsonEnumsOutput$fooEnumMap",
  107    107   
        "aws.protocoltests.json.synthetic",
  108    108   
        "JsonEnumsOutput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Map,
  111         -
    "foo_enum_map",
         111  +
    "fooEnumMap",
  112    112   
    5,
  113    113   
);
  114    114   
static JSONENUMSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  115    115   
    JSONENUMSOUTPUT_SCHEMA_ID,
  116    116   
    ::aws_smithy_schema::ShapeType::Structure,
  117    117   
    &[
  118    118   
        &JSONENUMSOUTPUT_MEMBER_FOO_ENUM1,
  119    119   
        &JSONENUMSOUTPUT_MEMBER_FOO_ENUM2,
  120    120   
        &JSONENUMSOUTPUT_MEMBER_FOO_ENUM3,
  121    121   
        &JSONENUMSOUTPUT_MEMBER_FOO_ENUM_LIST,
@@ -154,154 +282,284 @@
  174    174   
                    }
  175    175   
                    Ok(())
  176    176   
                },
  177    177   
            )?;
  178    178   
        }
  179    179   
        Ok(())
  180    180   
    }
  181    181   
}
  182    182   
impl JsonEnumsOutput {
  183    183   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  184         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  185         -
        deserializer: &mut D,
         184  +
    pub fn deserialize(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  186    186   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  187    187   
        #[allow(unused_variables, unused_mut)]
  188    188   
        let mut builder = Self::builder();
  189    189   
        #[allow(
  190    190   
            unused_variables,
  191    191   
            unreachable_code,
  192    192   
            clippy::single_match,
  193    193   
            clippy::match_single_binding,
  194    194   
            clippy::diverging_sub_expression
  195    195   
        )]
  196         -
        deserializer.read_struct(&JSONENUMSOUTPUT_SCHEMA, (), |_, member, deser| {
         196  +
        deserializer.read_struct(&JSONENUMSOUTPUT_SCHEMA, &mut |member, deser| {
  197    197   
            match member.member_index() {
  198    198   
                Some(0) => {
  199    199   
                    builder.foo_enum1 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  200    200   
                }
  201    201   
                Some(1) => {
  202    202   
                    builder.foo_enum2 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  203    203   
                }
  204    204   
                Some(2) => {
  205    205   
                    builder.foo_enum3 = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  206    206   
                }
  207    207   
                Some(3) => {
  208    208   
                    builder.foo_enum_list = Some({
  209         -
                        let container = if let Some(cap) = deser.container_size() {
  210         -
                            Vec::with_capacity(cap)
  211         -
                        } else {
  212         -
                            Vec::new()
  213         -
                        };
  214         -
                        deser.read_list(member, container, |mut list, deser| {
  215         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  216         -
                            Ok(list)
  217         -
                        })?
         209  +
                        let mut container = Vec::new();
         210  +
                        deser.read_list(member, &mut |deser| {
         211  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         212  +
                            Ok(())
         213  +
                        })?;
         214  +
                        container
  218    215   
                    });
  219    216   
                }
  220    217   
                Some(4) => {
  221    218   
                    builder.foo_enum_set = Some({
  222         -
                        let container = if let Some(cap) = deser.container_size() {
  223         -
                            Vec::with_capacity(cap)
  224         -
                        } else {
  225         -
                            Vec::new()
  226         -
                        };
  227         -
                        deser.read_list(member, container, |mut list, deser| {
  228         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  229         -
                            Ok(list)
  230         -
                        })?
         219  +
                        let mut container = Vec::new();
         220  +
                        deser.read_list(member, &mut |deser| {
         221  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         222  +
                            Ok(())
         223  +
                        })?;
         224  +
                        container
  231    225   
                    });
  232    226   
                }
  233    227   
                Some(5) => {
  234    228   
                    builder.foo_enum_map = Some({
  235         -
                        let container = if let Some(cap) = deser.container_size() {
  236         -
                            std::collections::HashMap::with_capacity(cap)
  237         -
                        } else {
  238         -
                            std::collections::HashMap::new()
  239         -
                        };
  240         -
                        deser.read_map(member, container, |mut map, key, deser| {
  241         -
                            map.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  242         -
                            Ok(map)
  243         -
                        })?
         229  +
                        let mut container = std::collections::HashMap::new();
         230  +
                        deser.read_map(member, &mut |key, deser| {
         231  +
                            container.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         232  +
                            Ok(())
         233  +
                        })?;
         234  +
                        container
  244    235   
                    });
  245    236   
                }
  246    237   
                _ => {}
  247    238   
            }
  248    239   
            Ok(())
  249    240   
        })?;
  250    241   
        Ok(builder.build())
  251    242   
    }
  252    243   
}
         244  +
impl JsonEnumsOutput {
         245  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         246  +
    pub fn deserialize_with_response(
         247  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         248  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         249  +
        _status: u16,
         250  +
        _body: &[u8],
         251  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         252  +
        Self::deserialize(deserializer)
         253  +
    }
         254  +
}
  253    255   
impl JsonEnumsOutput {
  254    256   
    /// Creates a new builder-style object to manufacture [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
  255    257   
    pub fn builder() -> crate::operation::json_enums::builders::JsonEnumsOutputBuilder {
  256    258   
        crate::operation::json_enums::builders::JsonEnumsOutputBuilder::default()
  257    259   
    }
  258    260   
}
  259    261   
  260    262   
/// A builder for [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
  261    263   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  262    264   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_int_enums.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 `JsonIntEnums`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonIntEnums;
    6      6   
impl JsonIntEnums {
    7      7   
    /// Creates a new `JsonIntEnums`
    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_int_enums::JsonIntEnumsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_int_enums::JsonIntEnumsOutput::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_int_enums::JsonIntEnumsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_int_enums::JsonIntEnumsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_int_enums::JsonIntEnumsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +231,231 @@
  124    128   
                crate::operation::json_int_enums::JsonIntEnumsError,
  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 JsonIntEnumsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonIntEnumsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_int_enums::JsonIntEnumsError::generic(
         158  +
                    generic,
         159  +
                )),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_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.deserialize_response(response, JsonIntEnums::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         166  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         167  +
            })?;
         168  +
            let body = response.body().bytes().expect("body loaded");
         169  +
            let output = crate::operation::json_int_enums::JsonIntEnumsOutput::deserialize_with_response(
         170  +
                &mut *deser,
         171  +
                response.headers(),
         172  +
                response.status().into(),
         173  +
                body,
         174  +
            )
         175  +
            .map_err(|e| {
         176  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
            })?;
         178  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         179  +
        }
  150    180   
    }
  151    181   
}
  152    182   
#[derive(Debug)]
  153    183   
struct JsonIntEnumsRequestSerializer;
  154    184   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonIntEnumsRequestSerializer {
  155    185   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    186   
    fn serialize_input(
  157    187   
        &self,
  158    188   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    189   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    190   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    191   
        let input = input
  162    192   
            .downcast::<crate::operation::json_int_enums::JsonIntEnumsInput>()
  163    193   
            .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_int_enums::JsonIntEnumsInput,
  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, "/").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_int_enums::JsonIntEnumsInput,
  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/x-amz-json-1.1");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "JsonProtocol.JsonIntEnums",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_input(&input)?);
  197         -
        if let Some(content_length) = body.content_length() {
  198         -
            let content_length = content_length.to_string();
  199         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  200         -
        }
  201         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         194  +
        let protocol = _cfg
         195  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         196  +
            .expect("a SharedClientProtocol is required");
         197  +
        let mut request = protocol
         198  +
            .serialize_request(&input, JsonIntEnums::INPUT_SCHEMA, "", _cfg)
         199  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         200  +
         201  +
        return ::std::result::Result::Ok(request);
  202    202   
    }
  203    203   
}
  204    204   
#[derive(Debug)]
  205    205   
struct JsonIntEnumsEndpointParamsInterceptor;
  206    206   
  207    207   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonIntEnumsEndpointParamsInterceptor {
  208    208   
    fn name(&self) -> &'static str {
  209    209   
        "JsonIntEnumsEndpointParamsInterceptor"
  210    210   
    }
  211    211   
@@ -300,300 +360,370 @@
  320    320   
            .expect("the config must have a deserializer");
  321    321   
  322    322   
        let parsed = de.deserialize_streaming(&mut http_response);
  323    323   
        let parsed = parsed.unwrap_or_else(|| {
  324    324   
            let http_response = http_response.map(|body| {
  325    325   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  326    326   
                    body.bytes().unwrap(),
  327    327   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  328    328   
                )))
  329    329   
            });
  330         -
            de.deserialize_nonstreaming(&http_response)
         330  +
            // Build a config bag with the protocol for schema-based deserialization
         331  +
            #[allow(unused_mut)]
         332  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         333  +
            {
         334  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         335  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         336  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         337  +
                ));
         338  +
                test_cfg.push_shared_layer(layer.freeze());
         339  +
            }
         340  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  331    341   
        });
  332    342   
        let parsed = parsed
  333    343   
            .expect("should be successful response")
  334    344   
            .downcast::<crate::operation::json_int_enums::JsonIntEnumsOutput>()
  335    345   
            .unwrap();
  336    346   
        ::pretty_assertions::assert_eq!(parsed.int_enum1, expected_output.int_enum1, "Unexpected value for `int_enum1`");
  337    347   
        ::pretty_assertions::assert_eq!(parsed.int_enum2, expected_output.int_enum2, "Unexpected value for `int_enum2`");
  338    348   
        ::pretty_assertions::assert_eq!(parsed.int_enum3, expected_output.int_enum3, "Unexpected value for `int_enum3`");
  339    349   
        ::pretty_assertions::assert_eq!(
  340    350   
            parsed.int_enum_list,

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_int_enums/_json_int_enums_input.rs

@@ -31,31 +141,141 @@
   51     51   
    "aws.protocoltests.json.synthetic",
   52     52   
    "JsonIntEnumsInput",
   53     53   
);
   54     54   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM1: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnum1",
   57     57   
        "aws.protocoltests.json.synthetic",
   58     58   
        "JsonIntEnumsInput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::Integer,
   61         -
    "int_enum1",
          61  +
    "intEnum1",
   62     62   
    0,
   63     63   
);
   64     64   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM2: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   65     65   
    ::aws_smithy_schema::ShapeId::from_static(
   66     66   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnum2",
   67     67   
        "aws.protocoltests.json.synthetic",
   68     68   
        "JsonIntEnumsInput",
   69     69   
    ),
   70     70   
    ::aws_smithy_schema::ShapeType::Integer,
   71         -
    "int_enum2",
          71  +
    "intEnum2",
   72     72   
    1,
   73     73   
);
   74     74   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM3: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   75     75   
    ::aws_smithy_schema::ShapeId::from_static(
   76     76   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnum3",
   77     77   
        "aws.protocoltests.json.synthetic",
   78     78   
        "JsonIntEnumsInput",
   79     79   
    ),
   80     80   
    ::aws_smithy_schema::ShapeType::Integer,
   81         -
    "int_enum3",
          81  +
    "intEnum3",
   82     82   
    2,
   83     83   
);
   84     84   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   85     85   
    ::aws_smithy_schema::ShapeId::from_static(
   86     86   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnumList",
   87     87   
        "aws.protocoltests.json.synthetic",
   88     88   
        "JsonIntEnumsInput",
   89     89   
    ),
   90     90   
    ::aws_smithy_schema::ShapeType::List,
   91         -
    "int_enum_list",
          91  +
    "intEnumList",
   92     92   
    3,
   93     93   
);
   94     94   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnumSet",
   97     97   
        "aws.protocoltests.json.synthetic",
   98     98   
        "JsonIntEnumsInput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::List,
  101         -
    "int_enum_set",
         101  +
    "intEnumSet",
  102    102   
    4,
  103    103   
);
  104    104   
static JSONINTENUMSINPUT_MEMBER_INT_ENUM_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "aws.protocoltests.json.synthetic#JsonIntEnumsInput$intEnumMap",
  107    107   
        "aws.protocoltests.json.synthetic",
  108    108   
        "JsonIntEnumsInput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Map,
  111         -
    "int_enum_map",
         111  +
    "intEnumMap",
  112    112   
    5,
  113    113   
);
  114    114   
static JSONINTENUMSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  115    115   
    JSONINTENUMSINPUT_SCHEMA_ID,
  116    116   
    ::aws_smithy_schema::ShapeType::Structure,
  117    117   
    &[
  118    118   
        &JSONINTENUMSINPUT_MEMBER_INT_ENUM1,
  119    119   
        &JSONINTENUMSINPUT_MEMBER_INT_ENUM2,
  120    120   
        &JSONINTENUMSINPUT_MEMBER_INT_ENUM3,
  121    121   
        &JSONINTENUMSINPUT_MEMBER_INT_ENUM_LIST,
@@ -154,154 +284,272 @@
  174    174   
                    }
  175    175   
                    Ok(())
  176    176   
                },
  177    177   
            )?;
  178    178   
        }
  179    179   
        Ok(())
  180    180   
    }
  181    181   
}
  182    182   
impl JsonIntEnumsInput {
  183    183   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  184         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  185         -
        deserializer: &mut D,
         184  +
    pub fn deserialize(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  186    186   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  187    187   
        #[allow(unused_variables, unused_mut)]
  188    188   
        let mut builder = Self::builder();
  189    189   
        #[allow(
  190    190   
            unused_variables,
  191    191   
            unreachable_code,
  192    192   
            clippy::single_match,
  193    193   
            clippy::match_single_binding,
  194    194   
            clippy::diverging_sub_expression
  195    195   
        )]
  196         -
        deserializer.read_struct(&JSONINTENUMSINPUT_SCHEMA, (), |_, member, deser| {
         196  +
        deserializer.read_struct(&JSONINTENUMSINPUT_SCHEMA, &mut |member, deser| {
  197    197   
            match member.member_index() {
  198    198   
                Some(0) => {
  199    199   
                    builder.int_enum1 = Some(deser.read_integer(member)?);
  200    200   
                }
  201    201   
                Some(1) => {
  202    202   
                    builder.int_enum2 = Some(deser.read_integer(member)?);
  203    203   
                }
  204    204   
                Some(2) => {
  205    205   
                    builder.int_enum3 = Some(deser.read_integer(member)?);
  206    206   
                }
  207    207   
                Some(3) => {
  208         -
                    builder.int_enum_list = Some({
  209         -
                        let container = if let Some(cap) = deser.container_size() {
  210         -
                            Vec::with_capacity(cap)
  211         -
                        } else {
  212         -
                            Vec::new()
  213         -
                        };
  214         -
                        deser.read_list(member, container, |mut list, deser| {
  215         -
                            list.push(deser.read_integer(member)?);
  216         -
                            Ok(list)
  217         -
                        })?
  218         -
                    });
         208  +
                    builder.int_enum_list = Some(deser.read_integer_list(member)?);
  219    209   
                }
  220    210   
                Some(4) => {
  221         -
                    builder.int_enum_set = Some({
  222         -
                        let container = if let Some(cap) = deser.container_size() {
  223         -
                            Vec::with_capacity(cap)
  224         -
                        } else {
  225         -
                            Vec::new()
  226         -
                        };
  227         -
                        deser.read_list(member, container, |mut list, deser| {
  228         -
                            list.push(deser.read_integer(member)?);
  229         -
                            Ok(list)
  230         -
                        })?
  231         -
                    });
         211  +
                    builder.int_enum_set = Some(deser.read_integer_list(member)?);
  232    212   
                }
  233    213   
                Some(5) => {
  234    214   
                    builder.int_enum_map = Some({
  235         -
                        let container = if let Some(cap) = deser.container_size() {
  236         -
                            std::collections::HashMap::with_capacity(cap)
  237         -
                        } else {
  238         -
                            std::collections::HashMap::new()
  239         -
                        };
  240         -
                        deser.read_map(member, container, |mut map, key, deser| {
  241         -
                            map.insert(key, deser.read_integer(member)?);
  242         -
                            Ok(map)
  243         -
                        })?
         215  +
                        let mut container = std::collections::HashMap::new();
         216  +
                        deser.read_map(member, &mut |key, deser| {
         217  +
                            container.insert(key, deser.read_integer(member)?);
         218  +
                            Ok(())
         219  +
                        })?;
         220  +
                        container
  244    221   
                    });
  245    222   
                }
  246    223   
                _ => {}
  247    224   
            }
  248    225   
            Ok(())
  249    226   
        })?;
  250    227   
        builder
  251    228   
            .build()
  252    229   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  253    230   
    }
  254    231   
}
         232  +
impl JsonIntEnumsInput {
         233  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         234  +
    pub fn deserialize_with_response(
         235  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         236  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         237  +
        _status: u16,
         238  +
        _body: &[u8],
         239  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         240  +
        Self::deserialize(deserializer)
         241  +
    }
         242  +
}
  255    243   
impl JsonIntEnumsInput {
  256    244   
    /// Creates a new builder-style object to manufacture [`JsonIntEnumsInput`](crate::operation::json_int_enums::JsonIntEnumsInput).
  257    245   
    pub fn builder() -> crate::operation::json_int_enums::builders::JsonIntEnumsInputBuilder {
  258    246   
        crate::operation::json_int_enums::builders::JsonIntEnumsInputBuilder::default()
  259    247   
    }
  260    248   
}
  261    249   
  262    250   
/// A builder for [`JsonIntEnumsInput`](crate::operation::json_int_enums::JsonIntEnumsInput).
  263    251   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  264    252   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_int_enums/_json_int_enums_output.rs

@@ -31,31 +141,141 @@
   51     51   
    "aws.protocoltests.json.synthetic",
   52     52   
    "JsonIntEnumsOutput",
   53     53   
);
   54     54   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM1: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnum1",
   57     57   
        "aws.protocoltests.json.synthetic",
   58     58   
        "JsonIntEnumsOutput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::Integer,
   61         -
    "int_enum1",
          61  +
    "intEnum1",
   62     62   
    0,
   63     63   
);
   64     64   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM2: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   65     65   
    ::aws_smithy_schema::ShapeId::from_static(
   66     66   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnum2",
   67     67   
        "aws.protocoltests.json.synthetic",
   68     68   
        "JsonIntEnumsOutput",
   69     69   
    ),
   70     70   
    ::aws_smithy_schema::ShapeType::Integer,
   71         -
    "int_enum2",
          71  +
    "intEnum2",
   72     72   
    1,
   73     73   
);
   74     74   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM3: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   75     75   
    ::aws_smithy_schema::ShapeId::from_static(
   76     76   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnum3",
   77     77   
        "aws.protocoltests.json.synthetic",
   78     78   
        "JsonIntEnumsOutput",
   79     79   
    ),
   80     80   
    ::aws_smithy_schema::ShapeType::Integer,
   81         -
    "int_enum3",
          81  +
    "intEnum3",
   82     82   
    2,
   83     83   
);
   84     84   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   85     85   
    ::aws_smithy_schema::ShapeId::from_static(
   86     86   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnumList",
   87     87   
        "aws.protocoltests.json.synthetic",
   88     88   
        "JsonIntEnumsOutput",
   89     89   
    ),
   90     90   
    ::aws_smithy_schema::ShapeType::List,
   91         -
    "int_enum_list",
          91  +
    "intEnumList",
   92     92   
    3,
   93     93   
);
   94     94   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnumSet",
   97     97   
        "aws.protocoltests.json.synthetic",
   98     98   
        "JsonIntEnumsOutput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::List,
  101         -
    "int_enum_set",
         101  +
    "intEnumSet",
  102    102   
    4,
  103    103   
);
  104    104   
static JSONINTENUMSOUTPUT_MEMBER_INT_ENUM_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "aws.protocoltests.json.synthetic#JsonIntEnumsOutput$intEnumMap",
  107    107   
        "aws.protocoltests.json.synthetic",
  108    108   
        "JsonIntEnumsOutput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Map,
  111         -
    "int_enum_map",
         111  +
    "intEnumMap",
  112    112   
    5,
  113    113   
);
  114    114   
static JSONINTENUMSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  115    115   
    JSONINTENUMSOUTPUT_SCHEMA_ID,
  116    116   
    ::aws_smithy_schema::ShapeType::Structure,
  117    117   
    &[
  118    118   
        &JSONINTENUMSOUTPUT_MEMBER_INT_ENUM1,
  119    119   
        &JSONINTENUMSOUTPUT_MEMBER_INT_ENUM2,
  120    120   
        &JSONINTENUMSOUTPUT_MEMBER_INT_ENUM3,
  121    121   
        &JSONINTENUMSOUTPUT_MEMBER_INT_ENUM_LIST,
@@ -154,154 +282,270 @@
  174    174   
                    }
  175    175   
                    Ok(())
  176    176   
                },
  177    177   
            )?;
  178    178   
        }
  179    179   
        Ok(())
  180    180   
    }
  181    181   
}
  182    182   
impl JsonIntEnumsOutput {
  183    183   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  184         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  185         -
        deserializer: &mut D,
         184  +
    pub fn deserialize(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  186    186   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  187    187   
        #[allow(unused_variables, unused_mut)]
  188    188   
        let mut builder = Self::builder();
  189    189   
        #[allow(
  190    190   
            unused_variables,
  191    191   
            unreachable_code,
  192    192   
            clippy::single_match,
  193    193   
            clippy::match_single_binding,
  194    194   
            clippy::diverging_sub_expression
  195    195   
        )]
  196         -
        deserializer.read_struct(&JSONINTENUMSOUTPUT_SCHEMA, (), |_, member, deser| {
         196  +
        deserializer.read_struct(&JSONINTENUMSOUTPUT_SCHEMA, &mut |member, deser| {
  197    197   
            match member.member_index() {
  198    198   
                Some(0) => {
  199    199   
                    builder.int_enum1 = Some(deser.read_integer(member)?);
  200    200   
                }
  201    201   
                Some(1) => {
  202    202   
                    builder.int_enum2 = Some(deser.read_integer(member)?);
  203    203   
                }
  204    204   
                Some(2) => {
  205    205   
                    builder.int_enum3 = Some(deser.read_integer(member)?);
  206    206   
                }
  207    207   
                Some(3) => {
  208         -
                    builder.int_enum_list = Some({
  209         -
                        let container = if let Some(cap) = deser.container_size() {
  210         -
                            Vec::with_capacity(cap)
  211         -
                        } else {
  212         -
                            Vec::new()
  213         -
                        };
  214         -
                        deser.read_list(member, container, |mut list, deser| {
  215         -
                            list.push(deser.read_integer(member)?);
  216         -
                            Ok(list)
  217         -
                        })?
  218         -
                    });
         208  +
                    builder.int_enum_list = Some(deser.read_integer_list(member)?);
  219    209   
                }
  220    210   
                Some(4) => {
  221         -
                    builder.int_enum_set = Some({
  222         -
                        let container = if let Some(cap) = deser.container_size() {
  223         -
                            Vec::with_capacity(cap)
  224         -
                        } else {
  225         -
                            Vec::new()
  226         -
                        };
  227         -
                        deser.read_list(member, container, |mut list, deser| {
  228         -
                            list.push(deser.read_integer(member)?);
  229         -
                            Ok(list)
  230         -
                        })?
  231         -
                    });
         211  +
                    builder.int_enum_set = Some(deser.read_integer_list(member)?);
  232    212   
                }
  233    213   
                Some(5) => {
  234    214   
                    builder.int_enum_map = Some({
  235         -
                        let container = if let Some(cap) = deser.container_size() {
  236         -
                            std::collections::HashMap::with_capacity(cap)
  237         -
                        } else {
  238         -
                            std::collections::HashMap::new()
  239         -
                        };
  240         -
                        deser.read_map(member, container, |mut map, key, deser| {
  241         -
                            map.insert(key, deser.read_integer(member)?);
  242         -
                            Ok(map)
  243         -
                        })?
         215  +
                        let mut container = std::collections::HashMap::new();
         216  +
                        deser.read_map(member, &mut |key, deser| {
         217  +
                            container.insert(key, deser.read_integer(member)?);
         218  +
                            Ok(())
         219  +
                        })?;
         220  +
                        container
  244    221   
                    });
  245    222   
                }
  246    223   
                _ => {}
  247    224   
            }
  248    225   
            Ok(())
  249    226   
        })?;
  250    227   
        Ok(builder.build())
  251    228   
    }
  252    229   
}
         230  +
impl JsonIntEnumsOutput {
         231  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         232  +
    pub fn deserialize_with_response(
         233  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         234  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         235  +
        _status: u16,
         236  +
        _body: &[u8],
         237  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         238  +
        Self::deserialize(deserializer)
         239  +
    }
         240  +
}
  253    241   
impl JsonIntEnumsOutput {
  254    242   
    /// Creates a new builder-style object to manufacture [`JsonIntEnumsOutput`](crate::operation::json_int_enums::JsonIntEnumsOutput).
  255    243   
    pub fn builder() -> crate::operation::json_int_enums::builders::JsonIntEnumsOutputBuilder {
  256    244   
        crate::operation::json_int_enums::builders::JsonIntEnumsOutputBuilder::default()
  257    245   
    }
  258    246   
}
  259    247   
  260    248   
/// A builder for [`JsonIntEnumsOutput`](crate::operation::json_int_enums::JsonIntEnumsOutput).
  261    249   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  262    250   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_unions.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `JsonUnions`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonUnions;
    6      6   
impl JsonUnions {
    7      7   
    /// Creates a new `JsonUnions`
    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_unions::JsonUnionsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_unions::JsonUnionsOutput::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_unions::JsonUnionsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_unions::JsonUnionsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_unions::JsonUnionsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +229,229 @@
  124    128   
                crate::operation::json_unions::JsonUnionsError,
  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 JsonUnionsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonUnionsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_unions::JsonUnionsError::generic(
         158  +
                    generic,
         159  +
                )),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_json_unions::de_json_unions_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.deserialize_response(response, JsonUnions::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         166  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         167  +
            })?;
         168  +
            let body = response.body().bytes().expect("body loaded");
         169  +
            let output = crate::operation::json_unions::JsonUnionsOutput::deserialize_with_response(
         170  +
                &mut *deser,
         171  +
                response.headers(),
         172  +
                response.status().into(),
         173  +
                body,
         174  +
            )
         175  +
            .map_err(|e| {
         176  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
            })?;
         178  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         179  +
        }
  150    180   
    }
  151    181   
}
  152    182   
#[derive(Debug)]
  153    183   
struct JsonUnionsRequestSerializer;
  154    184   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonUnionsRequestSerializer {
  155    185   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    186   
    fn serialize_input(
  157    187   
        &self,
  158    188   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    189   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    190   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    191   
        let input = input.downcast::<crate::operation::json_unions::JsonUnionsInput>().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_unions::JsonUnionsInput,
  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, "/").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_unions::JsonUnionsInput,
  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("POST").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/x-amz-json-1.1");
  187         -
            builder = _header_serialization_settings.set_default_header(
  188         -
                builder,
  189         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  190         -
                "JsonProtocol.JsonUnions",
  191         -
            );
  192         -
            builder
  193         -
        };
  194         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_input(&input)?);
  195         -
        if let Some(content_length) = body.content_length() {
  196         -
            let content_length = content_length.to_string();
  197         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  198         -
        }
  199         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         192  +
        let protocol = _cfg
         193  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         194  +
            .expect("a SharedClientProtocol is required");
         195  +
        let mut request = protocol
         196  +
            .serialize_request(&input, JsonUnions::INPUT_SCHEMA, "", _cfg)
         197  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         198  +
         199  +
        return ::std::result::Result::Ok(request);
  200    200   
    }
  201    201   
}
  202    202   
#[derive(Debug)]
  203    203   
struct JsonUnionsEndpointParamsInterceptor;
  204    204   
  205    205   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
  206    206   
    fn name(&self) -> &'static str {
  207    207   
        "JsonUnionsEndpointParamsInterceptor"
  208    208   
    }
  209    209   
@@ -597,597 +1067,1167 @@
  617    617   
            .expect("the config must have a deserializer");
  618    618   
  619    619   
        let parsed = de.deserialize_streaming(&mut http_response);
  620    620   
        let parsed = parsed.unwrap_or_else(|| {
  621    621   
            let http_response = http_response.map(|body| {
  622    622   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  623    623   
                    body.bytes().unwrap(),
  624    624   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  625    625   
                )))
  626    626   
            });
  627         -
            de.deserialize_nonstreaming(&http_response)
         627  +
            // Build a config bag with the protocol for schema-based deserialization
         628  +
            #[allow(unused_mut)]
         629  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         630  +
            {
         631  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         632  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         633  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         634  +
                ));
         635  +
                test_cfg.push_shared_layer(layer.freeze());
         636  +
            }
         637  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  628    638   
        });
  629    639   
        let parsed = parsed
  630    640   
            .expect("should be successful response")
  631    641   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  632    642   
            .unwrap();
  633    643   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  634    644   
    }
  635    645   
  636    646   
    /// Deserializes a boolean union value
  637    647   
    /// Test ID: AwsJson11DeserializeBooleanUnionValue
  638    648   
    #[::tokio::test]
  639    649   
    #[::tracing_test::traced_test]
  640    650   
    async fn aws_json11_deserialize_boolean_union_value_response() {
  641    651   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  642    652   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
  643    653   
            .build();
  644    654   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  645    655   
            ::http_1x::response::Builder::new()
  646    656   
                .header("Content-Type", "application/x-amz-json-1.1")
  647    657   
                .status(200)
  648    658   
                .body(::aws_smithy_types::body::SdkBody::from(
  649    659   
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
  650    660   
                ))
  651    661   
                .unwrap(),
  652    662   
        )
  653    663   
        .unwrap();
  654    664   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  655    665   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  656    666   
  657    667   
        let op = crate::operation::json_unions::JsonUnions::new();
  658    668   
        let config = op.config().expect("the operation has config");
  659    669   
        let de = config
  660    670   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  661    671   
            .expect("the config must have a deserializer");
  662    672   
  663    673   
        let parsed = de.deserialize_streaming(&mut http_response);
  664    674   
        let parsed = parsed.unwrap_or_else(|| {
  665    675   
            let http_response = http_response.map(|body| {
  666    676   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  667    677   
                    body.bytes().unwrap(),
  668    678   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  669    679   
                )))
  670    680   
            });
  671         -
            de.deserialize_nonstreaming(&http_response)
         681  +
            // Build a config bag with the protocol for schema-based deserialization
         682  +
            #[allow(unused_mut)]
         683  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         684  +
            {
         685  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         686  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         687  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         688  +
                ));
         689  +
                test_cfg.push_shared_layer(layer.freeze());
         690  +
            }
         691  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  672    692   
        });
  673    693   
        let parsed = parsed
  674    694   
            .expect("should be successful response")
  675    695   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  676    696   
            .unwrap();
  677    697   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  678    698   
    }
  679    699   
  680    700   
    /// Deserializes a number union value
  681    701   
    /// Test ID: AwsJson11DeserializeNumberUnionValue
  682    702   
    #[::tokio::test]
  683    703   
    #[::tracing_test::traced_test]
  684    704   
    async fn aws_json11_deserialize_number_union_value_response() {
  685    705   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  686    706   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
  687    707   
            .build();
  688    708   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  689    709   
            ::http_1x::response::Builder::new()
  690    710   
                .header("Content-Type", "application/x-amz-json-1.1")
  691    711   
                .status(200)
  692    712   
                .body(::aws_smithy_types::body::SdkBody::from(
  693    713   
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
  694    714   
                ))
  695    715   
                .unwrap(),
  696    716   
        )
  697    717   
        .unwrap();
  698    718   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  699    719   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  700    720   
  701    721   
        let op = crate::operation::json_unions::JsonUnions::new();
  702    722   
        let config = op.config().expect("the operation has config");
  703    723   
        let de = config
  704    724   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  705    725   
            .expect("the config must have a deserializer");
  706    726   
  707    727   
        let parsed = de.deserialize_streaming(&mut http_response);
  708    728   
        let parsed = parsed.unwrap_or_else(|| {
  709    729   
            let http_response = http_response.map(|body| {
  710    730   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  711    731   
                    body.bytes().unwrap(),
  712    732   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  713    733   
                )))
  714    734   
            });
  715         -
            de.deserialize_nonstreaming(&http_response)
         735  +
            // Build a config bag with the protocol for schema-based deserialization
         736  +
            #[allow(unused_mut)]
         737  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         738  +
            {
         739  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         740  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         741  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         742  +
                ));
         743  +
                test_cfg.push_shared_layer(layer.freeze());
         744  +
            }
         745  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  716    746   
        });
  717    747   
        let parsed = parsed
  718    748   
            .expect("should be successful response")
  719    749   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  720    750   
            .unwrap();
  721    751   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  722    752   
    }
  723    753   
  724    754   
    /// Deserializes a blob union value
  725    755   
    /// Test ID: AwsJson11DeserializeBlobUnionValue
  726    756   
    #[::tokio::test]
  727    757   
    #[::tracing_test::traced_test]
  728    758   
    async fn aws_json11_deserialize_blob_union_value_response() {
  729    759   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  730    760   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
  731    761   
                ::aws_smithy_types::Blob::new("foo"),
  732    762   
            )))
  733    763   
            .build();
  734    764   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  735    765   
            ::http_1x::response::Builder::new()
  736    766   
                .header("Content-Type", "application/x-amz-json-1.1")
  737    767   
                .status(200)
  738    768   
                .body(::aws_smithy_types::body::SdkBody::from(
  739    769   
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
  740    770   
                ))
  741    771   
                .unwrap(),
  742    772   
        )
  743    773   
        .unwrap();
  744    774   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  745    775   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  746    776   
  747    777   
        let op = crate::operation::json_unions::JsonUnions::new();
  748    778   
        let config = op.config().expect("the operation has config");
  749    779   
        let de = config
  750    780   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  751    781   
            .expect("the config must have a deserializer");
  752    782   
  753    783   
        let parsed = de.deserialize_streaming(&mut http_response);
  754    784   
        let parsed = parsed.unwrap_or_else(|| {
  755    785   
            let http_response = http_response.map(|body| {
  756    786   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  757    787   
                    body.bytes().unwrap(),
  758    788   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  759    789   
                )))
  760    790   
            });
  761         -
            de.deserialize_nonstreaming(&http_response)
         791  +
            // Build a config bag with the protocol for schema-based deserialization
         792  +
            #[allow(unused_mut)]
         793  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         794  +
            {
         795  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         796  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         797  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         798  +
                ));
         799  +
                test_cfg.push_shared_layer(layer.freeze());
         800  +
            }
         801  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  762    802   
        });
  763    803   
        let parsed = parsed
  764    804   
            .expect("should be successful response")
  765    805   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  766    806   
            .unwrap();
  767    807   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  768    808   
    }
  769    809   
  770    810   
    /// Deserializes a timestamp union value
  771    811   
    /// Test ID: AwsJson11DeserializeTimestampUnionValue
  772    812   
    #[::tokio::test]
  773    813   
    #[::tracing_test::traced_test]
  774    814   
    async fn aws_json11_deserialize_timestamp_union_value_response() {
  775    815   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  776    816   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
  777    817   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  778    818   
            )))
  779    819   
            .build();
  780    820   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  781    821   
            ::http_1x::response::Builder::new()
  782    822   
                .header("Content-Type", "application/x-amz-json-1.1")
  783    823   
                .status(200)
  784    824   
                .body(::aws_smithy_types::body::SdkBody::from(
  785    825   
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
  786    826   
                ))
  787    827   
                .unwrap(),
  788    828   
        )
  789    829   
        .unwrap();
  790    830   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  791    831   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  792    832   
  793    833   
        let op = crate::operation::json_unions::JsonUnions::new();
  794    834   
        let config = op.config().expect("the operation has config");
  795    835   
        let de = config
  796    836   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  797    837   
            .expect("the config must have a deserializer");
  798    838   
  799    839   
        let parsed = de.deserialize_streaming(&mut http_response);
  800    840   
        let parsed = parsed.unwrap_or_else(|| {
  801    841   
            let http_response = http_response.map(|body| {
  802    842   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  803    843   
                    body.bytes().unwrap(),
  804    844   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  805    845   
                )))
  806    846   
            });
  807         -
            de.deserialize_nonstreaming(&http_response)
         847  +
            // Build a config bag with the protocol for schema-based deserialization
         848  +
            #[allow(unused_mut)]
         849  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         850  +
            {
         851  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         852  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         853  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         854  +
                ));
         855  +
                test_cfg.push_shared_layer(layer.freeze());
         856  +
            }
         857  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  808    858   
        });
  809    859   
        let parsed = parsed
  810    860   
            .expect("should be successful response")
  811    861   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  812    862   
            .unwrap();
  813    863   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  814    864   
    }
  815    865   
  816    866   
    /// Deserializes an enum union value
  817    867   
    /// Test ID: AwsJson11DeserializeEnumUnionValue
  818    868   
    #[::tokio::test]
  819    869   
    #[::tracing_test::traced_test]
  820    870   
    async fn aws_json11_deserialize_enum_union_value_response() {
  821    871   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  822    872   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
  823    873   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  824    874   
            )))
  825    875   
            .build();
  826    876   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  827    877   
            ::http_1x::response::Builder::new()
  828    878   
                .header("Content-Type", "application/x-amz-json-1.1")
  829    879   
                .status(200)
  830    880   
                .body(::aws_smithy_types::body::SdkBody::from(
  831    881   
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
  832    882   
                ))
  833    883   
                .unwrap(),
  834    884   
        )
  835    885   
        .unwrap();
  836    886   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  837    887   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  838    888   
  839    889   
        let op = crate::operation::json_unions::JsonUnions::new();
  840    890   
        let config = op.config().expect("the operation has config");
  841    891   
        let de = config
  842    892   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  843    893   
            .expect("the config must have a deserializer");
  844    894   
  845    895   
        let parsed = de.deserialize_streaming(&mut http_response);
  846    896   
        let parsed = parsed.unwrap_or_else(|| {
  847    897   
            let http_response = http_response.map(|body| {
  848    898   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  849    899   
                    body.bytes().unwrap(),
  850    900   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  851    901   
                )))
  852    902   
            });
  853         -
            de.deserialize_nonstreaming(&http_response)
         903  +
            // Build a config bag with the protocol for schema-based deserialization
         904  +
            #[allow(unused_mut)]
         905  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         906  +
            {
         907  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         908  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         909  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         910  +
                ));
         911  +
                test_cfg.push_shared_layer(layer.freeze());
         912  +
            }
         913  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  854    914   
        });
  855    915   
        let parsed = parsed
  856    916   
            .expect("should be successful response")
  857    917   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  858    918   
            .unwrap();
  859    919   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  860    920   
    }
  861    921   
  862    922   
    /// Deserializes a list union value
  863    923   
    /// Test ID: AwsJson11DeserializeListUnionValue
  864    924   
    #[::tokio::test]
  865    925   
    #[::tracing_test::traced_test]
  866    926   
    async fn aws_json11_deserialize_list_union_value_response() {
  867    927   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  868    928   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
  869    929   
                "foo".to_owned(),
  870    930   
                "bar".to_owned(),
  871    931   
            ])))
  872    932   
            .build();
  873    933   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  874    934   
            ::http_1x::response::Builder::new()
  875    935   
                .header("Content-Type", "application/x-amz-json-1.1")
  876    936   
                .status(200)
  877    937   
                .body(::aws_smithy_types::body::SdkBody::from(
  878    938   
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
  879    939   
                ))
  880    940   
                .unwrap(),
  881    941   
        )
  882    942   
        .unwrap();
  883    943   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  884    944   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  885    945   
  886    946   
        let op = crate::operation::json_unions::JsonUnions::new();
  887    947   
        let config = op.config().expect("the operation has config");
  888    948   
        let de = config
  889    949   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  890    950   
            .expect("the config must have a deserializer");
  891    951   
  892    952   
        let parsed = de.deserialize_streaming(&mut http_response);
  893    953   
        let parsed = parsed.unwrap_or_else(|| {
  894    954   
            let http_response = http_response.map(|body| {
  895    955   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  896    956   
                    body.bytes().unwrap(),
  897    957   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  898    958   
                )))
  899    959   
            });
  900         -
            de.deserialize_nonstreaming(&http_response)
         960  +
            // Build a config bag with the protocol for schema-based deserialization
         961  +
            #[allow(unused_mut)]
         962  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         963  +
            {
         964  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         965  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         966  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         967  +
                ));
         968  +
                test_cfg.push_shared_layer(layer.freeze());
         969  +
            }
         970  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  901    971   
        });
  902    972   
        let parsed = parsed
  903    973   
            .expect("should be successful response")
  904    974   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  905    975   
            .unwrap();
  906    976   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  907    977   
    }
  908    978   
  909    979   
    /// Deserializes a map union value
  910    980   
    /// Test ID: AwsJson11DeserializeMapUnionValue
  911    981   
    #[::tokio::test]
  912    982   
    #[::tracing_test::traced_test]
  913    983   
    async fn aws_json11_deserialize_map_union_value_response() {
  914    984   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  915    985   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
  916    986   
                let mut ret = ::std::collections::HashMap::new();
  917    987   
                ret.insert("foo".to_owned(), "bar".to_owned());
  918    988   
                ret.insert("spam".to_owned(), "eggs".to_owned());
  919    989   
                ret
  920    990   
            })))
  921    991   
            .build();
  922    992   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  923    993   
        .header("Content-Type", "application/x-amz-json-1.1")
  924    994   
        .status(200)
  925    995   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}"))
  926    996   
                    .unwrap()
  927    997   
                    ).unwrap();
  928    998   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  929    999   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  930   1000   
  931   1001   
        let op = crate::operation::json_unions::JsonUnions::new();
  932   1002   
        let config = op.config().expect("the operation has config");
  933   1003   
        let de = config
  934   1004   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  935   1005   
            .expect("the config must have a deserializer");
  936   1006   
  937   1007   
        let parsed = de.deserialize_streaming(&mut http_response);
  938   1008   
        let parsed = parsed.unwrap_or_else(|| {
  939   1009   
            let http_response = http_response.map(|body| {
  940   1010   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  941   1011   
                    body.bytes().unwrap(),
  942   1012   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  943   1013   
                )))
  944   1014   
            });
  945         -
            de.deserialize_nonstreaming(&http_response)
        1015  +
            // Build a config bag with the protocol for schema-based deserialization
        1016  +
            #[allow(unused_mut)]
        1017  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1018  +
            {
        1019  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1020  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1021  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1022  +
                ));
        1023  +
                test_cfg.push_shared_layer(layer.freeze());
        1024  +
            }
        1025  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  946   1026   
        });
  947   1027   
        let parsed = parsed
  948   1028   
            .expect("should be successful response")
  949   1029   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  950   1030   
            .unwrap();
  951   1031   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  952   1032   
    }
  953   1033   
  954   1034   
    /// Deserializes a structure union value
  955   1035   
    /// Test ID: AwsJson11DeserializeStructureUnionValue
  956   1036   
    #[::tokio::test]
  957   1037   
    #[::tracing_test::traced_test]
  958   1038   
    async fn aws_json11_deserialize_structure_union_value_response() {
  959   1039   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  960   1040   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
  961   1041   
                crate::types::GreetingStruct::builder()
  962   1042   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
  963   1043   
                    .build(),
  964   1044   
            )))
  965   1045   
            .build();
  966   1046   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  967   1047   
            ::http_1x::response::Builder::new()
  968   1048   
                .header("Content-Type", "application/x-amz-json-1.1")
  969   1049   
                .status(200)
  970   1050   
                .body(::aws_smithy_types::body::SdkBody::from(
  971   1051   
                    "{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}",
  972   1052   
                ))
  973   1053   
                .unwrap(),
  974   1054   
        )
  975   1055   
        .unwrap();
  976   1056   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  977   1057   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  978   1058   
  979   1059   
        let op = crate::operation::json_unions::JsonUnions::new();
  980   1060   
        let config = op.config().expect("the operation has config");
  981   1061   
        let de = config
  982   1062   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  983   1063   
            .expect("the config must have a deserializer");
  984   1064   
  985   1065   
        let parsed = de.deserialize_streaming(&mut http_response);
  986   1066   
        let parsed = parsed.unwrap_or_else(|| {
  987   1067   
            let http_response = http_response.map(|body| {
  988   1068   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  989   1069   
                    body.bytes().unwrap(),
  990   1070   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  991   1071   
                )))
  992   1072   
            });
  993         -
            de.deserialize_nonstreaming(&http_response)
        1073  +
            // Build a config bag with the protocol for schema-based deserialization
        1074  +
            #[allow(unused_mut)]
        1075  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1076  +
            {
        1077  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1078  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1079  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1080  +
                ));
        1081  +
                test_cfg.push_shared_layer(layer.freeze());
        1082  +
            }
        1083  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  994   1084   
        });
  995   1085   
        let parsed = parsed
  996   1086   
            .expect("should be successful response")
  997   1087   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  998   1088   
            .unwrap();
  999   1089   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
 1000   1090   
    }
 1001   1091   
 1002   1092   
    /// Ignores an unrecognized __type property
 1003   1093   
    /// Test ID: AwsJson11DeserializeIgnoreType
 1004   1094   
    #[::tokio::test]
 1005   1095   
    #[::tracing_test::traced_test]
 1006   1096   
    async fn aws_json11_deserialize_ignore_type_response() {
 1007   1097   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
 1008   1098   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
 1009   1099   
                crate::types::GreetingStruct::builder()
 1010   1100   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
 1011   1101   
                    .build(),
 1012   1102   
            )))
 1013   1103   
            .build();
 1014   1104   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
 1015   1105   
        .header("Content-Type", "application/x-amz-json-1.1")
 1016   1106   
        .status(200)
 1017   1107   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"contents\": {\n        \"__type\": \"aws.protocoltests.json10#MyUnion\",\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}"))
 1018   1108   
                    .unwrap()
 1019   1109   
                    ).unwrap();
 1020   1110   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
 1021   1111   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
 1022   1112   
 1023   1113   
        let op = crate::operation::json_unions::JsonUnions::new();
 1024   1114   
        let config = op.config().expect("the operation has config");
 1025   1115   
        let de = config
 1026   1116   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
 1027   1117   
            .expect("the config must have a deserializer");
 1028   1118   
 1029   1119   
        let parsed = de.deserialize_streaming(&mut http_response);
 1030   1120   
        let parsed = parsed.unwrap_or_else(|| {
 1031   1121   
            let http_response = http_response.map(|body| {
 1032   1122   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1033   1123   
                    body.bytes().unwrap(),
 1034   1124   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1035   1125   
                )))
 1036   1126   
            });
 1037         -
            de.deserialize_nonstreaming(&http_response)
        1127  +
            // Build a config bag with the protocol for schema-based deserialization
        1128  +
            #[allow(unused_mut)]
        1129  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1130  +
            {
        1131  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1132  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1133  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1134  +
                ));
        1135  +
                test_cfg.push_shared_layer(layer.freeze());
        1136  +
            }
        1137  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1038   1138   
        });
 1039   1139   
        let parsed = parsed
 1040   1140   
            .expect("should be successful response")
 1041   1141   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
 1042   1142   
            .unwrap();
 1043   1143   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
 1044   1144   
    }
 1045   1145   
}
 1046   1146   
 1047   1147   
/// Error type for the `JsonUnionsError` operation.

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_unions/_json_unions_input.rs

@@ -17,17 +112,120 @@
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONUNIONSINPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonUnionsInput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.contents {
   47         -
            ser.write_null(&JSONUNIONSINPUT_MEMBER_CONTENTS)?;
          47  +
            ser.write_struct(&JSONUNIONSINPUT_MEMBER_CONTENTS, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl JsonUnionsInput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&JSONUNIONSINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&JSONUNIONSINPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69         -
                    builder.contents = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          69  +
                    builder.contents = Some(crate::types::MyUnion::deserialize(deser)?);
   73     70   
                }
   74     71   
                _ => {}
   75     72   
            }
   76     73   
            Ok(())
   77     74   
        })?;
   78     75   
        builder
   79     76   
            .build()
   80     77   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   81     78   
    }
   82     79   
}
          80  +
impl JsonUnionsInput {
          81  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        _body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        Self::deserialize(deserializer)
          89  +
    }
          90  +
}
   83     91   
impl JsonUnionsInput {
   84     92   
    /// Creates a new builder-style object to manufacture [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
   85     93   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsInputBuilder {
   86     94   
        crate::operation::json_unions::builders::JsonUnionsInputBuilder::default()
   87     95   
    }
   88     96   
}
   89     97   
   90     98   
/// A builder for [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
   91     99   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   92    100   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_unions/_json_unions_output.rs

@@ -17,17 +110,118 @@
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONUNIONSOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonUnionsOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.contents {
   47         -
            ser.write_null(&JSONUNIONSOUTPUT_MEMBER_CONTENTS)?;
          47  +
            ser.write_struct(&JSONUNIONSOUTPUT_MEMBER_CONTENTS, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl JsonUnionsOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&JSONUNIONSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&JSONUNIONSOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69         -
                    builder.contents = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          69  +
                    builder.contents = Some(crate::types::MyUnion::deserialize(deser)?);
   73     70   
                }
   74     71   
                _ => {}
   75     72   
            }
   76     73   
            Ok(())
   77     74   
        })?;
   78     75   
        Ok(builder.build())
   79     76   
    }
   80     77   
}
          78  +
impl JsonUnionsOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   81     89   
impl JsonUnionsOutput {
   82     90   
    /// Creates a new builder-style object to manufacture [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
   83     91   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsOutputBuilder {
   84     92   
        crate::operation::json_unions::builders::JsonUnionsOutputBuilder::default()
   85     93   
    }
   86     94   
}
   87     95   
   88     96   
/// A builder for [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
   89     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90     98   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/kitchen_sink_operation.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 `KitchenSinkOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct KitchenSinkOperation;
    6      6   
impl KitchenSinkOperation {
    7      7   
    /// Creates a new `KitchenSinkOperation`
    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::kitchen_sink_operation::KitchenSinkOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput::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::kitchen_sink_operation::KitchenSinkOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::kitchen_sink_operation::KitchenSinkOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +239,302 @@
  130    134   
                crate::operation::kitchen_sink_operation::KitchenSinkOperationError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct KitchenSinkOperationResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for KitchenSinkOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation_http_error(status, headers, body)
  152         -
        } else {
  153         -
            crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation_http_response(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            let error_code = match generic.code() {
         163  +
                ::std::option::Option::Some(code) => code,
         164  +
                ::std::option::Option::None => {
         165  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         166  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         167  +
                            crate::operation::kitchen_sink_operation::KitchenSinkOperationError::unhandled(generic),
         168  +
                        ),
         169  +
                    ))
         170  +
                }
         171  +
            };
         172  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         173  +
            let protocol = _cfg
         174  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         175  +
                .expect("a SharedClientProtocol is required");
         176  +
            let err = match error_code {
         177  +
                "ErrorWithMembers" => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::ErrorWithMembers({
         178  +
                    let mut tmp = match protocol
         179  +
                        .deserialize_response(response, crate::types::error::ErrorWithMembers::SCHEMA, _cfg)
         180  +
                        .and_then(|mut deser| {
         181  +
                            crate::types::error::ErrorWithMembers::deserialize_with_response(
         182  +
                                &mut *deser,
         183  +
                                response.headers(),
         184  +
                                response.status().into(),
         185  +
                                body,
         186  +
                            )
         187  +
                        }) {
         188  +
                        ::std::result::Result::Ok(val) => val,
         189  +
                        ::std::result::Result::Err(e) => {
         190  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         191  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         192  +
                            ))
         193  +
                        }
         194  +
                    };
         195  +
                    tmp.meta = generic;
         196  +
                    if tmp.message.is_none() {
         197  +
                        tmp.message = _error_message;
         198  +
                    }
         199  +
                    tmp
         200  +
                }),
         201  +
                "ErrorWithoutMembers" => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::ErrorWithoutMembers({
         202  +
                    let mut tmp = match protocol
         203  +
                        .deserialize_response(response, crate::types::error::ErrorWithoutMembers::SCHEMA, _cfg)
         204  +
                        .and_then(|mut deser| {
         205  +
                            crate::types::error::ErrorWithoutMembers::deserialize_with_response(
         206  +
                                &mut *deser,
         207  +
                                response.headers(),
         208  +
                                response.status().into(),
         209  +
                                body,
         210  +
                            )
         211  +
                        }) {
         212  +
                        ::std::result::Result::Ok(val) => val,
         213  +
                        ::std::result::Result::Err(e) => {
         214  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         215  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         216  +
                            ))
         217  +
                        }
         218  +
                    };
         219  +
                    tmp.meta = generic;
         220  +
                    if tmp.message.is_none() {
         221  +
                        tmp.message = _error_message;
         222  +
                    }
         223  +
                    tmp
         224  +
                }),
         225  +
                _ => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::generic(generic),
  154    226   
            };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         227  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         228  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         229  +
            ))
         230  +
        } else {
         231  +
            let protocol = _cfg
         232  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         233  +
                .expect("a SharedClientProtocol is required");
         234  +
            let mut deser = protocol
         235  +
                .deserialize_response(response, KitchenSinkOperation::OUTPUT_SCHEMA, _cfg)
         236  +
                .map_err(|e| {
         237  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         238  +
                })?;
         239  +
            let body = response.body().bytes().expect("body loaded");
         240  +
            let output = crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput::deserialize_with_response(
         241  +
                &mut *deser,
         242  +
                response.headers(),
         243  +
                response.status().into(),
         244  +
                body,
         245  +
            )
         246  +
            .map_err(|e| {
         247  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         248  +
            })?;
         249  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         250  +
        }
  156    251   
    }
  157    252   
}
  158    253   
#[derive(Debug)]
  159    254   
struct KitchenSinkOperationRequestSerializer;
  160    255   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for KitchenSinkOperationRequestSerializer {
  161    256   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    257   
    fn serialize_input(
  163    258   
        &self,
  164    259   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    260   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    261   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    262   
        let input = input
  168    263   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationInput>()
  169    264   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::kitchen_sink_operation::KitchenSinkOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::kitchen_sink_operation::KitchenSinkOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonProtocol.KitchenSinkOperation",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_kitchen_sink_operation::ser_kitchen_sink_operation_input(
  203         -
            &input,
  204         -
        )?);
  205         -
        if let Some(content_length) = body.content_length() {
  206         -
            let content_length = content_length.to_string();
  207         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  208         -
        }
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         265  +
        let protocol = _cfg
         266  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         267  +
            .expect("a SharedClientProtocol is required");
         268  +
        let mut request = protocol
         269  +
            .serialize_request(&input, KitchenSinkOperation::INPUT_SCHEMA, "", _cfg)
         270  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         271  +
         272  +
        return ::std::result::Result::Ok(request);
  210    273   
    }
  211    274   
}
  212    275   
#[derive(Debug)]
  213    276   
struct KitchenSinkOperationEndpointParamsInterceptor;
  214    277   
  215    278   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for KitchenSinkOperationEndpointParamsInterceptor {
  216    279   
    fn name(&self) -> &'static str {
  217    280   
        "KitchenSinkOperationEndpointParamsInterceptor"
  218    281   
    }
  219    282   
@@ -1467,1530 +1527,1600 @@
 1487   1550   
            .expect("the config must have a deserializer");
 1488   1551   
 1489   1552   
        let parsed = de.deserialize_streaming(&mut http_response);
 1490   1553   
        let parsed = parsed.unwrap_or_else(|| {
 1491   1554   
            let http_response = http_response.map(|body| {
 1492   1555   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1493   1556   
                    body.bytes().unwrap(),
 1494   1557   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1495   1558   
                )))
 1496   1559   
            });
 1497         -
            de.deserialize_nonstreaming(&http_response)
        1560  +
            // Build a config bag with the protocol for schema-based deserialization
        1561  +
            #[allow(unused_mut)]
        1562  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1563  +
            {
        1564  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1565  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1566  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1567  +
                ));
        1568  +
                test_cfg.push_shared_layer(layer.freeze());
        1569  +
            }
        1570  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1498   1571   
        });
 1499   1572   
        let parsed = parsed
 1500   1573   
            .expect("should be successful response")
 1501   1574   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 1502   1575   
            .unwrap();
 1503   1576   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 1504   1577   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 1505   1578   
        assert!(
 1506   1579   
            parsed.double.float_equals(&expected_output.double),
 1507   1580   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -1604,1677 +1664,1747 @@
 1624   1697   
            .expect("the config must have a deserializer");
 1625   1698   
 1626   1699   
        let parsed = de.deserialize_streaming(&mut http_response);
 1627   1700   
        let parsed = parsed.unwrap_or_else(|| {
 1628   1701   
            let http_response = http_response.map(|body| {
 1629   1702   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1630   1703   
                    body.bytes().unwrap(),
 1631   1704   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1632   1705   
                )))
 1633   1706   
            });
 1634         -
            de.deserialize_nonstreaming(&http_response)
        1707  +
            // Build a config bag with the protocol for schema-based deserialization
        1708  +
            #[allow(unused_mut)]
        1709  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1710  +
            {
        1711  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1712  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1713  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1714  +
                ));
        1715  +
                test_cfg.push_shared_layer(layer.freeze());
        1716  +
            }
        1717  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1635   1718   
        });
 1636   1719   
        let parsed = parsed
 1637   1720   
            .expect("should be successful response")
 1638   1721   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 1639   1722   
            .unwrap();
 1640   1723   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 1641   1724   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 1642   1725   
        assert!(
 1643   1726   
            parsed.double.float_equals(&expected_output.double),
 1644   1727   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -1741,1824 +1801,1894 @@
 1761   1844   
            .expect("the config must have a deserializer");
 1762   1845   
 1763   1846   
        let parsed = de.deserialize_streaming(&mut http_response);
 1764   1847   
        let parsed = parsed.unwrap_or_else(|| {
 1765   1848   
            let http_response = http_response.map(|body| {
 1766   1849   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1767   1850   
                    body.bytes().unwrap(),
 1768   1851   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1769   1852   
                )))
 1770   1853   
            });
 1771         -
            de.deserialize_nonstreaming(&http_response)
        1854  +
            // Build a config bag with the protocol for schema-based deserialization
        1855  +
            #[allow(unused_mut)]
        1856  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1857  +
            {
        1858  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1859  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1860  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        1861  +
                ));
        1862  +
                test_cfg.push_shared_layer(layer.freeze());
        1863  +
            }
        1864  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1772   1865   
        });
 1773   1866   
        let parsed = parsed
 1774   1867   
            .expect("should be successful response")
 1775   1868   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 1776   1869   
            .unwrap();
 1777   1870   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 1778   1871   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 1779   1872   
        assert!(
 1780   1873   
            parsed.double.float_equals(&expected_output.double),
 1781   1874   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -1878,1971 +1938,2041 @@
 1898   1991   
            .expect("the config must have a deserializer");
 1899   1992   
 1900   1993   
        let parsed = de.deserialize_streaming(&mut http_response);
 1901   1994   
        let parsed = parsed.unwrap_or_else(|| {
 1902   1995   
            let http_response = http_response.map(|body| {
 1903   1996   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1904   1997   
                    body.bytes().unwrap(),
 1905   1998   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1906   1999   
                )))
 1907   2000   
            });
 1908         -
            de.deserialize_nonstreaming(&http_response)
        2001  +
            // Build a config bag with the protocol for schema-based deserialization
        2002  +
            #[allow(unused_mut)]
        2003  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2004  +
            {
        2005  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2006  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2007  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2008  +
                ));
        2009  +
                test_cfg.push_shared_layer(layer.freeze());
        2010  +
            }
        2011  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1909   2012   
        });
 1910   2013   
        let parsed = parsed
 1911   2014   
            .expect("should be successful response")
 1912   2015   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 1913   2016   
            .unwrap();
 1914   2017   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 1915   2018   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 1916   2019   
        assert!(
 1917   2020   
            parsed.double.float_equals(&expected_output.double),
 1918   2021   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2015,2118 +2075,2188 @@
 2035   2138   
            .expect("the config must have a deserializer");
 2036   2139   
 2037   2140   
        let parsed = de.deserialize_streaming(&mut http_response);
 2038   2141   
        let parsed = parsed.unwrap_or_else(|| {
 2039   2142   
            let http_response = http_response.map(|body| {
 2040   2143   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2041   2144   
                    body.bytes().unwrap(),
 2042   2145   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2043   2146   
                )))
 2044   2147   
            });
 2045         -
            de.deserialize_nonstreaming(&http_response)
        2148  +
            // Build a config bag with the protocol for schema-based deserialization
        2149  +
            #[allow(unused_mut)]
        2150  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2151  +
            {
        2152  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2153  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2154  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2155  +
                ));
        2156  +
                test_cfg.push_shared_layer(layer.freeze());
        2157  +
            }
        2158  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2046   2159   
        });
 2047   2160   
        let parsed = parsed
 2048   2161   
            .expect("should be successful response")
 2049   2162   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2050   2163   
            .unwrap();
 2051   2164   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2052   2165   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2053   2166   
        assert!(
 2054   2167   
            parsed.double.float_equals(&expected_output.double),
 2055   2168   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2152,2265 +2212,2335 @@
 2172   2285   
            .expect("the config must have a deserializer");
 2173   2286   
 2174   2287   
        let parsed = de.deserialize_streaming(&mut http_response);
 2175   2288   
        let parsed = parsed.unwrap_or_else(|| {
 2176   2289   
            let http_response = http_response.map(|body| {
 2177   2290   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2178   2291   
                    body.bytes().unwrap(),
 2179   2292   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2180   2293   
                )))
 2181   2294   
            });
 2182         -
            de.deserialize_nonstreaming(&http_response)
        2295  +
            // Build a config bag with the protocol for schema-based deserialization
        2296  +
            #[allow(unused_mut)]
        2297  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2298  +
            {
        2299  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2300  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2301  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2302  +
                ));
        2303  +
                test_cfg.push_shared_layer(layer.freeze());
        2304  +
            }
        2305  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2183   2306   
        });
 2184   2307   
        let parsed = parsed
 2185   2308   
            .expect("should be successful response")
 2186   2309   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2187   2310   
            .unwrap();
 2188   2311   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2189   2312   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2190   2313   
        assert!(
 2191   2314   
            parsed.double.float_equals(&expected_output.double),
 2192   2315   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2289,2412 +2349,2482 @@
 2309   2432   
            .expect("the config must have a deserializer");
 2310   2433   
 2311   2434   
        let parsed = de.deserialize_streaming(&mut http_response);
 2312   2435   
        let parsed = parsed.unwrap_or_else(|| {
 2313   2436   
            let http_response = http_response.map(|body| {
 2314   2437   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2315   2438   
                    body.bytes().unwrap(),
 2316   2439   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2317   2440   
                )))
 2318   2441   
            });
 2319         -
            de.deserialize_nonstreaming(&http_response)
        2442  +
            // Build a config bag with the protocol for schema-based deserialization
        2443  +
            #[allow(unused_mut)]
        2444  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2445  +
            {
        2446  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2447  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2448  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2449  +
                ));
        2450  +
                test_cfg.push_shared_layer(layer.freeze());
        2451  +
            }
        2452  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2320   2453   
        });
 2321   2454   
        let parsed = parsed
 2322   2455   
            .expect("should be successful response")
 2323   2456   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2324   2457   
            .unwrap();
 2325   2458   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2326   2459   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2327   2460   
        assert!(
 2328   2461   
            parsed.double.float_equals(&expected_output.double),
 2329   2462   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2426,2559 +2486,2629 @@
 2446   2579   
            .expect("the config must have a deserializer");
 2447   2580   
 2448   2581   
        let parsed = de.deserialize_streaming(&mut http_response);
 2449   2582   
        let parsed = parsed.unwrap_or_else(|| {
 2450   2583   
            let http_response = http_response.map(|body| {
 2451   2584   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2452   2585   
                    body.bytes().unwrap(),
 2453   2586   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2454   2587   
                )))
 2455   2588   
            });
 2456         -
            de.deserialize_nonstreaming(&http_response)
        2589  +
            // Build a config bag with the protocol for schema-based deserialization
        2590  +
            #[allow(unused_mut)]
        2591  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2592  +
            {
        2593  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2594  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2595  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2596  +
                ));
        2597  +
                test_cfg.push_shared_layer(layer.freeze());
        2598  +
            }
        2599  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2457   2600   
        });
 2458   2601   
        let parsed = parsed
 2459   2602   
            .expect("should be successful response")
 2460   2603   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2461   2604   
            .unwrap();
 2462   2605   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2463   2606   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2464   2607   
        assert!(
 2465   2608   
            parsed.double.float_equals(&expected_output.double),
 2466   2609   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2563,2706 +2623,2776 @@
 2583   2726   
            .expect("the config must have a deserializer");
 2584   2727   
 2585   2728   
        let parsed = de.deserialize_streaming(&mut http_response);
 2586   2729   
        let parsed = parsed.unwrap_or_else(|| {
 2587   2730   
            let http_response = http_response.map(|body| {
 2588   2731   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2589   2732   
                    body.bytes().unwrap(),
 2590   2733   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2591   2734   
                )))
 2592   2735   
            });
 2593         -
            de.deserialize_nonstreaming(&http_response)
        2736  +
            // Build a config bag with the protocol for schema-based deserialization
        2737  +
            #[allow(unused_mut)]
        2738  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2739  +
            {
        2740  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2741  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2742  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2743  +
                ));
        2744  +
                test_cfg.push_shared_layer(layer.freeze());
        2745  +
            }
        2746  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2594   2747   
        });
 2595   2748   
        let parsed = parsed
 2596   2749   
            .expect("should be successful response")
 2597   2750   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2598   2751   
            .unwrap();
 2599   2752   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2600   2753   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2601   2754   
        assert!(
 2602   2755   
            parsed.double.float_equals(&expected_output.double),
 2603   2756   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2702,2855 +2762,2925 @@
 2722   2875   
            .expect("the config must have a deserializer");
 2723   2876   
 2724   2877   
        let parsed = de.deserialize_streaming(&mut http_response);
 2725   2878   
        let parsed = parsed.unwrap_or_else(|| {
 2726   2879   
            let http_response = http_response.map(|body| {
 2727   2880   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2728   2881   
                    body.bytes().unwrap(),
 2729   2882   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2730   2883   
                )))
 2731   2884   
            });
 2732         -
            de.deserialize_nonstreaming(&http_response)
        2885  +
            // Build a config bag with the protocol for schema-based deserialization
        2886  +
            #[allow(unused_mut)]
        2887  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        2888  +
            {
        2889  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        2890  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        2891  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        2892  +
                ));
        2893  +
                test_cfg.push_shared_layer(layer.freeze());
        2894  +
            }
        2895  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2733   2896   
        });
 2734   2897   
        let parsed = parsed
 2735   2898   
            .expect("should be successful response")
 2736   2899   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2737   2900   
            .unwrap();
 2738   2901   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2739   2902   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2740   2903   
        assert!(
 2741   2904   
            parsed.double.float_equals(&expected_output.double),
 2742   2905   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2841,3004 +2901,3074 @@
 2861   3024   
            .expect("the config must have a deserializer");
 2862   3025   
 2863   3026   
        let parsed = de.deserialize_streaming(&mut http_response);
 2864   3027   
        let parsed = parsed.unwrap_or_else(|| {
 2865   3028   
            let http_response = http_response.map(|body| {
 2866   3029   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 2867   3030   
                    body.bytes().unwrap(),
 2868   3031   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2869   3032   
                )))
 2870   3033   
            });
 2871         -
            de.deserialize_nonstreaming(&http_response)
        3034  +
            // Build a config bag with the protocol for schema-based deserialization
        3035  +
            #[allow(unused_mut)]
        3036  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3037  +
            {
        3038  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3039  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3040  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3041  +
                ));
        3042  +
                test_cfg.push_shared_layer(layer.freeze());
        3043  +
            }
        3044  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 2872   3045   
        });
 2873   3046   
        let parsed = parsed
 2874   3047   
            .expect("should be successful response")
 2875   3048   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 2876   3049   
            .unwrap();
 2877   3050   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 2878   3051   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 2879   3052   
        assert!(
 2880   3053   
            parsed.double.float_equals(&expected_output.double),
 2881   3054   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -2982,3155 +3042,3225 @@
 3002   3175   
            .expect("the config must have a deserializer");
 3003   3176   
 3004   3177   
        let parsed = de.deserialize_streaming(&mut http_response);
 3005   3178   
        let parsed = parsed.unwrap_or_else(|| {
 3006   3179   
            let http_response = http_response.map(|body| {
 3007   3180   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3008   3181   
                    body.bytes().unwrap(),
 3009   3182   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3010   3183   
                )))
 3011   3184   
            });
 3012         -
            de.deserialize_nonstreaming(&http_response)
        3185  +
            // Build a config bag with the protocol for schema-based deserialization
        3186  +
            #[allow(unused_mut)]
        3187  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3188  +
            {
        3189  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3190  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3191  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3192  +
                ));
        3193  +
                test_cfg.push_shared_layer(layer.freeze());
        3194  +
            }
        3195  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3013   3196   
        });
 3014   3197   
        let parsed = parsed
 3015   3198   
            .expect("should be successful response")
 3016   3199   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3017   3200   
            .unwrap();
 3018   3201   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3019   3202   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3020   3203   
        assert!(
 3021   3204   
            parsed.double.float_equals(&expected_output.double),
 3022   3205   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3119,3302 +3179,3372 @@
 3139   3322   
            .expect("the config must have a deserializer");
 3140   3323   
 3141   3324   
        let parsed = de.deserialize_streaming(&mut http_response);
 3142   3325   
        let parsed = parsed.unwrap_or_else(|| {
 3143   3326   
            let http_response = http_response.map(|body| {
 3144   3327   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3145   3328   
                    body.bytes().unwrap(),
 3146   3329   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3147   3330   
                )))
 3148   3331   
            });
 3149         -
            de.deserialize_nonstreaming(&http_response)
        3332  +
            // Build a config bag with the protocol for schema-based deserialization
        3333  +
            #[allow(unused_mut)]
        3334  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3335  +
            {
        3336  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3337  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3338  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3339  +
                ));
        3340  +
                test_cfg.push_shared_layer(layer.freeze());
        3341  +
            }
        3342  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3150   3343   
        });
 3151   3344   
        let parsed = parsed
 3152   3345   
            .expect("should be successful response")
 3153   3346   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3154   3347   
            .unwrap();
 3155   3348   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3156   3349   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3157   3350   
        assert!(
 3158   3351   
            parsed.double.float_equals(&expected_output.double),
 3159   3352   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3269,3462 +3329,3532 @@
 3289   3482   
            .expect("the config must have a deserializer");
 3290   3483   
 3291   3484   
        let parsed = de.deserialize_streaming(&mut http_response);
 3292   3485   
        let parsed = parsed.unwrap_or_else(|| {
 3293   3486   
            let http_response = http_response.map(|body| {
 3294   3487   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3295   3488   
                    body.bytes().unwrap(),
 3296   3489   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3297   3490   
                )))
 3298   3491   
            });
 3299         -
            de.deserialize_nonstreaming(&http_response)
        3492  +
            // Build a config bag with the protocol for schema-based deserialization
        3493  +
            #[allow(unused_mut)]
        3494  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3495  +
            {
        3496  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3497  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3498  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3499  +
                ));
        3500  +
                test_cfg.push_shared_layer(layer.freeze());
        3501  +
            }
        3502  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3300   3503   
        });
 3301   3504   
        let parsed = parsed
 3302   3505   
            .expect("should be successful response")
 3303   3506   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3304   3507   
            .unwrap();
 3305   3508   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3306   3509   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3307   3510   
        assert!(
 3308   3511   
            parsed.double.float_equals(&expected_output.double),
 3309   3512   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3411,3614 +3471,3684 @@
 3431   3634   
            .expect("the config must have a deserializer");
 3432   3635   
 3433   3636   
        let parsed = de.deserialize_streaming(&mut http_response);
 3434   3637   
        let parsed = parsed.unwrap_or_else(|| {
 3435   3638   
            let http_response = http_response.map(|body| {
 3436   3639   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3437   3640   
                    body.bytes().unwrap(),
 3438   3641   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3439   3642   
                )))
 3440   3643   
            });
 3441         -
            de.deserialize_nonstreaming(&http_response)
        3644  +
            // Build a config bag with the protocol for schema-based deserialization
        3645  +
            #[allow(unused_mut)]
        3646  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3647  +
            {
        3648  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3649  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3650  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3651  +
                ));
        3652  +
                test_cfg.push_shared_layer(layer.freeze());
        3653  +
            }
        3654  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3442   3655   
        });
 3443   3656   
        let parsed = parsed
 3444   3657   
            .expect("should be successful response")
 3445   3658   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3446   3659   
            .unwrap();
 3447   3660   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3448   3661   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3449   3662   
        assert!(
 3450   3663   
            parsed.double.float_equals(&expected_output.double),
 3451   3664   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3557,3770 +3617,3840 @@
 3577   3790   
            .expect("the config must have a deserializer");
 3578   3791   
 3579   3792   
        let parsed = de.deserialize_streaming(&mut http_response);
 3580   3793   
        let parsed = parsed.unwrap_or_else(|| {
 3581   3794   
            let http_response = http_response.map(|body| {
 3582   3795   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3583   3796   
                    body.bytes().unwrap(),
 3584   3797   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3585   3798   
                )))
 3586   3799   
            });
 3587         -
            de.deserialize_nonstreaming(&http_response)
        3800  +
            // Build a config bag with the protocol for schema-based deserialization
        3801  +
            #[allow(unused_mut)]
        3802  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3803  +
            {
        3804  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3805  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3806  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3807  +
                ));
        3808  +
                test_cfg.push_shared_layer(layer.freeze());
        3809  +
            }
        3810  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3588   3811   
        });
 3589   3812   
        let parsed = parsed
 3590   3813   
            .expect("should be successful response")
 3591   3814   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3592   3815   
            .unwrap();
 3593   3816   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3594   3817   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3595   3818   
        assert!(
 3596   3819   
            parsed.double.float_equals(&expected_output.double),
 3597   3820   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3702,3925 +3762,3995 @@
 3722   3945   
            .expect("the config must have a deserializer");
 3723   3946   
 3724   3947   
        let parsed = de.deserialize_streaming(&mut http_response);
 3725   3948   
        let parsed = parsed.unwrap_or_else(|| {
 3726   3949   
            let http_response = http_response.map(|body| {
 3727   3950   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3728   3951   
                    body.bytes().unwrap(),
 3729   3952   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3730   3953   
                )))
 3731   3954   
            });
 3732         -
            de.deserialize_nonstreaming(&http_response)
        3955  +
            // Build a config bag with the protocol for schema-based deserialization
        3956  +
            #[allow(unused_mut)]
        3957  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        3958  +
            {
        3959  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        3960  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        3961  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        3962  +
                ));
        3963  +
                test_cfg.push_shared_layer(layer.freeze());
        3964  +
            }
        3965  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3733   3966   
        });
 3734   3967   
        let parsed = parsed
 3735   3968   
            .expect("should be successful response")
 3736   3969   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3737   3970   
            .unwrap();
 3738   3971   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3739   3972   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3740   3973   
        assert!(
 3741   3974   
            parsed.double.float_equals(&expected_output.double),
 3742   3975   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3846,4079 +3906,4149 @@
 3866   4099   
            .expect("the config must have a deserializer");
 3867   4100   
 3868   4101   
        let parsed = de.deserialize_streaming(&mut http_response);
 3869   4102   
        let parsed = parsed.unwrap_or_else(|| {
 3870   4103   
            let http_response = http_response.map(|body| {
 3871   4104   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 3872   4105   
                    body.bytes().unwrap(),
 3873   4106   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3874   4107   
                )))
 3875   4108   
            });
 3876         -
            de.deserialize_nonstreaming(&http_response)
        4109  +
            // Build a config bag with the protocol for schema-based deserialization
        4110  +
            #[allow(unused_mut)]
        4111  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4112  +
            {
        4113  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4114  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4115  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4116  +
                ));
        4117  +
                test_cfg.push_shared_layer(layer.freeze());
        4118  +
            }
        4119  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 3877   4120   
        });
 3878   4121   
        let parsed = parsed
 3879   4122   
            .expect("should be successful response")
 3880   4123   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 3881   4124   
            .unwrap();
 3882   4125   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 3883   4126   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 3884   4127   
        assert!(
 3885   4128   
            parsed.double.float_equals(&expected_output.double),
 3886   4129   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -3990,4233 +4050,4303 @@
 4010   4253   
            .expect("the config must have a deserializer");
 4011   4254   
 4012   4255   
        let parsed = de.deserialize_streaming(&mut http_response);
 4013   4256   
        let parsed = parsed.unwrap_or_else(|| {
 4014   4257   
            let http_response = http_response.map(|body| {
 4015   4258   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 4016   4259   
                    body.bytes().unwrap(),
 4017   4260   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 4018   4261   
                )))
 4019   4262   
            });
 4020         -
            de.deserialize_nonstreaming(&http_response)
        4263  +
            // Build a config bag with the protocol for schema-based deserialization
        4264  +
            #[allow(unused_mut)]
        4265  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4266  +
            {
        4267  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4268  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4269  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4270  +
                ));
        4271  +
                test_cfg.push_shared_layer(layer.freeze());
        4272  +
            }
        4273  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 4021   4274   
        });
 4022   4275   
        let parsed = parsed
 4023   4276   
            .expect("should be successful response")
 4024   4277   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 4025   4278   
            .unwrap();
 4026   4279   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 4027   4280   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 4028   4281   
        assert!(
 4029   4282   
            parsed.double.float_equals(&expected_output.double),
 4030   4283   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -4144,4397 +4204,4467 @@
 4164   4417   
            .expect("the config must have a deserializer");
 4165   4418   
 4166   4419   
        let parsed = de.deserialize_streaming(&mut http_response);
 4167   4420   
        let parsed = parsed.unwrap_or_else(|| {
 4168   4421   
            let http_response = http_response.map(|body| {
 4169   4422   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 4170   4423   
                    body.bytes().unwrap(),
 4171   4424   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 4172   4425   
                )))
 4173   4426   
            });
 4174         -
            de.deserialize_nonstreaming(&http_response)
        4427  +
            // Build a config bag with the protocol for schema-based deserialization
        4428  +
            #[allow(unused_mut)]
        4429  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4430  +
            {
        4431  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4432  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4433  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4434  +
                ));
        4435  +
                test_cfg.push_shared_layer(layer.freeze());
        4436  +
            }
        4437  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 4175   4438   
        });
 4176   4439   
        let parsed = parsed
 4177   4440   
            .expect("should be successful response")
 4178   4441   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 4179   4442   
            .unwrap();
 4180   4443   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 4181   4444   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 4182   4445   
        assert!(
 4183   4446   
            parsed.double.float_equals(&expected_output.double),
 4184   4447   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -4298,4561 +4358,4631 @@
 4318   4581   
            .expect("the config must have a deserializer");
 4319   4582   
 4320   4583   
        let parsed = de.deserialize_streaming(&mut http_response);
 4321   4584   
        let parsed = parsed.unwrap_or_else(|| {
 4322   4585   
            let http_response = http_response.map(|body| {
 4323   4586   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 4324   4587   
                    body.bytes().unwrap(),
 4325   4588   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 4326   4589   
                )))
 4327   4590   
            });
 4328         -
            de.deserialize_nonstreaming(&http_response)
        4591  +
            // Build a config bag with the protocol for schema-based deserialization
        4592  +
            #[allow(unused_mut)]
        4593  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4594  +
            {
        4595  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4596  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4597  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4598  +
                ));
        4599  +
                test_cfg.push_shared_layer(layer.freeze());
        4600  +
            }
        4601  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 4329   4602   
        });
 4330   4603   
        let parsed = parsed
 4331   4604   
            .expect("should be successful response")
 4332   4605   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 4333   4606   
            .unwrap();
 4334   4607   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 4335   4608   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 4336   4609   
        assert!(
 4337   4610   
            parsed.double.float_equals(&expected_output.double),
 4338   4611   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -4464,4737 +4524,4807 @@
 4484   4757   
            .expect("the config must have a deserializer");
 4485   4758   
 4486   4759   
        let parsed = de.deserialize_streaming(&mut http_response);
 4487   4760   
        let parsed = parsed.unwrap_or_else(|| {
 4488   4761   
            let http_response = http_response.map(|body| {
 4489   4762   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 4490   4763   
                    body.bytes().unwrap(),
 4491   4764   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 4492   4765   
                )))
 4493   4766   
            });
 4494         -
            de.deserialize_nonstreaming(&http_response)
        4767  +
            // Build a config bag with the protocol for schema-based deserialization
        4768  +
            #[allow(unused_mut)]
        4769  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4770  +
            {
        4771  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4772  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4773  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4774  +
                ));
        4775  +
                test_cfg.push_shared_layer(layer.freeze());
        4776  +
            }
        4777  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 4495   4778   
        });
 4496   4779   
        let parsed = parsed
 4497   4780   
            .expect("should be successful response")
 4498   4781   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 4499   4782   
            .unwrap();
 4500   4783   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 4501   4784   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 4502   4785   
        assert!(
 4503   4786   
            parsed.double.float_equals(&expected_output.double),
 4504   4787   
            "Unexpected value for `double` {:?} vs. {:?}",
@@ -4600,4883 +4660,4953 @@
 4620   4903   
            .expect("the config must have a deserializer");
 4621   4904   
 4622   4905   
        let parsed = de.deserialize_streaming(&mut http_response);
 4623   4906   
        let parsed = parsed.unwrap_or_else(|| {
 4624   4907   
            let http_response = http_response.map(|body| {
 4625   4908   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 4626   4909   
                    body.bytes().unwrap(),
 4627   4910   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 4628   4911   
                )))
 4629   4912   
            });
 4630         -
            de.deserialize_nonstreaming(&http_response)
        4913  +
            // Build a config bag with the protocol for schema-based deserialization
        4914  +
            #[allow(unused_mut)]
        4915  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        4916  +
            {
        4917  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        4918  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        4919  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        4920  +
                ));
        4921  +
                test_cfg.push_shared_layer(layer.freeze());
        4922  +
            }
        4923  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 4631   4924   
        });
 4632   4925   
        let parsed = parsed
 4633   4926   
            .expect("should be successful response")
 4634   4927   
            .downcast::<crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput>()
 4635   4928   
            .unwrap();
 4636   4929   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
 4637   4930   
        ::pretty_assertions::assert_eq!(parsed.boolean, expected_output.boolean, "Unexpected value for `boolean`");
 4638   4931   
        assert!(
 4639   4932   
            parsed.double.float_equals(&expected_output.double),
 4640   4933   
            "Unexpected value for `double` {:?} vs. {:?}",