Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

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

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

@@ -1,1 +107,123 @@
   17     17   
    "aws.protocoltests.restjson.synthetic",
   18     18   
    "HttpResponseCodeOutput",
   19     19   
);
   20     20   
static HTTPRESPONSECODEOUTPUT_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restjson.synthetic#HttpResponseCodeOutput$Status",
   23     23   
        "aws.protocoltests.restjson.synthetic",
   24     24   
        "HttpResponseCodeOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Integer,
   27         -
    "status",
          27  +
    "Status",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_response_code();
   31     31   
static HTTPRESPONSECODEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPRESPONSECODEOUTPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPRESPONSECODEOUTPUT_MEMBER_STATUS],
   35     35   
);
   36     36   
impl HttpResponseCodeOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPRESPONSECODEOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpResponseCodeOutput {
   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.status {
   47     47   
            ser.write_integer(&HTTPRESPONSECODEOUTPUT_MEMBER_STATUS, *val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpResponseCodeOutput {
   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(&HTTPRESPONSECODEOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPRESPONSECODEOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.status = Some(deser.read_integer(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpResponseCodeOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        _body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        builder.status = Some(_status as i32);
          91  +
        Ok(builder.build())
          92  +
    }
          93  +
}
   78     94   
impl HttpResponseCodeOutput {
   79     95   
    /// Creates a new builder-style object to manufacture [`HttpResponseCodeOutput`](crate::operation::http_response_code::HttpResponseCodeOutput).
   80     96   
    pub fn builder() -> crate::operation::http_response_code::builders::HttpResponseCodeOutputBuilder {
   81     97   
        crate::operation::http_response_code::builders::HttpResponseCodeOutputBuilder::default()
   82     98   
    }
   83     99   
}
   84    100   
   85    101   
/// A builder for [`HttpResponseCodeOutput`](crate::operation::http_response_code::HttpResponseCodeOutput).
   86    102   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    103   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_string_payload.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 `HttpStringPayload`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpStringPayload;
    6      6   
impl HttpStringPayload {
    7      7   
    /// Creates a new `HttpStringPayload`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_string_payload::HttpStringPayloadInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_string_payload::HttpStringPayloadOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::http_string_payload::HttpStringPayloadInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_string_payload::HttpStringPayloadOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_string_payload::HttpStringPayloadError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +234,248 @@
  130    134   
                crate::operation::http_string_payload::HttpStringPayloadError,
  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 HttpStringPayloadResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpStringPayloadResponseDeserializer {
  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_http_string_payload::de_http_string_payload_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::http_string_payload::HttpStringPayloadError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_http_string_payload::de_http_string_payload_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, HttpStringPayload::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::http_string_payload::HttpStringPayloadOutput::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 HttpStringPayloadRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpStringPayloadRequestSerializer {
  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::http_string_payload::HttpStringPayloadInput>()
  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::http_string_payload::HttpStringPayloadInput,
  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, "/StringPayload").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut input = input;
         206  +
        let payload = input.payload.take();
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, HttpStringPayload::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
        if let ::std::option::Option::Some(payload) = payload {
         211  +
            *request.body_mut() = ::aws_smithy_types::body::SdkBody::from(payload.into_bytes());
         212  +
            request.headers_mut().insert("Content-Type", "text/plain");
         213  +
            if let ::std::option::Option::Some(content_length) = request.body().content_length() {
         214  +
                request.headers_mut().insert("Content-Length", content_length.to_string());
  183    215   
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::http_string_payload::HttpStringPayloadInput,
  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, "text/plain");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_http_string_payload_input::ser_payload_http_payload(
  198         -
            input.payload,
  199         -
        )?);
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203    216   
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         217  +
         218  +
        return ::std::result::Result::Ok(request);
  205    219   
    }
  206    220   
}
  207    221   
#[derive(Debug)]
  208    222   
struct HttpStringPayloadEndpointParamsInterceptor;
  209    223   
  210    224   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpStringPayloadEndpointParamsInterceptor {
  211    225   
    fn name(&self) -> &'static str {
  212    226   
        "HttpStringPayloadEndpointParamsInterceptor"
  213    227   
    }
  214    228   
@@ -282,296 +342,366 @@
  302    316   
            .expect("the config must have a deserializer");
  303    317   
  304    318   
        let parsed = de.deserialize_streaming(&mut http_response);
  305    319   
        let parsed = parsed.unwrap_or_else(|| {
  306    320   
            let http_response = http_response.map(|body| {
  307    321   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  308    322   
                    body.bytes().unwrap(),
  309    323   
                    ::aws_smithy_protocol_test::MediaType::from("text/plain"),
  310    324   
                )))
  311    325   
            });
  312         -
            de.deserialize_nonstreaming(&http_response)
         326  +
            // Build a config bag with the protocol for schema-based deserialization
         327  +
            #[allow(unused_mut)]
         328  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         329  +
            {
         330  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         331  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         332  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         333  +
                ));
         334  +
                test_cfg.push_shared_layer(layer.freeze());
         335  +
            }
         336  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  313    337   
        });
  314    338   
        let parsed = parsed
  315    339   
            .expect("should be successful response")
  316    340   
            .downcast::<crate::operation::http_string_payload::HttpStringPayloadOutput>()
  317    341   
            .unwrap();
  318    342   
        ::pretty_assertions::assert_eq!(parsed.payload, expected_output.payload, "Unexpected value for `payload`");
  319    343   
    }
  320    344   
}
  321    345   
  322    346   
/// Error type for the `HttpStringPayloadError` operation.

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

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

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

@@ -24,24 +107,126 @@
   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.payload {
   47     47   
            ser.write_string(&HTTPSTRINGPAYLOADOUTPUT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl HttpStringPayloadOutput {
   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(&HTTPSTRINGPAYLOADOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&HTTPSTRINGPAYLOADOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl HttpStringPayloadOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            let s = ::std::string::String::from_utf8_lossy(body).into_owned();
          92  +
            builder.payload = Some(s);
          93  +
        }
          94  +
        Ok(builder.build())
          95  +
    }
          96  +
}
   78     97   
impl HttpStringPayloadOutput {
   79     98   
    /// Creates a new builder-style object to manufacture [`HttpStringPayloadOutput`](crate::operation::http_string_payload::HttpStringPayloadOutput).
   80     99   
    pub fn builder() -> crate::operation::http_string_payload::builders::HttpStringPayloadOutputBuilder {
   81    100   
        crate::operation::http_string_payload::builders::HttpStringPayloadOutputBuilder::default()
   82    101   
    }
   83    102   
}
   84    103   
   85    104   
/// A builder for [`HttpStringPayloadOutput`](crate::operation::http_string_payload::HttpStringPayloadOutput).
   86    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    106   
#[non_exhaustive]

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `IgnoreQueryParamsInResponse`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct IgnoreQueryParamsInResponse;
    6      6   
impl IgnoreQueryParamsInResponse {
    7      7   
    /// Creates a new `IgnoreQueryParamsInResponse`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct IgnoreQueryParamsInResponseResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for IgnoreQueryParamsInResponseResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, IgnoreQueryParamsInResponse::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct IgnoreQueryParamsInResponseRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for IgnoreQueryParamsInResponseRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseInput,
  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, "/IgnoreQueryParamsInResponse").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, IgnoreQueryParamsInResponse::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    210   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  199    212   
    }
  200    213   
}
  201    214   
#[derive(Debug)]
  202    215   
struct IgnoreQueryParamsInResponseEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for IgnoreQueryParamsInResponseEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "IgnoreQueryParamsInResponseEndpointParamsInterceptor"
  207    220   
    }
  208    221   
@@ -246,259 +306,329 @@
  266    279   
            .expect("the config must have a deserializer");
  267    280   
  268    281   
        let parsed = de.deserialize_streaming(&mut http_response);
  269    282   
        let parsed = parsed.unwrap_or_else(|| {
  270    283   
            let http_response = http_response.map(|body| {
  271    284   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  272    285   
                    body.bytes().unwrap(),
  273    286   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  274    287   
                )))
  275    288   
            });
  276         -
            de.deserialize_nonstreaming(&http_response)
         289  +
            // Build a config bag with the protocol for schema-based deserialization
         290  +
            #[allow(unused_mut)]
         291  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         292  +
            {
         293  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         294  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         295  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         296  +
                ));
         297  +
                test_cfg.push_shared_layer(layer.freeze());
         298  +
            }
         299  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  277    300   
        });
  278    301   
        let parsed = parsed
  279    302   
            .expect("should be successful response")
  280    303   
            .downcast::<crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput>()
  281    304   
            .unwrap();
  282    305   
        ::pretty_assertions::assert_eq!(parsed.baz, expected_output.baz, "Unexpected value for `baz`");
  283    306   
    }
  284    307   
}
  285    308   
  286    309   
/// Error type for the `IgnoreQueryParamsInResponseError` operation.

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

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

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

@@ -24,24 +107,118 @@
   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.baz {
   47     47   
            ser.write_string(&IGNOREQUERYPARAMSINRESPONSEOUTPUT_MEMBER_BAZ, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl IgnoreQueryParamsInResponseOutput {
   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(&IGNOREQUERYPARAMSINRESPONSEOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&IGNOREQUERYPARAMSINRESPONSEOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.baz = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl IgnoreQueryParamsInResponseOutput {
          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  +
}
   78     89   
impl IgnoreQueryParamsInResponseOutput {
   79     90   
    /// Creates a new builder-style object to manufacture [`IgnoreQueryParamsInResponseOutput`](crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput).
   80     91   
    pub fn builder() -> crate::operation::ignore_query_params_in_response::builders::IgnoreQueryParamsInResponseOutputBuilder {
   81     92   
        crate::operation::ignore_query_params_in_response::builders::IgnoreQueryParamsInResponseOutputBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`IgnoreQueryParamsInResponseOutput`](crate::operation::ignore_query_params_in_response::IgnoreQueryParamsInResponseOutput).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `InputAndOutputWithHeaders`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct InputAndOutputWithHeaders;
    6      6   
impl InputAndOutputWithHeaders {
    7      7   
    /// Creates a new `InputAndOutputWithHeaders`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +229,369 @@
  130    136   
                crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct InputAndOutputWithHeadersResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InputAndOutputWithHeadersResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_input_and_output_with_headers::de_input_and_output_with_headers_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_input_and_output_with_headers::de_input_and_output_with_headers_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, InputAndOutputWithHeaders::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct InputAndOutputWithHeadersRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InputAndOutputWithHeadersRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput,
  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, "/InputAndOutputWithHeaders").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, InputAndOutputWithHeaders::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/InputAndOutputWithHeaders".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.header_string {
         215  +
                    request.headers_mut().insert("X-String", val.to_string());
  183    216   
                }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                let builder = crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_headers(input, builder)?;
  192         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  193         -
            }
  194         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         217  +
                if let Some(ref val) = input.header_byte {
         218  +
                    request.headers_mut().insert("X-Byte", val.to_string());
         219  +
                }
         220  +
                if let Some(ref val) = input.header_short {
         221  +
                    request.headers_mut().insert("X-Short", val.to_string());
         222  +
                }
         223  +
                if let Some(ref val) = input.header_integer {
         224  +
                    request.headers_mut().insert("X-Integer", val.to_string());
         225  +
                }
         226  +
                if let Some(ref val) = input.header_long {
         227  +
                    request.headers_mut().insert("X-Long", val.to_string());
         228  +
                }
         229  +
                if let Some(ref val) = input.header_float {
         230  +
                    request.headers_mut().insert("X-Float", {
         231  +
                        let s = val.to_string();
         232  +
                        match s.as_str() {
         233  +
                            "inf" => "Infinity".to_string(),
         234  +
                            "-inf" => "-Infinity".to_string(),
         235  +
                            _ => s,
         236  +
                        }
         237  +
                    });
         238  +
                }
         239  +
                if let Some(ref val) = input.header_double {
         240  +
                    request.headers_mut().insert("X-Double", {
         241  +
                        let s = val.to_string();
         242  +
                        match s.as_str() {
         243  +
                            "inf" => "Infinity".to_string(),
         244  +
                            "-inf" => "-Infinity".to_string(),
         245  +
                            _ => s,
         246  +
                        }
         247  +
                    });
         248  +
                }
         249  +
                if let Some(ref val) = input.header_true_bool {
         250  +
                    request.headers_mut().insert("X-Boolean1", val.to_string());
         251  +
                }
         252  +
                if let Some(ref val) = input.header_false_bool {
         253  +
                    request.headers_mut().insert("X-Boolean2", val.to_string());
         254  +
                }
         255  +
                if let Some(ref val) = input.header_string_list {
         256  +
                    let header_val = val
         257  +
                        .iter()
         258  +
                        .map(|item| {
         259  +
                            let s = item.to_string();
         260  +
                            if s.contains(',') || s.contains('"') {
         261  +
                                format!("\"{}\"", s.replace('\\', "\\\\").replace('"', "\\\""))
         262  +
                            } else {
         263  +
                                s
         264  +
                            }
         265  +
                        })
         266  +
                        .collect::<Vec<_>>()
         267  +
                        .join(", ");
         268  +
                    request.headers_mut().insert("X-StringList", header_val);
         269  +
                }
         270  +
                if let Some(ref val) = input.header_string_set {
         271  +
                    let header_val = val
         272  +
                        .iter()
         273  +
                        .map(|item| {
         274  +
                            let s = item.to_string();
         275  +
                            if s.contains(',') || s.contains('"') {
         276  +
                                format!("\"{}\"", s.replace('\\', "\\\\").replace('"', "\\\""))
         277  +
                            } else {
         278  +
                                s
         279  +
                            }
         280  +
                        })
         281  +
                        .collect::<Vec<_>>()
         282  +
                        .join(", ");
         283  +
                    request.headers_mut().insert("X-StringSet", header_val);
         284  +
                }
         285  +
                if let Some(ref val) = input.header_integer_list {
         286  +
                    let header_val = val.iter().map(|item| item.to_string()).collect::<Vec<_>>().join(", ");
         287  +
                    request.headers_mut().insert("X-IntegerList", header_val);
         288  +
                }
         289  +
                if let Some(ref val) = input.header_boolean_list {
         290  +
                    let header_val = val.iter().map(|item| item.to_string()).collect::<Vec<_>>().join(", ");
         291  +
                    request.headers_mut().insert("X-BooleanList", header_val);
         292  +
                }
         293  +
                if let Some(ref val) = input.header_timestamp_list {
         294  +
                    let header_val = val
         295  +
                        .iter()
         296  +
                        .map(|item| item.fmt(::aws_smithy_types::date_time::Format::HttpDate).expect("valid timestamp"))
         297  +
                        .collect::<Vec<_>>()
         298  +
                        .join(", ");
         299  +
                    request.headers_mut().insert("X-TimestampList", header_val);
         300  +
                }
         301  +
                if let Some(ref val) = input.header_enum {
         302  +
                    request.headers_mut().insert("X-Enum", val.as_str().to_string());
         303  +
                }
         304  +
                if let Some(ref val) = input.header_enum_list {
         305  +
                    let header_val = val.iter().map(|item| item.as_str().to_string()).collect::<Vec<_>>().join(", ");
         306  +
                    request.headers_mut().insert("X-EnumList", header_val);
         307  +
                }
         308  +
                if let Some(ref val) = input.header_integer_enum {
         309  +
                    request.headers_mut().insert("X-IntegerEnum", val.to_string());
         310  +
                }
         311  +
                if let Some(ref val) = input.header_integer_enum_list {
         312  +
                    let header_val = val.iter().map(|item| item.to_string()).collect::<Vec<_>>().join(", ");
         313  +
                    request.headers_mut().insert("X-IntegerEnumList", header_val);
         314  +
                }
         315  +
                if !query_params.is_empty() {
         316  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         317  +
                    let pairs: Vec<String> = query_params
         318  +
                        .iter()
         319  +
                        .map(|(k, v)| {
         320  +
                            format!(
         321  +
                                "{}={}",
         322  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         323  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         324  +
                            )
         325  +
                        })
         326  +
                        .collect();
         327  +
                    uri.push_str(&pairs.join("&"));
         328  +
                }
         329  +
                request.set_uri(uri.as_str()).expect("valid URI");
         330  +
            }
         331  +
         332  +
            return ::std::result::Result::Ok(request);
         333  +
        } else {
         334  +
            let mut request = protocol
         335  +
                .serialize_request(&input, InputAndOutputWithHeaders::INPUT_SCHEMA, "", _cfg)
         336  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  198    337   
  199         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         338  +
            return ::std::result::Result::Ok(request);
         339  +
        }
  200    340   
    }
  201    341   
}
  202    342   
#[derive(Debug)]
  203    343   
struct InputAndOutputWithHeadersEndpointParamsInterceptor;
  204    344   
  205    345   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InputAndOutputWithHeadersEndpointParamsInterceptor {
  206    346   
    fn name(&self) -> &'static str {
  207    347   
        "InputAndOutputWithHeadersEndpointParamsInterceptor"
  208    348   
    }
  209    349   
@@ -603,743 +663,813 @@
  623    763   
            .expect("the config must have a deserializer");
  624    764   
  625    765   
        let parsed = de.deserialize_streaming(&mut http_response);
  626    766   
        let parsed = parsed.unwrap_or_else(|| {
  627    767   
            let http_response = http_response.map(|body| {
  628    768   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  629    769   
                    body.bytes().unwrap(),
  630    770   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  631    771   
                )))
  632    772   
            });
  633         -
            de.deserialize_nonstreaming(&http_response)
         773  +
            // Build a config bag with the protocol for schema-based deserialization
         774  +
            #[allow(unused_mut)]
         775  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         776  +
            {
         777  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         778  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         779  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         780  +
                ));
         781  +
                test_cfg.push_shared_layer(layer.freeze());
         782  +
            }
         783  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  634    784   
        });
  635    785   
        let parsed = parsed
  636    786   
            .expect("should be successful response")
  637    787   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  638    788   
            .unwrap();
  639    789   
        ::pretty_assertions::assert_eq!(
  640    790   
            parsed.header_string,
  641    791   
            expected_output.header_string,
  642    792   
            "Unexpected value for `header_string`"
  643    793   
        );
@@ -720,870 +780,940 @@
  740    890   
            .expect("the config must have a deserializer");
  741    891   
  742    892   
        let parsed = de.deserialize_streaming(&mut http_response);
  743    893   
        let parsed = parsed.unwrap_or_else(|| {
  744    894   
            let http_response = http_response.map(|body| {
  745    895   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  746    896   
                    body.bytes().unwrap(),
  747    897   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  748    898   
                )))
  749    899   
            });
  750         -
            de.deserialize_nonstreaming(&http_response)
         900  +
            // Build a config bag with the protocol for schema-based deserialization
         901  +
            #[allow(unused_mut)]
         902  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         903  +
            {
         904  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         905  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         906  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         907  +
                ));
         908  +
                test_cfg.push_shared_layer(layer.freeze());
         909  +
            }
         910  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  751    911   
        });
  752    912   
        let parsed = parsed
  753    913   
            .expect("should be successful response")
  754    914   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  755    915   
            .unwrap();
  756    916   
        ::pretty_assertions::assert_eq!(
  757    917   
            parsed.header_string,
  758    918   
            expected_output.header_string,
  759    919   
            "Unexpected value for `header_string`"
  760    920   
        );
@@ -849,1009 +909,1079 @@
  869   1029   
            .expect("the config must have a deserializer");
  870   1030   
  871   1031   
        let parsed = de.deserialize_streaming(&mut http_response);
  872   1032   
        let parsed = parsed.unwrap_or_else(|| {
  873   1033   
            let http_response = http_response.map(|body| {
  874   1034   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  875   1035   
                    body.bytes().unwrap(),
  876   1036   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  877   1037   
                )))
  878   1038   
            });
  879         -
            de.deserialize_nonstreaming(&http_response)
        1039  +
            // Build a config bag with the protocol for schema-based deserialization
        1040  +
            #[allow(unused_mut)]
        1041  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1042  +
            {
        1043  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1044  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1045  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1046  +
                ));
        1047  +
                test_cfg.push_shared_layer(layer.freeze());
        1048  +
            }
        1049  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  880   1050   
        });
  881   1051   
        let parsed = parsed
  882   1052   
            .expect("should be successful response")
  883   1053   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  884   1054   
            .unwrap();
  885   1055   
        ::pretty_assertions::assert_eq!(
  886   1056   
            parsed.header_string,
  887   1057   
            expected_output.header_string,
  888   1058   
            "Unexpected value for `header_string`"
  889   1059   
        );
@@ -970,1140 +1030,1210 @@
  990   1160   
            .expect("the config must have a deserializer");
  991   1161   
  992   1162   
        let parsed = de.deserialize_streaming(&mut http_response);
  993   1163   
        let parsed = parsed.unwrap_or_else(|| {
  994   1164   
            let http_response = http_response.map(|body| {
  995   1165   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  996   1166   
                    body.bytes().unwrap(),
  997   1167   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  998   1168   
                )))
  999   1169   
            });
 1000         -
            de.deserialize_nonstreaming(&http_response)
        1170  +
            // Build a config bag with the protocol for schema-based deserialization
        1171  +
            #[allow(unused_mut)]
        1172  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1173  +
            {
        1174  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1175  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1176  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1177  +
                ));
        1178  +
                test_cfg.push_shared_layer(layer.freeze());
        1179  +
            }
        1180  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1001   1181   
        });
 1002   1182   
        let parsed = parsed
 1003   1183   
            .expect("should be successful response")
 1004   1184   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1005   1185   
            .unwrap();
 1006   1186   
        ::pretty_assertions::assert_eq!(
 1007   1187   
            parsed.header_string,
 1008   1188   
            expected_output.header_string,
 1009   1189   
            "Unexpected value for `header_string`"
 1010   1190   
        );
@@ -1090,1270 +1150,1340 @@
 1110   1290   
            .expect("the config must have a deserializer");
 1111   1291   
 1112   1292   
        let parsed = de.deserialize_streaming(&mut http_response);
 1113   1293   
        let parsed = parsed.unwrap_or_else(|| {
 1114   1294   
            let http_response = http_response.map(|body| {
 1115   1295   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1116   1296   
                    body.bytes().unwrap(),
 1117   1297   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1118   1298   
                )))
 1119   1299   
            });
 1120         -
            de.deserialize_nonstreaming(&http_response)
        1300  +
            // Build a config bag with the protocol for schema-based deserialization
        1301  +
            #[allow(unused_mut)]
        1302  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1303  +
            {
        1304  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1305  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1306  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1307  +
                ));
        1308  +
                test_cfg.push_shared_layer(layer.freeze());
        1309  +
            }
        1310  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1121   1311   
        });
 1122   1312   
        let parsed = parsed
 1123   1313   
            .expect("should be successful response")
 1124   1314   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1125   1315   
            .unwrap();
 1126   1316   
        ::pretty_assertions::assert_eq!(
 1127   1317   
            parsed.header_string,
 1128   1318   
            expected_output.header_string,
 1129   1319   
            "Unexpected value for `header_string`"
 1130   1320   
        );
@@ -1215,1405 +1275,1475 @@
 1235   1425   
            .expect("the config must have a deserializer");
 1236   1426   
 1237   1427   
        let parsed = de.deserialize_streaming(&mut http_response);
 1238   1428   
        let parsed = parsed.unwrap_or_else(|| {
 1239   1429   
            let http_response = http_response.map(|body| {
 1240   1430   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1241   1431   
                    body.bytes().unwrap(),
 1242   1432   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1243   1433   
                )))
 1244   1434   
            });
 1245         -
            de.deserialize_nonstreaming(&http_response)
        1435  +
            // Build a config bag with the protocol for schema-based deserialization
        1436  +
            #[allow(unused_mut)]
        1437  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1438  +
            {
        1439  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1440  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1441  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1442  +
                ));
        1443  +
                test_cfg.push_shared_layer(layer.freeze());
        1444  +
            }
        1445  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1246   1446   
        });
 1247   1447   
        let parsed = parsed
 1248   1448   
            .expect("should be successful response")
 1249   1449   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1250   1450   
            .unwrap();
 1251   1451   
        ::pretty_assertions::assert_eq!(
 1252   1452   
            parsed.header_string,
 1253   1453   
            expected_output.header_string,
 1254   1454   
            "Unexpected value for `header_string`"
 1255   1455   
        );
@@ -1334,1534 +1394,1604 @@
 1354   1554   
            .expect("the config must have a deserializer");
 1355   1555   
 1356   1556   
        let parsed = de.deserialize_streaming(&mut http_response);
 1357   1557   
        let parsed = parsed.unwrap_or_else(|| {
 1358   1558   
            let http_response = http_response.map(|body| {
 1359   1559   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1360   1560   
                    body.bytes().unwrap(),
 1361   1561   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1362   1562   
                )))
 1363   1563   
            });
 1364         -
            de.deserialize_nonstreaming(&http_response)
        1564  +
            // Build a config bag with the protocol for schema-based deserialization
        1565  +
            #[allow(unused_mut)]
        1566  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1567  +
            {
        1568  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1569  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1570  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1571  +
                ));
        1572  +
                test_cfg.push_shared_layer(layer.freeze());
        1573  +
            }
        1574  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1365   1575   
        });
 1366   1576   
        let parsed = parsed
 1367   1577   
            .expect("should be successful response")
 1368   1578   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1369   1579   
            .unwrap();
 1370   1580   
        ::pretty_assertions::assert_eq!(
 1371   1581   
            parsed.header_string,
 1372   1582   
            expected_output.header_string,
 1373   1583   
            "Unexpected value for `header_string`"
 1374   1584   
        );
@@ -1457,1667 +1517,1737 @@
 1477   1687   
            .expect("the config must have a deserializer");
 1478   1688   
 1479   1689   
        let parsed = de.deserialize_streaming(&mut http_response);
 1480   1690   
        let parsed = parsed.unwrap_or_else(|| {
 1481   1691   
            let http_response = http_response.map(|body| {
 1482   1692   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1483   1693   
                    body.bytes().unwrap(),
 1484   1694   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1485   1695   
                )))
 1486   1696   
            });
 1487         -
            de.deserialize_nonstreaming(&http_response)
        1697  +
            // Build a config bag with the protocol for schema-based deserialization
        1698  +
            #[allow(unused_mut)]
        1699  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1700  +
            {
        1701  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1702  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1703  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1704  +
                ));
        1705  +
                test_cfg.push_shared_layer(layer.freeze());
        1706  +
            }
        1707  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1488   1708   
        });
 1489   1709   
        let parsed = parsed
 1490   1710   
            .expect("should be successful response")
 1491   1711   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1492   1712   
            .unwrap();
 1493   1713   
        ::pretty_assertions::assert_eq!(
 1494   1714   
            parsed.header_string,
 1495   1715   
            expected_output.header_string,
 1496   1716   
            "Unexpected value for `header_string`"
 1497   1717   
        );
@@ -1580,1800 +1640,1870 @@
 1600   1820   
            .expect("the config must have a deserializer");
 1601   1821   
 1602   1822   
        let parsed = de.deserialize_streaming(&mut http_response);
 1603   1823   
        let parsed = parsed.unwrap_or_else(|| {
 1604   1824   
            let http_response = http_response.map(|body| {
 1605   1825   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1606   1826   
                    body.bytes().unwrap(),
 1607   1827   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1608   1828   
                )))
 1609   1829   
            });
 1610         -
            de.deserialize_nonstreaming(&http_response)
        1830  +
            // Build a config bag with the protocol for schema-based deserialization
        1831  +
            #[allow(unused_mut)]
        1832  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1833  +
            {
        1834  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1835  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1836  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1837  +
                ));
        1838  +
                test_cfg.push_shared_layer(layer.freeze());
        1839  +
            }
        1840  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1611   1841   
        });
 1612   1842   
        let parsed = parsed
 1613   1843   
            .expect("should be successful response")
 1614   1844   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1615   1845   
            .unwrap();
 1616   1846   
        ::pretty_assertions::assert_eq!(
 1617   1847   
            parsed.header_string,
 1618   1848   
            expected_output.header_string,
 1619   1849   
            "Unexpected value for `header_string`"
 1620   1850   
        );
@@ -1703,1933 +1763,2003 @@
 1723   1953   
            .expect("the config must have a deserializer");
 1724   1954   
 1725   1955   
        let parsed = de.deserialize_streaming(&mut http_response);
 1726   1956   
        let parsed = parsed.unwrap_or_else(|| {
 1727   1957   
            let http_response = http_response.map(|body| {
 1728   1958   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1729   1959   
                    body.bytes().unwrap(),
 1730   1960   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1731   1961   
                )))
 1732   1962   
            });
 1733         -
            de.deserialize_nonstreaming(&http_response)
        1963  +
            // Build a config bag with the protocol for schema-based deserialization
        1964  +
            #[allow(unused_mut)]
        1965  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1966  +
            {
        1967  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1968  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1969  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1970  +
                ));
        1971  +
                test_cfg.push_shared_layer(layer.freeze());
        1972  +
            }
        1973  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1734   1974   
        });
 1735   1975   
        let parsed = parsed
 1736   1976   
            .expect("should be successful response")
 1737   1977   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1738   1978   
            .unwrap();
 1739   1979   
        ::pretty_assertions::assert_eq!(
 1740   1980   
            parsed.header_string,
 1741   1981   
            expected_output.header_string,
 1742   1982   
            "Unexpected value for `header_string`"
 1743   1983   
        );

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

@@ -113,113 +387,388 @@
  133    133   
    "aws.protocoltests.restjson.synthetic",
  134    134   
    "InputAndOutputWithHeadersInput",
  135    135   
);
  136    136   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerString",
  139    139   
        "aws.protocoltests.restjson.synthetic",
  140    140   
        "InputAndOutputWithHeadersInput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::String,
  143         -
    "header_string",
         143  +
    "headerString",
  144    144   
    0,
  145    145   
)
  146    146   
.with_http_header("X-String");
  147    147   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  148    148   
    ::aws_smithy_schema::ShapeId::from_static(
  149    149   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerByte",
  150    150   
        "aws.protocoltests.restjson.synthetic",
  151    151   
        "InputAndOutputWithHeadersInput",
  152    152   
    ),
  153    153   
    ::aws_smithy_schema::ShapeType::Byte,
  154         -
    "header_byte",
         154  +
    "headerByte",
  155    155   
    1,
  156    156   
)
  157    157   
.with_http_header("X-Byte");
  158    158   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  159    159   
    ::aws_smithy_schema::ShapeId::from_static(
  160    160   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerShort",
  161    161   
        "aws.protocoltests.restjson.synthetic",
  162    162   
        "InputAndOutputWithHeadersInput",
  163    163   
    ),
  164    164   
    ::aws_smithy_schema::ShapeType::Short,
  165         -
    "header_short",
         165  +
    "headerShort",
  166    166   
    2,
  167    167   
)
  168    168   
.with_http_header("X-Short");
  169    169   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  170    170   
    ::aws_smithy_schema::ShapeId::from_static(
  171    171   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerInteger",
  172    172   
        "aws.protocoltests.restjson.synthetic",
  173    173   
        "InputAndOutputWithHeadersInput",
  174    174   
    ),
  175    175   
    ::aws_smithy_schema::ShapeType::Integer,
  176         -
    "header_integer",
         176  +
    "headerInteger",
  177    177   
    3,
  178    178   
)
  179    179   
.with_http_header("X-Integer");
  180    180   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  181    181   
    ::aws_smithy_schema::ShapeId::from_static(
  182    182   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerLong",
  183    183   
        "aws.protocoltests.restjson.synthetic",
  184    184   
        "InputAndOutputWithHeadersInput",
  185    185   
    ),
  186    186   
    ::aws_smithy_schema::ShapeType::Long,
  187         -
    "header_long",
         187  +
    "headerLong",
  188    188   
    4,
  189    189   
)
  190    190   
.with_http_header("X-Long");
  191    191   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  192    192   
    ::aws_smithy_schema::ShapeId::from_static(
  193    193   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerFloat",
  194    194   
        "aws.protocoltests.restjson.synthetic",
  195    195   
        "InputAndOutputWithHeadersInput",
  196    196   
    ),
  197    197   
    ::aws_smithy_schema::ShapeType::Float,
  198         -
    "header_float",
         198  +
    "headerFloat",
  199    199   
    5,
  200    200   
)
  201    201   
.with_http_header("X-Float");
  202    202   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  203    203   
    ::aws_smithy_schema::ShapeId::from_static(
  204    204   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerDouble",
  205    205   
        "aws.protocoltests.restjson.synthetic",
  206    206   
        "InputAndOutputWithHeadersInput",
  207    207   
    ),
  208    208   
    ::aws_smithy_schema::ShapeType::Double,
  209         -
    "header_double",
         209  +
    "headerDouble",
  210    210   
    6,
  211    211   
)
  212    212   
.with_http_header("X-Double");
  213    213   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TRUE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  214    214   
    ::aws_smithy_schema::ShapeId::from_static(
  215    215   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerTrueBool",
  216    216   
        "aws.protocoltests.restjson.synthetic",
  217    217   
        "InputAndOutputWithHeadersInput",
  218    218   
    ),
  219    219   
    ::aws_smithy_schema::ShapeType::Boolean,
  220         -
    "header_true_bool",
         220  +
    "headerTrueBool",
  221    221   
    7,
  222    222   
)
  223    223   
.with_http_header("X-Boolean1");
  224    224   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FALSE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  225    225   
    ::aws_smithy_schema::ShapeId::from_static(
  226    226   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerFalseBool",
  227    227   
        "aws.protocoltests.restjson.synthetic",
  228    228   
        "InputAndOutputWithHeadersInput",
  229    229   
    ),
  230    230   
    ::aws_smithy_schema::ShapeType::Boolean,
  231         -
    "header_false_bool",
         231  +
    "headerFalseBool",
  232    232   
    8,
  233    233   
)
  234    234   
.with_http_header("X-Boolean2");
  235    235   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  236    236   
    ::aws_smithy_schema::ShapeId::from_static(
  237    237   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerStringList",
  238    238   
        "aws.protocoltests.restjson.synthetic",
  239    239   
        "InputAndOutputWithHeadersInput",
  240    240   
    ),
  241    241   
    ::aws_smithy_schema::ShapeType::List,
  242         -
    "header_string_list",
         242  +
    "headerStringList",
  243    243   
    9,
  244    244   
)
  245    245   
.with_http_header("X-StringList");
  246    246   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  247    247   
    ::aws_smithy_schema::ShapeId::from_static(
  248    248   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerStringSet",
  249    249   
        "aws.protocoltests.restjson.synthetic",
  250    250   
        "InputAndOutputWithHeadersInput",
  251    251   
    ),
  252    252   
    ::aws_smithy_schema::ShapeType::List,
  253         -
    "header_string_set",
         253  +
    "headerStringSet",
  254    254   
    10,
  255    255   
)
  256    256   
.with_http_header("X-StringSet");
  257    257   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  258    258   
    ::aws_smithy_schema::ShapeId::from_static(
  259    259   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerList",
  260    260   
        "aws.protocoltests.restjson.synthetic",
  261    261   
        "InputAndOutputWithHeadersInput",
  262    262   
    ),
  263    263   
    ::aws_smithy_schema::ShapeType::List,
  264         -
    "header_integer_list",
         264  +
    "headerIntegerList",
  265    265   
    11,
  266    266   
)
  267    267   
.with_http_header("X-IntegerList");
  268    268   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  269    269   
    ::aws_smithy_schema::ShapeId::from_static(
  270    270   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerBooleanList",
  271    271   
        "aws.protocoltests.restjson.synthetic",
  272    272   
        "InputAndOutputWithHeadersInput",
  273    273   
    ),
  274    274   
    ::aws_smithy_schema::ShapeType::List,
  275         -
    "header_boolean_list",
         275  +
    "headerBooleanList",
  276    276   
    12,
  277    277   
)
  278    278   
.with_http_header("X-BooleanList");
  279    279   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  280    280   
    ::aws_smithy_schema::ShapeId::from_static(
  281    281   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerTimestampList",
  282    282   
        "aws.protocoltests.restjson.synthetic",
  283    283   
        "InputAndOutputWithHeadersInput",
  284    284   
    ),
  285    285   
    ::aws_smithy_schema::ShapeType::List,
  286         -
    "header_timestamp_list",
         286  +
    "headerTimestampList",
  287    287   
    13,
  288    288   
)
  289    289   
.with_http_header("X-TimestampList");
  290    290   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  291    291   
    ::aws_smithy_schema::ShapeId::from_static(
  292    292   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerEnum",
  293    293   
        "aws.protocoltests.restjson.synthetic",
  294    294   
        "InputAndOutputWithHeadersInput",
  295    295   
    ),
  296    296   
    ::aws_smithy_schema::ShapeType::String,
  297         -
    "header_enum",
         297  +
    "headerEnum",
  298    298   
    14,
  299    299   
)
  300    300   
.with_http_header("X-Enum");
  301    301   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  302    302   
    ::aws_smithy_schema::ShapeId::from_static(
  303    303   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerEnumList",
  304    304   
        "aws.protocoltests.restjson.synthetic",
  305    305   
        "InputAndOutputWithHeadersInput",
  306    306   
    ),
  307    307   
    ::aws_smithy_schema::ShapeType::List,
  308         -
    "header_enum_list",
         308  +
    "headerEnumList",
  309    309   
    15,
  310    310   
)
  311    311   
.with_http_header("X-EnumList");
  312    312   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  313    313   
    ::aws_smithy_schema::ShapeId::from_static(
  314    314   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerEnum",
  315    315   
        "aws.protocoltests.restjson.synthetic",
  316    316   
        "InputAndOutputWithHeadersInput",
  317    317   
    ),
  318    318   
    ::aws_smithy_schema::ShapeType::Integer,
  319         -
    "header_integer_enum",
         319  +
    "headerIntegerEnum",
  320    320   
    16,
  321    321   
)
  322    322   
.with_http_header("X-IntegerEnum");
  323    323   
static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  324    324   
    ::aws_smithy_schema::ShapeId::from_static(
  325    325   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerEnumList",
  326    326   
        "aws.protocoltests.restjson.synthetic",
  327    327   
        "InputAndOutputWithHeadersInput",
  328    328   
    ),
  329    329   
    ::aws_smithy_schema::ShapeType::List,
  330         -
    "header_integer_enum_list",
         330  +
    "headerIntegerEnumList",
  331    331   
    17,
  332    332   
)
  333    333   
.with_http_header("X-IntegerEnumList");
  334    334   
static INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  335    335   
    INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA_ID,
  336    336   
    ::aws_smithy_schema::ShapeType::Structure,
  337    337   
    &[
  338    338   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING,
  339    339   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BYTE,
  340    340   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_SHORT,
  341    341   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER,
  342    342   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_LONG,
  343    343   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FLOAT,
  344    344   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_DOUBLE,
  345    345   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TRUE_BOOL,
  346    346   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FALSE_BOOL,
  347    347   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_LIST,
  348    348   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_SET,
  349    349   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_LIST,
  350    350   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BOOLEAN_LIST,
  351    351   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TIMESTAMP_LIST,
  352    352   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM,
  353    353   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM_LIST,
  354    354   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM,
  355    355   
        &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM_LIST,
  356    356   
    ],
  357         -
);
         357  +
)
         358  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/InputAndOutputWithHeaders", None));
  358    359   
impl InputAndOutputWithHeadersInput {
  359    360   
    /// The schema for this shape.
  360    361   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA;
  361    362   
}
  362    363   
impl ::aws_smithy_schema::serde::SerializableStruct for InputAndOutputWithHeadersInput {
  363    364   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  364    365   
    fn serialize_members(
  365    366   
        &self,
  366    367   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  367    368   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -453,454 +659,779 @@
  473    474   
                    }
  474    475   
                    Ok(())
  475    476   
                },
  476    477   
            )?;
  477    478   
        }
  478    479   
        Ok(())
  479    480   
    }
  480    481   
}
  481    482   
impl InputAndOutputWithHeadersInput {
  482    483   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  483         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  484         -
        deserializer: &mut D,
         484  +
    pub fn deserialize(
         485  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  485    486   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  486    487   
        #[allow(unused_variables, unused_mut)]
  487    488   
        let mut builder = Self::builder();
  488    489   
        #[allow(
  489    490   
            unused_variables,
  490    491   
            unreachable_code,
  491    492   
            clippy::single_match,
  492    493   
            clippy::match_single_binding,
  493    494   
            clippy::diverging_sub_expression
  494    495   
        )]
  495         -
        deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA, (), |_, member, deser| {
         496  +
        deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA, &mut |member, deser| {
  496    497   
            match member.member_index() {
  497    498   
                Some(0) => {
  498    499   
                    builder.header_string = Some(deser.read_string(member)?);
  499    500   
                }
  500    501   
                Some(1) => {
  501    502   
                    builder.header_byte = Some(deser.read_byte(member)?);
  502    503   
                }
  503    504   
                Some(2) => {
  504    505   
                    builder.header_short = Some(deser.read_short(member)?);
  505    506   
                }
  506    507   
                Some(3) => {
  507    508   
                    builder.header_integer = Some(deser.read_integer(member)?);
  508    509   
                }
  509    510   
                Some(4) => {
  510    511   
                    builder.header_long = Some(deser.read_long(member)?);
  511    512   
                }
  512    513   
                Some(5) => {
  513    514   
                    builder.header_float = Some(deser.read_float(member)?);
  514    515   
                }
  515    516   
                Some(6) => {
  516    517   
                    builder.header_double = Some(deser.read_double(member)?);
  517    518   
                }
  518    519   
                Some(7) => {
  519    520   
                    builder.header_true_bool = Some(deser.read_boolean(member)?);
  520    521   
                }
  521    522   
                Some(8) => {
  522    523   
                    builder.header_false_bool = Some(deser.read_boolean(member)?);
  523    524   
                }
  524    525   
                Some(9) => {
  525         -
                    builder.header_string_list = Some({
  526         -
                        let container = if let Some(cap) = deser.container_size() {
  527         -
                            Vec::with_capacity(cap)
  528         -
                        } else {
  529         -
                            Vec::new()
  530         -
                        };
  531         -
                        deser.read_list(member, container, |mut list, deser| {
  532         -
                            list.push(deser.read_string(member)?);
  533         -
                            Ok(list)
  534         -
                        })?
  535         -
                    });
         526  +
                    builder.header_string_list = Some(deser.read_string_list(member)?);
  536    527   
                }
  537    528   
                Some(10) => {
  538         -
                    builder.header_string_set = Some({
  539         -
                        let container = if let Some(cap) = deser.container_size() {
  540         -
                            Vec::with_capacity(cap)
  541         -
                        } else {
  542         -
                            Vec::new()
  543         -
                        };
  544         -
                        deser.read_list(member, container, |mut list, deser| {
  545         -
                            list.push(deser.read_string(member)?);
  546         -
                            Ok(list)
  547         -
                        })?
  548         -
                    });
         529  +
                    builder.header_string_set = Some(deser.read_string_list(member)?);
  549    530   
                }
  550    531   
                Some(11) => {
  551         -
                    builder.header_integer_list = Some({
  552         -
                        let container = if let Some(cap) = deser.container_size() {
  553         -
                            Vec::with_capacity(cap)
  554         -
                        } else {
  555         -
                            Vec::new()
  556         -
                        };
  557         -
                        deser.read_list(member, container, |mut list, deser| {
  558         -
                            list.push(deser.read_integer(member)?);
  559         -
                            Ok(list)
  560         -
                        })?
  561         -
                    });
         532  +
                    builder.header_integer_list = Some(deser.read_integer_list(member)?);
  562    533   
                }
  563    534   
                Some(12) => {
  564    535   
                    builder.header_boolean_list = Some({
  565         -
                        let container = if let Some(cap) = deser.container_size() {
  566         -
                            Vec::with_capacity(cap)
  567         -
                        } else {
  568         -
                            Vec::new()
  569         -
                        };
  570         -
                        deser.read_list(member, container, |mut list, deser| {
  571         -
                            list.push(deser.read_boolean(member)?);
  572         -
                            Ok(list)
  573         -
                        })?
         536  +
                        let mut container = Vec::new();
         537  +
                        deser.read_list(member, &mut |deser| {
         538  +
                            container.push(deser.read_boolean(member)?);
         539  +
                            Ok(())
         540  +
                        })?;
         541  +
                        container
  574    542   
                    });
  575    543   
                }
  576    544   
                Some(13) => {
  577    545   
                    builder.header_timestamp_list = Some({
  578         -
                        let container = if let Some(cap) = deser.container_size() {
  579         -
                            Vec::with_capacity(cap)
  580         -
                        } else {
  581         -
                            Vec::new()
  582         -
                        };
  583         -
                        deser.read_list(member, container, |mut list, deser| {
  584         -
                            list.push(deser.read_timestamp(member)?);
  585         -
                            Ok(list)
  586         -
                        })?
         546  +
                        let mut container = Vec::new();
         547  +
                        deser.read_list(member, &mut |deser| {
         548  +
                            container.push(deser.read_timestamp(member)?);
         549  +
                            Ok(())
         550  +
                        })?;
         551  +
                        container
  587    552   
                    });
  588    553   
                }
  589    554   
                Some(14) => {
  590    555   
                    builder.header_enum = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  591    556   
                }
  592    557   
                Some(15) => {
  593    558   
                    builder.header_enum_list = Some({
  594         -
                        let container = if let Some(cap) = deser.container_size() {
  595         -
                            Vec::with_capacity(cap)
  596         -
                        } else {
  597         -
                            Vec::new()
  598         -
                        };
  599         -
                        deser.read_list(member, container, |mut list, deser| {
  600         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  601         -
                            Ok(list)
  602         -
                        })?
         559  +
                        let mut container = Vec::new();
         560  +
                        deser.read_list(member, &mut |deser| {
         561  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         562  +
                            Ok(())
         563  +
                        })?;
         564  +
                        container
  603    565   
                    });
  604    566   
                }
  605    567   
                Some(16) => {
  606    568   
                    builder.header_integer_enum = Some(deser.read_integer(member)?);
  607    569   
                }
  608    570   
                Some(17) => {
  609         -
                    builder.header_integer_enum_list = Some({
  610         -
                        let container = if let Some(cap) = deser.container_size() {
  611         -
                            Vec::with_capacity(cap)
  612         -
                        } else {
  613         -
                            Vec::new()
  614         -
                        };
  615         -
                        deser.read_list(member, container, |mut list, deser| {
  616         -
                            list.push(deser.read_integer(member)?);
  617         -
                            Ok(list)
  618         -
                        })?
  619         -
                    });
         571  +
                    builder.header_integer_enum_list = Some(deser.read_integer_list(member)?);
  620    572   
                }
  621    573   
                _ => {}
  622    574   
            }
  623    575   
            Ok(())
  624    576   
        })?;
  625    577   
        builder
  626    578   
            .build()
  627    579   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  628    580   
    }
  629    581   
}
         582  +
impl InputAndOutputWithHeadersInput {
         583  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         584  +
    /// Header-bound members are read directly from headers, avoiding runtime
         585  +
    /// member iteration overhead. Body members are read via the deserializer.
         586  +
    pub fn deserialize_with_response(
         587  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         588  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         589  +
        _status: u16,
         590  +
        _body: &[u8],
         591  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         592  +
        #[allow(unused_variables, unused_mut)]
         593  +
        let mut builder = Self::builder();
         594  +
        if let Some(val) = headers.get("X-String") {
         595  +
            builder.header_string = Some(val.to_string());
         596  +
        }
         597  +
        if let Some(val) = headers.get("X-Byte") {
         598  +
            builder.header_byte = val.parse::<i8>().ok();
         599  +
        }
         600  +
        if let Some(val) = headers.get("X-Short") {
         601  +
            builder.header_short = val.parse::<i16>().ok();
         602  +
        }
         603  +
        if let Some(val) = headers.get("X-Integer") {
         604  +
            builder.header_integer = val.parse::<i32>().ok();
         605  +
        }
         606  +
        if let Some(val) = headers.get("X-Long") {
         607  +
            builder.header_long = val.parse::<i64>().ok();
         608  +
        }
         609  +
        if let Some(val) = headers.get("X-Float") {
         610  +
            builder.header_float = val.parse::<f32>().ok();
         611  +
        }
         612  +
        if let Some(val) = headers.get("X-Double") {
         613  +
            builder.header_double = val.parse::<f64>().ok();
         614  +
        }
         615  +
        if let Some(val) = headers.get("X-Boolean1") {
         616  +
            builder.header_true_bool = val.parse::<bool>().ok();
         617  +
        }
         618  +
        if let Some(val) = headers.get("X-Boolean2") {
         619  +
            builder.header_false_bool = val.parse::<bool>().ok();
         620  +
        }
         621  +
        if let Some(val) = headers.get("X-StringList") {
         622  +
            builder.header_string_list = {
         623  +
                let mut items = Vec::new();
         624  +
                let mut chars = val.chars().peekable();
         625  +
                while chars.peek().is_some() {
         626  +
                    // Skip whitespace
         627  +
                    while chars.peek() == Some(&' ') {
         628  +
                        chars.next();
         629  +
                    }
         630  +
                    if chars.peek() == Some(&'"') {
         631  +
                        chars.next(); // skip opening quote
         632  +
                        let mut s = String::new();
         633  +
                        while let Some(&c) = chars.peek() {
         634  +
                            if c == '\\' {
         635  +
                                chars.next();
         636  +
                                if let Some(escaped) = chars.next() {
         637  +
                                    s.push(escaped);
         638  +
                                }
         639  +
                            } else if c == '"' {
         640  +
                                chars.next();
         641  +
                                break;
         642  +
                            } else {
         643  +
                                s.push(c);
         644  +
                                chars.next();
         645  +
                            }
         646  +
                        }
         647  +
                        items.push(s);
         648  +
                    } else {
         649  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         650  +
                        let trimmed = s.trim();
         651  +
                        if !trimmed.is_empty() {
         652  +
                            items.push(trimmed.to_string());
         653  +
                        }
         654  +
                    }
         655  +
                    // Skip comma separator
         656  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         657  +
                        chars.next();
         658  +
                    }
         659  +
                }
         660  +
                Some(items)
         661  +
            };
         662  +
        }
         663  +
        if let Some(val) = headers.get("X-StringSet") {
         664  +
            builder.header_string_set = {
         665  +
                let mut items = Vec::new();
         666  +
                let mut chars = val.chars().peekable();
         667  +
                while chars.peek().is_some() {
         668  +
                    // Skip whitespace
         669  +
                    while chars.peek() == Some(&' ') {
         670  +
                        chars.next();
         671  +
                    }
         672  +
                    if chars.peek() == Some(&'"') {
         673  +
                        chars.next(); // skip opening quote
         674  +
                        let mut s = String::new();
         675  +
                        while let Some(&c) = chars.peek() {
         676  +
                            if c == '\\' {
         677  +
                                chars.next();
         678  +
                                if let Some(escaped) = chars.next() {
         679  +
                                    s.push(escaped);
         680  +
                                }
         681  +
                            } else if c == '"' {
         682  +
                                chars.next();
         683  +
                                break;
         684  +
                            } else {
         685  +
                                s.push(c);
         686  +
                                chars.next();
         687  +
                            }
         688  +
                        }
         689  +
                        items.push(s);
         690  +
                    } else {
         691  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         692  +
                        let trimmed = s.trim();
         693  +
                        if !trimmed.is_empty() {
         694  +
                            items.push(trimmed.to_string());
         695  +
                        }
         696  +
                    }
         697  +
                    // Skip comma separator
         698  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         699  +
                        chars.next();
         700  +
                    }
         701  +
                }
         702  +
                Some(items)
         703  +
            };
         704  +
        }
         705  +
        if let Some(val) = headers.get("X-IntegerList") {
         706  +
            builder.header_integer_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
         707  +
        }
         708  +
        if let Some(val) = headers.get("X-BooleanList") {
         709  +
            builder.header_boolean_list = Some(val.split(',').filter_map(|s| s.trim().parse::<bool>().ok()).collect());
         710  +
        }
         711  +
        if let Some(val) = headers.get("X-TimestampList") {
         712  +
            builder.header_timestamp_list = {
         713  +
                let mut timestamps = Vec::new();
         714  +
                let re_split: Vec<&str> = val.split(", ").collect();
         715  +
                let mut i = 0;
         716  +
                while i < re_split.len() {
         717  +
                    if i + 1 < re_split.len() {
         718  +
                        let combined = format!("{}, {}", re_split[i], re_split[i + 1]);
         719  +
                        if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(&combined, ::aws_smithy_types::date_time::Format::HttpDate) {
         720  +
                            timestamps.push(ts);
         721  +
                            i += 2;
         722  +
                            continue;
         723  +
                        }
         724  +
                    }
         725  +
                    if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(re_split[i].trim(), ::aws_smithy_types::date_time::Format::HttpDate) {
         726  +
                        timestamps.push(ts);
         727  +
                    }
         728  +
                    i += 1;
         729  +
                }
         730  +
                Some(timestamps)
         731  +
            };
         732  +
        }
         733  +
        if let Some(val) = headers.get("X-Enum") {
         734  +
            builder.header_enum = Some(crate::types::FooEnum::from(val));
         735  +
        }
         736  +
        if let Some(val) = headers.get("X-EnumList") {
         737  +
            builder.header_enum_list = Some(val.split(',').map(|s| crate::types::FooEnum::from(s.trim())).collect());
         738  +
        }
         739  +
        if let Some(val) = headers.get("X-IntegerEnum") {
         740  +
            builder.header_integer_enum = val.parse::<i32>().ok();
         741  +
        }
         742  +
        if let Some(val) = headers.get("X-IntegerEnumList") {
         743  +
            builder.header_integer_enum_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
         744  +
        }
         745  +
        builder
         746  +
            .build()
         747  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         748  +
    }
         749  +
}
  630    750   
impl InputAndOutputWithHeadersInput {
  631    751   
    /// Creates a new builder-style object to manufacture [`InputAndOutputWithHeadersInput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput).
  632    752   
    pub fn builder() -> crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersInputBuilder {
  633    753   
        crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersInputBuilder::default()
  634    754   
    }
  635    755   
}
  636    756   
  637    757   
/// A builder for [`InputAndOutputWithHeadersInput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput).
  638    758   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  639    759   
#[non_exhaustive]

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

@@ -113,113 +360,360 @@
  133    133   
    "aws.protocoltests.restjson.synthetic",
  134    134   
    "InputAndOutputWithHeadersOutput",
  135    135   
);
  136    136   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerString",
  139    139   
        "aws.protocoltests.restjson.synthetic",
  140    140   
        "InputAndOutputWithHeadersOutput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::String,
  143         -
    "header_string",
         143  +
    "headerString",
  144    144   
    0,
  145    145   
)
  146    146   
.with_http_header("X-String");
  147    147   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  148    148   
    ::aws_smithy_schema::ShapeId::from_static(
  149    149   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerByte",
  150    150   
        "aws.protocoltests.restjson.synthetic",
  151    151   
        "InputAndOutputWithHeadersOutput",
  152    152   
    ),
  153    153   
    ::aws_smithy_schema::ShapeType::Byte,
  154         -
    "header_byte",
         154  +
    "headerByte",
  155    155   
    1,
  156    156   
)
  157    157   
.with_http_header("X-Byte");
  158    158   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  159    159   
    ::aws_smithy_schema::ShapeId::from_static(
  160    160   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerShort",
  161    161   
        "aws.protocoltests.restjson.synthetic",
  162    162   
        "InputAndOutputWithHeadersOutput",
  163    163   
    ),
  164    164   
    ::aws_smithy_schema::ShapeType::Short,
  165         -
    "header_short",
         165  +
    "headerShort",
  166    166   
    2,
  167    167   
)
  168    168   
.with_http_header("X-Short");
  169    169   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  170    170   
    ::aws_smithy_schema::ShapeId::from_static(
  171    171   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerInteger",
  172    172   
        "aws.protocoltests.restjson.synthetic",
  173    173   
        "InputAndOutputWithHeadersOutput",
  174    174   
    ),
  175    175   
    ::aws_smithy_schema::ShapeType::Integer,
  176         -
    "header_integer",
         176  +
    "headerInteger",
  177    177   
    3,
  178    178   
)
  179    179   
.with_http_header("X-Integer");
  180    180   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  181    181   
    ::aws_smithy_schema::ShapeId::from_static(
  182    182   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerLong",
  183    183   
        "aws.protocoltests.restjson.synthetic",
  184    184   
        "InputAndOutputWithHeadersOutput",
  185    185   
    ),
  186    186   
    ::aws_smithy_schema::ShapeType::Long,
  187         -
    "header_long",
         187  +
    "headerLong",
  188    188   
    4,
  189    189   
)
  190    190   
.with_http_header("X-Long");
  191    191   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  192    192   
    ::aws_smithy_schema::ShapeId::from_static(
  193    193   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerFloat",
  194    194   
        "aws.protocoltests.restjson.synthetic",
  195    195   
        "InputAndOutputWithHeadersOutput",
  196    196   
    ),
  197    197   
    ::aws_smithy_schema::ShapeType::Float,
  198         -
    "header_float",
         198  +
    "headerFloat",
  199    199   
    5,
  200    200   
)
  201    201   
.with_http_header("X-Float");
  202    202   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  203    203   
    ::aws_smithy_schema::ShapeId::from_static(
  204    204   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerDouble",
  205    205   
        "aws.protocoltests.restjson.synthetic",
  206    206   
        "InputAndOutputWithHeadersOutput",
  207    207   
    ),
  208    208   
    ::aws_smithy_schema::ShapeType::Double,
  209         -
    "header_double",
         209  +
    "headerDouble",
  210    210   
    6,
  211    211   
)
  212    212   
.with_http_header("X-Double");
  213    213   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_TRUE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  214    214   
    ::aws_smithy_schema::ShapeId::from_static(
  215    215   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerTrueBool",
  216    216   
        "aws.protocoltests.restjson.synthetic",
  217    217   
        "InputAndOutputWithHeadersOutput",
  218    218   
    ),
  219    219   
    ::aws_smithy_schema::ShapeType::Boolean,
  220         -
    "header_true_bool",
         220  +
    "headerTrueBool",
  221    221   
    7,
  222    222   
)
  223    223   
.with_http_header("X-Boolean1");
  224    224   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_FALSE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  225    225   
    ::aws_smithy_schema::ShapeId::from_static(
  226    226   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerFalseBool",
  227    227   
        "aws.protocoltests.restjson.synthetic",
  228    228   
        "InputAndOutputWithHeadersOutput",
  229    229   
    ),
  230    230   
    ::aws_smithy_schema::ShapeType::Boolean,
  231         -
    "header_false_bool",
         231  +
    "headerFalseBool",
  232    232   
    8,
  233    233   
)
  234    234   
.with_http_header("X-Boolean2");
  235    235   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  236    236   
    ::aws_smithy_schema::ShapeId::from_static(
  237    237   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerStringList",
  238    238   
        "aws.protocoltests.restjson.synthetic",
  239    239   
        "InputAndOutputWithHeadersOutput",
  240    240   
    ),
  241    241   
    ::aws_smithy_schema::ShapeType::List,
  242         -
    "header_string_list",
         242  +
    "headerStringList",
  243    243   
    9,
  244    244   
)
  245    245   
.with_http_header("X-StringList");
  246    246   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  247    247   
    ::aws_smithy_schema::ShapeId::from_static(
  248    248   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerStringSet",
  249    249   
        "aws.protocoltests.restjson.synthetic",
  250    250   
        "InputAndOutputWithHeadersOutput",
  251    251   
    ),
  252    252   
    ::aws_smithy_schema::ShapeType::List,
  253         -
    "header_string_set",
         253  +
    "headerStringSet",
  254    254   
    10,
  255    255   
)
  256    256   
.with_http_header("X-StringSet");
  257    257   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  258    258   
    ::aws_smithy_schema::ShapeId::from_static(
  259    259   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerIntegerList",
  260    260   
        "aws.protocoltests.restjson.synthetic",
  261    261   
        "InputAndOutputWithHeadersOutput",
  262    262   
    ),
  263    263   
    ::aws_smithy_schema::ShapeType::List,
  264         -
    "header_integer_list",
         264  +
    "headerIntegerList",
  265    265   
    11,
  266    266   
)
  267    267   
.with_http_header("X-IntegerList");
  268    268   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  269    269   
    ::aws_smithy_schema::ShapeId::from_static(
  270    270   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerBooleanList",
  271    271   
        "aws.protocoltests.restjson.synthetic",
  272    272   
        "InputAndOutputWithHeadersOutput",
  273    273   
    ),
  274    274   
    ::aws_smithy_schema::ShapeType::List,
  275         -
    "header_boolean_list",
         275  +
    "headerBooleanList",
  276    276   
    12,
  277    277   
)
  278    278   
.with_http_header("X-BooleanList");
  279    279   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  280    280   
    ::aws_smithy_schema::ShapeId::from_static(
  281    281   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerTimestampList",
  282    282   
        "aws.protocoltests.restjson.synthetic",
  283    283   
        "InputAndOutputWithHeadersOutput",
  284    284   
    ),
  285    285   
    ::aws_smithy_schema::ShapeType::List,
  286         -
    "header_timestamp_list",
         286  +
    "headerTimestampList",
  287    287   
    13,
  288    288   
)
  289    289   
.with_http_header("X-TimestampList");
  290    290   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  291    291   
    ::aws_smithy_schema::ShapeId::from_static(
  292    292   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerEnum",
  293    293   
        "aws.protocoltests.restjson.synthetic",
  294    294   
        "InputAndOutputWithHeadersOutput",
  295    295   
    ),
  296    296   
    ::aws_smithy_schema::ShapeType::String,
  297         -
    "header_enum",
         297  +
    "headerEnum",
  298    298   
    14,
  299    299   
)
  300    300   
.with_http_header("X-Enum");
  301    301   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  302    302   
    ::aws_smithy_schema::ShapeId::from_static(
  303    303   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerEnumList",
  304    304   
        "aws.protocoltests.restjson.synthetic",
  305    305   
        "InputAndOutputWithHeadersOutput",
  306    306   
    ),
  307    307   
    ::aws_smithy_schema::ShapeType::List,
  308         -
    "header_enum_list",
         308  +
    "headerEnumList",
  309    309   
    15,
  310    310   
)
  311    311   
.with_http_header("X-EnumList");
  312    312   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_INTEGER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  313    313   
    ::aws_smithy_schema::ShapeId::from_static(
  314    314   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerIntegerEnum",
  315    315   
        "aws.protocoltests.restjson.synthetic",
  316    316   
        "InputAndOutputWithHeadersOutput",
  317    317   
    ),
  318    318   
    ::aws_smithy_schema::ShapeType::Integer,
  319         -
    "header_integer_enum",
         319  +
    "headerIntegerEnum",
  320    320   
    16,
  321    321   
)
  322    322   
.with_http_header("X-IntegerEnum");
  323    323   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_INTEGER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  324    324   
    ::aws_smithy_schema::ShapeId::from_static(
  325    325   
        "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersOutput$headerIntegerEnumList",
  326    326   
        "aws.protocoltests.restjson.synthetic",
  327    327   
        "InputAndOutputWithHeadersOutput",
  328    328   
    ),
  329    329   
    ::aws_smithy_schema::ShapeType::List,
  330         -
    "header_integer_enum_list",
         330  +
    "headerIntegerEnumList",
  331    331   
    17,
  332    332   
)
  333    333   
.with_http_header("X-IntegerEnumList");
  334    334   
static INPUTANDOUTPUTWITHHEADERSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  335    335   
    INPUTANDOUTPUTWITHHEADERSOUTPUT_SCHEMA_ID,
  336    336   
    ::aws_smithy_schema::ShapeType::Structure,
  337    337   
    &[
  338    338   
        &INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_STRING,
  339    339   
        &INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_BYTE,
  340    340   
        &INPUTANDOUTPUTWITHHEADERSOUTPUT_MEMBER_HEADER_SHORT,
@@ -453,453 +657,774 @@
  473    473   
                    }
  474    474   
                    Ok(())
  475    475   
                },
  476    476   
            )?;
  477    477   
        }
  478    478   
        Ok(())
  479    479   
    }
  480    480   
}
  481    481   
impl InputAndOutputWithHeadersOutput {
  482    482   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  483         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  484         -
        deserializer: &mut D,
         483  +
    pub fn deserialize(
         484  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  485    485   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  486    486   
        #[allow(unused_variables, unused_mut)]
  487    487   
        let mut builder = Self::builder();
  488    488   
        #[allow(
  489    489   
            unused_variables,
  490    490   
            unreachable_code,
  491    491   
            clippy::single_match,
  492    492   
            clippy::match_single_binding,
  493    493   
            clippy::diverging_sub_expression
  494    494   
        )]
  495         -
        deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSOUTPUT_SCHEMA, (), |_, member, deser| {
         495  +
        deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSOUTPUT_SCHEMA, &mut |member, deser| {
  496    496   
            match member.member_index() {
  497    497   
                Some(0) => {
  498    498   
                    builder.header_string = Some(deser.read_string(member)?);
  499    499   
                }
  500    500   
                Some(1) => {
  501    501   
                    builder.header_byte = Some(deser.read_byte(member)?);
  502    502   
                }
  503    503   
                Some(2) => {
  504    504   
                    builder.header_short = Some(deser.read_short(member)?);
  505    505   
                }
  506    506   
                Some(3) => {
  507    507   
                    builder.header_integer = Some(deser.read_integer(member)?);
  508    508   
                }
  509    509   
                Some(4) => {
  510    510   
                    builder.header_long = Some(deser.read_long(member)?);
  511    511   
                }
  512    512   
                Some(5) => {
  513    513   
                    builder.header_float = Some(deser.read_float(member)?);
  514    514   
                }
  515    515   
                Some(6) => {
  516    516   
                    builder.header_double = Some(deser.read_double(member)?);
  517    517   
                }
  518    518   
                Some(7) => {
  519    519   
                    builder.header_true_bool = Some(deser.read_boolean(member)?);
  520    520   
                }
  521    521   
                Some(8) => {
  522    522   
                    builder.header_false_bool = Some(deser.read_boolean(member)?);
  523    523   
                }
  524    524   
                Some(9) => {
  525         -
                    builder.header_string_list = Some({
  526         -
                        let container = if let Some(cap) = deser.container_size() {
  527         -
                            Vec::with_capacity(cap)
  528         -
                        } else {
  529         -
                            Vec::new()
  530         -
                        };
  531         -
                        deser.read_list(member, container, |mut list, deser| {
  532         -
                            list.push(deser.read_string(member)?);
  533         -
                            Ok(list)
  534         -
                        })?
  535         -
                    });
         525  +
                    builder.header_string_list = Some(deser.read_string_list(member)?);
  536    526   
                }
  537    527   
                Some(10) => {
  538         -
                    builder.header_string_set = Some({
  539         -
                        let container = if let Some(cap) = deser.container_size() {
  540         -
                            Vec::with_capacity(cap)
  541         -
                        } else {
  542         -
                            Vec::new()
  543         -
                        };
  544         -
                        deser.read_list(member, container, |mut list, deser| {
  545         -
                            list.push(deser.read_string(member)?);
  546         -
                            Ok(list)
  547         -
                        })?
  548         -
                    });
         528  +
                    builder.header_string_set = Some(deser.read_string_list(member)?);
  549    529   
                }
  550    530   
                Some(11) => {
  551         -
                    builder.header_integer_list = Some({
  552         -
                        let container = if let Some(cap) = deser.container_size() {
  553         -
                            Vec::with_capacity(cap)
  554         -
                        } else {
  555         -
                            Vec::new()
  556         -
                        };
  557         -
                        deser.read_list(member, container, |mut list, deser| {
  558         -
                            list.push(deser.read_integer(member)?);
  559         -
                            Ok(list)
  560         -
                        })?
  561         -
                    });
         531  +
                    builder.header_integer_list = Some(deser.read_integer_list(member)?);
  562    532   
                }
  563    533   
                Some(12) => {
  564    534   
                    builder.header_boolean_list = Some({
  565         -
                        let container = if let Some(cap) = deser.container_size() {
  566         -
                            Vec::with_capacity(cap)
  567         -
                        } else {
  568         -
                            Vec::new()
  569         -
                        };
  570         -
                        deser.read_list(member, container, |mut list, deser| {
  571         -
                            list.push(deser.read_boolean(member)?);
  572         -
                            Ok(list)
  573         -
                        })?
         535  +
                        let mut container = Vec::new();
         536  +
                        deser.read_list(member, &mut |deser| {
         537  +
                            container.push(deser.read_boolean(member)?);
         538  +
                            Ok(())
         539  +
                        })?;
         540  +
                        container
  574    541   
                    });
  575    542   
                }
  576    543   
                Some(13) => {
  577    544   
                    builder.header_timestamp_list = Some({
  578         -
                        let container = if let Some(cap) = deser.container_size() {
  579         -
                            Vec::with_capacity(cap)
  580         -
                        } else {
  581         -
                            Vec::new()
  582         -
                        };
  583         -
                        deser.read_list(member, container, |mut list, deser| {
  584         -
                            list.push(deser.read_timestamp(member)?);
  585         -
                            Ok(list)
  586         -
                        })?
         545  +
                        let mut container = Vec::new();
         546  +
                        deser.read_list(member, &mut |deser| {
         547  +
                            container.push(deser.read_timestamp(member)?);
         548  +
                            Ok(())
         549  +
                        })?;
         550  +
                        container
  587    551   
                    });
  588    552   
                }
  589    553   
                Some(14) => {
  590    554   
                    builder.header_enum = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  591    555   
                }
  592    556   
                Some(15) => {
  593    557   
                    builder.header_enum_list = Some({
  594         -
                        let container = if let Some(cap) = deser.container_size() {
  595         -
                            Vec::with_capacity(cap)
  596         -
                        } else {
  597         -
                            Vec::new()
  598         -
                        };
  599         -
                        deser.read_list(member, container, |mut list, deser| {
  600         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  601         -
                            Ok(list)
  602         -
                        })?
         558  +
                        let mut container = Vec::new();
         559  +
                        deser.read_list(member, &mut |deser| {
         560  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         561  +
                            Ok(())
         562  +
                        })?;
         563  +
                        container
  603    564   
                    });
  604    565   
                }
  605    566   
                Some(16) => {
  606    567   
                    builder.header_integer_enum = Some(deser.read_integer(member)?);
  607    568   
                }
  608    569   
                Some(17) => {
  609         -
                    builder.header_integer_enum_list = Some({
  610         -
                        let container = if let Some(cap) = deser.container_size() {
  611         -
                            Vec::with_capacity(cap)
  612         -
                        } else {
  613         -
                            Vec::new()
  614         -
                        };
  615         -
                        deser.read_list(member, container, |mut list, deser| {
  616         -
                            list.push(deser.read_integer(member)?);
  617         -
                            Ok(list)
  618         -
                        })?
  619         -
                    });
         570  +
                    builder.header_integer_enum_list = Some(deser.read_integer_list(member)?);
  620    571   
                }
  621    572   
                _ => {}
  622    573   
            }
  623    574   
            Ok(())
  624    575   
        })?;
  625    576   
        Ok(builder.build())
  626    577   
    }
  627    578   
}
         579  +
impl InputAndOutputWithHeadersOutput {
         580  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         581  +
    /// Header-bound members are read directly from headers, avoiding runtime
         582  +
    /// member iteration overhead. Body members are read via the deserializer.
         583  +
    pub fn deserialize_with_response(
         584  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         585  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         586  +
        _status: u16,
         587  +
        _body: &[u8],
         588  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         589  +
        #[allow(unused_variables, unused_mut)]
         590  +
        let mut builder = Self::builder();
         591  +
        if let Some(val) = headers.get("X-String") {
         592  +
            builder.header_string = Some(val.to_string());
         593  +
        }
         594  +
        if let Some(val) = headers.get("X-Byte") {
         595  +
            builder.header_byte = val.parse::<i8>().ok();
         596  +
        }
         597  +
        if let Some(val) = headers.get("X-Short") {
         598  +
            builder.header_short = val.parse::<i16>().ok();
         599  +
        }
         600  +
        if let Some(val) = headers.get("X-Integer") {
         601  +
            builder.header_integer = val.parse::<i32>().ok();
         602  +
        }
         603  +
        if let Some(val) = headers.get("X-Long") {
         604  +
            builder.header_long = val.parse::<i64>().ok();
         605  +
        }
         606  +
        if let Some(val) = headers.get("X-Float") {
         607  +
            builder.header_float = val.parse::<f32>().ok();
         608  +
        }
         609  +
        if let Some(val) = headers.get("X-Double") {
         610  +
            builder.header_double = val.parse::<f64>().ok();
         611  +
        }
         612  +
        if let Some(val) = headers.get("X-Boolean1") {
         613  +
            builder.header_true_bool = val.parse::<bool>().ok();
         614  +
        }
         615  +
        if let Some(val) = headers.get("X-Boolean2") {
         616  +
            builder.header_false_bool = val.parse::<bool>().ok();
         617  +
        }
         618  +
        if let Some(val) = headers.get("X-StringList") {
         619  +
            builder.header_string_list = {
         620  +
                let mut items = Vec::new();
         621  +
                let mut chars = val.chars().peekable();
         622  +
                while chars.peek().is_some() {
         623  +
                    // Skip whitespace
         624  +
                    while chars.peek() == Some(&' ') {
         625  +
                        chars.next();
         626  +
                    }
         627  +
                    if chars.peek() == Some(&'"') {
         628  +
                        chars.next(); // skip opening quote
         629  +
                        let mut s = String::new();
         630  +
                        while let Some(&c) = chars.peek() {
         631  +
                            if c == '\\' {
         632  +
                                chars.next();
         633  +
                                if let Some(escaped) = chars.next() {
         634  +
                                    s.push(escaped);
         635  +
                                }
         636  +
                            } else if c == '"' {
         637  +
                                chars.next();
         638  +
                                break;
         639  +
                            } else {
         640  +
                                s.push(c);
         641  +
                                chars.next();
         642  +
                            }
         643  +
                        }
         644  +
                        items.push(s);
         645  +
                    } else {
         646  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         647  +
                        let trimmed = s.trim();
         648  +
                        if !trimmed.is_empty() {
         649  +
                            items.push(trimmed.to_string());
         650  +
                        }
         651  +
                    }
         652  +
                    // Skip comma separator
         653  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         654  +
                        chars.next();
         655  +
                    }
         656  +
                }
         657  +
                Some(items)
         658  +
            };
         659  +
        }
         660  +
        if let Some(val) = headers.get("X-StringSet") {
         661  +
            builder.header_string_set = {
         662  +
                let mut items = Vec::new();
         663  +
                let mut chars = val.chars().peekable();
         664  +
                while chars.peek().is_some() {
         665  +
                    // Skip whitespace
         666  +
                    while chars.peek() == Some(&' ') {
         667  +
                        chars.next();
         668  +
                    }
         669  +
                    if chars.peek() == Some(&'"') {
         670  +
                        chars.next(); // skip opening quote
         671  +
                        let mut s = String::new();
         672  +
                        while let Some(&c) = chars.peek() {
         673  +
                            if c == '\\' {
         674  +
                                chars.next();
         675  +
                                if let Some(escaped) = chars.next() {
         676  +
                                    s.push(escaped);
         677  +
                                }
         678  +
                            } else if c == '"' {
         679  +
                                chars.next();
         680  +
                                break;
         681  +
                            } else {
         682  +
                                s.push(c);
         683  +
                                chars.next();
         684  +
                            }
         685  +
                        }
         686  +
                        items.push(s);
         687  +
                    } else {
         688  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         689  +
                        let trimmed = s.trim();
         690  +
                        if !trimmed.is_empty() {
         691  +
                            items.push(trimmed.to_string());
         692  +
                        }
         693  +
                    }
         694  +
                    // Skip comma separator
         695  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         696  +
                        chars.next();
         697  +
                    }
         698  +
                }
         699  +
                Some(items)
         700  +
            };
         701  +
        }
         702  +
        if let Some(val) = headers.get("X-IntegerList") {
         703  +
            builder.header_integer_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
         704  +
        }
         705  +
        if let Some(val) = headers.get("X-BooleanList") {
         706  +
            builder.header_boolean_list = Some(val.split(',').filter_map(|s| s.trim().parse::<bool>().ok()).collect());
         707  +
        }
         708  +
        if let Some(val) = headers.get("X-TimestampList") {
         709  +
            builder.header_timestamp_list = {
         710  +
                let mut timestamps = Vec::new();
         711  +
                let re_split: Vec<&str> = val.split(", ").collect();
         712  +
                let mut i = 0;
         713  +
                while i < re_split.len() {
         714  +
                    if i + 1 < re_split.len() {
         715  +
                        let combined = format!("{}, {}", re_split[i], re_split[i + 1]);
         716  +
                        if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(&combined, ::aws_smithy_types::date_time::Format::HttpDate) {
         717  +
                            timestamps.push(ts);
         718  +
                            i += 2;
         719  +
                            continue;
         720  +
                        }
         721  +
                    }
         722  +
                    if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(re_split[i].trim(), ::aws_smithy_types::date_time::Format::HttpDate) {
         723  +
                        timestamps.push(ts);
         724  +
                    }
         725  +
                    i += 1;
         726  +
                }
         727  +
                Some(timestamps)
         728  +
            };
         729  +
        }
         730  +
        if let Some(val) = headers.get("X-Enum") {
         731  +
            builder.header_enum = Some(crate::types::FooEnum::from(val));
         732  +
        }
         733  +
        if let Some(val) = headers.get("X-EnumList") {
         734  +
            builder.header_enum_list = Some(val.split(',').map(|s| crate::types::FooEnum::from(s.trim())).collect());
         735  +
        }
         736  +
        if let Some(val) = headers.get("X-IntegerEnum") {
         737  +
            builder.header_integer_enum = val.parse::<i32>().ok();
         738  +
        }
         739  +
        if let Some(val) = headers.get("X-IntegerEnumList") {
         740  +
            builder.header_integer_enum_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
         741  +
        }
         742  +
        Ok(builder.build())
         743  +
    }
         744  +
}
  628    745   
impl InputAndOutputWithHeadersOutput {
  629    746   
    /// Creates a new builder-style object to manufacture [`InputAndOutputWithHeadersOutput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput).
  630    747   
    pub fn builder() -> crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersOutputBuilder {
  631    748   
        crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersOutputBuilder::default()
  632    749   
    }
  633    750   
}
  634    751   
  635    752   
/// A builder for [`InputAndOutputWithHeadersOutput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput).
  636    753   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  637    754   
#[non_exhaustive]