Client Test

Client Test

rev. 18b1dd205ff4335251e6dd0ecb88193de1b1cede (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/endpoint_operation/_endpoint_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 EndpointOperationOutput {}
           6  +
static ENDPOINTOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#EndpointOperationOutput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "EndpointOperationOutput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
);
          15  +
impl EndpointOperationOutput {
          16  +
    /// The schema for this shape.
          17  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &ENDPOINTOPERATIONOUTPUT_SCHEMA;
          18  +
}
          19  +
impl ::aws_smithy_schema::serde::SerializableStruct for EndpointOperationOutput {
          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 EndpointOperationOutput {
          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(&ENDPOINTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
          43  +
            match member.member_index() {
          44  +
                _ => {}
          45  +
            }
          46  +
            Ok(())
          47  +
        })?;
          48  +
        Ok(builder.build())
          49  +
    }
          50  +
}
          51  +
impl EndpointOperationOutput {
          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 EndpointOperationOutput {
    7     63   
    /// Creates a new builder-style object to manufacture [`EndpointOperationOutput`](crate::operation::endpoint_operation::EndpointOperationOutput).
    8     64   
    pub fn builder() -> crate::operation::endpoint_operation::builders::EndpointOperationOutputBuilder {
    9     65   
        crate::operation::endpoint_operation::builders::EndpointOperationOutputBuilder::default()
   10     66   
    }
   11     67   
}
   12     68   
   13     69   
/// A builder for [`EndpointOperationOutput`](crate::operation::endpoint_operation::EndpointOperationOutput).
   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/endpoint_with_host_label_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 `EndpointWithHostLabelOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EndpointWithHostLabelOperation;
    6      6   
impl EndpointWithHostLabelOperation {
    7      7   
    /// Creates a new `EndpointWithHostLabelOperation`
    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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -166,172 +292,304 @@
  186    192   
}
  187    193   
#[derive(Debug)]
  188    194   
struct EndpointWithHostLabelOperationResponseDeserializer;
  189    195   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointWithHostLabelOperationResponseDeserializer {
  190    196   
    fn deserialize_nonstreaming_with_config(
  191    197   
        &self,
  192    198   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  193    199   
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  194    200   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  195    201   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  196         -
        let headers = response.headers();
         202  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         203  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         204  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         205  +
        // loads `body` before firing this hook.
  197    206   
        let body = response.body().bytes().expect("body loaded");
         207  +
        let headers = response.headers();
  198    208   
        #[allow(unused_mut)]
  199    209   
        let mut force_error = false;
  200    210   
  201         -
        let parse_result = if !success && status != 200 || force_error {
  202         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_error(status, headers, body)
         211  +
        if !success && status != 200 || force_error {
         212  +
            let protocol = _cfg
         213  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         214  +
                .expect("a SharedClientProtocol is required");
         215  +
            #[allow(unused_mut)]
         216  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         217  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         218  +
            })?;
         219  +
         220  +
            let generic = generic_builder.build();
         221  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         222  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         223  +
                    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::generic(generic),
         224  +
                ),
         225  +
            ))
  203    226   
        } else {
  204         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_response(
  205         -
                status, headers, body,
         227  +
            let protocol = _cfg
         228  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         229  +
                .expect("a SharedClientProtocol is required");
         230  +
            let mut deser = protocol
         231  +
                .deserialize_response(response, EndpointWithHostLabelOperation::OUTPUT_SCHEMA, _cfg)
         232  +
                .map_err(|e| {
         233  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         234  +
                })?;
         235  +
            // body and headers are already in scope from the top of the function;
         236  +
            // alias `headers` as `_response_headers` so MutateOutput
         237  +
            // customizations have a stable name to read from.
         238  +
            let _response_headers = headers;
         239  +
            #[allow(unused_mut)]
         240  +
            let mut output = crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput::deserialize_with_response(
         241  +
                &mut *deser,
         242  +
                _response_headers,
         243  +
                response.status().into(),
         244  +
                body,
  206    245   
            )
  207         -
        };
  208         -
        crate::protocol_serde::type_erase_result(parse_result)
         246  +
            .map_err(|e| {
         247  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         248  +
            })?;
         249  +
         250  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         251  +
        }
  209    252   
    }
  210    253   
}
  211    254   
#[derive(Debug)]
  212    255   
struct EndpointWithHostLabelOperationRequestSerializer;
  213    256   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EndpointWithHostLabelOperationRequestSerializer {
  214    257   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  215    258   
    fn serialize_input(
  216    259   
        &self,
  217    260   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    261   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  219    262   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  220    263   
        let input = input
  221    264   
            .downcast::<crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput>()
  222    265   
            .expect("correct type");
  223         -
        let _header_serialization_settings = _cfg
  224         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  225         -
            .cloned()
  226         -
            .unwrap_or_default();
  227         -
        let mut request_builder = {
  228         -
            #[allow(clippy::uninlined_format_args)]
  229         -
            fn uri_base(
  230         -
                _input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  231         -
                output: &mut ::std::string::String,
  232         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  233         -
                use ::std::fmt::Write as _;
  234         -
                ::std::write!(output, "/").expect("formatting should succeed");
  235         -
                ::std::result::Result::Ok(())
  236         -
            }
  237         -
            #[allow(clippy::unnecessary_wraps)]
  238         -
            fn update_http_builder(
  239         -
                input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  240         -
                builder: ::http_1x::request::Builder,
  241         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  242         -
                let mut uri = ::std::string::String::new();
  243         -
                uri_base(input, &mut uri)?;
  244         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  245         -
            }
  246         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  247         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  248         -
            builder = _header_serialization_settings.set_default_header(
  249         -
                builder,
  250         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  251         -
                "JsonRpc10.EndpointWithHostLabelOperation",
  252         -
            );
  253         -
            builder
  254         -
        };
  255         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  256         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_input(&input)?,
  257         -
        );
  258         -
        if let Some(content_length) = body.content_length() {
  259         -
            let content_length = content_length.to_string();
  260         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  261         -
        }
  262         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         266  +
         267  +
        let protocol = _cfg
         268  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         269  +
            .expect("a SharedClientProtocol is required");
         270  +
        let mut request = protocol
         271  +
            .serialize_request(&input, EndpointWithHostLabelOperation::INPUT_SCHEMA, "/", _cfg)
         272  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         273  +
         274  +
        return ::std::result::Result::Ok(request);
  263    275   
    }
  264    276   
}
  265    277   
#[derive(Debug)]
  266    278   
struct EndpointWithHostLabelOperationEndpointParamsInterceptor;
  267    279   
  268    280   
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
  269    281   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointWithHostLabelOperationEndpointParamsInterceptor {
  270    282   
    fn name(&self) -> &'static str {
  271    283   
        "EndpointWithHostLabelOperationEndpointParamsInterceptor"
  272    284   
    }

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_operation_input.rs

@@ -1,1 +44,124 @@
    5      5   
pub struct EndpointWithHostLabelOperationInput {
    6      6   
    #[allow(missing_docs)] // documentation missing in model
    7      7   
    pub label: ::std::option::Option<::std::string::String>,
    8      8   
}
    9      9   
impl EndpointWithHostLabelOperationInput {
   10     10   
    #[allow(missing_docs)] // documentation missing in model
   11     11   
    pub fn label(&self) -> ::std::option::Option<&str> {
   12     12   
        self.label.as_deref()
   13     13   
    }
   14     14   
}
          15  +
static ENDPOINTWITHHOSTLABELOPERATIONINPUT_MEMBER_LABEL: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          16  +
    ::aws_smithy_schema::ShapeId::from_parts(
          17  +
        "aws.protocoltests.json10.synthetic#EndpointWithHostLabelOperationInput$label",
          18  +
        "aws.protocoltests.json10.synthetic",
          19  +
        "EndpointWithHostLabelOperationInput",
          20  +
    ),
          21  +
    ::aws_smithy_schema::ShapeType::String,
          22  +
    "label",
          23  +
    0,
          24  +
)
          25  +
.with_host_label();
          26  +
static ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          27  +
    ::aws_smithy_schema::ShapeId::from_parts(
          28  +
        "aws.protocoltests.json10.synthetic#EndpointWithHostLabelOperationInput",
          29  +
        "aws.protocoltests.json10.synthetic",
          30  +
        "EndpointWithHostLabelOperationInput",
          31  +
    ),
          32  +
    ::aws_smithy_schema::ShapeType::Structure,
          33  +
    &[&ENDPOINTWITHHOSTLABELOPERATIONINPUT_MEMBER_LABEL],
          34  +
)
          35  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          36  +
.with_original_name("EndpointWithHostLabelOperationInput");
          37  +
impl EndpointWithHostLabelOperationInput {
          38  +
    /// The schema for this shape.
          39  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA;
          40  +
}
          41  +
impl ::aws_smithy_schema::serde::SerializableStruct for EndpointWithHostLabelOperationInput {
          42  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          43  +
    fn serialize_members(
          44  +
        &self,
          45  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          46  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          47  +
        if let Some(ref val) = self.label {
          48  +
            ser.write_string(&ENDPOINTWITHHOSTLABELOPERATIONINPUT_MEMBER_LABEL, val)?;
          49  +
        }
          50  +
        Ok(())
          51  +
    }
          52  +
}
          53  +
impl EndpointWithHostLabelOperationInput {
          54  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          57  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          58  +
        #[allow(unused_variables, unused_mut)]
          59  +
        let mut builder = Self::builder();
          60  +
        #[allow(
          61  +
            unused_variables,
          62  +
            unreachable_code,
          63  +
            clippy::single_match,
          64  +
            clippy::match_single_binding,
          65  +
            clippy::diverging_sub_expression
          66  +
        )]
          67  +
        deserializer.read_struct(&ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA, &mut |member, deser| {
          68  +
            match member.member_index() {
          69  +
                Some(0) => {
          70  +
                    if deser.is_null() {
          71  +
                        deser.read_null()?;
          72  +
                    } else {
          73  +
                        builder.label = Some(deser.read_string(member)?);
          74  +
                    }
          75  +
                }
          76  +
                _ => {}
          77  +
            }
          78  +
            Ok(())
          79  +
        })?;
          80  +
        builder.label = builder.label.or(Some(String::new()));
          81  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          82  +
    }
          83  +
}
          84  +
impl EndpointWithHostLabelOperationInput {
          85  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          86  +
    pub fn deserialize_with_response(
          87  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          88  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          89  +
        _status: u16,
          90  +
        _body: &[u8],
          91  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          92  +
        Self::deserialize(deserializer)
          93  +
    }
          94  +
}
   15     95   
impl EndpointWithHostLabelOperationInput {
   16     96   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
   17     97   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
   18     98   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder::default()
   19     99   
    }
   20    100   
}
   21    101   
   22    102   
/// A builder for [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
   23    103   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   24    104   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_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 EndpointWithHostLabelOperationOutput {}
           6  +
static ENDPOINTWITHHOSTLABELOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#EndpointWithHostLabelOperationOutput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "EndpointWithHostLabelOperationOutput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
);
          15  +
impl EndpointWithHostLabelOperationOutput {
          16  +
    /// The schema for this shape.
          17  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &ENDPOINTWITHHOSTLABELOPERATIONOUTPUT_SCHEMA;
          18  +
}
          19  +
impl ::aws_smithy_schema::serde::SerializableStruct for EndpointWithHostLabelOperationOutput {
          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 EndpointWithHostLabelOperationOutput {
          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(&ENDPOINTWITHHOSTLABELOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
          43  +
            match member.member_index() {
          44  +
                _ => {}
          45  +
            }
          46  +
            Ok(())
          47  +
        })?;
          48  +
        Ok(builder.build())
          49  +
    }
          50  +
}
          51  +
impl EndpointWithHostLabelOperationOutput {
          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 EndpointWithHostLabelOperationOutput {
    7     63   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
    8     64   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder {
    9     65   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default()
   10     66   
    }
   11     67   
}
   12     68   
   13     69   
/// A builder for [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
   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/greeting_with_errors.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 `GreetingWithErrors`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GreetingWithErrors;
    6      6   
impl GreetingWithErrors {
    7      7   
    /// Creates a new `GreetingWithErrors`
    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> = crate::operation::greeting_with_errors::GreetingWithErrorsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::greeting_with_errors::GreetingWithErrorsOutput::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::greeting_with_errors::GreetingWithErrorsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -56,60 +115,160 @@
   76     80   
            }
   77     81   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   78     82   
                config_override,
   79     83   
                client_config.config.clone(),
   80     84   
                &client_config.runtime_components,
   81     85   
            ));
   82     86   
        }
   83     87   
        runtime_plugins
   84     88   
    }
   85     89   
}
          90  +
/// Per-operation error registry. Contains an entry for every modeled
          91  +
/// error this operation can throw.
          92  +
///
          93  +
/// Used by the schema-serde error path as the operation-scoped lookup
          94  +
/// for registry-backed error reification: an error code that does not
          95  +
/// match one of the operation's modeled errors directly is resolved
          96  +
/// against this registry first, then widened to the service-wide error
          97  +
/// registry.
          98  +
pub(crate) mod error_registry {
          99  +
    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
         100  +
        ::aws_smithy_schema::registry::TypeRegistry::builder()
         101  +
                            .insert_error_shape(
         102  +
                        crate::types::error::ComplexError::SCHEMA,
         103  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         104  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ComplexError::deserialize(d)?))
         105  +
                        },
         106  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         107  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ComplexError::deserialize(d)?))
         108  +
                        },
         109  +
                    )
         110  +
.insert_error_shape(
         111  +
                        crate::types::error::FooError::SCHEMA,
         112  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         113  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::FooError::deserialize(d)?))
         114  +
                        },
         115  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         116  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::FooError::deserialize(d)?))
         117  +
                        },
         118  +
                    )
         119  +
.insert_error_shape(
         120  +
                        crate::types::error::InvalidGreeting::SCHEMA,
         121  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         122  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidGreeting::deserialize(d)?))
         123  +
                        },
         124  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         125  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidGreeting::deserialize(d)?))
         126  +
                        },
         127  +
                    )
         128  +
                            .build()
         129  +
    });
         130  +
}
   86    131   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GreetingWithErrors {
   87    132   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   88    133   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GreetingWithErrors");
   89    134   
   90    135   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   91    136   
            GreetingWithErrorsRequestSerializer,
   92    137   
        ));
   93    138   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   94    139   
            GreetingWithErrorsResponseDeserializer,
   95    140   
        ));
@@ -160,205 +283,427 @@
  180    225   
}
  181    226   
#[derive(Debug)]
  182    227   
struct GreetingWithErrorsResponseDeserializer;
  183    228   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  184    229   
    fn deserialize_nonstreaming_with_config(
  185    230   
        &self,
  186    231   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  187    232   
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  188    233   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  189    234   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  190         -
        let headers = response.headers();
         235  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         236  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         237  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         238  +
        // loads `body` before firing this hook.
  191    239   
        let body = response.body().bytes().expect("body loaded");
         240  +
        let headers = response.headers();
  192    241   
        #[allow(unused_mut)]
  193    242   
        let mut force_error = false;
  194    243   
  195         -
        let parse_result = if !success && status != 200 || force_error {
  196         -
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  197         -
        } else {
  198         -
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_response(status, headers, body)
         244  +
        if !success && status != 200 || force_error {
         245  +
            let protocol = _cfg
         246  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         247  +
                .expect("a SharedClientProtocol is required");
         248  +
            #[allow(unused_mut)]
         249  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         250  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         251  +
            })?;
         252  +
         253  +
            let generic = generic_builder.build();
         254  +
            let error_code = match generic.code() {
         255  +
                ::std::option::Option::Some(code) => code,
         256  +
                ::std::option::Option::None => {
         257  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         258  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         259  +
                            crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled(generic),
         260  +
                        ),
         261  +
                    ))
         262  +
                }
         263  +
            };
         264  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         265  +
            let err = match error_code {
         266  +
                "InvalidGreeting" => crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting({
         267  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         268  +
                        crate::types::error::InvalidGreeting::deserialize_with_response(
         269  +
                            &mut *deser,
         270  +
                            response.headers(),
         271  +
                            response.status().into(),
         272  +
                            body,
         273  +
                        )
         274  +
                    }) {
         275  +
                        ::std::result::Result::Ok(val) => val,
         276  +
                        ::std::result::Result::Err(e) => {
         277  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         278  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         279  +
                            ))
         280  +
                        }
  199    281   
                    };
  200         -
        crate::protocol_serde::type_erase_result(parse_result)
         282  +
                    tmp.meta = generic;
         283  +
                    if tmp.message.is_none() {
         284  +
                        tmp.message = _error_message;
         285  +
                    }
         286  +
                    tmp
         287  +
                }),
         288  +
                "ComplexError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError({
         289  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         290  +
                        crate::types::error::ComplexError::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
         291  +
                    }) {
         292  +
                        ::std::result::Result::Ok(val) => val,
         293  +
                        ::std::result::Result::Err(e) => {
         294  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         295  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         296  +
                            ))
         297  +
                        }
         298  +
                    };
         299  +
                    tmp.meta = generic;
         300  +
                    if tmp.message.is_none() {
         301  +
                        tmp.message = _error_message;
         302  +
                    }
         303  +
                    tmp
         304  +
                }),
         305  +
                "FooError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError({
         306  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         307  +
                        crate::types::error::FooError::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
         308  +
                    }) {
         309  +
                        ::std::result::Result::Ok(val) => val,
         310  +
                        ::std::result::Result::Err(e) => {
         311  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         312  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         313  +
                            ))
         314  +
                        }
         315  +
                    };
         316  +
                    tmp.meta = generic;
         317  +
                    if tmp.message.is_none() {
         318  +
                        tmp.message = _error_message;
         319  +
                    }
         320  +
                    tmp
         321  +
                }),
         322  +
                _ => {
         323  +
                    // Registry-backed, operation-scoped reification of an error whose
         324  +
                    // code this operation does not model directly: the operation's own
         325  +
                    // error registry is consulted first, then the lookup widens to the
         326  +
                    // service-wide error registry. On a hit, the reified error is attached
         327  +
                    // as the source of the returned unhandled error while its metadata
         328  +
                    // (code, message, request id) is preserved; on a miss the generic
         329  +
                    // error is returned unchanged.
         330  +
                    match protocol
         331  +
                        .deserialize_error_response(response, _cfg)
         332  +
                        .ok()
         333  +
                        .and_then(|mut deser| {
         334  +
                            ::aws_smithy_schema::registry::reify_error(
         335  +
                                crate::operation::greeting_with_errors::error_registry::REGISTRY
         336  +
                                    .or(&crate::error_type_registry::REGISTRY),
         337  +
                                error_code,
         338  +
                                &mut *deser,
         339  +
                            )
         340  +
                        }) {
         341  +
                        ::std::option::Option::Some(source) => <crate::operation::greeting_with_errors::GreetingWithErrorsError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         342  +
                        ::std::option::Option::None => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
         343  +
                    }
         344  +
                }
         345  +
            };
         346  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         347  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         348  +
            ))
         349  +
        } else {
         350  +
            let protocol = _cfg
         351  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         352  +
                .expect("a SharedClientProtocol is required");
         353  +
            let mut deser = protocol
         354  +
                .deserialize_response(response, GreetingWithErrors::OUTPUT_SCHEMA, _cfg)
         355  +
                .map_err(|e| {
         356  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         357  +
                })?;
         358  +
            // body and headers are already in scope from the top of the function;
         359  +
            // alias `headers` as `_response_headers` so MutateOutput
         360  +
            // customizations have a stable name to read from.
         361  +
            let _response_headers = headers;
         362  +
            #[allow(unused_mut)]
         363  +
            let mut output = crate::operation::greeting_with_errors::GreetingWithErrorsOutput::deserialize_with_response(
         364  +
                &mut *deser,
         365  +
                _response_headers,
         366  +
                response.status().into(),
         367  +
                body,
         368  +
            )
         369  +
            .map_err(|e| {
         370  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         371  +
            })?;
         372  +
         373  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         374  +
        }
  201    375   
    }
  202    376   
}
  203    377   
#[derive(Debug)]
  204    378   
struct GreetingWithErrorsRequestSerializer;
  205    379   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithErrorsRequestSerializer {
  206    380   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  207    381   
    fn serialize_input(
  208    382   
        &self,
  209    383   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    384   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  211    385   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  212    386   
        let input = input
  213    387   
            .downcast::<crate::operation::greeting_with_errors::GreetingWithErrorsInput>()
  214    388   
            .expect("correct type");
  215         -
        let _header_serialization_settings = _cfg
  216         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  217         -
            .cloned()
  218         -
            .unwrap_or_default();
  219         -
        let mut request_builder = {
  220         -
            #[allow(clippy::uninlined_format_args)]
  221         -
            fn uri_base(
  222         -
                _input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  223         -
                output: &mut ::std::string::String,
  224         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  225         -
                use ::std::fmt::Write as _;
  226         -
                ::std::write!(output, "/").expect("formatting should succeed");
  227         -
                ::std::result::Result::Ok(())
  228         -
            }
  229         -
            #[allow(clippy::unnecessary_wraps)]
  230         -
            fn update_http_builder(
  231         -
                input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  232         -
                builder: ::http_1x::request::Builder,
  233         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  234         -
                let mut uri = ::std::string::String::new();
  235         -
                uri_base(input, &mut uri)?;
  236         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  237         -
            }
  238         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  239         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  240         -
            builder = _header_serialization_settings.set_default_header(
  241         -
                builder,
  242         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  243         -
                "JsonRpc10.GreetingWithErrors",
  244         -
            );
  245         -
            builder
  246         -
        };
  247         -
        let body =
  248         -
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_input(&input)?);
  249         -
        if let Some(content_length) = body.content_length() {
  250         -
            let content_length = content_length.to_string();
  251         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  252         -
        }
  253         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         389  +
         390  +
        let protocol = _cfg
         391  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         392  +
            .expect("a SharedClientProtocol is required");
         393  +
        let mut request = protocol
         394  +
            .serialize_request(&input, GreetingWithErrors::INPUT_SCHEMA, "/", _cfg)
         395  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         396  +
         397  +
        return ::std::result::Result::Ok(request);
  254    398   
    }
  255    399   
}
  256    400   
#[derive(Debug)]
  257    401   
struct GreetingWithErrorsEndpointParamsInterceptor;
  258    402   
  259    403   
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
  260    404   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  261    405   
    fn name(&self) -> &'static str {
  262    406   
        "GreetingWithErrorsEndpointParamsInterceptor"
  263    407   
    }
@@ -296,440 +995,1237 @@
  316    460   
  317    461   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  318    462   
        let config = op.config().expect("the operation has config");
  319    463   
        let de = config
  320    464   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  321    465   
            .expect("the config must have a deserializer");
  322    466   
  323    467   
        // Build a config bag with the protocol for schema-based deserialization
  324    468   
        #[allow(unused_mut)]
  325    469   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         470  +
        {
         471  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         472  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         473  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         474  +
            ));
         475  +
            test_cfg.push_shared_layer(layer.freeze());
         476  +
        }
  326    477   
  327    478   
        let parsed = de.deserialize_streaming(&mut http_response);
  328    479   
        let parsed = parsed.unwrap_or_else(|| {
  329    480   
            let http_response = http_response.map(|body| {
  330    481   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  331    482   
                    body.bytes().unwrap(),
  332    483   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  333    484   
                )))
  334    485   
            });
  335    486   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  336    487   
        });
  337    488   
        let parsed = parsed.expect_err("should be error response");
  338    489   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  339    490   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  340    491   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting(parsed) = parsed {
  341    492   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  342    493   
        } else {
  343    494   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  344    495   
        }
  345    496   
    }
  346    497   
  347    498   
    /// Parses a complex error with no message member
  348    499   
    /// Test ID: AwsJson10ComplexError
  349    500   
    #[::tokio::test]
  350    501   
    #[::tracing_test::traced_test]
  351    502   
    async fn aws_json10_complex_error_response() {
  352    503   
        let expected_output = crate::types::error::ComplexError::builder()
  353    504   
            .set_top_level(::std::option::Option::Some("Top level".to_owned()))
  354    505   
            .set_nested(::std::option::Option::Some(
  355    506   
                crate::types::ComplexNestedErrorData::builder()
  356    507   
                    .set_foo(::std::option::Option::Some("bar".to_owned()))
  357    508   
                    .build(),
  358    509   
            ))
  359    510   
            .build();
  360    511   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  361    512   
        .header("Content-Type", "application/x-amz-json-1.0")
  362    513   
        .status(400)
  363    514   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\",\n    \"TopLevel\": \"Top level\",\n    \"Nested\": {\n        \"Foo\": \"bar\"\n    }\n}"))
  364    515   
                    .unwrap()
  365    516   
                    ).unwrap();
  366    517   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  367    518   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  368    519   
  369    520   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  370    521   
        let config = op.config().expect("the operation has config");
  371    522   
        let de = config
  372    523   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  373    524   
            .expect("the config must have a deserializer");
  374    525   
  375    526   
        // Build a config bag with the protocol for schema-based deserialization
  376    527   
        #[allow(unused_mut)]
  377    528   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         529  +
        {
         530  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         531  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         532  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         533  +
            ));
         534  +
            test_cfg.push_shared_layer(layer.freeze());
         535  +
        }
  378    536   
  379    537   
        let parsed = de.deserialize_streaming(&mut http_response);
  380    538   
        let parsed = parsed.unwrap_or_else(|| {
  381    539   
            let http_response = http_response.map(|body| {
  382    540   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  383    541   
                    body.bytes().unwrap(),
  384    542   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  385    543   
                )))
  386    544   
            });
  387    545   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  388    546   
        });
  389    547   
        let parsed = parsed.expect_err("should be error response");
  390    548   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  391    549   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  392    550   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError(parsed) = parsed {
  393    551   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  394    552   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  395    553   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  396    554   
        } else {
  397    555   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  398    556   
        }
  399    557   
    }
  400    558   
  401    559   
    /// Parses a complex error with an empty body
  402    560   
    /// Test ID: AwsJson10EmptyComplexError
  403    561   
    #[::tokio::test]
  404    562   
    #[::tracing_test::traced_test]
  405    563   
    async fn aws_json10_empty_complex_error_response() {
  406    564   
        let expected_output = crate::types::error::ComplexError::builder().build();
  407    565   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  408    566   
            ::http_1x::response::Builder::new()
  409    567   
                .header("Content-Type", "application/x-amz-json-1.0")
  410    568   
                .status(400)
  411    569   
                .body(::aws_smithy_types::body::SdkBody::from(
  412    570   
                    "{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\"\n}",
  413    571   
                ))
  414    572   
                .unwrap(),
  415    573   
        )
  416    574   
        .unwrap();
  417    575   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  418    576   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  419    577   
  420    578   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  421    579   
        let config = op.config().expect("the operation has config");
  422    580   
        let de = config
  423    581   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  424    582   
            .expect("the config must have a deserializer");
  425    583   
  426    584   
        // Build a config bag with the protocol for schema-based deserialization
  427    585   
        #[allow(unused_mut)]
  428    586   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         587  +
        {
         588  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         589  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         590  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         591  +
            ));
         592  +
            test_cfg.push_shared_layer(layer.freeze());
         593  +
        }
  429    594   
  430    595   
        let parsed = de.deserialize_streaming(&mut http_response);
  431    596   
        let parsed = parsed.unwrap_or_else(|| {
  432    597   
            let http_response = http_response.map(|body| {
  433    598   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  434    599   
                    body.bytes().unwrap(),
  435    600   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  436    601   
                )))
  437    602   
            });
  438    603   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  439    604   
        });
  440    605   
        let parsed = parsed.expect_err("should be error response");
  441    606   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  442    607   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  443    608   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError(parsed) = parsed {
  444    609   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  445    610   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  446    611   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  447    612   
        } else {
  448    613   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  449    614   
        }
  450    615   
    }
  451    616   
  452    617   
    /// Serializes the X-Amzn-ErrorType header. For an example service, see Amazon EKS.
  453    618   
    /// Test ID: AwsJson10FooErrorUsingXAmznErrorType
  454    619   
    #[::tokio::test]
  455    620   
    #[::tracing_test::traced_test]
  456    621   
    async fn aws_json10_foo_error_using_x_amzn_error_type_response() {
  457    622   
        let expected_output = crate::types::error::FooError::builder().build();
  458    623   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  459    624   
            ::http_1x::response::Builder::new()
  460    625   
                .header("X-Amzn-Errortype", "FooError")
  461    626   
                .status(500)
  462    627   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  463    628   
                .unwrap(),
  464    629   
        )
  465    630   
        .unwrap();
  466    631   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  467    632   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  468    633   
  469    634   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  470    635   
        let config = op.config().expect("the operation has config");
  471    636   
        let de = config
  472    637   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  473    638   
            .expect("the config must have a deserializer");
  474    639   
  475    640   
        // Build a config bag with the protocol for schema-based deserialization
  476    641   
        #[allow(unused_mut)]
  477    642   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         643  +
        {
         644  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         645  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         646  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         647  +
            ));
         648  +
            test_cfg.push_shared_layer(layer.freeze());
         649  +
        }
  478    650   
  479    651   
        let parsed = de.deserialize_streaming(&mut http_response);
  480    652   
        let parsed = parsed.unwrap_or_else(|| {
  481    653   
            let http_response = http_response.map(|body| {
  482    654   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  483    655   
                    body.bytes().unwrap(),
  484    656   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  485    657   
                )))
  486    658   
            });
  487    659   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  488    660   
        });
  489    661   
        let parsed = parsed.expect_err("should be error response");
  490    662   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  491    663   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  492    664   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  493    665   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  494    666   
        } else {
  495    667   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  496    668   
        }
  497    669   
    }
  498    670   
  499    671   
    /// Some X-Amzn-Errortype headers contain URLs. Clients need to split the URL on ':' and take only the first half of the string. For example, 'ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/'
  500    672   
    /// is to be interpreted as 'ValidationException'.
  501    673   
    ///
  502    674   
    /// For an example service see Amazon Polly.
  503    675   
    /// Test ID: AwsJson10FooErrorUsingXAmznErrorTypeWithUri
  504    676   
    #[::tokio::test]
  505    677   
    #[::tracing_test::traced_test]
  506    678   
    async fn aws_json10_foo_error_using_x_amzn_error_type_with_uri_response() {
  507    679   
        let expected_output = crate::types::error::FooError::builder().build();
  508    680   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  509    681   
            ::http_1x::response::Builder::new()
  510    682   
                .header("X-Amzn-Errortype", "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/")
  511    683   
                .status(500)
  512    684   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  513    685   
                .unwrap(),
  514    686   
        )
  515    687   
        .unwrap();
  516    688   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  517    689   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  518    690   
  519    691   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  520    692   
        let config = op.config().expect("the operation has config");
  521    693   
        let de = config
  522    694   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  523    695   
            .expect("the config must have a deserializer");
  524    696   
  525    697   
        // Build a config bag with the protocol for schema-based deserialization
  526    698   
        #[allow(unused_mut)]
  527    699   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         700  +
        {
         701  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         702  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         703  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         704  +
            ));
         705  +
            test_cfg.push_shared_layer(layer.freeze());
         706  +
        }
  528    707   
  529    708   
        let parsed = de.deserialize_streaming(&mut http_response);
  530    709   
        let parsed = parsed.unwrap_or_else(|| {
  531    710   
            let http_response = http_response.map(|body| {
  532    711   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  533    712   
                    body.bytes().unwrap(),
  534    713   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  535    714   
                )))
  536    715   
            });
  537    716   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  538    717   
        });
  539    718   
        let parsed = parsed.expect_err("should be error response");
  540    719   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  541    720   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  542    721   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  543    722   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  544    723   
        } else {
  545    724   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  546    725   
        }
  547    726   
    }
  548    727   
  549    728   
    /// X-Amzn-Errortype might contain a URL and a namespace. Client should extract only the shape name. This is a pathalogical case that might not actually happen in any deployed AWS service.
  550    729   
    /// Test ID: AwsJson10FooErrorUsingXAmznErrorTypeWithUriAndNamespace
  551    730   
    #[::tokio::test]
  552    731   
    #[::tracing_test::traced_test]
  553    732   
    async fn aws_json10_foo_error_using_x_amzn_error_type_with_uri_and_namespace_response() {
  554    733   
        let expected_output = crate::types::error::FooError::builder().build();
  555    734   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  556    735   
            ::http_1x::response::Builder::new()
  557    736   
                .header(
  558    737   
                    "X-Amzn-Errortype",
  559    738   
                    "aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/",
  560    739   
                )
  561    740   
                .status(500)
  562    741   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  563    742   
                .unwrap(),
  564    743   
        )
  565    744   
        .unwrap();
  566    745   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  567    746   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  568    747   
  569    748   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  570    749   
        let config = op.config().expect("the operation has config");
  571    750   
        let de = config
  572    751   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  573    752   
            .expect("the config must have a deserializer");
  574    753   
  575    754   
        // Build a config bag with the protocol for schema-based deserialization
  576    755   
        #[allow(unused_mut)]
  577    756   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         757  +
        {
         758  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         759  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         760  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         761  +
            ));
         762  +
            test_cfg.push_shared_layer(layer.freeze());
         763  +
        }
  578    764   
  579    765   
        let parsed = de.deserialize_streaming(&mut http_response);
  580    766   
        let parsed = parsed.unwrap_or_else(|| {
  581    767   
            let http_response = http_response.map(|body| {
  582    768   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  583    769   
                    body.bytes().unwrap(),
  584    770   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  585    771   
                )))
  586    772   
            });
  587    773   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  588    774   
        });
  589    775   
        let parsed = parsed.expect_err("should be error response");
  590    776   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  591    777   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  592    778   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  593    779   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  594    780   
        } else {
  595    781   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  596    782   
        }
  597    783   
    }
  598    784   
  599    785   
    /// This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property.
  600    786   
    ///
  601    787   
    /// For example service see Amazon S3 Glacier.
  602    788   
    /// Test ID: AwsJson10FooErrorUsingCode
  603    789   
    #[::tokio::test]
  604    790   
    #[::tracing_test::traced_test]
  605    791   
    async fn aws_json10_foo_error_using_code_response() {
  606    792   
        let expected_output = crate::types::error::FooError::builder().build();
  607    793   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  608    794   
            ::http_1x::response::Builder::new()
  609    795   
                .header("Content-Type", "application/x-amz-json-1.0")
  610    796   
                .status(500)
  611    797   
                .body(::aws_smithy_types::body::SdkBody::from("{\n    \"code\": \"FooError\"\n}"))
  612    798   
                .unwrap(),
  613    799   
        )
  614    800   
        .unwrap();
  615    801   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  616    802   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  617    803   
  618    804   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  619    805   
        let config = op.config().expect("the operation has config");
  620    806   
        let de = config
  621    807   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  622    808   
            .expect("the config must have a deserializer");
  623    809   
  624    810   
        // Build a config bag with the protocol for schema-based deserialization
  625    811   
        #[allow(unused_mut)]
  626    812   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         813  +
        {
         814  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         815  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         816  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         817  +
            ));
         818  +
            test_cfg.push_shared_layer(layer.freeze());
         819  +
        }
  627    820   
  628    821   
        let parsed = de.deserialize_streaming(&mut http_response);
  629    822   
        let parsed = parsed.unwrap_or_else(|| {
  630    823   
            let http_response = http_response.map(|body| {
  631    824   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  632    825   
                    body.bytes().unwrap(),
  633    826   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  634    827   
                )))
  635    828   
            });
  636    829   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  637    830   
        });
  638    831   
        let parsed = parsed.expect_err("should be error response");
  639    832   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  640    833   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  641    834   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  642    835   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  643    836   
        } else {
  644    837   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  645    838   
        }
  646    839   
    }
  647    840   
  648    841   
    /// Some services serialize errors using code, and it might contain a namespace. Clients should just take the last part of the string after '#'.
  649    842   
    /// Test ID: AwsJson10FooErrorUsingCodeAndNamespace
  650    843   
    #[::tokio::test]
  651    844   
    #[::tracing_test::traced_test]
  652    845   
    async fn aws_json10_foo_error_using_code_and_namespace_response() {
  653    846   
        let expected_output = crate::types::error::FooError::builder().build();
  654    847   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  655    848   
            ::http_1x::response::Builder::new()
  656    849   
                .header("Content-Type", "application/x-amz-json-1.0")
  657    850   
                .status(500)
  658    851   
                .body(::aws_smithy_types::body::SdkBody::from(
  659    852   
                    "{\n    \"code\": \"aws.protocoltests.json10#FooError\"\n}",
  660    853   
                ))
  661    854   
                .unwrap(),
  662    855   
        )
  663    856   
        .unwrap();
  664    857   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  665    858   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  666    859   
  667    860   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  668    861   
        let config = op.config().expect("the operation has config");
  669    862   
        let de = config
  670    863   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  671    864   
            .expect("the config must have a deserializer");
  672    865   
  673    866   
        // Build a config bag with the protocol for schema-based deserialization
  674    867   
        #[allow(unused_mut)]
  675    868   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         869  +
        {
         870  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         871  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         872  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         873  +
            ));
         874  +
            test_cfg.push_shared_layer(layer.freeze());
         875  +
        }
  676    876   
  677    877   
        let parsed = de.deserialize_streaming(&mut http_response);
  678    878   
        let parsed = parsed.unwrap_or_else(|| {
  679    879   
            let http_response = http_response.map(|body| {
  680    880   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  681    881   
                    body.bytes().unwrap(),
  682    882   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  683    883   
                )))
  684    884   
            });
  685    885   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  686    886   
        });
  687    887   
        let parsed = parsed.expect_err("should be error response");
  688    888   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  689    889   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  690    890   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  691    891   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  692    892   
        } else {
  693    893   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  694    894   
        }
  695    895   
    }
  696    896   
  697    897   
    /// Some services serialize errors using code, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
  698    898   
    /// Test ID: AwsJson10FooErrorUsingCodeUriAndNamespace
  699    899   
    #[::tokio::test]
  700    900   
    #[::tracing_test::traced_test]
  701    901   
    async fn aws_json10_foo_error_using_code_uri_and_namespace_response() {
  702    902   
        let expected_output = crate::types::error::FooError::builder().build();
  703    903   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  704    904   
            ::http_1x::response::Builder::new()
  705    905   
                .header("Content-Type", "application/x-amz-json-1.0")
  706    906   
                .status(500)
  707    907   
                .body(::aws_smithy_types::body::SdkBody::from(
  708    908   
                    "{\n    \"code\": \"aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/\"\n}",
  709    909   
                ))
  710    910   
                .unwrap(),
  711    911   
        )
  712    912   
        .unwrap();
  713    913   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  714    914   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  715    915   
  716    916   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  717    917   
        let config = op.config().expect("the operation has config");
  718    918   
        let de = config
  719    919   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  720    920   
            .expect("the config must have a deserializer");
  721    921   
  722    922   
        // Build a config bag with the protocol for schema-based deserialization
  723    923   
        #[allow(unused_mut)]
  724    924   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         925  +
        {
         926  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         927  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         928  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         929  +
            ));
         930  +
            test_cfg.push_shared_layer(layer.freeze());
         931  +
        }
  725    932   
  726    933   
        let parsed = de.deserialize_streaming(&mut http_response);
  727    934   
        let parsed = parsed.unwrap_or_else(|| {
  728    935   
            let http_response = http_response.map(|body| {
  729    936   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  730    937   
                    body.bytes().unwrap(),
  731    938   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  732    939   
                )))
  733    940   
            });
  734    941   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  735    942   
        });
  736    943   
        let parsed = parsed.expect_err("should be error response");
  737    944   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  738    945   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  739    946   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  740    947   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  741    948   
        } else {
  742    949   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  743    950   
        }
  744    951   
    }
  745    952   
  746    953   
    /// Some services serialize errors using __type.
  747    954   
    /// Test ID: AwsJson10FooErrorWithDunderType
  748    955   
    #[::tokio::test]
  749    956   
    #[::tracing_test::traced_test]
  750    957   
    async fn aws_json10_foo_error_with_dunder_type_response() {
  751    958   
        let expected_output = crate::types::error::FooError::builder().build();
  752    959   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  753    960   
            ::http_1x::response::Builder::new()
  754    961   
                .header("Content-Type", "application/x-amz-json-1.0")
  755    962   
                .status(500)
  756    963   
                .body(::aws_smithy_types::body::SdkBody::from("{\n    \"__type\": \"FooError\"\n}"))
  757    964   
                .unwrap(),
  758    965   
        )
  759    966   
        .unwrap();
  760    967   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  761    968   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  762    969   
  763    970   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  764    971   
        let config = op.config().expect("the operation has config");
  765    972   
        let de = config
  766    973   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  767    974   
            .expect("the config must have a deserializer");
  768    975   
  769    976   
        // Build a config bag with the protocol for schema-based deserialization
  770    977   
        #[allow(unused_mut)]
  771    978   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         979  +
        {
         980  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         981  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         982  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
         983  +
            ));
         984  +
            test_cfg.push_shared_layer(layer.freeze());
         985  +
        }
  772    986   
  773    987   
        let parsed = de.deserialize_streaming(&mut http_response);
  774    988   
        let parsed = parsed.unwrap_or_else(|| {
  775    989   
            let http_response = http_response.map(|body| {
  776    990   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  777    991   
                    body.bytes().unwrap(),
  778    992   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  779    993   
                )))
  780    994   
            });
  781    995   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  782    996   
        });
  783    997   
        let parsed = parsed.expect_err("should be error response");
  784    998   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  785    999   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  786   1000   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  787   1001   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  788   1002   
        } else {
  789   1003   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  790   1004   
        }
  791   1005   
    }
  792   1006   
  793   1007   
    /// Some services serialize errors using __type, and it might contain a namespace. Clients should just take the last part of the string after '#'.
  794   1008   
    /// Test ID: AwsJson10FooErrorWithDunderTypeAndNamespace
  795   1009   
    #[::tokio::test]
  796   1010   
    #[::tracing_test::traced_test]
  797   1011   
    async fn aws_json10_foo_error_with_dunder_type_and_namespace_response() {
  798   1012   
        let expected_output = crate::types::error::FooError::builder().build();
  799   1013   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  800   1014   
            ::http_1x::response::Builder::new()
  801   1015   
                .header("Content-Type", "application/x-amz-json-1.0")
  802   1016   
                .status(500)
  803   1017   
                .body(::aws_smithy_types::body::SdkBody::from(
  804   1018   
                    "{\n    \"__type\": \"aws.protocoltests.json10#FooError\"\n}",
  805   1019   
                ))
  806   1020   
                .unwrap(),
  807   1021   
        )
  808   1022   
        .unwrap();
  809   1023   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  810   1024   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  811   1025   
  812   1026   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  813   1027   
        let config = op.config().expect("the operation has config");
  814   1028   
        let de = config
  815   1029   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  816   1030   
            .expect("the config must have a deserializer");
  817   1031   
  818   1032   
        // Build a config bag with the protocol for schema-based deserialization
  819   1033   
        #[allow(unused_mut)]
  820   1034   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1035  +
        {
        1036  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1037  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1038  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
        1039  +
            ));
        1040  +
            test_cfg.push_shared_layer(layer.freeze());
        1041  +
        }
  821   1042   
  822   1043   
        let parsed = de.deserialize_streaming(&mut http_response);
  823   1044   
        let parsed = parsed.unwrap_or_else(|| {
  824   1045   
            let http_response = http_response.map(|body| {
  825   1046   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  826   1047   
                    body.bytes().unwrap(),
  827   1048   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  828   1049   
                )))
  829   1050   
            });
  830   1051   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  831   1052   
        });
  832   1053   
        let parsed = parsed.expect_err("should be error response");
  833   1054   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  834   1055   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  835   1056   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  836   1057   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  837   1058   
        } else {
  838   1059   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  839   1060   
        }
  840   1061   
    }
  841   1062   
  842   1063   
    /// Because only the part after '#' is considered, an unrecognized namespace should not make a difference.
  843   1064   
    /// Test ID: AwsJson10FooErrorWithDunderTypeAndDifferentNamespace
  844   1065   
    #[::tokio::test]
  845   1066   
    #[::tracing_test::traced_test]
  846   1067   
    async fn aws_json10_foo_error_with_dunder_type_and_different_namespace_response() {
  847   1068   
        let expected_output = crate::types::error::FooError::builder().build();
  848   1069   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  849   1070   
            ::http_1x::response::Builder::new()
  850   1071   
                .header("Content-Type", "application/x-amz-json-1.0")
  851   1072   
                .status(500)
  852   1073   
                .body(::aws_smithy_types::body::SdkBody::from(
  853   1074   
                    "{\n    \"__type\": \"aws.different.namespace#FooError\"\n}",
  854   1075   
                ))
  855   1076   
                .unwrap(),
  856   1077   
        )
  857   1078   
        .unwrap();
  858   1079   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  859   1080   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  860   1081   
  861   1082   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  862   1083   
        let config = op.config().expect("the operation has config");
  863   1084   
        let de = config
  864   1085   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  865   1086   
            .expect("the config must have a deserializer");
  866   1087   
  867   1088   
        // Build a config bag with the protocol for schema-based deserialization
  868   1089   
        #[allow(unused_mut)]
  869   1090   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1091  +
        {
        1092  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1093  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1094  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
        1095  +
            ));
        1096  +
            test_cfg.push_shared_layer(layer.freeze());
        1097  +
        }
  870   1098   
  871   1099   
        let parsed = de.deserialize_streaming(&mut http_response);
  872   1100   
        let parsed = parsed.unwrap_or_else(|| {
  873   1101   
            let http_response = http_response.map(|body| {
  874   1102   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  875   1103   
                    body.bytes().unwrap(),
  876   1104   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  877   1105   
                )))
  878   1106   
            });
  879   1107   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  880   1108   
        });
  881   1109   
        let parsed = parsed.expect_err("should be error response");
  882   1110   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  883   1111   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  884   1112   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  885   1113   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  886   1114   
        } else {
  887   1115   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  888   1116   
        }
  889   1117   
    }
  890   1118   
  891   1119   
    /// Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
  892   1120   
    /// Test ID: AwsJson10FooErrorWithDunderTypeUriAndNamespace
  893   1121   
    #[::tokio::test]
  894   1122   
    #[::tracing_test::traced_test]
  895   1123   
    async fn aws_json10_foo_error_with_dunder_type_uri_and_namespace_response() {
  896   1124   
        let expected_output = crate::types::error::FooError::builder().build();
  897   1125   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  898   1126   
            ::http_1x::response::Builder::new()
  899   1127   
                .header("Content-Type", "application/x-amz-json-1.0")
  900   1128   
                .status(500)
  901   1129   
                .body(::aws_smithy_types::body::SdkBody::from(
  902   1130   
                    "{\n    \"__type\": \"aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/\"\n}",
  903   1131   
                ))
  904   1132   
                .unwrap(),
  905   1133   
        )
  906   1134   
        .unwrap();
  907   1135   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  908   1136   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  909   1137   
  910   1138   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  911   1139   
        let config = op.config().expect("the operation has config");
  912   1140   
        let de = config
  913   1141   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  914   1142   
            .expect("the config must have a deserializer");
  915   1143   
  916   1144   
        // Build a config bag with the protocol for schema-based deserialization
  917   1145   
        #[allow(unused_mut)]
  918   1146   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1147  +
        {
        1148  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1149  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1150  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
        1151  +
            ));
        1152  +
            test_cfg.push_shared_layer(layer.freeze());
        1153  +
        }
  919   1154   
  920   1155   
        let parsed = de.deserialize_streaming(&mut http_response);
  921   1156   
        let parsed = parsed.unwrap_or_else(|| {
  922   1157   
            let http_response = http_response.map(|body| {
  923   1158   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  924   1159   
                    body.bytes().unwrap(),
  925   1160   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  926   1161   
                )))
  927   1162   
            });
  928   1163   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  929   1164   
        });
  930   1165   
        let parsed = parsed.expect_err("should be error response");
  931   1166   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  932   1167   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  933   1168   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  934   1169   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  935   1170   
        } else {
  936   1171   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  937   1172   
        }
  938   1173   
    }
  939   1174   
  940   1175   
    /// Some services serialize errors using __type, and if the response includes additional shapes that belong to a different namespace there'll be a nested __type property that must not be considered when determining which error to be surfaced.
  941   1176   
    ///
  942   1177   
    /// For an example service see Amazon DynamoDB.
  943   1178   
    /// Test ID: AwsJson10FooErrorWithNestedTypeProperty
  944   1179   
    #[::tokio::test]
  945   1180   
    #[::tracing_test::traced_test]
  946   1181   
    async fn aws_json10_foo_error_with_nested_type_property_response() {
  947   1182   
        let expected_output = crate::types::error::FooError::builder().build();
  948   1183   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  949   1184   
        .header("Content-Type", "application/x-amz-json-1.0")
  950   1185   
        .status(500)
  951   1186   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"__type\": \"aws.protocoltests.json10#FooError\",\n    \"ErrorDetails\": [\n      {\n          \"__type\": \"com.amazon.internal#ErrorDetails\",\n          \"reason\": \"Some reason\"\n      }\n    ]\n}"))
  952   1187   
                    .unwrap()
  953   1188   
                    ).unwrap();
  954   1189   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  955   1190   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  956   1191   
  957   1192   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  958   1193   
        let config = op.config().expect("the operation has config");
  959   1194   
        let de = config
  960   1195   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  961   1196   
            .expect("the config must have a deserializer");
  962   1197   
  963   1198   
        // Build a config bag with the protocol for schema-based deserialization
  964   1199   
        #[allow(unused_mut)]
  965   1200   
        let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1201  +
        {
        1202  +
            let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1203  +
            layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1204  +
                ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
        1205  +
            ));
        1206  +
            test_cfg.push_shared_layer(layer.freeze());
        1207  +
        }
  966   1208   
  967   1209   
        let parsed = de.deserialize_streaming(&mut http_response);
  968   1210   
        let parsed = parsed.unwrap_or_else(|| {
  969   1211   
            let http_response = http_response.map(|body| {
  970   1212   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  971   1213   
                    body.bytes().unwrap(),
  972   1214   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  973   1215   
                )))
  974   1216   
            });
  975   1217   
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_input.rs

@@ -1,1 +44,122 @@
    5      5   
pub struct GreetingWithErrorsInput {
    6      6   
    #[allow(missing_docs)] // documentation missing in model
    7      7   
    pub greeting: ::std::option::Option<::std::string::String>,
    8      8   
}
    9      9   
impl GreetingWithErrorsInput {
   10     10   
    #[allow(missing_docs)] // documentation missing in model
   11     11   
    pub fn greeting(&self) -> ::std::option::Option<&str> {
   12     12   
        self.greeting.as_deref()
   13     13   
    }
   14     14   
}
          15  +
static GREETINGWITHERRORSINPUT_MEMBER_GREETING: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          16  +
    ::aws_smithy_schema::ShapeId::from_parts(
          17  +
        "aws.protocoltests.json10.synthetic#GreetingWithErrorsInput$greeting",
          18  +
        "aws.protocoltests.json10.synthetic",
          19  +
        "GreetingWithErrorsInput",
          20  +
    ),
          21  +
    ::aws_smithy_schema::ShapeType::String,
          22  +
    "greeting",
          23  +
    0,
          24  +
);
          25  +
static GREETINGWITHERRORSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          26  +
    ::aws_smithy_schema::ShapeId::from_parts(
          27  +
        "aws.protocoltests.json10.synthetic#GreetingWithErrorsInput",
          28  +
        "aws.protocoltests.json10.synthetic",
          29  +
        "GreetingWithErrorsInput",
          30  +
    ),
          31  +
    ::aws_smithy_schema::ShapeType::Structure,
          32  +
    &[&GREETINGWITHERRORSINPUT_MEMBER_GREETING],
          33  +
)
          34  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          35  +
.with_original_name("GreetingWithErrorsInput");
          36  +
impl GreetingWithErrorsInput {
          37  +
    /// The schema for this shape.
          38  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GREETINGWITHERRORSINPUT_SCHEMA;
          39  +
}
          40  +
impl ::aws_smithy_schema::serde::SerializableStruct for GreetingWithErrorsInput {
          41  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          42  +
    fn serialize_members(
          43  +
        &self,
          44  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          45  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          46  +
        if let Some(ref val) = self.greeting {
          47  +
            ser.write_string(&GREETINGWITHERRORSINPUT_MEMBER_GREETING, val)?;
          48  +
        }
          49  +
        Ok(())
          50  +
    }
          51  +
}
          52  +
impl GreetingWithErrorsInput {
          53  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        #[allow(unused_variables, unused_mut)]
          58  +
        let mut builder = Self::builder();
          59  +
        #[allow(
          60  +
            unused_variables,
          61  +
            unreachable_code,
          62  +
            clippy::single_match,
          63  +
            clippy::match_single_binding,
          64  +
            clippy::diverging_sub_expression
          65  +
        )]
          66  +
        deserializer.read_struct(&GREETINGWITHERRORSINPUT_SCHEMA, &mut |member, deser| {
          67  +
            match member.member_index() {
          68  +
                Some(0) => {
          69  +
                    if deser.is_null() {
          70  +
                        deser.read_null()?;
          71  +
                    } else {
          72  +
                        builder.greeting = Some(deser.read_string(member)?);
          73  +
                    }
          74  +
                }
          75  +
                _ => {}
          76  +
            }
          77  +
            Ok(())
          78  +
        })?;
          79  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          80  +
    }
          81  +
}
          82  +
impl GreetingWithErrorsInput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          84  +
    pub fn deserialize_with_response(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          87  +
        _status: u16,
          88  +
        _body: &[u8],
          89  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          90  +
        Self::deserialize(deserializer)
          91  +
    }
          92  +
}
   15     93   
impl GreetingWithErrorsInput {
   16     94   
    /// Creates a new builder-style object to manufacture [`GreetingWithErrorsInput`](crate::operation::greeting_with_errors::GreetingWithErrorsInput).
   17     95   
    pub fn builder() -> crate::operation::greeting_with_errors::builders::GreetingWithErrorsInputBuilder {
   18     96   
        crate::operation::greeting_with_errors::builders::GreetingWithErrorsInputBuilder::default()
   19     97   
    }
   20     98   
}
   21     99   
   22    100   
/// A builder for [`GreetingWithErrorsInput`](crate::operation::greeting_with_errors::GreetingWithErrorsInput).
   23    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   24    102   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_output.rs

@@ -1,1 +44,121 @@
    5      5   
pub struct GreetingWithErrorsOutput {
    6      6   
    #[allow(missing_docs)] // documentation missing in model
    7      7   
    pub greeting: ::std::option::Option<::std::string::String>,
    8      8   
}
    9      9   
impl GreetingWithErrorsOutput {
   10     10   
    #[allow(missing_docs)] // documentation missing in model
   11     11   
    pub fn greeting(&self) -> ::std::option::Option<&str> {
   12     12   
        self.greeting.as_deref()
   13     13   
    }
   14     14   
}
          15  +
static GREETINGWITHERRORSOUTPUT_MEMBER_GREETING: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          16  +
    ::aws_smithy_schema::ShapeId::from_parts(
          17  +
        "aws.protocoltests.json10.synthetic#GreetingWithErrorsOutput$greeting",
          18  +
        "aws.protocoltests.json10.synthetic",
          19  +
        "GreetingWithErrorsOutput",
          20  +
    ),
          21  +
    ::aws_smithy_schema::ShapeType::String,
          22  +
    "greeting",
          23  +
    0,
          24  +
);
          25  +
static GREETINGWITHERRORSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          26  +
    ::aws_smithy_schema::ShapeId::from_parts(
          27  +
        "aws.protocoltests.json10.synthetic#GreetingWithErrorsOutput",
          28  +
        "aws.protocoltests.json10.synthetic",
          29  +
        "GreetingWithErrorsOutput",
          30  +
    ),
          31  +
    ::aws_smithy_schema::ShapeType::Structure,
          32  +
    &[&GREETINGWITHERRORSOUTPUT_MEMBER_GREETING],
          33  +
)
          34  +
.with_original_name("GreetingWithErrorsOutput");
          35  +
impl GreetingWithErrorsOutput {
          36  +
    /// The schema for this shape.
          37  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GREETINGWITHERRORSOUTPUT_SCHEMA;
          38  +
}
          39  +
impl ::aws_smithy_schema::serde::SerializableStruct for GreetingWithErrorsOutput {
          40  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          41  +
    fn serialize_members(
          42  +
        &self,
          43  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          44  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          45  +
        if let Some(ref val) = self.greeting {
          46  +
            ser.write_string(&GREETINGWITHERRORSOUTPUT_MEMBER_GREETING, val)?;
          47  +
        }
          48  +
        Ok(())
          49  +
    }
          50  +
}
          51  +
impl GreetingWithErrorsOutput {
          52  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          55  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          56  +
        #[allow(unused_variables, unused_mut)]
          57  +
        let mut builder = Self::builder();
          58  +
        #[allow(
          59  +
            unused_variables,
          60  +
            unreachable_code,
          61  +
            clippy::single_match,
          62  +
            clippy::match_single_binding,
          63  +
            clippy::diverging_sub_expression
          64  +
        )]
          65  +
        deserializer.read_struct(&GREETINGWITHERRORSOUTPUT_SCHEMA, &mut |member, deser| {
          66  +
            match member.member_index() {
          67  +
                Some(0) => {
          68  +
                    if deser.is_null() {
          69  +
                        deser.read_null()?;
          70  +
                    } else {
          71  +
                        builder.greeting = Some(deser.read_string(member)?);
          72  +
                    }
          73  +
                }
          74  +
                _ => {}
          75  +
            }
          76  +
            Ok(())
          77  +
        })?;
          78  +
        Ok(builder.build())
          79  +
    }
          80  +
}
          81  +
impl GreetingWithErrorsOutput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          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  +
        Self::deserialize(deserializer)
          90  +
    }
          91  +
}
   15     92   
impl GreetingWithErrorsOutput {
   16     93   
    /// Creates a new builder-style object to manufacture [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
   17     94   
    pub fn builder() -> crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder {
   18     95   
        crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default()
   19     96   
    }
   20     97   
}
   21     98   
   22     99   
/// A builder for [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
   23    100   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   24    101   
#[non_exhaustive]

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/host_with_path_operation/_host_with_path_operation_input.rs

@@ -1,1 +25,85 @@
    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 HostWithPathOperationInput {}
           6  +
static HOSTWITHPATHOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#HostWithPathOperationInput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "HostWithPathOperationInput",
          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 HostWithPathOperationInput {
          18  +
    /// The schema for this shape.
          19  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &HOSTWITHPATHOPERATIONINPUT_SCHEMA;
          20  +
}
          21  +
impl ::aws_smithy_schema::serde::SerializableStruct for HostWithPathOperationInput {
          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 HostWithPathOperationInput {
          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(&HOSTWITHPATHOPERATIONINPUT_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 HostWithPathOperationInput {
          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 HostWithPathOperationInput {
    7     67   
    /// Creates a new builder-style object to manufacture [`HostWithPathOperationInput`](crate::operation::host_with_path_operation::HostWithPathOperationInput).
    8     68   
    pub fn builder() -> crate::operation::host_with_path_operation::builders::HostWithPathOperationInputBuilder {
    9     69   
        crate::operation::host_with_path_operation::builders::HostWithPathOperationInputBuilder::default()
   10     70   
    }
   11     71   
}
   12     72   
   13     73   
/// A builder for [`HostWithPathOperationInput`](crate::operation::host_with_path_operation::HostWithPathOperationInput).
   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/host_with_path_operation/_host_with_path_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 HostWithPathOperationOutput {}
           6  +
static HOSTWITHPATHOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
           7  +
    ::aws_smithy_schema::ShapeId::from_parts(
           8  +
        "aws.protocoltests.json10.synthetic#HostWithPathOperationOutput",
           9  +
        "aws.protocoltests.json10.synthetic",
          10  +
        "HostWithPathOperationOutput",
          11  +
    ),
          12  +
    ::aws_smithy_schema::ShapeType::Structure,
          13  +
    &[],
          14  +
);
          15  +
impl HostWithPathOperationOutput {
          16  +
    /// The schema for this shape.
          17  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &HOSTWITHPATHOPERATIONOUTPUT_SCHEMA;
          18  +
}
          19  +
impl ::aws_smithy_schema::serde::SerializableStruct for HostWithPathOperationOutput {
          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 HostWithPathOperationOutput {
          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(&HOSTWITHPATHOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
          43  +
            match member.member_index() {
          44  +
                _ => {}
          45  +
            }
          46  +
            Ok(())
          47  +
        })?;
          48  +
        Ok(builder.build())
          49  +
    }
          50  +
}
          51  +
impl HostWithPathOperationOutput {
          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 HostWithPathOperationOutput {
    7     63   
    /// Creates a new builder-style object to manufacture [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
    8     64   
    pub fn builder() -> crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder {
    9     65   
        crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder::default()
   10     66   
    }
   11     67   
}
   12     68   
   13     69   
/// A builder for [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
   14     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   15     71   
#[non_exhaustive]