Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

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

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

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string.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 `MalformedAcceptWithGenericString`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedAcceptWithGenericString;
    6      6   
impl MalformedAcceptWithGenericString {
    7      7   
    /// Creates a new `MalformedAcceptWithGenericString`
    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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput::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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +232,241 @@
  130    136   
                crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
  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 MalformedAcceptWithGenericStringResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithGenericStringResponseDeserializer {
  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_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_error(
  152         -
                status, headers, body,
  153         -
            )
         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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError::generic(generic),
         167  +
                ),
         168  +
            ))
  154    169   
        } else {
  155         -
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_response(
  156         -
                status, headers, body,
         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, MalformedAcceptWithGenericString::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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  157    184   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         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  +
        }
  160    190   
    }
  161    191   
}
  162    192   
#[derive(Debug)]
  163    193   
struct MalformedAcceptWithGenericStringRequestSerializer;
  164    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithGenericStringRequestSerializer {
  165    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    196   
    fn serialize_input(
  167    197   
        &self,
  168    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    201   
        let input = input
  172    202   
            .downcast::<crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput>()
  173    203   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                ::std::write!(output, "/MalformedAcceptWithGenericString").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  196         -
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder
  199         -
        };
  200         -
        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, MalformedAcceptWithGenericString::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  201    210   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  203    212   
    }
  204    213   
}
  205    214   
#[derive(Debug)]
  206    215   
struct MalformedAcceptWithGenericStringEndpointParamsInterceptor;
  207    216   
  208    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithGenericStringEndpointParamsInterceptor {
  209    218   
    fn name(&self) -> &'static str {
  210    219   
        "MalformedAcceptWithGenericStringEndpointParamsInterceptor"
  211    220   
    }
  212    221   

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_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 `MalformedAcceptWithPayload`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedAcceptWithPayload;
    6      6   
impl MalformedAcceptWithPayload {
    7      7   
    /// Creates a new `MalformedAcceptWithPayload`
    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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput::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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
  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 MalformedAcceptWithPayloadResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithPayloadResponseDeserializer {
  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_malformed_accept_with_payload::de_malformed_accept_with_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::malformed_accept_with_payload::MalformedAcceptWithPayloadError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_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, MalformedAcceptWithPayload::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::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput::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 MalformedAcceptWithPayloadRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithPayloadRequestSerializer {
  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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput>()
  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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  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, "/MalformedAcceptWithPayload").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  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, MalformedAcceptWithPayload::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 MalformedAcceptWithPayloadEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithPayloadEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "MalformedAcceptWithPayloadEndpointParamsInterceptor"
  207    220   
    }
  208    221   

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

@@ -1,1 +107,126 @@
   20     20   
static MALFORMEDACCEPTWITHPAYLOADOUTPUT_MEMBER_PAYLOAD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restjson.synthetic#MalformedAcceptWithPayloadOutput$payload",
   23     23   
        "aws.protocoltests.restjson.synthetic",
   24     24   
        "MalformedAcceptWithPayloadOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Blob,
   27     27   
    "payload",
   28     28   
    0,
   29     29   
)
   30         -
.with_http_payload();
          30  +
.with_http_payload()
          31  +
.with_media_type("image/jpeg");
   31     32   
static MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     33   
    MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA_ID,
   33     34   
    ::aws_smithy_schema::ShapeType::Structure,
   34     35   
    &[&MALFORMEDACCEPTWITHPAYLOADOUTPUT_MEMBER_PAYLOAD],
   35     36   
);
   36     37   
impl MalformedAcceptWithPayloadOutput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedAcceptWithPayloadOutput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.payload {
   47     48   
            ser.write_blob(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_MEMBER_PAYLOAD, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl MalformedAcceptWithPayloadOutput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.payload = Some(deser.read_blob(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
   75     76   
        Ok(builder.build())
   76     77   
    }
   77     78   
}
          79  +
impl MalformedAcceptWithPayloadOutput {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          81  +
    /// Header-bound members are read directly from headers, avoiding runtime
          82  +
    /// member iteration overhead. Body members are read via the deserializer.
          83  +
    pub fn deserialize_with_response(
          84  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        #[allow(unused_variables, unused_mut)]
          90  +
        let mut builder = Self::builder();
          91  +
        if !body.is_empty() {
          92  +
            builder.payload = Some(::aws_smithy_types::Blob::new(body.to_vec()));
          93  +
        }
          94  +
        Ok(builder.build())
          95  +
    }
          96  +
}
   78     97   
impl MalformedAcceptWithPayloadOutput {
   79     98   
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
   80     99   
    pub fn builder() -> crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder {
   81    100   
        crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder::default()
   82    101   
    }
   83    102   
}
   84    103   
   85    104   
/// A builder for [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
   86    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    106   
#[non_exhaustive]

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

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

@@ -4,4 +108,120 @@
   24     24   
        "MalformedBlobInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Blob,
   27     27   
    "blob",
   28     28   
    0,
   29     29   
);
   30     30   
static MALFORMEDBLOBINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    MALFORMEDBLOBINPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&MALFORMEDBLOBINPUT_MEMBER_BLOB],
   34         -
);
          34  +
)
          35  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedBlob", None));
   35     36   
impl MalformedBlobInput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDBLOBINPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedBlobInput {
   40     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     42   
    fn serialize_members(
   42     43   
        &self,
   43     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     46   
        if let Some(ref val) = self.blob {
   46     47   
            ser.write_blob(&MALFORMEDBLOBINPUT_MEMBER_BLOB, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl MalformedBlobInput {
   52     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     57   
        #[allow(unused_variables, unused_mut)]
   57     58   
        let mut builder = Self::builder();
   58     59   
        #[allow(
   59     60   
            unused_variables,
   60     61   
            unreachable_code,
   61     62   
            clippy::single_match,
   62     63   
            clippy::match_single_binding,
   63     64   
            clippy::diverging_sub_expression
   64     65   
        )]
   65         -
        deserializer.read_struct(&MALFORMEDBLOBINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&MALFORMEDBLOBINPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.blob = Some(deser.read_blob(member)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
   74     75   
        builder
   75     76   
            .build()
   76     77   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     78   
    }
   78     79   
}
          80  +
impl MalformedBlobInput {
          81  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        _body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        Self::deserialize(deserializer)
          89  +
    }
          90  +
}
   79     91   
impl MalformedBlobInput {
   80     92   
    /// Creates a new builder-style object to manufacture [`MalformedBlobInput`](crate::operation::malformed_blob::MalformedBlobInput).
   81     93   
    pub fn builder() -> crate::operation::malformed_blob::builders::MalformedBlobInputBuilder {
   82     94   
        crate::operation::malformed_blob::builders::MalformedBlobInputBuilder::default()
   83     95   
    }
   84     96   
}
   85     97   
   86     98   
/// A builder for [`MalformedBlobInput`](crate::operation::malformed_blob::MalformedBlobInput).
   87     99   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    100   
#[non_exhaustive]

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_boolean.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 `MalformedBoolean`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedBoolean;
    6      6   
impl MalformedBoolean {
    7      7   
    /// Creates a new `MalformedBoolean`
    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::malformed_boolean::MalformedBooleanInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::malformed_boolean::MalformedBooleanOutput::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::malformed_boolean::MalformedBooleanInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::malformed_boolean::MalformedBooleanOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::malformed_boolean::MalformedBooleanError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +258,239 @@
  130    134   
                crate::operation::malformed_boolean::MalformedBooleanError,
  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 MalformedBooleanResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedBooleanResponseDeserializer {
  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_malformed_boolean::de_malformed_boolean_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::malformed_boolean::MalformedBooleanError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_boolean::de_malformed_boolean_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, MalformedBoolean::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::malformed_boolean::MalformedBooleanOutput::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 MalformedBooleanRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedBooleanRequestSerializer {
  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::malformed_boolean::MalformedBooleanInput>()
  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::malformed_boolean::MalformedBooleanInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                let input_1 = &_input.boolean_in_path;
  182         -
                let input_1 = input_1
  183         -
                    .as_ref()
  184         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("boolean_in_path", "cannot be empty or unset"))?;
  185         -
                let mut boolean_in_path_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_1);
  186         -
                let boolean_in_path = boolean_in_path_encoder.encode();
  187         -
                if boolean_in_path.is_empty() {
  188         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  189         -
                        "boolean_in_path",
  190         -
                        "cannot be empty or unset",
  191         -
                    ));
  192         -
                }
  193         -
                ::std::write!(output, "/MalformedBoolean/{booleanInPath}", booleanInPath = boolean_in_path).expect("formatting should succeed");
  194         -
                ::std::result::Result::Ok(())
  195         -
            }
  196         -
            fn uri_query(
  197         -
                _input: &crate::operation::malformed_boolean::MalformedBooleanInput,
  198         -
                mut output: &mut ::std::string::String,
  199         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  200         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  201         -
                if let ::std::option::Option::Some(inner_2) = &_input.boolean_in_query {
  202         -
                    {
  203         -
                        query.push_kv("booleanInQuery", ::aws_smithy_types::primitive::Encoder::from(*inner_2).encode());
  204         -
                    }
  205         -
                }
  206         -
                ::std::result::Result::Ok(())
  207         -
            }
  208         -
            #[allow(clippy::unnecessary_wraps)]
  209         -
            fn update_http_builder(
  210         -
                input: &crate::operation::malformed_boolean::MalformedBooleanInput,
  211         -
                builder: ::http_1x::request::Builder,
  212         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  213         -
                let mut uri = ::std::string::String::new();
  214         -
                uri_base(input, &mut uri)?;
  215         -
                uri_query(input, &mut uri)?;
  216         -
                let builder = crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_headers(input, builder)?;
  217         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  218         -
            }
  219         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  220         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  221         -
            builder
  222         -
        };
  223         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_input(&input)?);
  224         -
        if let Some(content_length) = body.content_length() {
  225         -
            let content_length = content_length.to_string();
  226         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  227         -
        }
  228         -
        ::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, MalformedBoolean::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  229    210   
    }
  230    211   
}
  231    212   
#[derive(Debug)]
  232    213   
struct MalformedBooleanEndpointParamsInterceptor;
  233    214   
  234    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedBooleanEndpointParamsInterceptor {
  235    216   
    fn name(&self) -> &'static str {
  236    217   
        "MalformedBooleanEndpointParamsInterceptor"
  237    218   
    }
  238    219   

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

@@ -15,15 +177,226 @@
   35     35   
    "aws.protocoltests.restjson.synthetic",
   36     36   
    "MalformedBooleanInput",
   37     37   
);
   38     38   
static MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_BODY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "aws.protocoltests.restjson.synthetic#MalformedBooleanInput$booleanInBody",
   41     41   
        "aws.protocoltests.restjson.synthetic",
   42     42   
        "MalformedBooleanInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::Boolean,
   45         -
    "boolean_in_body",
          45  +
    "booleanInBody",
   46     46   
    0,
   47     47   
);
   48     48   
static MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_PATH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   49     49   
    ::aws_smithy_schema::ShapeId::from_static(
   50     50   
        "aws.protocoltests.restjson.synthetic#MalformedBooleanInput$booleanInPath",
   51     51   
        "aws.protocoltests.restjson.synthetic",
   52     52   
        "MalformedBooleanInput",
   53     53   
    ),
   54     54   
    ::aws_smithy_schema::ShapeType::Boolean,
   55         -
    "boolean_in_path",
          55  +
    "booleanInPath",
   56     56   
    1,
   57     57   
)
   58     58   
.with_http_label();
   59     59   
static MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_QUERY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   60     60   
    ::aws_smithy_schema::ShapeId::from_static(
   61     61   
        "aws.protocoltests.restjson.synthetic#MalformedBooleanInput$booleanInQuery",
   62     62   
        "aws.protocoltests.restjson.synthetic",
   63     63   
        "MalformedBooleanInput",
   64     64   
    ),
   65     65   
    ::aws_smithy_schema::ShapeType::Boolean,
   66         -
    "boolean_in_query",
          66  +
    "booleanInQuery",
   67     67   
    2,
   68     68   
)
   69     69   
.with_http_query("booleanInQuery");
   70     70   
static MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   71     71   
    ::aws_smithy_schema::ShapeId::from_static(
   72     72   
        "aws.protocoltests.restjson.synthetic#MalformedBooleanInput$booleanInHeader",
   73     73   
        "aws.protocoltests.restjson.synthetic",
   74     74   
        "MalformedBooleanInput",
   75     75   
    ),
   76     76   
    ::aws_smithy_schema::ShapeType::Boolean,
   77         -
    "boolean_in_header",
          77  +
    "booleanInHeader",
   78     78   
    3,
   79     79   
)
   80     80   
.with_http_header("booleanInHeader");
   81     81   
static MALFORMEDBOOLEANINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   82     82   
    MALFORMEDBOOLEANINPUT_SCHEMA_ID,
   83     83   
    ::aws_smithy_schema::ShapeType::Structure,
   84     84   
    &[
   85     85   
        &MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_BODY,
   86     86   
        &MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_PATH,
   87     87   
        &MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_QUERY,
   88     88   
        &MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_HEADER,
   89     89   
    ],
   90         -
);
          90  +
)
          91  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          92  +
    "POST",
          93  +
    "/MalformedBoolean/{booleanInPath}",
          94  +
    None,
          95  +
));
   91     96   
impl MalformedBooleanInput {
   92     97   
    /// The schema for this shape.
   93     98   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDBOOLEANINPUT_SCHEMA;
   94     99   
}
   95    100   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedBooleanInput {
   96    101   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   97    102   
    fn serialize_members(
   98    103   
        &self,
   99    104   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  100    105   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  101    106   
        if let Some(ref val) = self.boolean_in_body {
  102    107   
            ser.write_boolean(&MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_BODY, *val)?;
  103    108   
        }
  104    109   
        if let Some(ref val) = self.boolean_in_path {
  105    110   
            ser.write_boolean(&MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_PATH, *val)?;
  106    111   
        }
  107    112   
        if let Some(ref val) = self.boolean_in_query {
  108    113   
            ser.write_boolean(&MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_QUERY, *val)?;
  109    114   
        }
  110    115   
        if let Some(ref val) = self.boolean_in_header {
  111    116   
            ser.write_boolean(&MALFORMEDBOOLEANINPUT_MEMBER_BOOLEAN_IN_HEADER, *val)?;
  112    117   
        }
  113    118   
        Ok(())
  114    119   
    }
  115    120   
}
  116    121   
impl MalformedBooleanInput {
  117    122   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  118         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  119         -
        deserializer: &mut D,
         123  +
    pub fn deserialize(
         124  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  120    125   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  121    126   
        #[allow(unused_variables, unused_mut)]
  122    127   
        let mut builder = Self::builder();
  123    128   
        #[allow(
  124    129   
            unused_variables,
  125    130   
            unreachable_code,
  126    131   
            clippy::single_match,
  127    132   
            clippy::match_single_binding,
  128    133   
            clippy::diverging_sub_expression
  129    134   
        )]
  130         -
        deserializer.read_struct(&MALFORMEDBOOLEANINPUT_SCHEMA, (), |_, member, deser| {
         135  +
        deserializer.read_struct(&MALFORMEDBOOLEANINPUT_SCHEMA, &mut |member, deser| {
  131    136   
            match member.member_index() {
  132    137   
                Some(0) => {
  133    138   
                    builder.boolean_in_body = Some(deser.read_boolean(member)?);
  134    139   
                }
  135    140   
                Some(1) => {
  136    141   
                    builder.boolean_in_path = Some(deser.read_boolean(member)?);
  137    142   
                }
  138    143   
                Some(2) => {
  139    144   
                    builder.boolean_in_query = Some(deser.read_boolean(member)?);
  140    145   
                }
  141    146   
                Some(3) => {
  142    147   
                    builder.boolean_in_header = Some(deser.read_boolean(member)?);
  143    148   
                }
  144    149   
                _ => {}
  145    150   
            }
  146    151   
            Ok(())
  147    152   
        })?;
         153  +
        builder.boolean_in_path = builder.boolean_in_path.or(Some(false));
         154  +
        builder
         155  +
            .build()
         156  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         157  +
    }
         158  +
}
         159  +
impl MalformedBooleanInput {
         160  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         161  +
    /// Header-bound members are read directly from headers, avoiding runtime
         162  +
    /// member iteration overhead. Body members are read via the deserializer.
         163  +
    pub fn deserialize_with_response(
         164  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         165  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         166  +
        _status: u16,
         167  +
        _body: &[u8],
         168  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         169  +
        #[allow(unused_variables, unused_mut)]
         170  +
        let mut builder = Self::builder();
         171  +
        if let Some(val) = headers.get("booleanInHeader") {
         172  +
            builder.boolean_in_header = val.parse::<bool>().ok();
         173  +
        }
         174  +
        #[allow(
         175  +
            unused_variables,
         176  +
            unreachable_code,
         177  +
            clippy::single_match,
         178  +
            clippy::match_single_binding,
         179  +
            clippy::diverging_sub_expression
         180  +
        )]
         181  +
        deserializer.read_struct(&MALFORMEDBOOLEANINPUT_SCHEMA, &mut |member, deser| {
         182  +
            match member.member_index() {
         183  +
                Some(0) => {
         184  +
                    builder.boolean_in_body = Some(deser.read_boolean(member)?);
         185  +
                }
         186  +
                Some(1) => {
         187  +
                    builder.boolean_in_path = Some(deser.read_boolean(member)?);
         188  +
                }
         189  +
                Some(2) => {
         190  +
                    builder.boolean_in_query = Some(deser.read_boolean(member)?);
         191  +
                }
         192  +
                Some(3) => { /* read from headers above */ }
         193  +
                _ => {}
         194  +
            }
         195  +
            Ok(())
         196  +
        })?;
  148    197   
        builder
  149    198   
            .build()
  150    199   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  151    200   
    }
  152    201   
}
  153    202   
impl MalformedBooleanInput {
  154    203   
    /// Creates a new builder-style object to manufacture [`MalformedBooleanInput`](crate::operation::malformed_boolean::MalformedBooleanInput).
  155    204   
    pub fn builder() -> crate::operation::malformed_boolean::builders::MalformedBooleanInputBuilder {
  156    205   
        crate::operation::malformed_boolean::builders::MalformedBooleanInputBuilder::default()
  157    206   
    }

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

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