Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/json_unions/_json_unions_input.rs

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_no_output.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 `NoInputAndNoOutput`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct NoInputAndNoOutput;
    6      6   
impl NoInputAndNoOutput {
    7      7   
    /// Creates a new `NoInputAndNoOutput`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::no_input_and_no_output::NoInputAndNoOutputInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput::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::no_input_and_no_output::NoInputAndNoOutputInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +230,233 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct NoInputAndNoOutputResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndNoOutputResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_no_input_and_no_output::de_no_input_and_no_output_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::no_input_and_no_output::NoInputAndNoOutputError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_no_input_and_no_output::de_no_input_and_no_output_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, NoInputAndNoOutput::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct NoInputAndNoOutputRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndNoOutputRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::no_input_and_no_output::NoInputAndNoOutputInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::no_input_and_no_output::NoInputAndNoOutputInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "JsonRpc10.NoInputAndNoOutput",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_no_input_and_no_output::ser_no_input_and_no_output_input(
  197         -
            &input,
  198         -
        )?);
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, NoInputAndNoOutput::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  199    202   
  200         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         203  +
        return ::std::result::Result::Ok(request);
  201    204   
    }
  202    205   
}
  203    206   
#[derive(Debug)]
  204    207   
struct NoInputAndNoOutputEndpointParamsInterceptor;
  205    208   
  206    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndNoOutputEndpointParamsInterceptor {
  207    210   
    fn name(&self) -> &'static str {
  208    211   
        "NoInputAndNoOutputEndpointParamsInterceptor"
  209    212   
    }
  210    213   
@@ -284,287 +429,462 @@
  304    307   
            .expect("the config must have a deserializer");
  305    308   
  306    309   
        let parsed = de.deserialize_streaming(&mut http_response);
  307    310   
        let parsed = parsed.unwrap_or_else(|| {
  308    311   
            let http_response = http_response.map(|body| {
  309    312   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  310    313   
                    body.bytes().unwrap(),
  311    314   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  312    315   
                )))
  313    316   
            });
  314         -
            de.deserialize_nonstreaming(&http_response)
         317  +
            // Build a config bag with the protocol for schema-based deserialization
         318  +
            #[allow(unused_mut)]
         319  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         320  +
            {
         321  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         322  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         323  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         324  +
                ));
         325  +
                test_cfg.push_shared_layer(layer.freeze());
         326  +
            }
         327  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  315    328   
        });
  316    329   
        let parsed = parsed
  317    330   
            .expect("should be successful response")
  318    331   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput>()
  319    332   
            .unwrap();
  320    333   
    }
  321    334   
  322    335   
    /// This client-only test builds on handles_empty_output_shape,
  323    336   
    /// by including unexpected fields in the JSON. A client
  324    337   
    /// needs to ignore JSON output that is empty or that contains
  325    338   
    /// JSON object data.
  326    339   
    /// Test ID: AwsJson10HandlesUnexpectedJsonOutput
  327    340   
    #[::tokio::test]
  328    341   
    #[::tracing_test::traced_test]
  329    342   
    async fn aws_json10_handles_unexpected_json_output_response() {
  330    343   
        let expected_output = crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput::builder().build();
  331    344   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  332    345   
            ::http_1x::response::Builder::new()
  333    346   
                .header("Content-Type", "application/x-amz-json-1.0")
  334    347   
                .status(200)
  335    348   
                .body(::aws_smithy_types::body::SdkBody::from("{\n    \"foo\": true\n}"))
  336    349   
                .unwrap(),
  337    350   
        )
  338    351   
        .unwrap();
  339    352   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  340    353   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  341    354   
  342    355   
        let op = crate::operation::no_input_and_no_output::NoInputAndNoOutput::new();
  343    356   
        let config = op.config().expect("the operation has config");
  344    357   
        let de = config
  345    358   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  346    359   
            .expect("the config must have a deserializer");
  347    360   
  348    361   
        let parsed = de.deserialize_streaming(&mut http_response);
  349    362   
        let parsed = parsed.unwrap_or_else(|| {
  350    363   
            let http_response = http_response.map(|body| {
  351    364   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  352    365   
                    body.bytes().unwrap(),
  353    366   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  354    367   
                )))
  355    368   
            });
  356         -
            de.deserialize_nonstreaming(&http_response)
         369  +
            // Build a config bag with the protocol for schema-based deserialization
         370  +
            #[allow(unused_mut)]
         371  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         372  +
            {
         373  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         374  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         375  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         376  +
                ));
         377  +
                test_cfg.push_shared_layer(layer.freeze());
         378  +
            }
         379  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  357    380   
        });
  358    381   
        let parsed = parsed
  359    382   
            .expect("should be successful response")
  360    383   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput>()
  361    384   
            .unwrap();
  362    385   
    }
  363    386   
  364    387   
    /// When no output is defined, the service is expected to return
  365    388   
    /// an empty payload. Despite the lack of a payload, the service
  366    389   
    /// is expected to always send a Content-Type header. Clients must
  367    390   
    /// handle cases where a service returns a JSON object and where
  368    391   
    /// a service returns no JSON at all.
  369    392   
    /// Test ID: AwsJson10ServiceRespondsWithNoPayload
  370    393   
    #[::tokio::test]
  371    394   
    #[::tracing_test::traced_test]
  372    395   
    async fn aws_json10_service_responds_with_no_payload_response() {
  373    396   
        let expected_output = crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput::builder().build();
  374    397   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  375    398   
            ::http_1x::response::Builder::new()
  376    399   
                .header("Content-Type", "application/x-amz-json-1.0")
  377    400   
                .status(200)
  378    401   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  379    402   
                .unwrap(),
  380    403   
        )
  381    404   
        .unwrap();
  382    405   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  383    406   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  384    407   
  385    408   
        let op = crate::operation::no_input_and_no_output::NoInputAndNoOutput::new();
  386    409   
        let config = op.config().expect("the operation has config");
  387    410   
        let de = config
  388    411   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  389    412   
            .expect("the config must have a deserializer");
  390    413   
  391    414   
        let parsed = de.deserialize_streaming(&mut http_response);
  392    415   
        let parsed = parsed.unwrap_or_else(|| {
  393    416   
            let http_response = http_response.map(|body| {
  394    417   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  395    418   
                    body.bytes().unwrap(),
  396    419   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  397    420   
                )))
  398    421   
            });
  399         -
            de.deserialize_nonstreaming(&http_response)
         422  +
            // Build a config bag with the protocol for schema-based deserialization
         423  +
            #[allow(unused_mut)]
         424  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         425  +
            {
         426  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         427  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         428  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         429  +
                ));
         430  +
                test_cfg.push_shared_layer(layer.freeze());
         431  +
            }
         432  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  400    433   
        });
  401    434   
        let parsed = parsed
  402    435   
            .expect("should be successful response")
  403    436   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput>()
  404    437   
            .unwrap();
  405    438   
    }
  406    439   
}
  407    440   
  408    441   
/// Error type for the `NoInputAndNoOutputError` operation.
  409    442   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_no_output/_no_input_and_no_output_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_no_output/_no_input_and_no_output_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_output.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 `NoInputAndOutput`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct NoInputAndOutput;
    6      6   
impl NoInputAndOutput {
    7      7   
    /// Creates a new `NoInputAndOutput`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::no_input_and_output::NoInputAndOutputInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::no_input_and_output::NoInputAndOutputOutput::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::no_input_and_output::NoInputAndOutputInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +228,233 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct NoInputAndOutputResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndOutputResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_no_input_and_output::de_no_input_and_output_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::no_input_and_output::NoInputAndOutputError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_no_input_and_output::de_no_input_and_output_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, NoInputAndOutput::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::no_input_and_output::NoInputAndOutputOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct NoInputAndOutputRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndOutputRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::no_input_and_output::NoInputAndOutputInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::no_input_and_output::NoInputAndOutputInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::no_input_and_output::NoInputAndOutputInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "JsonRpc10.NoInputAndOutput",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_no_input_and_output::ser_no_input_and_output_input(&input)?);
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, NoInputAndOutput::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    202   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         203  +
        return ::std::result::Result::Ok(request);
  199    204   
    }
  200    205   
}
  201    206   
#[derive(Debug)]
  202    207   
struct NoInputAndOutputEndpointParamsInterceptor;
  203    208   
  204    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndOutputEndpointParamsInterceptor {
  205    210   
    fn name(&self) -> &'static str {
  206    211   
        "NoInputAndOutputEndpointParamsInterceptor"
  207    212   
    }
  208    213   
@@ -274,279 +334,349 @@
  294    299   
            .expect("the config must have a deserializer");
  295    300   
  296    301   
        let parsed = de.deserialize_streaming(&mut http_response);
  297    302   
        let parsed = parsed.unwrap_or_else(|| {
  298    303   
            let http_response = http_response.map(|body| {
  299    304   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  300    305   
                    body.bytes().unwrap(),
  301    306   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  302    307   
                )))
  303    308   
            });
  304         -
            de.deserialize_nonstreaming(&http_response)
         309  +
            // Build a config bag with the protocol for schema-based deserialization
         310  +
            #[allow(unused_mut)]
         311  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         312  +
            {
         313  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         314  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         315  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         316  +
                ));
         317  +
                test_cfg.push_shared_layer(layer.freeze());
         318  +
            }
         319  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  305    320   
        });
  306    321   
        let parsed = parsed
  307    322   
            .expect("should be successful response")
  308    323   
            .downcast::<crate::operation::no_input_and_output::NoInputAndOutputOutput>()
  309    324   
            .unwrap();
  310    325   
    }
  311    326   
}
  312    327   
  313    328   
/// Error type for the `NoInputAndOutputError` operation.
  314    329   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_output/_no_input_and_output_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_output/_no_input_and_output_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_defaults.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 `OperationWithDefaults`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct OperationWithDefaults;
    6      6   
impl OperationWithDefaults {
    7      7   
    /// Creates a new `OperationWithDefaults`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::operation_with_defaults::OperationWithDefaultsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::operation_with_defaults::OperationWithDefaultsOutput::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::operation_with_defaults::OperationWithDefaultsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::operation_with_defaults::OperationWithDefaultsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +233,233 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct OperationWithDefaultsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OperationWithDefaultsResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::operation_with_defaults::OperationWithDefaultsError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, OperationWithDefaults::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::operation_with_defaults::OperationWithDefaultsOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct OperationWithDefaultsRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OperationWithDefaultsRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "JsonRpc10.OperationWithDefaults",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_input(
  197         -
            &input,
  198         -
        )?);
  199         -
        if let Some(content_length) = body.content_length() {
  200         -
            let content_length = content_length.to_string();
  201         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  202         -
        }
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, OperationWithDefaults::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         202  +
         203  +
        return ::std::result::Result::Ok(request);
  204    204   
    }
  205    205   
}
  206    206   
#[derive(Debug)]
  207    207   
struct OperationWithDefaultsEndpointParamsInterceptor;
  208    208   
  209    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithDefaultsEndpointParamsInterceptor {
  210    210   
    fn name(&self) -> &'static str {
  211    211   
        "OperationWithDefaultsEndpointParamsInterceptor"
  212    212   
    }
  213    213   
@@ -520,520 +580,590 @@
  540    540   
            .expect("the config must have a deserializer");
  541    541   
  542    542   
        let parsed = de.deserialize_streaming(&mut http_response);
  543    543   
        let parsed = parsed.unwrap_or_else(|| {
  544    544   
            let http_response = http_response.map(|body| {
  545    545   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  546    546   
                    body.bytes().unwrap(),
  547    547   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  548    548   
                )))
  549    549   
            });
  550         -
            de.deserialize_nonstreaming(&http_response)
         550  +
            // Build a config bag with the protocol for schema-based deserialization
         551  +
            #[allow(unused_mut)]
         552  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         553  +
            {
         554  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         555  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         556  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         557  +
                ));
         558  +
                test_cfg.push_shared_layer(layer.freeze());
         559  +
            }
         560  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  551    561   
        });
  552    562   
        let parsed = parsed
  553    563   
            .expect("should be successful response")
  554    564   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsOutput>()
  555    565   
            .unwrap();
  556    566   
        ::pretty_assertions::assert_eq!(
  557    567   
            parsed.default_string,
  558    568   
            expected_output.default_string,
  559    569   
            "Unexpected value for `default_string`"
  560    570   
        );
@@ -712,722 +772,792 @@
  732    742   
            .expect("the config must have a deserializer");
  733    743   
  734    744   
        let parsed = de.deserialize_streaming(&mut http_response);
  735    745   
        let parsed = parsed.unwrap_or_else(|| {
  736    746   
            let http_response = http_response.map(|body| {
  737    747   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  738    748   
                    body.bytes().unwrap(),
  739    749   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  740    750   
                )))
  741    751   
            });
  742         -
            de.deserialize_nonstreaming(&http_response)
         752  +
            // Build a config bag with the protocol for schema-based deserialization
         753  +
            #[allow(unused_mut)]
         754  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         755  +
            {
         756  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         757  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         758  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         759  +
                ));
         760  +
                test_cfg.push_shared_layer(layer.freeze());
         761  +
            }
         762  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  743    763   
        });
  744    764   
        let parsed = parsed
  745    765   
            .expect("should be successful response")
  746    766   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsOutput>()
  747    767   
            .unwrap();
  748    768   
        ::pretty_assertions::assert_eq!(
  749    769   
            parsed.default_string,
  750    770   
            expected_output.default_string,
  751    771   
            "Unexpected value for `default_string`"
  752    772   
        );

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_defaults/_operation_with_defaults_input.rs

@@ -25,25 +179,190 @@
   45     45   
    "defaults",
   46     46   
    0,
   47     47   
);
   48     48   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   49     49   
    ::aws_smithy_schema::ShapeId::from_static(
   50     50   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsInput$clientOptionalDefaults",
   51     51   
        "aws.protocoltests.json10.synthetic",
   52     52   
        "OperationWithDefaultsInput",
   53     53   
    ),
   54     54   
    ::aws_smithy_schema::ShapeType::Structure,
   55         -
    "client_optional_defaults",
          55  +
    "clientOptionalDefaults",
   56     56   
    1,
   57     57   
);
   58     58   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   59     59   
    ::aws_smithy_schema::ShapeId::from_static(
   60     60   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsInput$topLevelDefault",
   61     61   
        "aws.protocoltests.json10.synthetic",
   62     62   
        "OperationWithDefaultsInput",
   63     63   
    ),
   64     64   
    ::aws_smithy_schema::ShapeType::String,
   65         -
    "top_level_default",
          65  +
    "topLevelDefault",
   66     66   
    2,
   67     67   
);
   68     68   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   69     69   
    ::aws_smithy_schema::ShapeId::from_static(
   70     70   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsInput$otherTopLevelDefault",
   71     71   
        "aws.protocoltests.json10.synthetic",
   72     72   
        "OperationWithDefaultsInput",
   73     73   
    ),
   74     74   
    ::aws_smithy_schema::ShapeType::Integer,
   75         -
    "other_top_level_default",
          75  +
    "otherTopLevelDefault",
   76     76   
    3,
   77     77   
);
   78     78   
static OPERATIONWITHDEFAULTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   79     79   
    OPERATIONWITHDEFAULTSINPUT_SCHEMA_ID,
   80     80   
    ::aws_smithy_schema::ShapeType::Structure,
   81     81   
    &[
   82     82   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_DEFAULTS,
   83     83   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS,
   84     84   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT,
   85     85   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT,
   86     86   
    ],
   87     87   
);
   88     88   
impl OperationWithDefaultsInput {
   89     89   
    /// The schema for this shape.
   90     90   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &OPERATIONWITHDEFAULTSINPUT_SCHEMA;
   91     91   
}
   92     92   
impl ::aws_smithy_schema::serde::SerializableStruct for OperationWithDefaultsInput {
   93     93   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   94     94   
    fn serialize_members(
   95     95   
        &self,
   96     96   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   97     97   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   98     98   
        if let Some(ref val) = self.defaults {
   99     99   
            ser.write_struct(&OPERATIONWITHDEFAULTSINPUT_MEMBER_DEFAULTS, val)?;
  100    100   
        }
  101    101   
        if let Some(ref val) = self.client_optional_defaults {
  102    102   
            ser.write_struct(&OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS, val)?;
  103    103   
        }
  104    104   
        if let Some(ref val) = self.top_level_default {
  105    105   
            ser.write_string(&OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT, val)?;
  106    106   
        }
  107    107   
        if let Some(ref val) = self.other_top_level_default {
  108    108   
            ser.write_integer(&OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT, *val)?;
  109    109   
        }
  110    110   
        Ok(())
  111    111   
    }
  112    112   
}
  113    113   
impl OperationWithDefaultsInput {
  114    114   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  115         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  116         -
        deserializer: &mut D,
         115  +
    pub fn deserialize(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  117    117   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  118    118   
        #[allow(unused_variables, unused_mut)]
  119    119   
        let mut builder = Self::builder();
  120    120   
        #[allow(
  121    121   
            unused_variables,
  122    122   
            unreachable_code,
  123    123   
            clippy::single_match,
  124    124   
            clippy::match_single_binding,
  125    125   
            clippy::diverging_sub_expression
  126    126   
        )]
  127         -
        deserializer.read_struct(&OPERATIONWITHDEFAULTSINPUT_SCHEMA, (), |_, member, deser| {
         127  +
        deserializer.read_struct(&OPERATIONWITHDEFAULTSINPUT_SCHEMA, &mut |member, deser| {
  128    128   
            match member.member_index() {
  129    129   
                Some(0) => {
  130    130   
                    builder.defaults = Some(crate::types::Defaults::deserialize(deser)?);
  131    131   
                }
  132    132   
                Some(1) => {
  133    133   
                    builder.client_optional_defaults = Some(crate::types::ClientOptionalDefaults::deserialize(deser)?);
  134    134   
                }
  135    135   
                Some(2) => {
  136    136   
                    builder.top_level_default = Some(deser.read_string(member)?);
  137    137   
                }
  138    138   
                Some(3) => {
  139    139   
                    builder.other_top_level_default = Some(deser.read_integer(member)?);
  140    140   
                }
  141    141   
                _ => {}
  142    142   
            }
  143    143   
            Ok(())
  144    144   
        })?;
  145    145   
        builder
  146    146   
            .build()
  147    147   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  148    148   
    }
  149    149   
}
         150  +
impl OperationWithDefaultsInput {
         151  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         152  +
    pub fn deserialize_with_response(
         153  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         154  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         155  +
        _status: u16,
         156  +
        _body: &[u8],
         157  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         158  +
        Self::deserialize(deserializer)
         159  +
    }
         160  +
}
  150    161   
impl OperationWithDefaultsInput {
  151    162   
    /// Creates a new builder-style object to manufacture [`OperationWithDefaultsInput`](crate::operation::operation_with_defaults::OperationWithDefaultsInput).
  152    163   
    pub fn builder() -> crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder {
  153    164   
        crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder::default()
  154    165   
    }
  155    166   
}
  156    167   
  157    168   
/// A builder for [`OperationWithDefaultsInput`](crate::operation::operation_with_defaults::OperationWithDefaultsInput).
  158    169   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  159    170   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_defaults/_operation_with_defaults_output.rs

@@ -162,162 +492,492 @@
  182    182   
    "aws.protocoltests.json10.synthetic",
  183    183   
    "OperationWithDefaultsOutput",
  184    184   
);
  185    185   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  186    186   
    ::aws_smithy_schema::ShapeId::from_static(
  187    187   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultString",
  188    188   
        "aws.protocoltests.json10.synthetic",
  189    189   
        "OperationWithDefaultsOutput",
  190    190   
    ),
  191    191   
    ::aws_smithy_schema::ShapeType::String,
  192         -
    "default_string",
         192  +
    "defaultString",
  193    193   
    0,
  194    194   
);
  195    195   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  196    196   
    ::aws_smithy_schema::ShapeId::from_static(
  197    197   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultBoolean",
  198    198   
        "aws.protocoltests.json10.synthetic",
  199    199   
        "OperationWithDefaultsOutput",
  200    200   
    ),
  201    201   
    ::aws_smithy_schema::ShapeType::Boolean,
  202         -
    "default_boolean",
         202  +
    "defaultBoolean",
  203    203   
    1,
  204    204   
);
  205    205   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  206    206   
    ::aws_smithy_schema::ShapeId::from_static(
  207    207   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultList",
  208    208   
        "aws.protocoltests.json10.synthetic",
  209    209   
        "OperationWithDefaultsOutput",
  210    210   
    ),
  211    211   
    ::aws_smithy_schema::ShapeType::List,
  212         -
    "default_list",
         212  +
    "defaultList",
  213    213   
    2,
  214    214   
);
  215    215   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  216    216   
    ::aws_smithy_schema::ShapeId::from_static(
  217    217   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultDocumentMap",
  218    218   
        "aws.protocoltests.json10.synthetic",
  219    219   
        "OperationWithDefaultsOutput",
  220    220   
    ),
  221    221   
    ::aws_smithy_schema::ShapeType::Document,
  222         -
    "default_document_map",
         222  +
    "defaultDocumentMap",
  223    223   
    3,
  224    224   
);
  225    225   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  226    226   
    ::aws_smithy_schema::ShapeId::from_static(
  227    227   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultDocumentString",
  228    228   
        "aws.protocoltests.json10.synthetic",
  229    229   
        "OperationWithDefaultsOutput",
  230    230   
    ),
  231    231   
    ::aws_smithy_schema::ShapeType::Document,
  232         -
    "default_document_string",
         232  +
    "defaultDocumentString",
  233    233   
    4,
  234    234   
);
  235    235   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  236    236   
    ::aws_smithy_schema::ShapeId::from_static(
  237    237   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultDocumentBoolean",
  238    238   
        "aws.protocoltests.json10.synthetic",
  239    239   
        "OperationWithDefaultsOutput",
  240    240   
    ),
  241    241   
    ::aws_smithy_schema::ShapeType::Document,
  242         -
    "default_document_boolean",
         242  +
    "defaultDocumentBoolean",
  243    243   
    5,
  244    244   
);
  245    245   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  246    246   
    ::aws_smithy_schema::ShapeId::from_static(
  247    247   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultDocumentList",
  248    248   
        "aws.protocoltests.json10.synthetic",
  249    249   
        "OperationWithDefaultsOutput",
  250    250   
    ),
  251    251   
    ::aws_smithy_schema::ShapeType::Document,
  252         -
    "default_document_list",
         252  +
    "defaultDocumentList",
  253    253   
    6,
  254    254   
);
  255    255   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_NULL_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  256    256   
    ::aws_smithy_schema::ShapeId::from_static(
  257    257   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultNullDocument",
  258    258   
        "aws.protocoltests.json10.synthetic",
  259    259   
        "OperationWithDefaultsOutput",
  260    260   
    ),
  261    261   
    ::aws_smithy_schema::ShapeType::Document,
  262         -
    "default_null_document",
         262  +
    "defaultNullDocument",
  263    263   
    7,
  264    264   
);
  265    265   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  266    266   
    ::aws_smithy_schema::ShapeId::from_static(
  267    267   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultTimestamp",
  268    268   
        "aws.protocoltests.json10.synthetic",
  269    269   
        "OperationWithDefaultsOutput",
  270    270   
    ),
  271    271   
    ::aws_smithy_schema::ShapeType::Timestamp,
  272         -
    "default_timestamp",
         272  +
    "defaultTimestamp",
  273    273   
    8,
  274    274   
);
  275    275   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  276    276   
    ::aws_smithy_schema::ShapeId::from_static(
  277    277   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultBlob",
  278    278   
        "aws.protocoltests.json10.synthetic",
  279    279   
        "OperationWithDefaultsOutput",
  280    280   
    ),
  281    281   
    ::aws_smithy_schema::ShapeType::Blob,
  282         -
    "default_blob",
         282  +
    "defaultBlob",
  283    283   
    9,
  284    284   
);
  285    285   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  286    286   
    ::aws_smithy_schema::ShapeId::from_static(
  287    287   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultByte",
  288    288   
        "aws.protocoltests.json10.synthetic",
  289    289   
        "OperationWithDefaultsOutput",
  290    290   
    ),
  291    291   
    ::aws_smithy_schema::ShapeType::Byte,
  292         -
    "default_byte",
         292  +
    "defaultByte",
  293    293   
    10,
  294    294   
);
  295    295   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  296    296   
    ::aws_smithy_schema::ShapeId::from_static(
  297    297   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultShort",
  298    298   
        "aws.protocoltests.json10.synthetic",
  299    299   
        "OperationWithDefaultsOutput",
  300    300   
    ),
  301    301   
    ::aws_smithy_schema::ShapeType::Short,
  302         -
    "default_short",
         302  +
    "defaultShort",
  303    303   
    11,
  304    304   
);
  305    305   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  306    306   
    ::aws_smithy_schema::ShapeId::from_static(
  307    307   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultInteger",
  308    308   
        "aws.protocoltests.json10.synthetic",
  309    309   
        "OperationWithDefaultsOutput",
  310    310   
    ),
  311    311   
    ::aws_smithy_schema::ShapeType::Integer,
  312         -
    "default_integer",
         312  +
    "defaultInteger",
  313    313   
    12,
  314    314   
);
  315    315   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  316    316   
    ::aws_smithy_schema::ShapeId::from_static(
  317    317   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultLong",
  318    318   
        "aws.protocoltests.json10.synthetic",
  319    319   
        "OperationWithDefaultsOutput",
  320    320   
    ),
  321    321   
    ::aws_smithy_schema::ShapeType::Long,
  322         -
    "default_long",
         322  +
    "defaultLong",
  323    323   
    13,
  324    324   
);
  325    325   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  326    326   
    ::aws_smithy_schema::ShapeId::from_static(
  327    327   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultFloat",
  328    328   
        "aws.protocoltests.json10.synthetic",
  329    329   
        "OperationWithDefaultsOutput",
  330    330   
    ),
  331    331   
    ::aws_smithy_schema::ShapeType::Float,
  332         -
    "default_float",
         332  +
    "defaultFloat",
  333    333   
    14,
  334    334   
);
  335    335   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  336    336   
    ::aws_smithy_schema::ShapeId::from_static(
  337    337   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultDouble",
  338    338   
        "aws.protocoltests.json10.synthetic",
  339    339   
        "OperationWithDefaultsOutput",
  340    340   
    ),
  341    341   
    ::aws_smithy_schema::ShapeType::Double,
  342         -
    "default_double",
         342  +
    "defaultDouble",
  343    343   
    15,
  344    344   
);
  345    345   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  346    346   
    ::aws_smithy_schema::ShapeId::from_static(
  347    347   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultMap",
  348    348   
        "aws.protocoltests.json10.synthetic",
  349    349   
        "OperationWithDefaultsOutput",
  350    350   
    ),
  351    351   
    ::aws_smithy_schema::ShapeType::Map,
  352         -
    "default_map",
         352  +
    "defaultMap",
  353    353   
    16,
  354    354   
);
  355    355   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  356    356   
    ::aws_smithy_schema::ShapeId::from_static(
  357    357   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultEnum",
  358    358   
        "aws.protocoltests.json10.synthetic",
  359    359   
        "OperationWithDefaultsOutput",
  360    360   
    ),
  361    361   
    ::aws_smithy_schema::ShapeType::String,
  362         -
    "default_enum",
         362  +
    "defaultEnum",
  363    363   
    17,
  364    364   
);
  365    365   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_INT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  366    366   
    ::aws_smithy_schema::ShapeId::from_static(
  367    367   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$defaultIntEnum",
  368    368   
        "aws.protocoltests.json10.synthetic",
  369    369   
        "OperationWithDefaultsOutput",
  370    370   
    ),
  371    371   
    ::aws_smithy_schema::ShapeType::Integer,
  372         -
    "default_int_enum",
         372  +
    "defaultIntEnum",
  373    373   
    18,
  374    374   
);
  375    375   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_EMPTY_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  376    376   
    ::aws_smithy_schema::ShapeId::from_static(
  377    377   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$emptyString",
  378    378   
        "aws.protocoltests.json10.synthetic",
  379    379   
        "OperationWithDefaultsOutput",
  380    380   
    ),
  381    381   
    ::aws_smithy_schema::ShapeType::String,
  382         -
    "empty_string",
         382  +
    "emptyString",
  383    383   
    19,
  384    384   
);
  385    385   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_FALSE_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  386    386   
    ::aws_smithy_schema::ShapeId::from_static(
  387    387   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$falseBoolean",
  388    388   
        "aws.protocoltests.json10.synthetic",
  389    389   
        "OperationWithDefaultsOutput",
  390    390   
    ),
  391    391   
    ::aws_smithy_schema::ShapeType::Boolean,
  392         -
    "false_boolean",
         392  +
    "falseBoolean",
  393    393   
    20,
  394    394   
);
  395    395   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_EMPTY_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  396    396   
    ::aws_smithy_schema::ShapeId::from_static(
  397    397   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$emptyBlob",
  398    398   
        "aws.protocoltests.json10.synthetic",
  399    399   
        "OperationWithDefaultsOutput",
  400    400   
    ),
  401    401   
    ::aws_smithy_schema::ShapeType::Blob,
  402         -
    "empty_blob",
         402  +
    "emptyBlob",
  403    403   
    21,
  404    404   
);
  405    405   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  406    406   
    ::aws_smithy_schema::ShapeId::from_static(
  407    407   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroByte",
  408    408   
        "aws.protocoltests.json10.synthetic",
  409    409   
        "OperationWithDefaultsOutput",
  410    410   
    ),
  411    411   
    ::aws_smithy_schema::ShapeType::Byte,
  412         -
    "zero_byte",
         412  +
    "zeroByte",
  413    413   
    22,
  414    414   
);
  415    415   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  416    416   
    ::aws_smithy_schema::ShapeId::from_static(
  417    417   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroShort",
  418    418   
        "aws.protocoltests.json10.synthetic",
  419    419   
        "OperationWithDefaultsOutput",
  420    420   
    ),
  421    421   
    ::aws_smithy_schema::ShapeType::Short,
  422         -
    "zero_short",
         422  +
    "zeroShort",
  423    423   
    23,
  424    424   
);
  425    425   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  426    426   
    ::aws_smithy_schema::ShapeId::from_static(
  427    427   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroInteger",
  428    428   
        "aws.protocoltests.json10.synthetic",
  429    429   
        "OperationWithDefaultsOutput",
  430    430   
    ),
  431    431   
    ::aws_smithy_schema::ShapeType::Integer,
  432         -
    "zero_integer",
         432  +
    "zeroInteger",
  433    433   
    24,
  434    434   
);
  435    435   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  436    436   
    ::aws_smithy_schema::ShapeId::from_static(
  437    437   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroLong",
  438    438   
        "aws.protocoltests.json10.synthetic",
  439    439   
        "OperationWithDefaultsOutput",
  440    440   
    ),
  441    441   
    ::aws_smithy_schema::ShapeType::Long,
  442         -
    "zero_long",
         442  +
    "zeroLong",
  443    443   
    25,
  444    444   
);
  445    445   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  446    446   
    ::aws_smithy_schema::ShapeId::from_static(
  447    447   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroFloat",
  448    448   
        "aws.protocoltests.json10.synthetic",
  449    449   
        "OperationWithDefaultsOutput",
  450    450   
    ),
  451    451   
    ::aws_smithy_schema::ShapeType::Float,
  452         -
    "zero_float",
         452  +
    "zeroFloat",
  453    453   
    26,
  454    454   
);
  455    455   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  456    456   
    ::aws_smithy_schema::ShapeId::from_static(
  457    457   
        "aws.protocoltests.json10.synthetic#OperationWithDefaultsOutput$zeroDouble",
  458    458   
        "aws.protocoltests.json10.synthetic",
  459    459   
        "OperationWithDefaultsOutput",
  460    460   
    ),
  461    461   
    ::aws_smithy_schema::ShapeType::Double,
  462         -
    "zero_double",
         462  +
    "zeroDouble",
  463    463   
    27,
  464    464   
);
  465    465   
static OPERATIONWITHDEFAULTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  466    466   
    OPERATIONWITHDEFAULTSOUTPUT_SCHEMA_ID,
  467    467   
    ::aws_smithy_schema::ShapeType::Structure,
  468    468   
    &[
  469    469   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_STRING,
  470    470   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BOOLEAN,
  471    471   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LIST,
  472    472   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_MAP,
@@ -614,614 +798,789 @@
  634    634   
        }
  635    635   
        {
  636    636   
            let val = &self.zero_double;
  637    637   
            ser.write_double(&OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_DOUBLE, *val)?;
  638    638   
        }
  639    639   
        Ok(())
  640    640   
    }
  641    641   
}
  642    642   
impl OperationWithDefaultsOutput {
  643    643   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  644         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  645         -
        deserializer: &mut D,
         644  +
    pub fn deserialize(
         645  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  646    646   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  647    647   
        #[allow(unused_variables, unused_mut)]
  648    648   
        let mut builder = Self::builder();
  649    649   
        #[allow(
  650    650   
            unused_variables,
  651    651   
            unreachable_code,
  652    652   
            clippy::single_match,
  653    653   
            clippy::match_single_binding,
  654    654   
            clippy::diverging_sub_expression
  655    655   
        )]
  656         -
        deserializer.read_struct(&OPERATIONWITHDEFAULTSOUTPUT_SCHEMA, (), |_, member, deser| {
         656  +
        deserializer.read_struct(&OPERATIONWITHDEFAULTSOUTPUT_SCHEMA, &mut |member, deser| {
  657    657   
            match member.member_index() {
  658    658   
                Some(0) => {
  659    659   
                    builder.default_string = Some(deser.read_string(member)?);
  660    660   
                }
  661    661   
                Some(1) => {
  662    662   
                    builder.default_boolean = Some(deser.read_boolean(member)?);
  663    663   
                }
  664    664   
                Some(2) => {
  665         -
                    builder.default_list = Some({
  666         -
                        let container = if let Some(cap) = deser.container_size() {
  667         -
                            Vec::with_capacity(cap)
  668         -
                        } else {
  669         -
                            Vec::new()
  670         -
                        };
  671         -
                        deser.read_list(member, container, |mut list, deser| {
  672         -
                            list.push(deser.read_string(member)?);
  673         -
                            Ok(list)
  674         -
                        })?
  675         -
                    });
         665  +
                    builder.default_list = Some(deser.read_string_list(member)?);
  676    666   
                }
  677    667   
                Some(3) => {
  678    668   
                    builder.default_document_map = Some(deser.read_document(member)?);
  679    669   
                }
  680    670   
                Some(4) => {
  681    671   
                    builder.default_document_string = Some(deser.read_document(member)?);
  682    672   
                }
  683    673   
                Some(5) => {
  684    674   
                    builder.default_document_boolean = Some(deser.read_document(member)?);
  685    675   
                }
  686    676   
                Some(6) => {
  687    677   
                    builder.default_document_list = Some(deser.read_document(member)?);
  688    678   
                }
  689    679   
                Some(7) => {
  690    680   
                    builder.default_null_document = Some(deser.read_document(member)?);
  691    681   
                }
  692    682   
                Some(8) => {
  693    683   
                    builder.default_timestamp = Some(deser.read_timestamp(member)?);
  694    684   
                }
  695    685   
                Some(9) => {
  696    686   
                    builder.default_blob = Some(deser.read_blob(member)?);
  697    687   
                }
  698    688   
                Some(10) => {
  699    689   
                    builder.default_byte = Some(deser.read_byte(member)?);
  700    690   
                }
  701    691   
                Some(11) => {
  702    692   
                    builder.default_short = Some(deser.read_short(member)?);
  703    693   
                }
  704    694   
                Some(12) => {
  705    695   
                    builder.default_integer = Some(deser.read_integer(member)?);
  706    696   
                }
  707    697   
                Some(13) => {
  708    698   
                    builder.default_long = Some(deser.read_long(member)?);
  709    699   
                }
  710    700   
                Some(14) => {
  711    701   
                    builder.default_float = Some(deser.read_float(member)?);
  712    702   
                }
  713    703   
                Some(15) => {
  714    704   
                    builder.default_double = Some(deser.read_double(member)?);
  715    705   
                }
  716    706   
                Some(16) => {
  717         -
                    builder.default_map = Some({
  718         -
                        let container = if let Some(cap) = deser.container_size() {
  719         -
                            std::collections::HashMap::with_capacity(cap)
  720         -
                        } else {
  721         -
                            std::collections::HashMap::new()
  722         -
                        };
  723         -
                        deser.read_map(member, container, |mut map, key, deser| {
  724         -
                            map.insert(key, deser.read_string(member)?);
  725         -
                            Ok(map)
  726         -
                        })?
  727         -
                    });
         707  +
                    builder.default_map = Some(deser.read_string_string_map(member)?);
  728    708   
                }
  729    709   
                Some(17) => {
  730    710   
                    builder.default_enum = Some(crate::types::TestEnum::from(deser.read_string(member)?.as_str()));
  731    711   
                }
  732    712   
                Some(18) => {
  733    713   
                    builder.default_int_enum = Some(deser.read_integer(member)?);
  734    714   
                }
  735    715   
                Some(19) => {
  736    716   
                    builder.empty_string = Some(deser.read_string(member)?);
  737    717   
                }
  738    718   
                Some(20) => {
  739    719   
                    builder.false_boolean = Some(deser.read_boolean(member)?);
  740    720   
                }
  741    721   
                Some(21) => {
  742    722   
                    builder.empty_blob = Some(deser.read_blob(member)?);
  743    723   
                }
  744    724   
                Some(22) => {
  745    725   
                    builder.zero_byte = Some(deser.read_byte(member)?);
  746    726   
                }
  747    727   
                Some(23) => {
  748    728   
                    builder.zero_short = Some(deser.read_short(member)?);
  749    729   
                }
  750    730   
                Some(24) => {
  751    731   
                    builder.zero_integer = Some(deser.read_integer(member)?);
  752    732   
                }
  753    733   
                Some(25) => {
  754    734   
                    builder.zero_long = Some(deser.read_long(member)?);
  755    735   
                }
  756    736   
                Some(26) => {
  757    737   
                    builder.zero_float = Some(deser.read_float(member)?);
  758    738   
                }
  759    739   
                Some(27) => {
  760    740   
                    builder.zero_double = Some(deser.read_double(member)?);
  761    741   
                }
  762    742   
                _ => {}
  763    743   
            }
  764    744   
            Ok(())
  765    745   
        })?;
  766    746   
        Ok(builder.build())
  767    747   
    }
  768    748   
}
         749  +
impl OperationWithDefaultsOutput {
         750  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         751  +
    pub fn deserialize_with_response(
         752  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         753  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         754  +
        _status: u16,
         755  +
        _body: &[u8],
         756  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         757  +
        Self::deserialize(deserializer)
         758  +
    }
         759  +
}
  769    760   
impl OperationWithDefaultsOutput {
  770    761   
    /// Creates a new builder-style object to manufacture [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
  771    762   
    pub fn builder() -> crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder {
  772    763   
        crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder::default()
  773    764   
    }
  774    765   
}
  775    766   
  776    767   
/// A builder for [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
  777    768   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  778    769   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_nested_structure.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 `OperationWithNestedStructure`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct OperationWithNestedStructure;
    6      6   
impl OperationWithNestedStructure {
    7      7   
    /// Creates a new `OperationWithNestedStructure`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput::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::operation_with_nested_structure::OperationWithNestedStructureInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +239,241 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct OperationWithNestedStructureResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OperationWithNestedStructureResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::operation_with_nested_structure::OperationWithNestedStructureError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, OperationWithNestedStructure::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct OperationWithNestedStructureRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OperationWithNestedStructureRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonRpc10.OperationWithNestedStructure",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_input(&input)?,
  204         -
        );
  205         -
        if let Some(content_length) = body.content_length() {
  206         -
            let content_length = content_length.to_string();
  207         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  208         -
        }
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, OperationWithNestedStructure::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
         211  +
        return ::std::result::Result::Ok(request);
  210    212   
    }
  211    213   
}
  212    214   
#[derive(Debug)]
  213    215   
struct OperationWithNestedStructureEndpointParamsInterceptor;
  214    216   
  215    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithNestedStructureEndpointParamsInterceptor {
  216    218   
    fn name(&self) -> &'static str {
  217    219   
        "OperationWithNestedStructureEndpointParamsInterceptor"
  218    220   
    }
  219    221   
@@ -392,394 +452,464 @@
  412    414   
            .expect("the config must have a deserializer");
  413    415   
  414    416   
        let parsed = de.deserialize_streaming(&mut http_response);
  415    417   
        let parsed = parsed.unwrap_or_else(|| {
  416    418   
            let http_response = http_response.map(|body| {
  417    419   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  418    420   
                    body.bytes().unwrap(),
  419    421   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  420    422   
                )))
  421    423   
            });
  422         -
            de.deserialize_nonstreaming(&http_response)
         424  +
            // Build a config bag with the protocol for schema-based deserialization
         425  +
            #[allow(unused_mut)]
         426  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         427  +
            {
         428  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         429  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         430  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         431  +
                ));
         432  +
                test_cfg.push_shared_layer(layer.freeze());
         433  +
            }
         434  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  423    435   
        });
  424    436   
        let parsed = parsed
  425    437   
            .expect("should be successful response")
  426    438   
            .downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput>()
  427    439   
            .unwrap();
  428    440   
        ::pretty_assertions::assert_eq!(parsed.dialog, expected_output.dialog, "Unexpected value for `dialog`");
  429    441   
        ::pretty_assertions::assert_eq!(parsed.dialog_list, expected_output.dialog_list, "Unexpected value for `dialog_list`");
  430    442   
        ::pretty_assertions::assert_eq!(parsed.dialog_map, expected_output.dialog_map, "Unexpected value for `dialog_map`");
  431    443   
    }
  432    444   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_nested_structure/_operation_with_nested_structure_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_nested_structure/_operation_with_nested_structure_output.rs

@@ -20,20 +199,204 @@
   40     40   
    "dialog",
   41     41   
    0,
   42     42   
);
   43     43   
static OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   44     44   
    ::aws_smithy_schema::ShapeId::from_static(
   45     45   
        "aws.protocoltests.json10.synthetic#OperationWithNestedStructureOutput$dialogList",
   46     46   
        "aws.protocoltests.json10.synthetic",
   47     47   
        "OperationWithNestedStructureOutput",
   48     48   
    ),
   49     49   
    ::aws_smithy_schema::ShapeType::List,
   50         -
    "dialog_list",
          50  +
    "dialogList",
   51     51   
    1,
   52     52   
);
   53     53   
static OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   54     54   
    ::aws_smithy_schema::ShapeId::from_static(
   55     55   
        "aws.protocoltests.json10.synthetic#OperationWithNestedStructureOutput$dialogMap",
   56     56   
        "aws.protocoltests.json10.synthetic",
   57     57   
        "OperationWithNestedStructureOutput",
   58     58   
    ),
   59     59   
    ::aws_smithy_schema::ShapeType::Map,
   60         -
    "dialog_map",
          60  +
    "dialogMap",
   61     61   
    2,
   62     62   
);
   63     63   
static OPERATIONWITHNESTEDSTRUCTUREOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   64     64   
    OPERATIONWITHNESTEDSTRUCTUREOUTPUT_SCHEMA_ID,
   65     65   
    ::aws_smithy_schema::ShapeType::Structure,
   66     66   
    &[
   67     67   
        &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG,
   68     68   
        &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_LIST,
   69     69   
        &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_MAP,
   70     70   
    ],
   71     71   
);
   72     72   
impl OperationWithNestedStructureOutput {
   73     73   
    /// The schema for this shape.
   74     74   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_SCHEMA;
   75     75   
}
   76     76   
impl ::aws_smithy_schema::serde::SerializableStruct for OperationWithNestedStructureOutput {
   77     77   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   78     78   
    fn serialize_members(
   79     79   
        &self,
   80     80   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   81     81   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   82     82   
        {
   83     83   
            let val = &self.dialog;
   84     84   
            ser.write_struct(&OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG, val)?;
   85     85   
        }
   86     86   
        {
   87     87   
            let val = &self.dialog_list;
   88     88   
   89     89   
            ser.write_list(
   90     90   
                &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_LIST,
   91     91   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   92     92   
                    for item in val {
   93     93   
                        ser.write_struct(crate::types::Dialog::SCHEMA, item)?;
   94     94   
                    }
   95     95   
                    Ok(())
   96     96   
                },
   97     97   
            )?;
   98     98   
        }
   99     99   
        {
  100    100   
            let val = &self.dialog_map;
  101    101   
  102    102   
            ser.write_map(
  103    103   
                &OPERATIONWITHNESTEDSTRUCTUREOUTPUT_MEMBER_DIALOG_MAP,
  104    104   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  105    105   
                    for (key, value) in val {
  106    106   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  107    107   
                        ser.write_struct(crate::types::Dialog::SCHEMA, value)?;
  108    108   
                    }
  109    109   
                    Ok(())
  110    110   
                },
  111    111   
            )?;
  112    112   
        }
  113    113   
        Ok(())
  114    114   
    }
  115    115   
}
  116    116   
impl OperationWithNestedStructureOutput {
  117    117   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  118         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  119         -
        deserializer: &mut D,
         118  +
    pub fn deserialize(
         119  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  120    120   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  121    121   
        #[allow(unused_variables, unused_mut)]
  122    122   
        let mut builder = Self::builder();
  123    123   
        #[allow(
  124    124   
            unused_variables,
  125    125   
            unreachable_code,
  126    126   
            clippy::single_match,
  127    127   
            clippy::match_single_binding,
  128    128   
            clippy::diverging_sub_expression
  129    129   
        )]
  130         -
        deserializer.read_struct(&OPERATIONWITHNESTEDSTRUCTUREOUTPUT_SCHEMA, (), |_, member, deser| {
         130  +
        deserializer.read_struct(&OPERATIONWITHNESTEDSTRUCTUREOUTPUT_SCHEMA, &mut |member, deser| {
  131    131   
            match member.member_index() {
  132    132   
                Some(0) => {
  133    133   
                    builder.dialog = Some(crate::types::Dialog::deserialize(deser)?);
  134    134   
                }
  135    135   
                Some(1) => {
  136    136   
                    builder.dialog_list = Some({
  137         -
                        let container = if let Some(cap) = deser.container_size() {
  138         -
                            Vec::with_capacity(cap)
  139         -
                        } else {
  140         -
                            Vec::new()
  141         -
                        };
  142         -
                        deser.read_list(member, container, |mut list, deser| {
  143         -
                            list.push(crate::types::Dialog::deserialize(deser)?);
  144         -
                            Ok(list)
  145         -
                        })?
         137  +
                        let mut container = Vec::new();
         138  +
                        deser.read_list(member, &mut |deser| {
         139  +
                            container.push(crate::types::Dialog::deserialize(deser)?);
         140  +
                            Ok(())
         141  +
                        })?;
         142  +
                        container
  146    143   
                    });
  147    144   
                }
  148    145   
                Some(2) => {
  149    146   
                    builder.dialog_map = Some({
  150         -
                        let container = if let Some(cap) = deser.container_size() {
  151         -
                            std::collections::HashMap::with_capacity(cap)
  152         -
                        } else {
  153         -
                            std::collections::HashMap::new()
  154         -
                        };
  155         -
                        deser.read_map(member, container, |mut map, key, deser| {
  156         -
                            map.insert(key, crate::types::Dialog::deserialize(deser)?);
  157         -
                            Ok(map)
  158         -
                        })?
         147  +
                        let mut container = std::collections::HashMap::new();
         148  +
                        deser.read_map(member, &mut |key, deser| {
         149  +
                            container.insert(key, crate::types::Dialog::deserialize(deser)?);
         150  +
                            Ok(())
         151  +
                        })?;
         152  +
                        container
  159    153   
                    });
  160    154   
                }
  161    155   
                _ => {}
  162    156   
            }
  163    157   
            Ok(())
  164    158   
        })?;
  165    159   
        builder
  166    160   
            .build()
  167    161   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  168    162   
    }
  169    163   
}
         164  +
impl OperationWithNestedStructureOutput {
         165  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         166  +
    pub fn deserialize_with_response(
         167  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         168  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         169  +
        _status: u16,
         170  +
        _body: &[u8],
         171  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         172  +
        Self::deserialize(deserializer)
         173  +
    }
         174  +
}
  170    175   
impl OperationWithNestedStructureOutput {
  171    176   
    /// Creates a new builder-style object to manufacture [`OperationWithNestedStructureOutput`](crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput).
  172    177   
    pub fn builder() -> crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder {
  173    178   
        crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder::default()
  174    179   
    }
  175    180   
}
  176    181   
  177    182   
/// A builder for [`OperationWithNestedStructureOutput`](crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput).
  178    183   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  179    184   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_required_members.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 `OperationWithRequiredMembers`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct OperationWithRequiredMembers;
    6      6   
impl OperationWithRequiredMembers {
    7      7   
    /// Creates a new `OperationWithRequiredMembers`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::operation_with_required_members::OperationWithRequiredMembersInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput::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::operation_with_required_members::OperationWithRequiredMembersInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::operation_with_required_members::OperationWithRequiredMembersError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +236,241 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct OperationWithRequiredMembersResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OperationWithRequiredMembersResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members_http_error(status, headers, body)
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::operation_with_required_members::OperationWithRequiredMembersError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, OperationWithRequiredMembers::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct OperationWithRequiredMembersRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OperationWithRequiredMembersRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::operation_with_required_members::OperationWithRequiredMembersInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::operation_with_required_members::OperationWithRequiredMembersInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::operation_with_required_members::OperationWithRequiredMembersInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonRpc10.OperationWithRequiredMembers",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_operation_with_required_members::ser_operation_with_required_members_input(&input)?,
  204         -
        );
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, OperationWithRequiredMembers::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  205    210   
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  207    212   
    }
  208    213   
}
  209    214   
#[derive(Debug)]
  210    215   
struct OperationWithRequiredMembersEndpointParamsInterceptor;
  211    216   
  212    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithRequiredMembersEndpointParamsInterceptor {
  213    218   
    fn name(&self) -> &'static str {
  214    219   
        "OperationWithRequiredMembersEndpointParamsInterceptor"
  215    220   
    }
  216    221   
@@ -264,269 +324,339 @@
  284    289   
            .expect("the config must have a deserializer");
  285    290   
  286    291   
        let parsed = de.deserialize_streaming(&mut http_response);
  287    292   
        let parsed = parsed.unwrap_or_else(|| {
  288    293   
            let http_response = http_response.map(|body| {
  289    294   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  290    295   
                    body.bytes().unwrap(),
  291    296   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  292    297   
                )))
  293    298   
            });
  294         -
            de.deserialize_nonstreaming(&http_response)
         299  +
            // Build a config bag with the protocol for schema-based deserialization
         300  +
            #[allow(unused_mut)]
         301  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         302  +
            {
         303  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         304  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         305  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         306  +
                ));
         307  +
                test_cfg.push_shared_layer(layer.freeze());
         308  +
            }
         309  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  295    310   
        });
  296    311   
        let parsed = parsed
  297    312   
            .expect("should be successful response")
  298    313   
            .downcast::<crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput>()
  299    314   
            .unwrap();
  300    315   
        ::pretty_assertions::assert_eq!(
  301    316   
            parsed.required_string,
  302    317   
            expected_output.required_string,
  303    318   
            "Unexpected value for `required_string`"
  304    319   
        );

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_required_members/_operation_with_required_members_input.rs

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