Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_traits.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 `StreamingTraits`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingTraits;
    6      6   
impl StreamingTraits {
    7      7   
    /// Creates a new `StreamingTraits`
    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::streaming_traits::StreamingTraitsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::streaming_traits::StreamingTraitsOutput::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::streaming_traits::StreamingTraitsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::streaming_traits::StreamingTraitsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::streaming_traits::StreamingTraitsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -126,130 +244,237 @@
  146    150   
  147    151   
        // If this is an error, defer to the non-streaming parser
  148    152   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  149    153   
            return ::std::option::Option::None;
  150    154   
        }
  151    155   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  152    156   
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_response(response),
  153    157   
        ))
  154    158   
    }
  155    159   
  156         -
    fn deserialize_nonstreaming(
         160  +
    fn deserialize_nonstreaming_with_config(
  157    161   
        &self,
  158    162   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         163  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  159    164   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  160    165   
        // For streaming operations, we only hit this case if its an error
  161    166   
        let body = response.body().bytes().expect("body loaded");
  162         -
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_error(
  163         -
            response.status().as_u16(),
  164         -
            response.headers(),
  165         -
            body,
         167  +
        let status = response.status().as_u16();
         168  +
        let headers = response.headers();
         169  +
        #[allow(unused_mut)]
         170  +
        let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         171  +
            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         172  +
        })?;
         173  +
         174  +
        let generic = generic_builder.build();
         175  +
        ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         176  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::streaming_traits::StreamingTraitsError::generic(
         177  +
                generic,
         178  +
            )),
  166    179   
        ))
  167    180   
    }
  168    181   
}
  169    182   
#[derive(Debug)]
  170    183   
struct StreamingTraitsRequestSerializer;
  171    184   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsRequestSerializer {
  172    185   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  173    186   
    fn serialize_input(
  174    187   
        &self,
  175    188   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  176    189   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  177    190   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  178    191   
        let input = input
  179    192   
            .downcast::<crate::operation::streaming_traits::StreamingTraitsInput>()
  180    193   
            .expect("correct type");
  181         -
        let _header_serialization_settings = _cfg
  182         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  183         -
            .cloned()
  184         -
            .unwrap_or_default();
  185         -
        let mut request_builder = {
  186         -
            #[allow(clippy::uninlined_format_args)]
  187         -
            fn uri_base(
  188         -
                _input: &crate::operation::streaming_traits::StreamingTraitsInput,
  189         -
                output: &mut ::std::string::String,
  190         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  191         -
                use ::std::fmt::Write as _;
  192         -
                ::std::write!(output, "/StreamingTraits").expect("formatting should succeed");
  193         -
                ::std::result::Result::Ok(())
  194         -
            }
  195         -
            #[allow(clippy::unnecessary_wraps)]
  196         -
            fn update_http_builder(
  197         -
                input: &crate::operation::streaming_traits::StreamingTraitsInput,
  198         -
                builder: ::http_1x::request::Builder,
  199         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  200         -
                let mut uri = ::std::string::String::new();
  201         -
                uri_base(input, &mut uri)?;
  202         -
                let builder = crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_headers(input, builder)?;
  203         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  204         -
            }
  205         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  206         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
  207         -
            builder
  208         -
        };
  209         -
        let body = crate::protocol_serde::shape_streaming_traits_input::ser_blob_http_payload(input.blob)?.into_inner();
  210         -
        if let Some(content_length) = body.content_length() {
  211         -
            let content_length = content_length.to_string();
  212         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         194  +
        let protocol = _cfg
         195  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         196  +
            .expect("a SharedClientProtocol is required");
         197  +
        let mut request = protocol
         198  +
            .serialize_request(&input, StreamingTraits::INPUT_SCHEMA, "", _cfg)
         199  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         200  +
        // Streaming blob payload: replace the body with the raw ByteStream.
         201  +
        *request.body_mut() = input.blob.into_inner();
         202  +
        request.headers_mut().insert("Content-Type", "application/octet-stream");
         203  +
        if let ::std::option::Option::Some(content_length) = request.body().content_length() {
         204  +
            request.headers_mut().insert("Content-Length", content_length.to_string());
  213    205   
        }
  214         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         206  +
         207  +
        return ::std::result::Result::Ok(request);
  215    208   
    }
  216    209   
}
  217    210   
#[derive(Debug)]
  218    211   
struct StreamingTraitsEndpointParamsInterceptor;
  219    212   
  220    213   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsEndpointParamsInterceptor {
  221    214   
    fn name(&self) -> &'static str {
  222    215   
        "StreamingTraitsEndpointParamsInterceptor"
  223    216   
    }
  224    217   
@@ -331,324 +437,450 @@
  351    344   
            .expect("the config must have a deserializer");
  352    345   
  353    346   
        let parsed = de.deserialize_streaming(&mut http_response);
  354    347   
        let parsed = parsed.unwrap_or_else(|| {
  355    348   
            let http_response = http_response.map(|body| {
  356    349   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  357    350   
                    body.bytes().unwrap(),
  358    351   
                    ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
  359    352   
                )))
  360    353   
            });
  361         -
            de.deserialize_nonstreaming(&http_response)
         354  +
            // Build a config bag with the protocol for schema-based deserialization
         355  +
            #[allow(unused_mut)]
         356  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         357  +
            {
         358  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         359  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         360  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         361  +
                ));
         362  +
                test_cfg.push_shared_layer(layer.freeze());
         363  +
            }
         364  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  362    365   
        });
  363    366   
        let parsed = parsed
  364    367   
            .expect("should be successful response")
  365    368   
            .downcast::<crate::operation::streaming_traits::StreamingTraitsOutput>()
  366    369   
            .unwrap();
  367    370   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  368    371   
        ::pretty_assertions::assert_eq!(
  369    372   
            parsed.blob.collect().await.unwrap().into_bytes(),
  370    373   
            expected_output.blob.collect().await.unwrap().into_bytes()
  371    374   
        );
  372    375   
    }
  373    376   
  374    377   
    /// Serializes an empty blob in the HTTP payload
  375    378   
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
  376    379   
    #[::tokio::test]
  377    380   
    #[::tracing_test::traced_test]
  378    381   
    async fn rest_json_streaming_traits_with_no_blob_body_response() {
  379    382   
        let expected_output = crate::operation::streaming_traits::StreamingTraitsOutput::builder()
  380    383   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  381    384   
            .build();
  382    385   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  383    386   
            ::http_1x::response::Builder::new()
  384    387   
                .header("X-Foo", "Foo")
  385    388   
                .status(200)
  386    389   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  387    390   
                .unwrap(),
  388    391   
        )
  389    392   
        .unwrap();
  390    393   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  391    394   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  392    395   
  393    396   
        let op = crate::operation::streaming_traits::StreamingTraits::new();
  394    397   
        let config = op.config().expect("the operation has config");
  395    398   
        let de = config
  396    399   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  397    400   
            .expect("the config must have a deserializer");
  398    401   
  399    402   
        let parsed = de.deserialize_streaming(&mut http_response);
  400    403   
        let parsed = parsed.unwrap_or_else(|| {
  401    404   
            let http_response = http_response.map(|body| {
  402    405   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  403    406   
                    body.bytes().unwrap(),
  404    407   
                    ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
  405    408   
                )))
  406    409   
            });
  407         -
            de.deserialize_nonstreaming(&http_response)
         410  +
            // Build a config bag with the protocol for schema-based deserialization
         411  +
            #[allow(unused_mut)]
         412  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         413  +
            {
         414  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         415  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         416  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         417  +
                ));
         418  +
                test_cfg.push_shared_layer(layer.freeze());
         419  +
            }
         420  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  408    421   
        });
  409    422   
        let parsed = parsed
  410    423   
            .expect("should be successful response")
  411    424   
            .downcast::<crate::operation::streaming_traits::StreamingTraitsOutput>()
  412    425   
            .unwrap();
  413    426   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  414    427   
        ::pretty_assertions::assert_eq!(
  415    428   
            parsed.blob.collect().await.unwrap().into_bytes(),
  416    429   
            expected_output.blob.collect().await.unwrap().into_bytes()
  417    430   
        );

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

@@ -22,22 +136,173 @@
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Blob,
   44     44   
    "blob",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_payload();
   48     48   
static STREAMINGTRAITSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    STREAMINGTRAITSINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&STREAMINGTRAITSINPUT_MEMBER_FOO, &STREAMINGTRAITSINPUT_MEMBER_BLOB],
   52         -
);
          52  +
)
          53  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StreamingTraits", None));
   53     54   
impl StreamingTraitsInput {
   54     55   
    /// The schema for this shape.
   55     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGTRAITSINPUT_SCHEMA;
   56     57   
}
   57     58   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingTraitsInput {
   58     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     60   
    fn serialize_members(
   60     61   
        &self,
   61     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     64   
        if let Some(ref val) = self.foo {
   64     65   
            ser.write_string(&STREAMINGTRAITSINPUT_MEMBER_FOO, val)?;
   65     66   
        }
   66         -
        {
   67         -
            let val = &self.blob;
   68         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   69         -
        }
   70     67   
        Ok(())
   71     68   
    }
   72     69   
}
   73     70   
impl StreamingTraitsInput {
   74     71   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          72  +
    pub fn deserialize(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     74   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     75   
        #[allow(unused_variables, unused_mut)]
   79     76   
        let mut builder = Self::builder();
   80     77   
        #[allow(
   81     78   
            unused_variables,
   82     79   
            unreachable_code,
   83     80   
            clippy::single_match,
   84     81   
            clippy::match_single_binding,
   85     82   
            clippy::diverging_sub_expression
   86     83   
        )]
   87         -
        deserializer.read_struct(&STREAMINGTRAITSINPUT_SCHEMA, (), |_, member, deser| {
          84  +
        deserializer.read_struct(&STREAMINGTRAITSINPUT_SCHEMA, &mut |member, deser| {
   88     85   
            match member.member_index() {
   89     86   
                Some(0) => {
   90     87   
                    builder.foo = Some(deser.read_string(member)?);
   91     88   
                }
   92     89   
                Some(1) => {
   93     90   
                    builder.blob = Some({
   94     91   
                        let _ = member;
   95     92   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   96     93   
                    });
   97     94   
                }
   98     95   
                _ => {}
   99     96   
            }
  100     97   
            Ok(())
  101     98   
        })?;
  102     99   
        builder
  103    100   
            .build()
  104    101   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  105    102   
    }
  106    103   
}
         104  +
impl StreamingTraitsInput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         106  +
    /// Header-bound members are read directly from headers, avoiding runtime
         107  +
    /// member iteration overhead. Body members are read via the deserializer.
         108  +
    pub fn deserialize_with_response(
         109  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         110  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         111  +
        _status: u16,
         112  +
        _body: &[u8],
         113  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         114  +
        #[allow(unused_variables, unused_mut)]
         115  +
        let mut builder = Self::builder();
         116  +
        if let Some(val) = headers.get("X-Foo") {
         117  +
            builder.foo = Some(val.to_string());
         118  +
        }
         119  +
        #[allow(
         120  +
            unused_variables,
         121  +
            unreachable_code,
         122  +
            clippy::single_match,
         123  +
            clippy::match_single_binding,
         124  +
            clippy::diverging_sub_expression
         125  +
        )]
         126  +
        deserializer.read_struct(&STREAMINGTRAITSINPUT_SCHEMA, &mut |member, deser| {
         127  +
            match member.member_index() {
         128  +
                Some(0) => { /* read from headers above */ }
         129  +
                Some(1) => {
         130  +
                    builder.blob = Some({
         131  +
                        let _ = member;
         132  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         133  +
                    });
         134  +
                }
         135  +
                _ => {}
         136  +
            }
         137  +
            Ok(())
         138  +
        })?;
         139  +
        builder
         140  +
            .build()
         141  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         142  +
    }
         143  +
}
  107    144   
impl StreamingTraitsInput {
  108    145   
    /// Creates a new builder-style object to manufacture [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
  109    146   
    pub fn builder() -> crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder {
  110    147   
        crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder::default()
  111    148   
    }
  112    149   
}
  113    150   
  114    151   
/// A builder for [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
  115    152   
#[derive(::std::default::Default, ::std::fmt::Debug)]
  116    153   
#[non_exhaustive]

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

@@ -36,36 +134,168 @@
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingTraitsOutput {
   58     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     59   
    fn serialize_members(
   60     60   
        &self,
   61     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     63   
        if let Some(ref val) = self.foo {
   64     64   
            ser.write_string(&STREAMINGTRAITSOUTPUT_MEMBER_FOO, val)?;
   65     65   
        }
   66         -
        {
   67         -
            let val = &self.blob;
   68         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   69         -
        }
   70     66   
        Ok(())
   71     67   
    }
   72     68   
}
   73     69   
impl StreamingTraitsOutput {
   74     70   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          71  +
    pub fn deserialize(
          72  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     73   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     74   
        #[allow(unused_variables, unused_mut)]
   79     75   
        let mut builder = Self::builder();
   80     76   
        #[allow(
   81     77   
            unused_variables,
   82     78   
            unreachable_code,
   83     79   
            clippy::single_match,
   84     80   
            clippy::match_single_binding,
   85     81   
            clippy::diverging_sub_expression
   86     82   
        )]
   87         -
        deserializer.read_struct(&STREAMINGTRAITSOUTPUT_SCHEMA, (), |_, member, deser| {
          83  +
        deserializer.read_struct(&STREAMINGTRAITSOUTPUT_SCHEMA, &mut |member, deser| {
   88     84   
            match member.member_index() {
   89     85   
                Some(0) => {
   90     86   
                    builder.foo = Some(deser.read_string(member)?);
   91     87   
                }
   92     88   
                Some(1) => {
   93     89   
                    builder.blob = Some({
   94     90   
                        let _ = member;
   95     91   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   96     92   
                    });
   97     93   
                }
   98     94   
                _ => {}
   99     95   
            }
  100     96   
            Ok(())
  101     97   
        })?;
  102     98   
        Ok(builder.build())
  103     99   
    }
  104    100   
}
         101  +
impl StreamingTraitsOutput {
         102  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         103  +
    /// Header-bound members are read directly from headers, avoiding runtime
         104  +
    /// member iteration overhead. Body members are read via the deserializer.
         105  +
    pub fn deserialize_with_response(
         106  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         107  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         108  +
        _status: u16,
         109  +
        _body: &[u8],
         110  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         111  +
        #[allow(unused_variables, unused_mut)]
         112  +
        let mut builder = Self::builder();
         113  +
        if let Some(val) = headers.get("X-Foo") {
         114  +
            builder.foo = Some(val.to_string());
         115  +
        }
         116  +
        #[allow(
         117  +
            unused_variables,
         118  +
            unreachable_code,
         119  +
            clippy::single_match,
         120  +
            clippy::match_single_binding,
         121  +
            clippy::diverging_sub_expression
         122  +
        )]
         123  +
        deserializer.read_struct(&STREAMINGTRAITSOUTPUT_SCHEMA, &mut |member, deser| {
         124  +
            match member.member_index() {
         125  +
                Some(0) => { /* read from headers above */ }
         126  +
                Some(1) => {
         127  +
                    builder.blob = Some({
         128  +
                        let _ = member;
         129  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         130  +
                    });
         131  +
                }
         132  +
                _ => {}
         133  +
            }
         134  +
            Ok(())
         135  +
        })?;
         136  +
        Ok(builder.build())
         137  +
    }
         138  +
}
  105    139   
impl StreamingTraitsOutput {
  106    140   
    /// Creates a new builder-style object to manufacture [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
  107    141   
    pub fn builder() -> crate::operation::streaming_traits::builders::StreamingTraitsOutputBuilder {
  108    142   
        crate::operation::streaming_traits::builders::StreamingTraitsOutputBuilder::default()
  109    143   
    }
  110    144   
}
  111    145   
  112    146   
/// A builder for [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
  113    147   
#[derive(::std::default::Default, ::std::fmt::Debug)]
  114    148   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_traits_require_length.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 `StreamingTraitsRequireLength`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingTraitsRequireLength;
    6      6   
impl StreamingTraitsRequireLength {
    7      7   
    /// Creates a new `StreamingTraitsRequireLength`
    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::streaming_traits_require_length::StreamingTraitsRequireLengthInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthOutput::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::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +234,247 @@
  130    136   
                crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
  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 StreamingTraitsRequireLengthResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StreamingTraitsRequireLengthResponseDeserializer {
  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_streaming_traits_require_length::de_streaming_traits_require_length_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::streaming_traits_require_length::StreamingTraitsRequireLengthError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_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, StreamingTraitsRequireLength::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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput::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 StreamingTraitsRequireLengthRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsRequireLengthRequestSerializer {
  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::streaming_traits_require_length::StreamingTraitsRequireLengthInput>()
  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::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
  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, "/StreamingTraitsRequireLength").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, StreamingTraitsRequireLength::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
        // Streaming blob payload: replace the body with the raw ByteStream.
         211  +
        *request.body_mut() = input.blob.into_inner();
         212  +
        request.headers_mut().insert("Content-Type", "application/octet-stream");
         213  +
        if let ::std::option::Option::Some(content_length) = request.body().content_length() {
         214  +
            request.headers_mut().insert("Content-Length", content_length.to_string());
  183    215   
        }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
  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 =
  192         -
                    crate::protocol_serde::shape_streaming_traits_require_length::ser_streaming_traits_require_length_headers(input, builder)?;
  193         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  194         -
            }
  195         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  196         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
  197         -
            builder
  198         -
        };
  199         -
        let body = crate::protocol_serde::shape_streaming_traits_require_length_input::ser_blob_http_payload(input.blob)?.into_inner();
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203         -
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         216  +
         217  +
        return ::std::result::Result::Ok(request);
  205    218   
    }
  206    219   
}
  207    220   
#[derive(Debug)]
  208    221   
struct StreamingTraitsRequireLengthEndpointParamsInterceptor;
  209    222   
  210    223   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsRequireLengthEndpointParamsInterceptor {
  211    224   
    fn name(&self) -> &'static str {
  212    225   
        "StreamingTraitsRequireLengthEndpointParamsInterceptor"
  213    226   
    }
  214    227   

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

@@ -25,25 +139,176 @@
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_payload();
   48     48   
static STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &STREAMINGTRAITSREQUIRELENGTHINPUT_MEMBER_FOO,
   53     53   
        &STREAMINGTRAITSREQUIRELENGTHINPUT_MEMBER_BLOB,
   54     54   
    ],
   55         -
);
          55  +
)
          56  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StreamingTraitsRequireLength", None));
   56     57   
impl StreamingTraitsRequireLengthInput {
   57     58   
    /// The schema for this shape.
   58     59   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA;
   59     60   
}
   60     61   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingTraitsRequireLengthInput {
   61     62   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     63   
    fn serialize_members(
   63     64   
        &self,
   64     65   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     66   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     67   
        if let Some(ref val) = self.foo {
   67     68   
            ser.write_string(&STREAMINGTRAITSREQUIRELENGTHINPUT_MEMBER_FOO, val)?;
   68     69   
        }
   69         -
        {
   70         -
            let val = &self.blob;
   71         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   72         -
        }
   73     70   
        Ok(())
   74     71   
    }
   75     72   
}
   76     73   
impl StreamingTraitsRequireLengthInput {
   77     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   78         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   79         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   80     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   81     78   
        #[allow(unused_variables, unused_mut)]
   82     79   
        let mut builder = Self::builder();
   83     80   
        #[allow(
   84     81   
            unused_variables,
   85     82   
            unreachable_code,
   86     83   
            clippy::single_match,
   87     84   
            clippy::match_single_binding,
   88     85   
            clippy::diverging_sub_expression
   89     86   
        )]
   90         -
        deserializer.read_struct(&STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA, &mut |member, deser| {
   91     88   
            match member.member_index() {
   92     89   
                Some(0) => {
   93     90   
                    builder.foo = Some(deser.read_string(member)?);
   94     91   
                }
   95     92   
                Some(1) => {
   96     93   
                    builder.blob = Some({
   97     94   
                        let _ = member;
   98     95   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   99     96   
                    });
  100     97   
                }
  101     98   
                _ => {}
  102     99   
            }
  103    100   
            Ok(())
  104    101   
        })?;
  105    102   
        builder
  106    103   
            .build()
  107    104   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  108    105   
    }
  109    106   
}
         107  +
impl StreamingTraitsRequireLengthInput {
         108  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         109  +
    /// Header-bound members are read directly from headers, avoiding runtime
         110  +
    /// member iteration overhead. Body members are read via the deserializer.
         111  +
    pub fn deserialize_with_response(
         112  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         113  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         114  +
        _status: u16,
         115  +
        _body: &[u8],
         116  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         117  +
        #[allow(unused_variables, unused_mut)]
         118  +
        let mut builder = Self::builder();
         119  +
        if let Some(val) = headers.get("X-Foo") {
         120  +
            builder.foo = Some(val.to_string());
         121  +
        }
         122  +
        #[allow(
         123  +
            unused_variables,
         124  +
            unreachable_code,
         125  +
            clippy::single_match,
         126  +
            clippy::match_single_binding,
         127  +
            clippy::diverging_sub_expression
         128  +
        )]
         129  +
        deserializer.read_struct(&STREAMINGTRAITSREQUIRELENGTHINPUT_SCHEMA, &mut |member, deser| {
         130  +
            match member.member_index() {
         131  +
                Some(0) => { /* read from headers above */ }
         132  +
                Some(1) => {
         133  +
                    builder.blob = Some({
         134  +
                        let _ = member;
         135  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         136  +
                    });
         137  +
                }
         138  +
                _ => {}
         139  +
            }
         140  +
            Ok(())
         141  +
        })?;
         142  +
        builder
         143  +
            .build()
         144  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         145  +
    }
         146  +
}
  110    147   
impl StreamingTraitsRequireLengthInput {
  111    148   
    /// Creates a new builder-style object to manufacture [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
  112    149   
    pub fn builder() -> crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder {
  113    150   
        crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder::default()
  114    151   
    }
  115    152   
}
  116    153   
  117    154   
/// A builder for [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
  118    155   
#[derive(::std::default::Default, ::std::fmt::Debug)]
  119    156   
#[non_exhaustive]

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_traits_with_media_type.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 `StreamingTraitsWithMediaType`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingTraitsWithMediaType;
    6      6   
impl StreamingTraitsWithMediaType {
    7      7   
    /// Creates a new `StreamingTraitsWithMediaType`
    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::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput::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::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -126,132 +247,239 @@
  146    152   
  147    153   
        // If this is an error, defer to the non-streaming parser
  148    154   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  149    155   
            return ::std::option::Option::None;
  150    156   
        }
  151    157   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  152    158   
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_response(response),
  153    159   
        ))
  154    160   
    }
  155    161   
  156         -
    fn deserialize_nonstreaming(
         162  +
    fn deserialize_nonstreaming_with_config(
  157    163   
        &self,
  158    164   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         165  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  159    166   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  160    167   
        // For streaming operations, we only hit this case if its an error
  161    168   
        let body = response.body().bytes().expect("body loaded");
  162         -
        crate::protocol_serde::type_erase_result(
  163         -
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_error(
  164         -
                response.status().as_u16(),
  165         -
                response.headers(),
  166         -
                body,
         169  +
        let status = response.status().as_u16();
         170  +
        let headers = response.headers();
         171  +
        #[allow(unused_mut)]
         172  +
        let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         173  +
            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         174  +
        })?;
         175  +
         176  +
        let generic = generic_builder.build();
         177  +
        ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         178  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         179  +
                crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeError::generic(generic),
  167    180   
            ),
  168         -
        )
         181  +
        ))
  169    182   
    }
  170    183   
}
  171    184   
#[derive(Debug)]
  172    185   
struct StreamingTraitsWithMediaTypeRequestSerializer;
  173    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsWithMediaTypeRequestSerializer {
  174    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  175    188   
    fn serialize_input(
  176    189   
        &self,
  177    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  178    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  179    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  180    193   
        let input = input
  181    194   
            .downcast::<crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput>()
  182    195   
            .expect("correct type");
  183         -
        let _header_serialization_settings = _cfg
  184         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  185         -
            .cloned()
  186         -
            .unwrap_or_default();
  187         -
        let mut request_builder = {
  188         -
            #[allow(clippy::uninlined_format_args)]
  189         -
            fn uri_base(
  190         -
                _input: &crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
  191         -
                output: &mut ::std::string::String,
  192         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  193         -
                use ::std::fmt::Write as _;
  194         -
                ::std::write!(output, "/StreamingTraitsWithMediaType").expect("formatting should succeed");
  195         -
                ::std::result::Result::Ok(())
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, StreamingTraitsWithMediaType::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         202  +
        // Streaming blob payload: replace the body with the raw ByteStream.
         203  +
        *request.body_mut() = input.blob.into_inner();
         204  +
        request.headers_mut().insert("Content-Type", "text/plain");
         205  +
        if let ::std::option::Option::Some(content_length) = request.body().content_length() {
         206  +
            request.headers_mut().insert("Content-Length", content_length.to_string());
  196    207   
        }
  197         -
            #[allow(clippy::unnecessary_wraps)]
  198         -
            fn update_http_builder(
  199         -
                input: &crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
  200         -
                builder: ::http_1x::request::Builder,
  201         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  202         -
                let mut uri = ::std::string::String::new();
  203         -
                uri_base(input, &mut uri)?;
  204         -
                let builder =
  205         -
                    crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_headers(input, builder)?;
  206         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  207         -
            }
  208         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  209         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "text/plain");
  210         -
            builder
  211         -
        };
  212         -
        let body = crate::protocol_serde::shape_streaming_traits_with_media_type_input::ser_blob_http_payload(input.blob)?.into_inner();
  213         -
        if let Some(content_length) = body.content_length() {
  214         -
            let content_length = content_length.to_string();
  215         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  216         -
        }
  217         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  218    210   
    }
  219    211   
}
  220    212   
#[derive(Debug)]
  221    213   
struct StreamingTraitsWithMediaTypeEndpointParamsInterceptor;
  222    214   
  223    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsWithMediaTypeEndpointParamsInterceptor {
  224    216   
    fn name(&self) -> &'static str {
  225    217   
        "StreamingTraitsWithMediaTypeEndpointParamsInterceptor"
  226    218   
    }
  227    219   
@@ -303,295 +363,365 @@
  323    315   
            .expect("the config must have a deserializer");
  324    316   
  325    317   
        let parsed = de.deserialize_streaming(&mut http_response);
  326    318   
        let parsed = parsed.unwrap_or_else(|| {
  327    319   
            let http_response = http_response.map(|body| {
  328    320   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  329    321   
                    body.bytes().unwrap(),
  330    322   
                    ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
  331    323   
                )))
  332    324   
            });
  333         -
            de.deserialize_nonstreaming(&http_response)
         325  +
            // Build a config bag with the protocol for schema-based deserialization
         326  +
            #[allow(unused_mut)]
         327  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         328  +
            {
         329  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         330  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         331  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         332  +
                ));
         333  +
                test_cfg.push_shared_layer(layer.freeze());
         334  +
            }
         335  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  334    336   
        });
  335    337   
        let parsed = parsed
  336    338   
            .expect("should be successful response")
  337    339   
            .downcast::<crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput>()
  338    340   
            .unwrap();
  339    341   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  340    342   
        ::pretty_assertions::assert_eq!(
  341    343   
            parsed.blob.collect().await.unwrap().into_bytes(),
  342    344   
            expected_output.blob.collect().await.unwrap().into_bytes()
  343    345   
        );

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

@@ -17,17 +139,177 @@
   37     37   
static STREAMINGTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restjson.synthetic#StreamingTraitsWithMediaTypeInput$blob",
   40     40   
        "aws.protocoltests.restjson.synthetic",
   41     41   
        "StreamingTraitsWithMediaTypeInput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Blob,
   44     44   
    "blob",
   45     45   
    1,
   46     46   
)
   47         -
.with_http_payload();
          47  +
.with_http_payload()
          48  +
.with_media_type("text/plain");
   48     49   
static STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     50   
    STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA_ID,
   50     51   
    ::aws_smithy_schema::ShapeType::Structure,
   51     52   
    &[
   52     53   
        &STREAMINGTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO,
   53     54   
        &STREAMINGTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB,
   54     55   
    ],
   55         -
);
          56  +
)
          57  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StreamingTraitsWithMediaType", None));
   56     58   
impl StreamingTraitsWithMediaTypeInput {
   57     59   
    /// The schema for this shape.
   58     60   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA;
   59     61   
}
   60     62   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingTraitsWithMediaTypeInput {
   61     63   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     64   
    fn serialize_members(
   63     65   
        &self,
   64     66   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     67   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     68   
        if let Some(ref val) = self.foo {
   67     69   
            ser.write_string(&STREAMINGTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO, val)?;
   68     70   
        }
   69         -
        {
   70         -
            let val = &self.blob;
   71         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   72         -
        }
   73     71   
        Ok(())
   74     72   
    }
   75     73   
}
   76     74   
impl StreamingTraitsWithMediaTypeInput {
   77     75   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   78         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   79         -
        deserializer: &mut D,
          76  +
    pub fn deserialize(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   80     78   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   81     79   
        #[allow(unused_variables, unused_mut)]
   82     80   
        let mut builder = Self::builder();
   83     81   
        #[allow(
   84     82   
            unused_variables,
   85     83   
            unreachable_code,
   86     84   
            clippy::single_match,
   87     85   
            clippy::match_single_binding,
   88     86   
            clippy::diverging_sub_expression
   89     87   
        )]
   90         -
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA, (), |_, member, deser| {
          88  +
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA, &mut |member, deser| {
   91     89   
            match member.member_index() {
   92     90   
                Some(0) => {
   93     91   
                    builder.foo = Some(deser.read_string(member)?);
   94     92   
                }
   95     93   
                Some(1) => {
   96     94   
                    builder.blob = Some({
   97     95   
                        let _ = member;
   98     96   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   99     97   
                    });
  100     98   
                }
  101     99   
                _ => {}
  102    100   
            }
  103    101   
            Ok(())
  104    102   
        })?;
  105    103   
        builder
  106    104   
            .build()
  107    105   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  108    106   
    }
  109    107   
}
         108  +
impl StreamingTraitsWithMediaTypeInput {
         109  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         110  +
    /// Header-bound members are read directly from headers, avoiding runtime
         111  +
    /// member iteration overhead. Body members are read via the deserializer.
         112  +
    pub fn deserialize_with_response(
         113  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         114  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         115  +
        _status: u16,
         116  +
        _body: &[u8],
         117  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         118  +
        #[allow(unused_variables, unused_mut)]
         119  +
        let mut builder = Self::builder();
         120  +
        if let Some(val) = headers.get("X-Foo") {
         121  +
            builder.foo = Some(val.to_string());
         122  +
        }
         123  +
        #[allow(
         124  +
            unused_variables,
         125  +
            unreachable_code,
         126  +
            clippy::single_match,
         127  +
            clippy::match_single_binding,
         128  +
            clippy::diverging_sub_expression
         129  +
        )]
         130  +
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEINPUT_SCHEMA, &mut |member, deser| {
         131  +
            match member.member_index() {
         132  +
                Some(0) => { /* read from headers above */ }
         133  +
                Some(1) => {
         134  +
                    builder.blob = Some({
         135  +
                        let _ = member;
         136  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         137  +
                    });
         138  +
                }
         139  +
                _ => {}
         140  +
            }
         141  +
            Ok(())
         142  +
        })?;
         143  +
        builder
         144  +
            .build()
         145  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         146  +
    }
         147  +
}
  110    148   
impl StreamingTraitsWithMediaTypeInput {
  111    149   
    /// Creates a new builder-style object to manufacture [`StreamingTraitsWithMediaTypeInput`](crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput).
  112    150   
    pub fn builder() -> crate::operation::streaming_traits_with_media_type::builders::StreamingTraitsWithMediaTypeInputBuilder {
  113    151   
        crate::operation::streaming_traits_with_media_type::builders::StreamingTraitsWithMediaTypeInputBuilder::default()
  114    152   
    }
  115    153   
}
  116    154   
  117    155   
/// A builder for [`StreamingTraitsWithMediaTypeInput`](crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput).
  118    156   
#[derive(::std::default::Default, ::std::fmt::Debug)]
  119    157   
#[non_exhaustive]

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

@@ -17,17 +137,172 @@
   37     37   
static STREAMINGTRAITSWITHMEDIATYPEOUTPUT_MEMBER_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restjson.synthetic#StreamingTraitsWithMediaTypeOutput$blob",
   40     40   
        "aws.protocoltests.restjson.synthetic",
   41     41   
        "StreamingTraitsWithMediaTypeOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Blob,
   44     44   
    "blob",
   45     45   
    1,
   46     46   
)
   47         -
.with_http_payload();
          47  +
.with_http_payload()
          48  +
.with_media_type("text/plain");
   48     49   
static STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     50   
    STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA_ID,
   50     51   
    ::aws_smithy_schema::ShapeType::Structure,
   51     52   
    &[
   52     53   
        &STREAMINGTRAITSWITHMEDIATYPEOUTPUT_MEMBER_FOO,
   53     54   
        &STREAMINGTRAITSWITHMEDIATYPEOUTPUT_MEMBER_BLOB,
   54     55   
    ],
   55     56   
);
   56     57   
impl StreamingTraitsWithMediaTypeOutput {
   57     58   
    /// The schema for this shape.
   58     59   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA;
   59     60   
}
   60     61   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingTraitsWithMediaTypeOutput {
   61     62   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     63   
    fn serialize_members(
   63     64   
        &self,
   64     65   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     66   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     67   
        if let Some(ref val) = self.foo {
   67     68   
            ser.write_string(&STREAMINGTRAITSWITHMEDIATYPEOUTPUT_MEMBER_FOO, val)?;
   68     69   
        }
   69         -
        {
   70         -
            let val = &self.blob;
   71         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   72         -
        }
   73     70   
        Ok(())
   74     71   
    }
   75     72   
}
   76     73   
impl StreamingTraitsWithMediaTypeOutput {
   77     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   78         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   79         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   80     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   81     78   
        #[allow(unused_variables, unused_mut)]
   82     79   
        let mut builder = Self::builder();
   83     80   
        #[allow(
   84     81   
            unused_variables,
   85     82   
            unreachable_code,
   86     83   
            clippy::single_match,
   87     84   
            clippy::match_single_binding,
   88     85   
            clippy::diverging_sub_expression
   89     86   
        )]
   90         -
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA, &mut |member, deser| {
   91     88   
            match member.member_index() {
   92     89   
                Some(0) => {
   93     90   
                    builder.foo = Some(deser.read_string(member)?);
   94     91   
                }
   95     92   
                Some(1) => {
   96     93   
                    builder.blob = Some({
   97     94   
                        let _ = member;
   98     95   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   99     96   
                    });
  100     97   
                }
  101     98   
                _ => {}
  102     99   
            }
  103    100   
            Ok(())
  104    101   
        })?;
  105    102   
        Ok(builder.build())
  106    103   
    }
  107    104   
}
         105  +
impl StreamingTraitsWithMediaTypeOutput {
         106  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         107  +
    /// Header-bound members are read directly from headers, avoiding runtime
         108  +
    /// member iteration overhead. Body members are read via the deserializer.
         109  +
    pub fn deserialize_with_response(
         110  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         111  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         112  +
        _status: u16,
         113  +
        _body: &[u8],
         114  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         115  +
        #[allow(unused_variables, unused_mut)]
         116  +
        let mut builder = Self::builder();
         117  +
        if let Some(val) = headers.get("X-Foo") {
         118  +
            builder.foo = Some(val.to_string());
         119  +
        }
         120  +
        #[allow(
         121  +
            unused_variables,
         122  +
            unreachable_code,
         123  +
            clippy::single_match,
         124  +
            clippy::match_single_binding,
         125  +
            clippy::diverging_sub_expression
         126  +
        )]
         127  +
        deserializer.read_struct(&STREAMINGTRAITSWITHMEDIATYPEOUTPUT_SCHEMA, &mut |member, deser| {
         128  +
            match member.member_index() {
         129  +
                Some(0) => { /* read from headers above */ }
         130  +
                Some(1) => {
         131  +
                    builder.blob = Some({
         132  +
                        let _ = member;
         133  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         134  +
                    });
         135  +
                }
         136  +
                _ => {}
         137  +
            }
         138  +
            Ok(())
         139  +
        })?;
         140  +
        Ok(builder.build())
         141  +
    }
         142  +
}
  108    143   
impl StreamingTraitsWithMediaTypeOutput {
  109    144   
    /// Creates a new builder-style object to manufacture [`StreamingTraitsWithMediaTypeOutput`](crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput).
  110    145   
    pub fn builder() -> crate::operation::streaming_traits_with_media_type::builders::StreamingTraitsWithMediaTypeOutputBuilder {
  111    146   
        crate::operation::streaming_traits_with_media_type::builders::StreamingTraitsWithMediaTypeOutputBuilder::default()
  112    147   
    }
  113    148   
}
  114    149   
  115    150   
/// A builder for [`StreamingTraitsWithMediaTypeOutput`](crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput).
  116    151   
#[derive(::std::default::Default, ::std::fmt::Debug)]
  117    152   
#[non_exhaustive]

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

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

@@ -3,3 +131,169 @@
   23     23   
    "aws.protocoltests.restjson.synthetic",
   24     24   
    "TestBodyStructureInput",
   25     25   
);
   26     26   
static TESTBODYSTRUCTUREINPUT_MEMBER_TEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.restjson.synthetic#TestBodyStructureInput$testId",
   29     29   
        "aws.protocoltests.restjson.synthetic",
   30     30   
        "TestBodyStructureInput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "test_id",
          33  +
    "testId",
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-amz-test-id");
   37     37   
static TESTBODYSTRUCTUREINPUT_MEMBER_TEST_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restjson.synthetic#TestBodyStructureInput$testConfig",
   40     40   
        "aws.protocoltests.restjson.synthetic",
   41     41   
        "TestBodyStructureInput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Structure,
   44         -
    "test_config",
          44  +
    "testConfig",
   45     45   
    1,
   46     46   
);
   47     47   
static TESTBODYSTRUCTUREINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   48     48   
    TESTBODYSTRUCTUREINPUT_SCHEMA_ID,
   49     49   
    ::aws_smithy_schema::ShapeType::Structure,
   50     50   
    &[&TESTBODYSTRUCTUREINPUT_MEMBER_TEST_ID, &TESTBODYSTRUCTUREINPUT_MEMBER_TEST_CONFIG],
   51         -
);
          51  +
)
          52  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/body", None));
   52     53   
impl TestBodyStructureInput {
   53     54   
    /// The schema for this shape.
   54     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TESTBODYSTRUCTUREINPUT_SCHEMA;
   55     56   
}
   56     57   
impl ::aws_smithy_schema::serde::SerializableStruct for TestBodyStructureInput {
   57     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   58     59   
    fn serialize_members(
   59     60   
        &self,
   60     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   61     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   62     63   
        if let Some(ref val) = self.test_id {
   63     64   
            ser.write_string(&TESTBODYSTRUCTUREINPUT_MEMBER_TEST_ID, val)?;
   64     65   
        }
   65     66   
        if let Some(ref val) = self.test_config {
   66     67   
            ser.write_struct(&TESTBODYSTRUCTUREINPUT_MEMBER_TEST_CONFIG, val)?;
   67     68   
        }
   68     69   
        Ok(())
   69     70   
    }
   70     71   
}
   71     72   
impl TestBodyStructureInput {
   72     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   73         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   74         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   75     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   76     77   
        #[allow(unused_variables, unused_mut)]
   77     78   
        let mut builder = Self::builder();
   78     79   
        #[allow(
   79     80   
            unused_variables,
   80     81   
            unreachable_code,
   81     82   
            clippy::single_match,
   82     83   
            clippy::match_single_binding,
   83     84   
            clippy::diverging_sub_expression
   84     85   
        )]
   85         -
        deserializer.read_struct(&TESTBODYSTRUCTUREINPUT_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&TESTBODYSTRUCTUREINPUT_SCHEMA, &mut |member, deser| {
   86     87   
            match member.member_index() {
   87     88   
                Some(0) => {
   88     89   
                    builder.test_id = Some(deser.read_string(member)?);
   89     90   
                }
   90     91   
                Some(1) => {
   91     92   
                    builder.test_config = Some(crate::types::TestConfig::deserialize(deser)?);
   92     93   
                }
   93     94   
                _ => {}
   94     95   
            }
   95     96   
            Ok(())
   96     97   
        })?;
   97     98   
        builder
   98     99   
            .build()
   99    100   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  100    101   
    }
  101    102   
}
         103  +
impl TestBodyStructureInput {
         104  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         105  +
    /// Header-bound members are read directly from headers, avoiding runtime
         106  +
    /// member iteration overhead. Body members are read via the deserializer.
         107  +
    pub fn deserialize_with_response(
         108  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         109  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         110  +
        _status: u16,
         111  +
        _body: &[u8],
         112  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         113  +
        #[allow(unused_variables, unused_mut)]
         114  +
        let mut builder = Self::builder();
         115  +
        if let Some(val) = headers.get("x-amz-test-id") {
         116  +
            builder.test_id = Some(val.to_string());
         117  +
        }
         118  +
        #[allow(
         119  +
            unused_variables,
         120  +
            unreachable_code,
         121  +
            clippy::single_match,
         122  +
            clippy::match_single_binding,
         123  +
            clippy::diverging_sub_expression
         124  +
        )]
         125  +
        deserializer.read_struct(&TESTBODYSTRUCTUREINPUT_SCHEMA, &mut |member, deser| {
         126  +
            match member.member_index() {
         127  +
                Some(0) => { /* read from headers above */ }
         128  +
                Some(1) => {
         129  +
                    builder.test_config = Some(crate::types::TestConfig::deserialize(deser)?);
         130  +
                }
         131  +
                _ => {}
         132  +
            }
         133  +
            Ok(())
         134  +
        })?;
         135  +
        builder
         136  +
            .build()
         137  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         138  +
    }
         139  +
}
  102    140   
impl TestBodyStructureInput {
  103    141   
    /// Creates a new builder-style object to manufacture [`TestBodyStructureInput`](crate::operation::test_body_structure::TestBodyStructureInput).
  104    142   
    pub fn builder() -> crate::operation::test_body_structure::builders::TestBodyStructureInputBuilder {
  105    143   
        crate::operation::test_body_structure::builders::TestBodyStructureInputBuilder::default()
  106    144   
    }
  107    145   
}
  108    146   
  109    147   
/// A builder for [`TestBodyStructureInput`](crate::operation::test_body_structure::TestBodyStructureInput).
  110    148   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  111    149   
#[non_exhaustive]

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

@@ -3,3 +129,164 @@
   23     23   
    "aws.protocoltests.restjson.synthetic",
   24     24   
    "TestBodyStructureOutput",
   25     25   
);
   26     26   
static TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.restjson.synthetic#TestBodyStructureOutput$testId",
   29     29   
        "aws.protocoltests.restjson.synthetic",
   30     30   
        "TestBodyStructureOutput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "test_id",
          33  +
    "testId",
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-amz-test-id");
   37     37   
static TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "aws.protocoltests.restjson.synthetic#TestBodyStructureOutput$testConfig",
   40     40   
        "aws.protocoltests.restjson.synthetic",
   41     41   
        "TestBodyStructureOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Structure,
   44         -
    "test_config",
          44  +
    "testConfig",
   45     45   
    1,
   46     46   
);
   47     47   
static TESTBODYSTRUCTUREOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   48     48   
    TESTBODYSTRUCTUREOUTPUT_SCHEMA_ID,
   49     49   
    ::aws_smithy_schema::ShapeType::Structure,
   50     50   
    &[&TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_ID, &TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_CONFIG],
   51     51   
);
   52     52   
impl TestBodyStructureOutput {
   53     53   
    /// The schema for this shape.
   54     54   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TESTBODYSTRUCTUREOUTPUT_SCHEMA;
   55     55   
}
   56     56   
impl ::aws_smithy_schema::serde::SerializableStruct for TestBodyStructureOutput {
   57     57   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   58     58   
    fn serialize_members(
   59     59   
        &self,
   60     60   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   61     61   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   62     62   
        if let Some(ref val) = self.test_id {
   63     63   
            ser.write_string(&TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_ID, val)?;
   64     64   
        }
   65     65   
        if let Some(ref val) = self.test_config {
   66     66   
            ser.write_struct(&TESTBODYSTRUCTUREOUTPUT_MEMBER_TEST_CONFIG, val)?;
   67     67   
        }
   68     68   
        Ok(())
   69     69   
    }
   70     70   
}
   71     71   
impl TestBodyStructureOutput {
   72     72   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   73         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   74         -
        deserializer: &mut D,
          73  +
    pub fn deserialize(
          74  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   75     75   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   76     76   
        #[allow(unused_variables, unused_mut)]
   77     77   
        let mut builder = Self::builder();
   78     78   
        #[allow(
   79     79   
            unused_variables,
   80     80   
            unreachable_code,
   81     81   
            clippy::single_match,
   82     82   
            clippy::match_single_binding,
   83     83   
            clippy::diverging_sub_expression
   84     84   
        )]
   85         -
        deserializer.read_struct(&TESTBODYSTRUCTUREOUTPUT_SCHEMA, (), |_, member, deser| {
          85  +
        deserializer.read_struct(&TESTBODYSTRUCTUREOUTPUT_SCHEMA, &mut |member, deser| {
   86     86   
            match member.member_index() {
   87     87   
                Some(0) => {
   88     88   
                    builder.test_id = Some(deser.read_string(member)?);
   89     89   
                }
   90     90   
                Some(1) => {
   91     91   
                    builder.test_config = Some(crate::types::TestConfig::deserialize(deser)?);
   92     92   
                }
   93     93   
                _ => {}
   94     94   
            }
   95     95   
            Ok(())
   96     96   
        })?;
   97     97   
        Ok(builder.build())
   98     98   
    }
   99     99   
}
         100  +
impl TestBodyStructureOutput {
         101  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         102  +
    /// Header-bound members are read directly from headers, avoiding runtime
         103  +
    /// member iteration overhead. Body members are read via the deserializer.
         104  +
    pub fn deserialize_with_response(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         106  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         107  +
        _status: u16,
         108  +
        _body: &[u8],
         109  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         110  +
        #[allow(unused_variables, unused_mut)]
         111  +
        let mut builder = Self::builder();
         112  +
        if let Some(val) = headers.get("x-amz-test-id") {
         113  +
            builder.test_id = Some(val.to_string());
         114  +
        }
         115  +
        #[allow(
         116  +
            unused_variables,
         117  +
            unreachable_code,
         118  +
            clippy::single_match,
         119  +
            clippy::match_single_binding,
         120  +
            clippy::diverging_sub_expression
         121  +
        )]
         122  +
        deserializer.read_struct(&TESTBODYSTRUCTUREOUTPUT_SCHEMA, &mut |member, deser| {
         123  +
            match member.member_index() {
         124  +
                Some(0) => { /* read from headers above */ }
         125  +
                Some(1) => {
         126  +
                    builder.test_config = Some(crate::types::TestConfig::deserialize(deser)?);
         127  +
                }
         128  +
                _ => {}
         129  +
            }
         130  +
            Ok(())
         131  +
        })?;
         132  +
        Ok(builder.build())
         133  +
    }
         134  +
}
  100    135   
impl TestBodyStructureOutput {
  101    136   
    /// Creates a new builder-style object to manufacture [`TestBodyStructureOutput`](crate::operation::test_body_structure::TestBodyStructureOutput).
  102    137   
    pub fn builder() -> crate::operation::test_body_structure::builders::TestBodyStructureOutputBuilder {
  103    138   
        crate::operation::test_body_structure::builders::TestBodyStructureOutputBuilder::default()
  104    139   
    }
  105    140   
}
  106    141   
  107    142   
/// A builder for [`TestBodyStructureOutput`](crate::operation::test_body_structure::TestBodyStructureOutput).
  108    143   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  109    144   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/test_get_no_input_no_payload.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 `TestGetNoInputNoPayload`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TestGetNoInputNoPayload;
    6      6   
impl TestGetNoInputNoPayload {
    7      7   
    /// Creates a new `TestGetNoInputNoPayload`
    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::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadOutput::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::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadError,
  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 TestGetNoInputNoPayloadResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TestGetNoInputNoPayloadResponseDeserializer {
  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_test_get_no_input_no_payload::de_test_get_no_input_no_payload_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::test_get_no_input_no_payload::TestGetNoInputNoPayloadError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_test_get_no_input_no_payload::de_test_get_no_input_no_payload_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, TestGetNoInputNoPayload::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::test_get_no_input_no_payload::TestGetNoInputNoPayloadOutput::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 TestGetNoInputNoPayloadRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TestGetNoInputNoPayloadRequestSerializer {
  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::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput>()
  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::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput,
  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, "/no_input_no_payload").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput,
  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, TestGetNoInputNoPayload::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 TestGetNoInputNoPayloadEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TestGetNoInputNoPayloadEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "TestGetNoInputNoPayloadEndpointParamsInterceptor"
  207    220   
    }
  208    221   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/test_get_no_input_no_payload/_test_get_no_input_no_payload_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 TestGetNoInputNoPayloadInput {}
    6      6   
static TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.restjson.synthetic#TestGetNoInputNoPayloadInput",
    8      8   
    "aws.protocoltests.restjson.synthetic",
    9      9   
    "TestGetNoInputNoPayloadInput",
   10     10   
);
   11     11   
static TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/no_input_no_payload", None));
   13     14   
impl TestGetNoInputNoPayloadInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for TestGetNoInputNoPayloadInput {
   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 TestGetNoInputNoPayloadInput {
   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(&TESTGETNOINPUTNOPAYLOADINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&TESTGETNOINPUTNOPAYLOADINPUT_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 TestGetNoInputNoPayloadInput {
          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 TestGetNoInputNoPayloadInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`TestGetNoInputNoPayloadInput`](crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput).
   53     67   
    pub fn builder() -> crate::operation::test_get_no_input_no_payload::builders::TestGetNoInputNoPayloadInputBuilder {
   54     68   
        crate::operation::test_get_no_input_no_payload::builders::TestGetNoInputNoPayloadInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`TestGetNoInputNoPayloadInput`](crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadInput).
   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/test_get_no_input_no_payload/_test_get_no_input_no_payload_output.rs

@@ -1,1 +107,125 @@
   17     17   
    "aws.protocoltests.restjson.synthetic",
   18     18   
    "TestGetNoInputNoPayloadOutput",
   19     19   
);
   20     20   
static TESTGETNOINPUTNOPAYLOADOUTPUT_MEMBER_TEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restjson.synthetic#TestGetNoInputNoPayloadOutput$testId",
   23     23   
        "aws.protocoltests.restjson.synthetic",
   24     24   
        "TestGetNoInputNoPayloadOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "test_id",
          27  +
    "testId",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_header("X-Amz-Test-Id");
   31     31   
static TESTGETNOINPUTNOPAYLOADOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    TESTGETNOINPUTNOPAYLOADOUTPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&TESTGETNOINPUTNOPAYLOADOUTPUT_MEMBER_TEST_ID],
   35     35   
);
   36     36   
impl TestGetNoInputNoPayloadOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TESTGETNOINPUTNOPAYLOADOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for TestGetNoInputNoPayloadOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.test_id {
   47     47   
            ser.write_string(&TESTGETNOINPUTNOPAYLOADOUTPUT_MEMBER_TEST_ID, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl TestGetNoInputNoPayloadOutput {
   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(&TESTGETNOINPUTNOPAYLOADOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&TESTGETNOINPUTNOPAYLOADOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.test_id = 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 TestGetNoInputNoPayloadOutput {
          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 let Some(val) = headers.get("X-Amz-Test-Id") {
          91  +
            builder.test_id = Some(val.to_string());
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl TestGetNoInputNoPayloadOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`TestGetNoInputNoPayloadOutput`](crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadOutput).
   80     98   
    pub fn builder() -> crate::operation::test_get_no_input_no_payload::builders::TestGetNoInputNoPayloadOutputBuilder {
   81     99   
        crate::operation::test_get_no_input_no_payload::builders::TestGetNoInputNoPayloadOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`TestGetNoInputNoPayloadOutput`](crate::operation::test_get_no_input_no_payload::TestGetNoInputNoPayloadOutput).
   86    104   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    105   
#[non_exhaustive]

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `TestGetNoPayload`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TestGetNoPayload;
    6      6   
impl TestGetNoPayload {
    7      7   
    /// Creates a new `TestGetNoPayload`
    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::test_get_no_payload::TestGetNoPayloadInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::test_get_no_payload::TestGetNoPayloadOutput::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::test_get_no_payload::TestGetNoPayloadInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::test_get_no_payload::TestGetNoPayloadOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::test_get_no_payload::TestGetNoPayloadError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +229,239 @@
  130    134   
                crate::operation::test_get_no_payload::TestGetNoPayloadError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct TestGetNoPayloadResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TestGetNoPayloadResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_test_get_no_payload::de_test_get_no_payload_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::test_get_no_payload::TestGetNoPayloadError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_test_get_no_payload::de_test_get_no_payload_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, TestGetNoPayload::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::test_get_no_payload::TestGetNoPayloadOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct TestGetNoPayloadRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TestGetNoPayloadRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::test_get_no_payload::TestGetNoPayloadInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::test_get_no_payload::TestGetNoPayloadInput,
  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, "/no_payload").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::test_get_no_payload::TestGetNoPayloadInput,
  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_test_get_no_payload::ser_test_get_no_payload_headers(input, builder)?;
  192         -
                ::std::result::Result::Ok(builder.method("GET").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("");
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, TestGetNoPayload::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  198    208   
  199         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         209  +
        return ::std::result::Result::Ok(request);
  200    210   
    }
  201    211   
}
  202    212   
#[derive(Debug)]
  203    213   
struct TestGetNoPayloadEndpointParamsInterceptor;
  204    214   
  205    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TestGetNoPayloadEndpointParamsInterceptor {
  206    216   
    fn name(&self) -> &'static str {
  207    217   
        "TestGetNoPayloadEndpointParamsInterceptor"
  208    218   
    }
  209    219