Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

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,241 @@
  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(())
  183         -
            }
  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("");
  198         -
  199         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         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, InputAndOutputWithHeaders::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
         211  +
        return ::std::result::Result::Ok(request);
  200    212   
    }
  201    213   
}
  202    214   
#[derive(Debug)]
  203    215   
struct InputAndOutputWithHeadersEndpointParamsInterceptor;
  204    216   
  205    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InputAndOutputWithHeadersEndpointParamsInterceptor {
  206    218   
    fn name(&self) -> &'static str {
  207    219   
        "InputAndOutputWithHeadersEndpointParamsInterceptor"
  208    220   
    }
  209    221   
@@ -603,615 +663,685 @@
  623    635   
            .expect("the config must have a deserializer");
  624    636   
  625    637   
        let parsed = de.deserialize_streaming(&mut http_response);
  626    638   
        let parsed = parsed.unwrap_or_else(|| {
  627    639   
            let http_response = http_response.map(|body| {
  628    640   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  629    641   
                    body.bytes().unwrap(),
  630    642   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  631    643   
                )))
  632    644   
            });
  633         -
            de.deserialize_nonstreaming(&http_response)
         645  +
            // Build a config bag with the protocol for schema-based deserialization
         646  +
            #[allow(unused_mut)]
         647  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         648  +
            {
         649  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         650  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         651  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         652  +
                ));
         653  +
                test_cfg.push_shared_layer(layer.freeze());
         654  +
            }
         655  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  634    656   
        });
  635    657   
        let parsed = parsed
  636    658   
            .expect("should be successful response")
  637    659   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  638    660   
            .unwrap();
  639    661   
        ::pretty_assertions::assert_eq!(
  640    662   
            parsed.header_string,
  641    663   
            expected_output.header_string,
  642    664   
            "Unexpected value for `header_string`"
  643    665   
        );
@@ -720,742 +780,812 @@
  740    762   
            .expect("the config must have a deserializer");
  741    763   
  742    764   
        let parsed = de.deserialize_streaming(&mut http_response);
  743    765   
        let parsed = parsed.unwrap_or_else(|| {
  744    766   
            let http_response = http_response.map(|body| {
  745    767   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  746    768   
                    body.bytes().unwrap(),
  747    769   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  748    770   
                )))
  749    771   
            });
  750         -
            de.deserialize_nonstreaming(&http_response)
         772  +
            // Build a config bag with the protocol for schema-based deserialization
         773  +
            #[allow(unused_mut)]
         774  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         775  +
            {
         776  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         777  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         778  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         779  +
                ));
         780  +
                test_cfg.push_shared_layer(layer.freeze());
         781  +
            }
         782  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  751    783   
        });
  752    784   
        let parsed = parsed
  753    785   
            .expect("should be successful response")
  754    786   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  755    787   
            .unwrap();
  756    788   
        ::pretty_assertions::assert_eq!(
  757    789   
            parsed.header_string,
  758    790   
            expected_output.header_string,
  759    791   
            "Unexpected value for `header_string`"
  760    792   
        );
@@ -849,881 +909,951 @@
  869    901   
            .expect("the config must have a deserializer");
  870    902   
  871    903   
        let parsed = de.deserialize_streaming(&mut http_response);
  872    904   
        let parsed = parsed.unwrap_or_else(|| {
  873    905   
            let http_response = http_response.map(|body| {
  874    906   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  875    907   
                    body.bytes().unwrap(),
  876    908   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  877    909   
                )))
  878    910   
            });
  879         -
            de.deserialize_nonstreaming(&http_response)
         911  +
            // Build a config bag with the protocol for schema-based deserialization
         912  +
            #[allow(unused_mut)]
         913  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         914  +
            {
         915  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         916  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         917  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         918  +
                ));
         919  +
                test_cfg.push_shared_layer(layer.freeze());
         920  +
            }
         921  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  880    922   
        });
  881    923   
        let parsed = parsed
  882    924   
            .expect("should be successful response")
  883    925   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
  884    926   
            .unwrap();
  885    927   
        ::pretty_assertions::assert_eq!(
  886    928   
            parsed.header_string,
  887    929   
            expected_output.header_string,
  888    930   
            "Unexpected value for `header_string`"
  889    931   
        );
@@ -970,1012 +1030,1082 @@
  990   1032   
            .expect("the config must have a deserializer");
  991   1033   
  992   1034   
        let parsed = de.deserialize_streaming(&mut http_response);
  993   1035   
        let parsed = parsed.unwrap_or_else(|| {
  994   1036   
            let http_response = http_response.map(|body| {
  995   1037   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  996   1038   
                    body.bytes().unwrap(),
  997   1039   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  998   1040   
                )))
  999   1041   
            });
 1000         -
            de.deserialize_nonstreaming(&http_response)
        1042  +
            // Build a config bag with the protocol for schema-based deserialization
        1043  +
            #[allow(unused_mut)]
        1044  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1045  +
            {
        1046  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1047  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1048  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1049  +
                ));
        1050  +
                test_cfg.push_shared_layer(layer.freeze());
        1051  +
            }
        1052  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1001   1053   
        });
 1002   1054   
        let parsed = parsed
 1003   1055   
            .expect("should be successful response")
 1004   1056   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1005   1057   
            .unwrap();
 1006   1058   
        ::pretty_assertions::assert_eq!(
 1007   1059   
            parsed.header_string,
 1008   1060   
            expected_output.header_string,
 1009   1061   
            "Unexpected value for `header_string`"
 1010   1062   
        );
@@ -1090,1142 +1150,1212 @@
 1110   1162   
            .expect("the config must have a deserializer");
 1111   1163   
 1112   1164   
        let parsed = de.deserialize_streaming(&mut http_response);
 1113   1165   
        let parsed = parsed.unwrap_or_else(|| {
 1114   1166   
            let http_response = http_response.map(|body| {
 1115   1167   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1116   1168   
                    body.bytes().unwrap(),
 1117   1169   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1118   1170   
                )))
 1119   1171   
            });
 1120         -
            de.deserialize_nonstreaming(&http_response)
        1172  +
            // Build a config bag with the protocol for schema-based deserialization
        1173  +
            #[allow(unused_mut)]
        1174  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1175  +
            {
        1176  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1177  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1178  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1179  +
                ));
        1180  +
                test_cfg.push_shared_layer(layer.freeze());
        1181  +
            }
        1182  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1121   1183   
        });
 1122   1184   
        let parsed = parsed
 1123   1185   
            .expect("should be successful response")
 1124   1186   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1125   1187   
            .unwrap();
 1126   1188   
        ::pretty_assertions::assert_eq!(
 1127   1189   
            parsed.header_string,
 1128   1190   
            expected_output.header_string,
 1129   1191   
            "Unexpected value for `header_string`"
 1130   1192   
        );
@@ -1215,1277 +1275,1347 @@
 1235   1297   
            .expect("the config must have a deserializer");
 1236   1298   
 1237   1299   
        let parsed = de.deserialize_streaming(&mut http_response);
 1238   1300   
        let parsed = parsed.unwrap_or_else(|| {
 1239   1301   
            let http_response = http_response.map(|body| {
 1240   1302   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1241   1303   
                    body.bytes().unwrap(),
 1242   1304   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1243   1305   
                )))
 1244   1306   
            });
 1245         -
            de.deserialize_nonstreaming(&http_response)
        1307  +
            // Build a config bag with the protocol for schema-based deserialization
        1308  +
            #[allow(unused_mut)]
        1309  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1310  +
            {
        1311  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1312  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1313  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1314  +
                ));
        1315  +
                test_cfg.push_shared_layer(layer.freeze());
        1316  +
            }
        1317  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1246   1318   
        });
 1247   1319   
        let parsed = parsed
 1248   1320   
            .expect("should be successful response")
 1249   1321   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1250   1322   
            .unwrap();
 1251   1323   
        ::pretty_assertions::assert_eq!(
 1252   1324   
            parsed.header_string,
 1253   1325   
            expected_output.header_string,
 1254   1326   
            "Unexpected value for `header_string`"
 1255   1327   
        );
@@ -1334,1406 +1394,1476 @@
 1354   1426   
            .expect("the config must have a deserializer");
 1355   1427   
 1356   1428   
        let parsed = de.deserialize_streaming(&mut http_response);
 1357   1429   
        let parsed = parsed.unwrap_or_else(|| {
 1358   1430   
            let http_response = http_response.map(|body| {
 1359   1431   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1360   1432   
                    body.bytes().unwrap(),
 1361   1433   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1362   1434   
                )))
 1363   1435   
            });
 1364         -
            de.deserialize_nonstreaming(&http_response)
        1436  +
            // Build a config bag with the protocol for schema-based deserialization
        1437  +
            #[allow(unused_mut)]
        1438  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1439  +
            {
        1440  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1441  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1442  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1443  +
                ));
        1444  +
                test_cfg.push_shared_layer(layer.freeze());
        1445  +
            }
        1446  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1365   1447   
        });
 1366   1448   
        let parsed = parsed
 1367   1449   
            .expect("should be successful response")
 1368   1450   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1369   1451   
            .unwrap();
 1370   1452   
        ::pretty_assertions::assert_eq!(
 1371   1453   
            parsed.header_string,
 1372   1454   
            expected_output.header_string,
 1373   1455   
            "Unexpected value for `header_string`"
 1374   1456   
        );
@@ -1457,1539 +1517,1609 @@
 1477   1559   
            .expect("the config must have a deserializer");
 1478   1560   
 1479   1561   
        let parsed = de.deserialize_streaming(&mut http_response);
 1480   1562   
        let parsed = parsed.unwrap_or_else(|| {
 1481   1563   
            let http_response = http_response.map(|body| {
 1482   1564   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1483   1565   
                    body.bytes().unwrap(),
 1484   1566   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1485   1567   
                )))
 1486   1568   
            });
 1487         -
            de.deserialize_nonstreaming(&http_response)
        1569  +
            // Build a config bag with the protocol for schema-based deserialization
        1570  +
            #[allow(unused_mut)]
        1571  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1572  +
            {
        1573  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1574  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1575  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1576  +
                ));
        1577  +
                test_cfg.push_shared_layer(layer.freeze());
        1578  +
            }
        1579  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1488   1580   
        });
 1489   1581   
        let parsed = parsed
 1490   1582   
            .expect("should be successful response")
 1491   1583   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1492   1584   
            .unwrap();
 1493   1585   
        ::pretty_assertions::assert_eq!(
 1494   1586   
            parsed.header_string,
 1495   1587   
            expected_output.header_string,
 1496   1588   
            "Unexpected value for `header_string`"
 1497   1589   
        );
@@ -1580,1672 +1640,1742 @@
 1600   1692   
            .expect("the config must have a deserializer");
 1601   1693   
 1602   1694   
        let parsed = de.deserialize_streaming(&mut http_response);
 1603   1695   
        let parsed = parsed.unwrap_or_else(|| {
 1604   1696   
            let http_response = http_response.map(|body| {
 1605   1697   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1606   1698   
                    body.bytes().unwrap(),
 1607   1699   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1608   1700   
                )))
 1609   1701   
            });
 1610         -
            de.deserialize_nonstreaming(&http_response)
        1702  +
            // Build a config bag with the protocol for schema-based deserialization
        1703  +
            #[allow(unused_mut)]
        1704  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1705  +
            {
        1706  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1707  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1708  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1709  +
                ));
        1710  +
                test_cfg.push_shared_layer(layer.freeze());
        1711  +
            }
        1712  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1611   1713   
        });
 1612   1714   
        let parsed = parsed
 1613   1715   
            .expect("should be successful response")
 1614   1716   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1615   1717   
            .unwrap();
 1616   1718   
        ::pretty_assertions::assert_eq!(
 1617   1719   
            parsed.header_string,
 1618   1720   
            expected_output.header_string,
 1619   1721   
            "Unexpected value for `header_string`"
 1620   1722   
        );
@@ -1703,1805 +1763,1875 @@
 1723   1825   
            .expect("the config must have a deserializer");
 1724   1826   
 1725   1827   
        let parsed = de.deserialize_streaming(&mut http_response);
 1726   1828   
        let parsed = parsed.unwrap_or_else(|| {
 1727   1829   
            let http_response = http_response.map(|body| {
 1728   1830   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1729   1831   
                    body.bytes().unwrap(),
 1730   1832   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1731   1833   
                )))
 1732   1834   
            });
 1733         -
            de.deserialize_nonstreaming(&http_response)
        1835  +
            // Build a config bag with the protocol for schema-based deserialization
        1836  +
            #[allow(unused_mut)]
        1837  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1838  +
            {
        1839  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1840  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1841  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1842  +
                ));
        1843  +
                test_cfg.push_shared_layer(layer.freeze());
        1844  +
            }
        1845  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1734   1846   
        });
 1735   1847   
        let parsed = parsed
 1736   1848   
            .expect("should be successful response")
 1737   1849   
            .downcast::<crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput>()
 1738   1850   
            .unwrap();
 1739   1851   
        ::pretty_assertions::assert_eq!(
 1740   1852   
            parsed.header_string,
 1741   1853   
            expected_output.header_string,
 1742   1854   
            "Unexpected value for `header_string`"
 1743   1855   
        );

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]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/input_stream.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 `InputStream`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct InputStream;
    6      6   
impl InputStream {
    7      7   
    /// Creates a new `InputStream`
    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::input_stream::InputStreamInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::input_stream::InputStreamOutput::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::input_stream::InputStreamInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::input_stream::InputStreamOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::input_stream::InputStreamError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -103,107 +236,282 @@
  123    127   
                crate::operation::input_stream::InputStreamError,
  124    128   
            >::new());
  125    129   
  126    130   
        ::std::borrow::Cow::Owned(rcb)
  127    131   
    }
  128    132   
}
  129    133   
  130    134   
#[derive(Debug)]
  131    135   
struct InputStreamResponseDeserializer;
  132    136   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for InputStreamResponseDeserializer {
  133         -
    fn deserialize_nonstreaming(
         137  +
    fn deserialize_nonstreaming_with_config(
  134    138   
        &self,
  135    139   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         140  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  136    141   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    142   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         143  +
        #[allow(unused_mut)]
         144  +
        let mut force_error = false;
         145  +
         146  +
        if !success && status != 200 || force_error {
  138    147   
            let headers = response.headers();
  139    148   
            let body = response.body().bytes().expect("body loaded");
  140    149   
            #[allow(unused_mut)]
  141         -
        let mut force_error = false;
         150  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         151  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         152  +
            })?;
  142    153   
  143         -
        let parse_result = if !success && status != 200 || force_error {
  144         -
            crate::protocol_serde::shape_input_stream::de_input_stream_http_error(status, headers, body)
  145         -
        } else {
  146         -
            crate::protocol_serde::shape_input_stream::de_input_stream_http_response(status, headers, body)
         154  +
            let generic = generic_builder.build();
         155  +
            let error_code = match generic.code() {
         156  +
                ::std::option::Option::Some(code) => code,
         157  +
                ::std::option::Option::None => {
         158  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         159  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::input_stream::InputStreamError::unhandled(generic)),
         160  +
                    ))
         161  +
                }
         162  +
            };
         163  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         164  +
            let protocol = _cfg
         165  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         166  +
                .expect("a SharedClientProtocol is required");
         167  +
            let err = match error_code {
         168  +
                "ErrorEvent" => crate::operation::input_stream::InputStreamError::ErrorEvent({
         169  +
                    let mut tmp = match protocol
         170  +
                        .deserialize_response(response, crate::types::error::ErrorEvent::SCHEMA, _cfg)
         171  +
                        .and_then(|mut deser| {
         172  +
                            crate::types::error::ErrorEvent::deserialize_with_response(
         173  +
                                &mut *deser,
         174  +
                                response.headers(),
         175  +
                                response.status().into(),
         176  +
                                body,
         177  +
                            )
         178  +
                        }) {
         179  +
                        ::std::result::Result::Ok(val) => val,
         180  +
                        ::std::result::Result::Err(e) => {
         181  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         182  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         183  +
                            ))
         184  +
                        }
         185  +
                    };
         186  +
                    tmp.meta = generic;
         187  +
                    if tmp.message.is_none() {
         188  +
                        tmp.message = _error_message;
         189  +
                    }
         190  +
                    tmp
         191  +
                }),
         192  +
                _ => crate::operation::input_stream::InputStreamError::generic(generic),
  147    193   
            };
  148         -
        crate::protocol_serde::type_erase_result(parse_result)
         194  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         195  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         196  +
            ))
         197  +
        } else {
         198  +
            let protocol = _cfg
         199  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         200  +
                .expect("a SharedClientProtocol is required");
         201  +
            let mut deser = protocol.deserialize_response(response, InputStream::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         202  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         203  +
            })?;
         204  +
            let body = response.body().bytes().expect("body loaded");
         205  +
            let output = crate::operation::input_stream::InputStreamOutput::deserialize_with_response(
         206  +
                &mut *deser,
         207  +
                response.headers(),
         208  +
                response.status().into(),
         209  +
                body,
         210  +
            )
         211  +
            .map_err(|e| {
         212  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         213  +
            })?;
         214  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         215  +
        }
  149    216   
    }
  150    217   
}
  151    218   
#[derive(Debug)]
  152    219   
struct InputStreamRequestSerializer;
  153    220   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for InputStreamRequestSerializer {
  154    221   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    222   
    fn serialize_input(
  156    223   
        &self,
  157    224   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    225   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    226   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    227   
        let input = input
  161    228   
            .downcast::<crate::operation::input_stream::InputStreamInput>()
  162    229   
            .expect("correct type");
  163         -
        let _header_serialization_settings = _cfg
  164         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165         -
            .cloned()
  166         -
            .unwrap_or_default();
  167         -
        let mut request_builder = {
  168         -
            #[allow(clippy::uninlined_format_args)]
  169         -
            fn uri_base(
  170         -
                _input: &crate::operation::input_stream::InputStreamInput,
  171         -
                output: &mut ::std::string::String,
  172         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  173         -
                use ::std::fmt::Write as _;
  174         -
                ::std::write!(output, "/InputStream").expect("formatting should succeed");
  175         -
                ::std::result::Result::Ok(())
  176         -
            }
  177         -
            #[allow(clippy::unnecessary_wraps)]
  178         -
            fn update_http_builder(
  179         -
                input: &crate::operation::input_stream::InputStreamInput,
  180         -
                builder: ::http_1x::request::Builder,
  181         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  182         -
                let mut uri = ::std::string::String::new();
  183         -
                uri_base(input, &mut uri)?;
  184         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  185         -
            }
  186         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  187         -
            builder =
  188         -
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
  189         -
            builder
  190         -
        };
  191         -
        let body = ::aws_smithy_types::body::SdkBody::from({
         230  +
        let protocol = _cfg
         231  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         232  +
            .expect("a SharedClientProtocol is required");
         233  +
        let mut request = protocol
         234  +
            .serialize_request(&input, InputStream::INPUT_SCHEMA, "", _cfg)
         235  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         236  +
        *request.body_mut() = ::aws_smithy_types::body::SdkBody::from({
  192    237   
            let error_marshaller = crate::event_stream_serde::EventStreamErrorMarshaller::new();
  193    238   
            let marshaller = crate::event_stream_serde::EventStreamMarshaller::new();
  194    239   
            let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
  195    240   
            _cfg.interceptor_state().store_put(signer_sender);
  196    241   
            ::aws_smithy_types::body::SdkBody::from_body_1_x(::http_body_util::StreamBody::new(input.stream.into_body_stream(
  197    242   
                marshaller,
  198    243   
                error_marshaller,
  199    244   
                signer,
  200    245   
            )))
  201    246   
        });
  202         -
        if let Some(content_length) = body.content_length() {
  203         -
            let content_length = content_length.to_string();
  204         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  205         -
        }
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         247  +
        // The protocol may have set Content-Length based on the initial empty body.
         248  +
        // Remove it since the event stream body has unknown length.
         249  +
        request.headers_mut().remove("Content-Length");
         250  +
        request.headers_mut().insert("Content-Type", "application/vnd.amazon.eventstream");
         251  +
         252  +
        return ::std::result::Result::Ok(request);
  207    253   
    }
  208    254   
}
  209    255   
#[derive(Debug)]
  210    256   
struct InputStreamEndpointParamsInterceptor;
  211    257   
  212    258   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InputStreamEndpointParamsInterceptor {
  213    259   
    fn name(&self) -> &'static str {
  214    260   
        "InputStreamEndpointParamsInterceptor"
  215    261   
    }
  216    262