Client Test

Client Test

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/put_with_content_encoding/_put_with_content_encoding_input.rs

@@ -1,1 +50,174 @@
   11     11   
impl PutWithContentEncodingInput {
   12     12   
    #[allow(missing_docs)] // documentation missing in model
   13     13   
    pub fn encoding(&self) -> ::std::option::Option<&str> {
   14     14   
        self.encoding.as_deref()
   15     15   
    }
   16     16   
    #[allow(missing_docs)] // documentation missing in model
   17     17   
    pub fn data(&self) -> ::std::option::Option<&str> {
   18     18   
        self.data.as_deref()
   19     19   
    }
   20     20   
}
          21  +
static PUTWITHCONTENTENCODINGINPUT_MEMBER_ENCODING: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "aws.protocoltests.json10.synthetic#PutWithContentEncodingInput$encoding",
          24  +
        "aws.protocoltests.json10.synthetic",
          25  +
        "PutWithContentEncodingInput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::String,
          28  +
    "encoding",
          29  +
    0,
          30  +
)
          31  +
.with_http_header("Content-Encoding");
          32  +
static PUTWITHCONTENTENCODINGINPUT_MEMBER_DATA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_parts(
          34  +
        "aws.protocoltests.json10.synthetic#PutWithContentEncodingInput$data",
          35  +
        "aws.protocoltests.json10.synthetic",
          36  +
        "PutWithContentEncodingInput",
          37  +
    ),
          38  +
    ::aws_smithy_schema::ShapeType::String,
          39  +
    "data",
          40  +
    1,
          41  +
);
          42  +
static PUTWITHCONTENTENCODINGINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts(
          44  +
        "aws.protocoltests.json10.synthetic#PutWithContentEncodingInput",
          45  +
        "aws.protocoltests.json10.synthetic",
          46  +
        "PutWithContentEncodingInput",
          47  +
    ),
          48  +
    ::aws_smithy_schema::ShapeType::Structure,
          49  +
    &[&PUTWITHCONTENTENCODINGINPUT_MEMBER_ENCODING, &PUTWITHCONTENTENCODINGINPUT_MEMBER_DATA],
          50  +
)
          51  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          52  +
.with_original_name("PutWithContentEncodingInput");
          53  +
impl PutWithContentEncodingInput {
          54  +
    /// The schema for this shape.
          55  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTWITHCONTENTENCODINGINPUT_SCHEMA;
          56  +
}
          57  +
impl ::aws_smithy_schema::serde::SerializableStruct for PutWithContentEncodingInput {
          58  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          59  +
    fn serialize_members(
          60  +
        &self,
          61  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          62  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          63  +
        if let Some(ref val) = self.encoding {
          64  +
            ser.write_string(&PUTWITHCONTENTENCODINGINPUT_MEMBER_ENCODING, val)?;
          65  +
        }
          66  +
        if let Some(ref val) = self.data {
          67  +
            ser.write_string(&PUTWITHCONTENTENCODINGINPUT_MEMBER_DATA, val)?;
          68  +
        }
          69  +
        Ok(())
          70  +
    }
          71  +
}
          72  +
impl PutWithContentEncodingInput {
          73  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          76  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          77  +
        #[allow(unused_variables, unused_mut)]
          78  +
        let mut builder = Self::builder();
          79  +
        #[allow(
          80  +
            unused_variables,
          81  +
            unreachable_code,
          82  +
            clippy::single_match,
          83  +
            clippy::match_single_binding,
          84  +
            clippy::diverging_sub_expression
          85  +
        )]
          86  +
        deserializer.read_struct(&PUTWITHCONTENTENCODINGINPUT_SCHEMA, &mut |member, deser| {
          87  +
            match member.member_index() {
          88  +
                Some(0) => {
          89  +
                    if deser.is_null() {
          90  +
                        deser.read_null()?;
          91  +
                    } else {
          92  +
                        builder.encoding = Some(deser.read_string(member)?);
          93  +
                    }
          94  +
                }
          95  +
                Some(1) => {
          96  +
                    if deser.is_null() {
          97  +
                        deser.read_null()?;
          98  +
                    } else {
          99  +
                        builder.data = Some(deser.read_string(member)?);
         100  +
                    }
         101  +
                }
         102  +
                _ => {}
         103  +
            }
         104  +
            Ok(())
         105  +
        })?;
         106  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         107  +
    }
         108  +
}
         109  +
impl PutWithContentEncodingInput {
         110  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         111  +
    /// Header-bound members are read directly from headers, avoiding runtime
         112  +
    /// member iteration overhead. Body members are read via the deserializer.
         113  +
    pub fn deserialize_with_response(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         116  +
        _status: u16,
         117  +
        _body: &[u8],
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        #[allow(unused_variables, unused_mut)]
         120  +
        let mut builder = Self::builder();
         121  +
        if let Some(val) = headers.get("Content-Encoding") {
         122  +
            builder.encoding = Some(val.to_string());
         123  +
        }
         124  +
         125  +
        #[allow(
         126  +
            unused_variables,
         127  +
            unreachable_code,
         128  +
            clippy::single_match,
         129  +
            clippy::match_single_binding,
         130  +
            clippy::diverging_sub_expression
         131  +
        )]
         132  +
        deserializer.read_struct(&PUTWITHCONTENTENCODINGINPUT_SCHEMA, &mut |member, deser| {
         133  +
            match member.member_index() {
         134  +
                Some(0) => { /* read from headers above */ }
         135  +
                Some(1) => {
         136  +
                    builder.data = Some(deser.read_string(member)?);
         137  +
                }
         138  +
                _ => {}
         139  +
            }
         140  +
            Ok(())
         141  +
        })?;
         142  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         143  +
    }
         144  +
}
   21    145   
impl PutWithContentEncodingInput {
   22    146   
    /// Creates a new builder-style object to manufacture [`PutWithContentEncodingInput`](crate::operation::put_with_content_encoding::PutWithContentEncodingInput).
   23    147   
    pub fn builder() -> crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder {
   24    148   
        crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder::default()
   25    149   
    }
   26    150   
}
   27    151   
   28    152   
/// A builder for [`PutWithContentEncodingInput`](crate::operation::put_with_content_encoding::PutWithContentEncodingInput).
   29    153   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   30    154   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/put_with_content_encoding/_put_with_content_encoding_output.rs

@@ -1,1 +22,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    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 PutWithContentEncodingOutput {}
           6  +
static PUTWITHCONTENTENCODINGOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#PutWithContentEncodingOutput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "PutWithContentEncodingOutput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
);
          15  +
impl PutWithContentEncodingOutput {
          16  +
    /// The schema for this shape.
          17  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTWITHCONTENTENCODINGOUTPUT_SCHEMA;
          18  +
}
          19  +
impl ::aws_smithy_schema::serde::SerializableStruct for PutWithContentEncodingOutput {
          20  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          21  +
    fn serialize_members(
          22  +
        &self,
          23  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          24  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          25  +
        Ok(())
          26  +
    }
          27  +
}
          28  +
impl PutWithContentEncodingOutput {
          29  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          30  +
    pub fn deserialize(
          31  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          32  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          33  +
        #[allow(unused_variables, unused_mut)]
          34  +
        let mut builder = Self::builder();
          35  +
        #[allow(
          36  +
            unused_variables,
          37  +
            unreachable_code,
          38  +
            clippy::single_match,
          39  +
            clippy::match_single_binding,
          40  +
            clippy::diverging_sub_expression
          41  +
        )]
          42  +
        deserializer.read_struct(&PUTWITHCONTENTENCODINGOUTPUT_SCHEMA, &mut |member, deser| {
          43  +
            match member.member_index() {
          44  +
                _ => {}
          45  +
            }
          46  +
            Ok(())
          47  +
        })?;
          48  +
        Ok(builder.build())
          49  +
    }
          50  +
}
          51  +
impl PutWithContentEncodingOutput {
          52  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          53  +
    pub fn deserialize_with_response(
          54  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          55  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          56  +
        _status: u16,
          57  +
        _body: &[u8],
          58  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          59  +
        Ok(Self::builder().build())
          60  +
    }
          61  +
}
    6     62   
impl PutWithContentEncodingOutput {
    7     63   
    /// Creates a new builder-style object to manufacture [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
    8     64   
    pub fn builder() -> crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder {
    9     65   
        crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default()
   10     66   
    }
   11     67   
}
   12     68   
   13     69   
/// A builder for [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
   14     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   15     71   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/query_incompatible_operation.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 `QueryIncompatibleOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct QueryIncompatibleOperation;
    6      6   
impl QueryIncompatibleOperation {
    7      7   
    /// Creates a new `QueryIncompatibleOperation`
    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<'static> =
          13  +
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput::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::query_incompatible_operation::QueryIncompatibleOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -120,126 +241,258 @@
  140    146   
  141    147   
#[derive(Debug)]
  142    148   
struct QueryIncompatibleOperationResponseDeserializer;
  143    149   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryIncompatibleOperationResponseDeserializer {
  144    150   
    fn deserialize_nonstreaming_with_config(
  145    151   
        &self,
  146    152   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  147    153   
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  148    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  149    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  150         -
        let headers = response.headers();
         156  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         157  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         158  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         159  +
        // loads `body` before firing this hook.
  151    160   
        let body = response.body().bytes().expect("body loaded");
         161  +
        let headers = response.headers();
  152    162   
        #[allow(unused_mut)]
  153    163   
        let mut force_error = false;
  154    164   
  155         -
        let parse_result = if !success && status != 200 || force_error {
  156         -
            crate::protocol_serde::shape_query_incompatible_operation::de_query_incompatible_operation_http_error(status, headers, body)
         165  +
        if !success && status != 200 || force_error {
         166  +
            let protocol = _cfg
         167  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         168  +
                .expect("a SharedClientProtocol is required");
         169  +
            #[allow(unused_mut)]
         170  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         171  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         172  +
            })?;
         173  +
         174  +
            let generic = generic_builder.build();
         175  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         176  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         177  +
                    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError::generic(generic),
         178  +
                ),
         179  +
            ))
  157    180   
        } else {
  158         -
            crate::protocol_serde::shape_query_incompatible_operation::de_query_incompatible_operation_http_response(status, headers, body)
  159         -
        };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         181  +
            let protocol = _cfg
         182  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         183  +
                .expect("a SharedClientProtocol is required");
         184  +
            let mut deser = protocol
         185  +
                .deserialize_response(response, QueryIncompatibleOperation::OUTPUT_SCHEMA, _cfg)
         186  +
                .map_err(|e| {
         187  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         188  +
                })?;
         189  +
            // body and headers are already in scope from the top of the function;
         190  +
            // alias `headers` as `_response_headers` so MutateOutput
         191  +
            // customizations have a stable name to read from.
         192  +
            let _response_headers = headers;
         193  +
            #[allow(unused_mut)]
         194  +
            let mut output = crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput::deserialize_with_response(
         195  +
                &mut *deser,
         196  +
                _response_headers,
         197  +
                response.status().into(),
         198  +
                body,
         199  +
            )
         200  +
            .map_err(|e| {
         201  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         202  +
            })?;
         203  +
         204  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         205  +
        }
  161    206   
    }
  162    207   
}
  163    208   
#[derive(Debug)]
  164    209   
struct QueryIncompatibleOperationRequestSerializer;
  165    210   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryIncompatibleOperationRequestSerializer {
  166    211   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    212   
    fn serialize_input(
  168    213   
        &self,
  169    214   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    215   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    216   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    217   
        let input = input
  173    218   
            .downcast::<crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput>()
  174    219   
            .expect("correct type");
  175         -
        let _header_serialization_settings = _cfg
  176         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  177         -
            .cloned()
  178         -
            .unwrap_or_default();
  179         -
        let mut request_builder = {
  180         -
            #[allow(clippy::uninlined_format_args)]
  181         -
            fn uri_base(
  182         -
                _input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                ::std::write!(output, "/").expect("formatting should succeed");
  187         -
                ::std::result::Result::Ok(())
  188         -
            }
  189         -
            #[allow(clippy::unnecessary_wraps)]
  190         -
            fn update_http_builder(
  191         -
                input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
  192         -
                builder: ::http_1x::request::Builder,
  193         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  194         -
                let mut uri = ::std::string::String::new();
  195         -
                uri_base(input, &mut uri)?;
  196         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  197         -
            }
  198         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  199         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  200         -
            builder = _header_serialization_settings.set_default_header(
  201         -
                builder,
  202         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  203         -
                "JsonRpc10.QueryIncompatibleOperation",
  204         -
            );
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  208         -
            crate::protocol_serde::shape_query_incompatible_operation::ser_query_incompatible_operation_input(&input)?,
  209         -
        );
  210    220   
  211         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         221  +
        let protocol = _cfg
         222  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         223  +
            .expect("a SharedClientProtocol is required");
         224  +
        let mut request = protocol
         225  +
            .serialize_request(&input, QueryIncompatibleOperation::INPUT_SCHEMA, "/", _cfg)
         226  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         227  +
         228  +
        return ::std::result::Result::Ok(request);
  212    229   
    }
  213    230   
}
  214    231   
#[derive(Debug)]
  215    232   
struct QueryIncompatibleOperationEndpointParamsInterceptor;
  216    233   
  217    234   
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
  218    235   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryIncompatibleOperationEndpointParamsInterceptor {
  219    236   
    fn name(&self) -> &'static str {
  220    237   
        "QueryIncompatibleOperationEndpointParamsInterceptor"
  221    238   
    }

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/query_incompatible_operation/_query_incompatible_operation_input.rs

@@ -1,1 +27,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    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 QueryIncompatibleOperationInput {}
           6  +
static QUERYINCOMPATIBLEOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#QueryIncompatibleOperationInput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "QueryIncompatibleOperationInput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
)
          15  +
.with_no_body_members()
          16  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload);
          17  +
impl QueryIncompatibleOperationInput {
          18  +
    /// The schema for this shape.
          19  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &QUERYINCOMPATIBLEOPERATIONINPUT_SCHEMA;
          20  +
}
          21  +
impl ::aws_smithy_schema::serde::SerializableStruct for QueryIncompatibleOperationInput {
          22  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          23  +
    fn serialize_members(
          24  +
        &self,
          25  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          26  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          27  +
        Ok(())
          28  +
    }
          29  +
}
          30  +
impl QueryIncompatibleOperationInput {
          31  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          32  +
    pub fn deserialize(
          33  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          34  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          35  +
        #[allow(unused_variables, unused_mut)]
          36  +
        let mut builder = Self::builder();
          37  +
        #[allow(
          38  +
            unused_variables,
          39  +
            unreachable_code,
          40  +
            clippy::single_match,
          41  +
            clippy::match_single_binding,
          42  +
            clippy::diverging_sub_expression
          43  +
        )]
          44  +
        deserializer.read_struct(&QUERYINCOMPATIBLEOPERATIONINPUT_SCHEMA, &mut |member, deser| {
          45  +
            match member.member_index() {
          46  +
                _ => {}
          47  +
            }
          48  +
            Ok(())
          49  +
        })?;
          50  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          51  +
    }
          52  +
}
          53  +
impl QueryIncompatibleOperationInput {
          54  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          55  +
    pub fn deserialize_with_response(
          56  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          57  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          58  +
        _status: u16,
          59  +
        _body: &[u8],
          60  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          61  +
        Self::builder()
          62  +
            .build()
          63  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          64  +
    }
          65  +
}
    6     66   
impl QueryIncompatibleOperationInput {
    7     67   
    /// Creates a new builder-style object to manufacture [`QueryIncompatibleOperationInput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput).
    8     68   
    pub fn builder() -> crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationInputBuilder {
    9     69   
        crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationInputBuilder::default()
   10     70   
    }
   11     71   
}
   12     72   
   13     73   
/// A builder for [`QueryIncompatibleOperationInput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput).
   14     74   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   15     75   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/query_incompatible_operation/_query_incompatible_operation_output.rs

@@ -1,1 +22,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    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 QueryIncompatibleOperationOutput {}
           6  +
static QUERYINCOMPATIBLEOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#QueryIncompatibleOperationOutput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "QueryIncompatibleOperationOutput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
);
          15  +
impl QueryIncompatibleOperationOutput {
          16  +
    /// The schema for this shape.
          17  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &QUERYINCOMPATIBLEOPERATIONOUTPUT_SCHEMA;
          18  +
}
          19  +
impl ::aws_smithy_schema::serde::SerializableStruct for QueryIncompatibleOperationOutput {
          20  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          21  +
    fn serialize_members(
          22  +
        &self,
          23  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          24  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          25  +
        Ok(())
          26  +
    }
          27  +
}
          28  +
impl QueryIncompatibleOperationOutput {
          29  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          30  +
    pub fn deserialize(
          31  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          32  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          33  +
        #[allow(unused_variables, unused_mut)]
          34  +
        let mut builder = Self::builder();
          35  +
        #[allow(
          36  +
            unused_variables,
          37  +
            unreachable_code,
          38  +
            clippy::single_match,
          39  +
            clippy::match_single_binding,
          40  +
            clippy::diverging_sub_expression
          41  +
        )]
          42  +
        deserializer.read_struct(&QUERYINCOMPATIBLEOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
          43  +
            match member.member_index() {
          44  +
                _ => {}
          45  +
            }
          46  +
            Ok(())
          47  +
        })?;
          48  +
        Ok(builder.build())
          49  +
    }
          50  +
}
          51  +
impl QueryIncompatibleOperationOutput {
          52  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          53  +
    pub fn deserialize_with_response(
          54  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          55  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          56  +
        _status: u16,
          57  +
        _body: &[u8],
          58  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          59  +
        Ok(Self::builder().build())
          60  +
    }
          61  +
}
    6     62   
impl QueryIncompatibleOperationOutput {
    7     63   
    /// Creates a new builder-style object to manufacture [`QueryIncompatibleOperationOutput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput).
    8     64   
    pub fn builder() -> crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationOutputBuilder {
    9     65   
        crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationOutputBuilder::default()
   10     66   
    }
   11     67   
}
   12     68   
   13     69   
/// A builder for [`QueryIncompatibleOperationOutput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput).
   14     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   15     71   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties.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 `SimpleScalarProperties`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleScalarProperties;
    6      6   
impl SimpleScalarProperties {
    7      7   
    /// Creates a new `SimpleScalarProperties`
    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<'static> =
          13  +
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::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::simple_scalar_properties::SimpleScalarPropertiesInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -120,126 +244,258 @@
  140    146   
  141    147   
#[derive(Debug)]
  142    148   
struct SimpleScalarPropertiesResponseDeserializer;
  143    149   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarPropertiesResponseDeserializer {
  144    150   
    fn deserialize_nonstreaming_with_config(
  145    151   
        &self,
  146    152   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  147    153   
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  148    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  149    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  150         -
        let headers = response.headers();
         156  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         157  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         158  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         159  +
        // loads `body` before firing this hook.
  151    160   
        let body = response.body().bytes().expect("body loaded");
         161  +
        let headers = response.headers();
  152    162   
        #[allow(unused_mut)]
  153    163   
        let mut force_error = false;
  154    164   
  155         -
        let parse_result = if !success && status != 200 || force_error {
  156         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_error(status, headers, body)
         165  +
        if !success && status != 200 || force_error {
         166  +
            let protocol = _cfg
         167  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         168  +
                .expect("a SharedClientProtocol is required");
         169  +
            #[allow(unused_mut)]
         170  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         171  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         172  +
            })?;
         173  +
         174  +
            let generic = generic_builder.build();
         175  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         176  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         177  +
                    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic),
         178  +
                ),
         179  +
            ))
  157    180   
        } else {
  158         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_response(status, headers, body)
  159         -
        };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         181  +
            let protocol = _cfg
         182  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         183  +
                .expect("a SharedClientProtocol is required");
         184  +
            let mut deser = protocol
         185  +
                .deserialize_response(response, SimpleScalarProperties::OUTPUT_SCHEMA, _cfg)
         186  +
                .map_err(|e| {
         187  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         188  +
                })?;
         189  +
            // body and headers are already in scope from the top of the function;
         190  +
            // alias `headers` as `_response_headers` so MutateOutput
         191  +
            // customizations have a stable name to read from.
         192  +
            let _response_headers = headers;
         193  +
            #[allow(unused_mut)]
         194  +
            let mut output = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::deserialize_with_response(
         195  +
                &mut *deser,
         196  +
                _response_headers,
         197  +
                response.status().into(),
         198  +
                body,
         199  +
            )
         200  +
            .map_err(|e| {
         201  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         202  +
            })?;
         203  +
         204  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         205  +
        }
  161    206   
    }
  162    207   
}
  163    208   
#[derive(Debug)]
  164    209   
struct SimpleScalarPropertiesRequestSerializer;
  165    210   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SimpleScalarPropertiesRequestSerializer {
  166    211   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    212   
    fn serialize_input(
  168    213   
        &self,
  169    214   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    215   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    216   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    217   
        let input = input
  173    218   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput>()
  174    219   
            .expect("correct type");
  175         -
        let _header_serialization_settings = _cfg
  176         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  177         -
            .cloned()
  178         -
            .unwrap_or_default();
  179         -
        let mut request_builder = {
  180         -
            #[allow(clippy::uninlined_format_args)]
  181         -
            fn uri_base(
  182         -
                _input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                ::std::write!(output, "/").expect("formatting should succeed");
  187         -
                ::std::result::Result::Ok(())
  188         -
            }
  189         -
            #[allow(clippy::unnecessary_wraps)]
  190         -
            fn update_http_builder(
  191         -
                input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  192         -
                builder: ::http_1x::request::Builder,
  193         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  194         -
                let mut uri = ::std::string::String::new();
  195         -
                uri_base(input, &mut uri)?;
  196         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  197         -
            }
  198         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  199         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  200         -
            builder = _header_serialization_settings.set_default_header(
  201         -
                builder,
  202         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  203         -
                "JsonRpc10.SimpleScalarProperties",
  204         -
            );
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  208         -
            crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_input(&input)?,
  209         -
        );
  210         -
        if let Some(content_length) = body.content_length() {
  211         -
            let content_length = content_length.to_string();
  212         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  213         -
        }
  214         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         220  +
         221  +
        let protocol = _cfg
         222  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         223  +
            .expect("a SharedClientProtocol is required");
         224  +
        let mut request = protocol
         225  +
            .serialize_request(&input, SimpleScalarProperties::INPUT_SCHEMA, "/", _cfg)
         226  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         227  +
         228  +
        return ::std::result::Result::Ok(request);
  215    229   
    }
  216    230   
}
  217    231   
#[derive(Debug)]
  218    232   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  219    233   
  220    234   
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
  221    235   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  222    236   
    fn name(&self) -> &'static str {
  223    237   
        "SimpleScalarPropertiesEndpointParamsInterceptor"
  224    238   
    }
@@ -389,403 +448,469 @@
  409    423   
  410    424   
        let op = crate::operation::simple_scalar_properties::SimpleScalarProperties::new();
  411    425   
        let config = op.config().expect("the operation has config");
  412    426   
        let de = config
  413    427   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  414    428   
            .expect("the config must have a deserializer");
  415    429   
  416    430   
        // Build a config bag with the protocol for schema-based deserialization
  417    431   
        #[allow(unused_mut)]
  418    432   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         433  +
        {
         434  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         435  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         436  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         437  +
            ));
         438  +
            test_cfg.push_shared_layer(layer.freeze());
         439  +
        }
  419    440   
  420    441   
        let parsed = de.deserialize_streaming(&mut http_response);
  421    442   
        let parsed = parsed.unwrap_or_else(|| {
  422    443   
            let http_response = http_response.map(|body| {
  423    444   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  424    445   
                    body.bytes().unwrap(),
  425    446   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  426    447   
                )))
  427    448   
            });
  428    449   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
@@ -453,474 +512,540 @@
  473    494   
  474    495   
        let op = crate::operation::simple_scalar_properties::SimpleScalarProperties::new();
  475    496   
        let config = op.config().expect("the operation has config");
  476    497   
        let de = config
  477    498   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  478    499   
            .expect("the config must have a deserializer");
  479    500   
  480    501   
        // Build a config bag with the protocol for schema-based deserialization
  481    502   
        #[allow(unused_mut)]
  482    503   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         504  +
        {
         505  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         506  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         507  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         508  +
            ));
         509  +
            test_cfg.push_shared_layer(layer.freeze());
         510  +
        }
  483    511   
  484    512   
        let parsed = de.deserialize_streaming(&mut http_response);
  485    513   
        let parsed = parsed.unwrap_or_else(|| {
  486    514   
            let http_response = http_response.map(|body| {
  487    515   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  488    516   
                    body.bytes().unwrap(),
  489    517   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  490    518   
                )))
  491    519   
            });
  492    520   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
@@ -517,545 +576,611 @@
  537    565   
  538    566   
        let op = crate::operation::simple_scalar_properties::SimpleScalarProperties::new();
  539    567   
        let config = op.config().expect("the operation has config");
  540    568   
        let de = config
  541    569   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  542    570   
            .expect("the config must have a deserializer");
  543    571   
  544    572   
        // Build a config bag with the protocol for schema-based deserialization
  545    573   
        #[allow(unused_mut)]
  546    574   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         575  +
        {
         576  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         577  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         578  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         579  +
            ));
         580  +
            test_cfg.push_shared_layer(layer.freeze());
         581  +
        }
  547    582   
  548    583   
        let parsed = de.deserialize_streaming(&mut http_response);
  549    584   
        let parsed = parsed.unwrap_or_else(|| {
  550    585   
            let http_response = http_response.map(|body| {
  551    586   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  552    587   
                    body.bytes().unwrap(),
  553    588   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  554    589   
                )))
  555    590   
            });
  556    591   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_input.rs

@@ -1,1 +50,151 @@
   11     11   
impl SimpleScalarPropertiesInput {
   12     12   
    #[allow(missing_docs)] // documentation missing in model
   13     13   
    pub fn float_value(&self) -> ::std::option::Option<f32> {
   14     14   
        self.float_value
   15     15   
    }
   16     16   
    #[allow(missing_docs)] // documentation missing in model
   17     17   
    pub fn double_value(&self) -> ::std::option::Option<f64> {
   18     18   
        self.double_value
   19     19   
    }
   20     20   
}
          21  +
static SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesInput$floatValue",
          24  +
        "aws.protocoltests.json10.synthetic",
          25  +
        "SimpleScalarPropertiesInput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::Float,
          28  +
    "floatValue",
          29  +
    0,
          30  +
);
          31  +
static SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesInput$doubleValue",
          34  +
        "aws.protocoltests.json10.synthetic",
          35  +
        "SimpleScalarPropertiesInput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::Double,
          38  +
    "doubleValue",
          39  +
    1,
          40  +
);
          41  +
static SIMPLESCALARPROPERTIESINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesInput",
          44  +
        "aws.protocoltests.json10.synthetic",
          45  +
        "SimpleScalarPropertiesInput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    &[
          49  +
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE,
          50  +
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE,
          51  +
    ],
          52  +
)
          53  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          54  +
.with_original_name("SimpleScalarPropertiesInput");
          55  +
impl SimpleScalarPropertiesInput {
          56  +
    /// The schema for this shape.
          57  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SIMPLESCALARPROPERTIESINPUT_SCHEMA;
          58  +
}
          59  +
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleScalarPropertiesInput {
          60  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          61  +
    fn serialize_members(
          62  +
        &self,
          63  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          64  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          65  +
        if let Some(ref val) = self.float_value {
          66  +
            ser.write_float(&SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE, *val)?;
          67  +
        }
          68  +
        if let Some(ref val) = self.double_value {
          69  +
            ser.write_double(&SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE, *val)?;
          70  +
        }
          71  +
        Ok(())
          72  +
    }
          73  +
}
          74  +
impl SimpleScalarPropertiesInput {
          75  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          76  +
    pub fn deserialize(
          77  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          78  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          79  +
        #[allow(unused_variables, unused_mut)]
          80  +
        let mut builder = Self::builder();
          81  +
        #[allow(
          82  +
            unused_variables,
          83  +
            unreachable_code,
          84  +
            clippy::single_match,
          85  +
            clippy::match_single_binding,
          86  +
            clippy::diverging_sub_expression
          87  +
        )]
          88  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, &mut |member, deser| {
          89  +
            match member.member_index() {
          90  +
                Some(0) => {
          91  +
                    if deser.is_null() {
          92  +
                        deser.read_null()?;
          93  +
                    } else {
          94  +
                        builder.float_value = Some(deser.read_float(member)?);
          95  +
                    }
          96  +
                }
          97  +
                Some(1) => {
          98  +
                    if deser.is_null() {
          99  +
                        deser.read_null()?;
         100  +
                    } else {
         101  +
                        builder.double_value = Some(deser.read_double(member)?);
         102  +
                    }
         103  +
                }
         104  +
                _ => {}
         105  +
            }
         106  +
            Ok(())
         107  +
        })?;
         108  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         109  +
    }
         110  +
}
         111  +
impl SimpleScalarPropertiesInput {
         112  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         113  +
    pub fn deserialize_with_response(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         116  +
        _status: u16,
         117  +
        _body: &[u8],
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        Self::deserialize(deserializer)
         120  +
    }
         121  +
}
   21    122   
impl SimpleScalarPropertiesInput {
   22    123   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
   23    124   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
   24    125   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder::default()
   25    126   
    }
   26    127   
}
   27    128   
   28    129   
/// A builder for [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
   29    130   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   30    131   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_output.rs

@@ -1,1 +50,150 @@
   11     11   
impl SimpleScalarPropertiesOutput {
   12     12   
    #[allow(missing_docs)] // documentation missing in model
   13     13   
    pub fn float_value(&self) -> ::std::option::Option<f32> {
   14     14   
        self.float_value
   15     15   
    }
   16     16   
    #[allow(missing_docs)] // documentation missing in model
   17     17   
    pub fn double_value(&self) -> ::std::option::Option<f64> {
   18     18   
        self.double_value
   19     19   
    }
   20     20   
}
          21  +
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          22  +
    ::aws_smithy_schema::ShapeId::from_parts(
          23  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesOutput$floatValue",
          24  +
        "aws.protocoltests.json10.synthetic",
          25  +
        "SimpleScalarPropertiesOutput",
          26  +
    ),
          27  +
    ::aws_smithy_schema::ShapeType::Float,
          28  +
    "floatValue",
          29  +
    0,
          30  +
);
          31  +
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesOutput$doubleValue",
          34  +
        "aws.protocoltests.json10.synthetic",
          35  +
        "SimpleScalarPropertiesOutput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::Double,
          38  +
    "doubleValue",
          39  +
    1,
          40  +
);
          41  +
static SIMPLESCALARPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts(
          43  +
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesOutput",
          44  +
        "aws.protocoltests.json10.synthetic",
          45  +
        "SimpleScalarPropertiesOutput",
          46  +
    ),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    &[
          49  +
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE,
          50  +
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE,
          51  +
    ],
          52  +
)
          53  +
.with_original_name("SimpleScalarPropertiesOutput");
          54  +
impl SimpleScalarPropertiesOutput {
          55  +
    /// The schema for this shape.
          56  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SIMPLESCALARPROPERTIESOUTPUT_SCHEMA;
          57  +
}
          58  +
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleScalarPropertiesOutput {
          59  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          60  +
    fn serialize_members(
          61  +
        &self,
          62  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          63  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          64  +
        if let Some(ref val) = self.float_value {
          65  +
            ser.write_float(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE, *val)?;
          66  +
        }
          67  +
        if let Some(ref val) = self.double_value {
          68  +
            ser.write_double(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE, *val)?;
          69  +
        }
          70  +
        Ok(())
          71  +
    }
          72  +
}
          73  +
impl SimpleScalarPropertiesOutput {
          74  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          77  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          78  +
        #[allow(unused_variables, unused_mut)]
          79  +
        let mut builder = Self::builder();
          80  +
        #[allow(
          81  +
            unused_variables,
          82  +
            unreachable_code,
          83  +
            clippy::single_match,
          84  +
            clippy::match_single_binding,
          85  +
            clippy::diverging_sub_expression
          86  +
        )]
          87  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
          88  +
            match member.member_index() {
          89  +
                Some(0) => {
          90  +
                    if deser.is_null() {
          91  +
                        deser.read_null()?;
          92  +
                    } else {
          93  +
                        builder.float_value = Some(deser.read_float(member)?);
          94  +
                    }
          95  +
                }
          96  +
                Some(1) => {
          97  +
                    if deser.is_null() {
          98  +
                        deser.read_null()?;
          99  +
                    } else {
         100  +
                        builder.double_value = Some(deser.read_double(member)?);
         101  +
                    }
         102  +
                }
         103  +
                _ => {}
         104  +
            }
         105  +
            Ok(())
         106  +
        })?;
         107  +
        Ok(builder.build())
         108  +
    }
         109  +
}
         110  +
impl SimpleScalarPropertiesOutput {
         111  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         112  +
    pub fn deserialize_with_response(
         113  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         114  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         115  +
        _status: u16,
         116  +
        _body: &[u8],
         117  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         118  +
        Self::deserialize(deserializer)
         119  +
    }
         120  +
}
   21    121   
impl SimpleScalarPropertiesOutput {
   22    122   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
   23    123   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder {
   24    124   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default()
   25    125   
    }
   26    126   
}
   27    127   
   28    128   
/// A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
   29    129   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   30    130   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde.rs

@@ -1,0 +118,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn type_erase_result<O, E>(
    3         -
    result: ::std::result::Result<O, E>,
    4         -
) -> ::std::result::Result<
    5         -
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6         -
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7         -
>
    8         -
where
    9         -
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10         -
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11         -
{
   12         -
    result
   13         -
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14         -
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15         -
        .map_err(::std::convert::Into::into)
   16         -
}
   17         -
   18         -
pub fn parse_http_error_metadata(
   19         -
    _response_status: u16,
   20         -
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21         -
    response_body: &[u8],
   22         -
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23         -
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24         -
}
   25         -
   26         -
pub(crate) mod shape_content_type_parameters;
   27         -
   28         -
pub(crate) mod shape_empty_input_and_empty_output;
   29         -
   30         -
pub(crate) mod shape_endpoint_operation;
   31         -
   32         -
pub(crate) mod shape_endpoint_with_host_label_operation;
   33         -
   34         -
pub(crate) mod shape_greeting_with_errors;
   35         -
   36         -
pub(crate) mod shape_host_with_path_operation;
   37         -
   38         -
pub(crate) mod shape_json_unions;
   39         -
   40         -
pub(crate) mod shape_no_input_and_no_output;
   41         -
   42         -
pub(crate) mod shape_no_input_and_output;
   43         -
   44         -
pub(crate) mod shape_operation_with_defaults;
   45         -
   46         -
pub(crate) mod shape_operation_with_nested_structure;
   47         -
   48         -
pub(crate) mod shape_operation_with_required_members;
   49         -
   50         -
pub(crate) mod shape_operation_with_required_members_with_defaults;
   51         -
   52         -
pub(crate) mod shape_put_with_content_encoding;
   53         -
   54         -
pub(crate) mod shape_query_incompatible_operation;
   55         -
   56         -
pub(crate) mod shape_simple_scalar_properties;
   57         -
   58         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   59         -
    if data.is_empty() {
   60         -
        b"{}"
   61         -
    } else {
   62         -
        data
   63         -
    }
   64         -
}
   65         -
   66         -
pub(crate) mod shape_complex_error;
   67         -
   68         -
pub(crate) mod shape_content_type_parameters_input;
   69         -
   70         -
pub(crate) mod shape_endpoint_with_host_label_operation_input;
   71         -
   72         -
pub(crate) mod shape_foo_error;
   73         -
   74         -
pub(crate) mod shape_greeting_with_errors_input;
   75         -
   76         -
pub(crate) mod shape_invalid_greeting;
   77         -
   78         -
pub(crate) mod shape_json_unions_input;
   79         -
   80         -
pub(crate) mod shape_operation_with_defaults_input;
   81         -
   82         -
pub(crate) mod shape_operation_with_nested_structure_input;
   83         -
   84         -
pub(crate) mod shape_put_with_content_encoding_input;
   85         -
   86         -
pub(crate) mod shape_simple_scalar_properties_input;
   87         -
   88         -
pub(crate) mod shape_client_optional_defaults;
   89         -
   90         -
pub(crate) mod shape_complex_nested_error_data;
   91         -
   92         -
pub(crate) mod shape_defaults;
   93         -
   94         -
pub(crate) mod shape_dialog;
   95         -
   96         -
pub(crate) mod shape_dialog_list;
   97         -
   98         -
pub(crate) mod shape_dialog_map;
   99         -
  100         -
pub(crate) mod shape_my_union;
  101         -
  102         -
pub(crate) mod shape_required_string_list;
  103         -
  104         -
pub(crate) mod shape_required_string_map;
  105         -
  106         -
pub(crate) mod shape_test_string_list;
  107         -
  108         -
pub(crate) mod shape_test_string_map;
  109         -
  110         -
pub(crate) mod shape_top_level;
  111         -
  112         -
pub(crate) mod shape_farewell;
  113         -
  114         -
pub(crate) mod shape_greeting_struct;
  115         -
  116         -
pub(crate) mod shape_string_list;
  117         -
  118         -
pub(crate) mod shape_string_map;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_client_optional_defaults.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_client_optional_defaults(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ClientOptionalDefaults,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.member {
    7         -
        object.key("member").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_complex_error.rs

@@ -1,0 +51,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ComplexErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ComplexErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    #[allow(unused_variables)]
    9         -
    let depth = 0u32;
   10         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   11         -
    loop {
   12         -
        match tokens.next().transpose()? {
   13         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   14         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   15         -
                "TopLevel" => {
   16         -
                    builder = builder.set_top_level(
   17         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   18         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                            .transpose()?,
   20         -
                    );
   21         -
                }
   22         -
                "Nested" => {
   23         -
                    builder = builder.set_nested(crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(
   24         -
                        tokens,
   25         -
                        _value,
   26         -
                        depth + 1,
   27         -
                    )?);
   28         -
                }
   29         -
                "Message" => {
   30         -
                    builder = builder.set_message(
   31         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   32         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   33         -
                            .transpose()?,
   34         -
                    );
   35         -
                }
   36         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   37         -
            },
   38         -
            other => {
   39         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   40         -
                    "expected object key or end object, found: {other:?}"
   41         -
                )))
   42         -
            }
   43         -
        }
   44         -
    }
   45         -
    if tokens.next().is_some() {
   46         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47         -
            "found more JSON tokens after completing parsing",
   48         -
        ));
   49         -
    }
   50         -
    Ok(builder)
   51         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_nested_error_data<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
    depth: u32,
    6         -
) -> ::std::result::Result<Option<crate::types::ComplexNestedErrorData>, ::aws_smithy_json::deserialize::error::DeserializeError>
    7         -
where
    8         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    9         -
{
   10         -
    if depth >= 128u32 {
   11         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   12         -
            "maximum nesting depth exceeded",
   13         -
        ));
   14         -
    }
   15         -
    match tokens.next().transpose()? {
   16         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   17         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   18         -
            #[allow(unused_mut)]
   19         -
            let mut builder = crate::types::builders::ComplexNestedErrorDataBuilder::default();
   20         -
            loop {
   21         -
                match tokens.next().transpose()? {
   22         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   24         -
                        "Foo" => {
   25         -
                            builder = builder.set_foo(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(builder.build()))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_content_type_parameters.rs

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_content_type_parameters_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
    9         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::content_type_parameters::ContentTypeParametersError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_content_type_parameters_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
   25         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_content_type_parameters_input(
   35         -
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_content_type_parameters_input::ser_content_type_parameters_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_content_type_parameters_input.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_content_type_parameters_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.value {
    7         -
        object.key("value").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}