Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/put_with_content_encoding.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 `PutWithContentEncoding`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct PutWithContentEncoding;
    6      6   
impl PutWithContentEncoding {
    7      7   
    /// Creates a new `PutWithContentEncoding`
    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::put_with_content_encoding::PutWithContentEncodingInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::put_with_content_encoding::PutWithContentEncodingOutput::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::put_with_content_encoding::PutWithContentEncodingInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +235,269 @@
  130    134   
                crate::operation::put_with_content_encoding::PutWithContentEncodingError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct PutWithContentEncodingResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutWithContentEncodingResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, PutWithContentEncoding::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::put_with_content_encoding::PutWithContentEncodingOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct PutWithContentEncodingRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PutWithContentEncodingRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::put_with_content_encoding::PutWithContentEncodingInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
  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, "/requestcompression/putcontentwithencoding").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        if protocol.supports_http_bindings() {
         206  +
            let mut request = protocol
         207  +
                .serialize_body(&input, PutWithContentEncoding::INPUT_SCHEMA, "", _cfg)
         208  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         209  +
            {
         210  +
                let mut uri = "/requestcompression/putcontentwithencoding".to_string();
         211  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         212  +
                if let Some(ref val) = input.encoding {
         213  +
                    request.headers_mut().insert("Content-Encoding", val.to_string());
         214  +
                }
         215  +
                if !query_params.is_empty() {
         216  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         217  +
                    let pairs: Vec<String> = query_params
         218  +
                        .iter()
         219  +
                        .map(|(k, v)| {
         220  +
                            format!(
         221  +
                                "{}={}",
         222  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         223  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         224  +
                            )
         225  +
                        })
         226  +
                        .collect();
         227  +
                    uri.push_str(&pairs.join("&"));
         228  +
                }
         229  +
                request.set_uri(uri.as_str()).expect("valid URI");
         230  +
            }
         231  +
         232  +
            return ::std::result::Result::Ok(request);
         233  +
        } else {
         234  +
            let mut request = protocol
         235  +
                .serialize_request(&input, PutWithContentEncoding::INPUT_SCHEMA, "", _cfg)
         236  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         237  +
         238  +
            return ::std::result::Result::Ok(request);
  183    239   
        }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                let builder = crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_headers(input, builder)?;
  192         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  193         -
            }
  194         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  195         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  196         -
            builder
  197         -
        };
  198         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  199         -
            crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_input(&input)?,
  200         -
        );
  201         -
        if let Some(content_length) = body.content_length() {
  202         -
            let content_length = content_length.to_string();
  203         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  204         -
        }
  205         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  206    240   
    }
  207    241   
}
  208    242   
#[derive(Debug)]
  209    243   
struct PutWithContentEncodingEndpointParamsInterceptor;
  210    244   
  211    245   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutWithContentEncodingEndpointParamsInterceptor {
  212    246   
    fn name(&self) -> &'static str {
  213    247   
        "PutWithContentEncodingEndpointParamsInterceptor"
  214    248   
    }
  215    249   

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/put_with_content_encoding/_put_with_content_encoding_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 PutWithContentEncodingOutput {
   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(&PUTWITHCONTENTENCODINGOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&PUTWITHCONTENTENCODINGOUTPUT_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 PutWithContentEncodingOutput {
          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 PutWithContentEncodingOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
   51     62   
    pub fn builder() -> crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder {
   52     63   
        crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_idempotency_token_auto_fill.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 `QueryIdempotencyTokenAutoFill`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct QueryIdempotencyTokenAutoFill;
    6      6   
impl QueryIdempotencyTokenAutoFill {
    7      7   
    /// Creates a new `QueryIdempotencyTokenAutoFill`
    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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -118,124 +249,279 @@
  138    144   
                crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
  139    145   
            >::new());
  140    146   
  141    147   
        ::std::borrow::Cow::Owned(rcb)
  142    148   
    }
  143    149   
}
  144    150   
  145    151   
#[derive(Debug)]
  146    152   
struct QueryIdempotencyTokenAutoFillResponseDeserializer;
  147    153   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryIdempotencyTokenAutoFillResponseDeserializer {
  148         -
    fn deserialize_nonstreaming(
         154  +
    fn deserialize_nonstreaming_with_config(
  149    155   
        &self,
  150    156   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         157  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  151    158   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  152    159   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         160  +
        #[allow(unused_mut)]
         161  +
        let mut force_error = false;
         162  +
         163  +
        if !success && status != 200 || force_error {
  153    164   
            let headers = response.headers();
  154    165   
            let body = response.body().bytes().expect("body loaded");
  155    166   
            #[allow(unused_mut)]
  156         -
        let mut force_error = false;
         167  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         168  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
            })?;
  157    170   
  158         -
        let parse_result = if !success && status != 200 || force_error {
  159         -
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_error(status, headers, body)
         171  +
            let generic = generic_builder.build();
         172  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         173  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         174  +
                    crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError::generic(generic),
         175  +
                ),
         176  +
            ))
  160    177   
        } else {
  161         -
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_response(status, headers, body)
  162         -
        };
  163         -
        crate::protocol_serde::type_erase_result(parse_result)
         178  +
            let protocol = _cfg
         179  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         180  +
                .expect("a SharedClientProtocol is required");
         181  +
            let mut deser = protocol
         182  +
                .deserialize_response(response, QueryIdempotencyTokenAutoFill::OUTPUT_SCHEMA, _cfg)
         183  +
                .map_err(|e| {
         184  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
                })?;
         186  +
            let body = response.body().bytes().expect("body loaded");
         187  +
            let output = crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput::deserialize_with_response(
         188  +
                &mut *deser,
         189  +
                response.headers(),
         190  +
                response.status().into(),
         191  +
                body,
         192  +
            )
         193  +
            .map_err(|e| {
         194  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         195  +
            })?;
         196  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         197  +
        }
  164    198   
    }
  165    199   
}
  166    200   
#[derive(Debug)]
  167    201   
struct QueryIdempotencyTokenAutoFillRequestSerializer;
  168    202   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryIdempotencyTokenAutoFillRequestSerializer {
  169    203   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  170    204   
    fn serialize_input(
  171    205   
        &self,
  172    206   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  173    207   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  174    208   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  175    209   
        let input = input
  176    210   
            .downcast::<crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput>()
  177    211   
            .expect("correct type");
  178         -
        let _header_serialization_settings = _cfg
  179         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  180         -
            .cloned()
  181         -
            .unwrap_or_default();
  182         -
        let mut request_builder = {
  183         -
            #[allow(clippy::uninlined_format_args)]
  184         -
            fn uri_base(
  185         -
                _input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  186         -
                output: &mut ::std::string::String,
  187         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188         -
                use ::std::fmt::Write as _;
  189         -
                ::std::write!(output, "/QueryIdempotencyTokenAutoFill").expect("formatting should succeed");
  190         -
                ::std::result::Result::Ok(())
  191         -
            }
  192         -
            fn uri_query(
  193         -
                _input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  194         -
                mut output: &mut ::std::string::String,
  195         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  196         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  197         -
                if let ::std::option::Option::Some(inner_1) = &_input.token {
         212  +
        let protocol = _cfg
         213  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         214  +
            .expect("a SharedClientProtocol is required");
         215  +
        if protocol.supports_http_bindings() {
         216  +
            let mut request = protocol
         217  +
                .serialize_body(&input, QueryIdempotencyTokenAutoFill::INPUT_SCHEMA, "", _cfg)
         218  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  198    219   
            {
  199         -
                        query.push_kv("token", &::aws_smithy_http::query::fmt_string(inner_1));
         220  +
                let mut uri = "/QueryIdempotencyTokenAutoFill".to_string();
         221  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         222  +
                if let Some(ref val) = input.token {
         223  +
                    query_params.push(("token".to_string(), val.to_string()));
         224  +
                }
         225  +
                if !query_params.is_empty() {
         226  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         227  +
                    let pairs: Vec<String> = query_params
         228  +
                        .iter()
         229  +
                        .map(|(k, v)| {
         230  +
                            format!(
         231  +
                                "{}={}",
         232  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         233  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         234  +
                            )
         235  +
                        })
         236  +
                        .collect();
         237  +
                    uri.push_str(&pairs.join("&"));
  200    238   
                }
         239  +
                request.set_uri(uri.as_str()).expect("valid URI");
  201    240   
            }
  202         -
                ::std::result::Result::Ok(())
  203         -
            }
  204         -
            #[allow(clippy::unnecessary_wraps)]
  205         -
            fn update_http_builder(
  206         -
                input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  207         -
                builder: ::http_1x::request::Builder,
  208         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  209         -
                let mut uri = ::std::string::String::new();
  210         -
                uri_base(input, &mut uri)?;
  211         -
                uri_query(input, &mut uri)?;
  212         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  213         -
            }
  214         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  215         -
            builder
  216         -
        };
  217         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  218    241   
  219         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         242  +
            return ::std::result::Result::Ok(request);
         243  +
        } else {
         244  +
            let mut request = protocol
         245  +
                .serialize_request(&input, QueryIdempotencyTokenAutoFill::INPUT_SCHEMA, "", _cfg)
         246  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         247  +
         248  +
            return ::std::result::Result::Ok(request);
         249  +
        }
  220    250   
    }
  221    251   
}
  222    252   
#[derive(Debug)]
  223    253   
struct QueryIdempotencyTokenAutoFillEndpointParamsInterceptor;
  224    254   
  225    255   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryIdempotencyTokenAutoFillEndpointParamsInterceptor {
  226    256   
    fn name(&self) -> &'static str {
  227    257   
        "QueryIdempotencyTokenAutoFillEndpointParamsInterceptor"
  228    258   
    }
  229    259   

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

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

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

@@ -1,1 +68,79 @@
   21     21   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     22   
    fn serialize_members(
   23     23   
        &self,
   24     24   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     25   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     26   
        Ok(())
   27     27   
    }
   28     28   
}
   29     29   
impl QueryIdempotencyTokenAutoFillOutput {
   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(&QUERYIDEMPOTENCYTOKENAUTOFILLOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&QUERYIDEMPOTENCYTOKENAUTOFILLOUTPUT_SCHEMA, &mut |member, deser| {
   44     44   
            match member.member_index() {
   45     45   
                _ => {}
   46     46   
            }
   47     47   
            Ok(())
   48     48   
        })?;
   49     49   
        Ok(builder.build())
   50     50   
    }
   51     51   
}
          52  +
impl QueryIdempotencyTokenAutoFillOutput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Ok(Self::builder().build())
          61  +
    }
          62  +
}
   52     63   
impl QueryIdempotencyTokenAutoFillOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`QueryIdempotencyTokenAutoFillOutput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput).
   54     65   
    pub fn builder() -> crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillOutputBuilder {
   55     66   
        crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`QueryIdempotencyTokenAutoFillOutput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput).
   60     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   61     72   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_params_as_string_list_map.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 `QueryParamsAsStringListMap`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct QueryParamsAsStringListMap;
    6      6   
impl QueryParamsAsStringListMap {
    7      7   
    /// Creates a new `QueryParamsAsStringListMap`
    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::query_params_as_string_list_map::QueryParamsAsStringListMapInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +253,281 @@
  130    136   
                crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct QueryParamsAsStringListMapResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryParamsAsStringListMapResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_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::query_params_as_string_list_map::QueryParamsAsStringListMapError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_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, QueryParamsAsStringListMap::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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput::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 QueryParamsAsStringListMapRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryParamsAsStringListMapRequestSerializer {
  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::query_params_as_string_list_map::QueryParamsAsStringListMapInput>()
  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::query_params_as_string_list_map::QueryParamsAsStringListMapInput,
  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, "/StringListMap").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput,
  186         -
                mut output: &mut ::std::string::String,
  187         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  189         -
                let protected_params = ["corge"];
  190         -
                if let ::std::option::Option::Some(inner_1) = &_input.foo {
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, QueryParamsAsStringListMap::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  191    211   
            {
  192         -
                        for (k, v) in inner_1 {
  193         -
                            for inner_2 in v {
  194         -
                                if !protected_params.contains(&k.as_str()) {
  195         -
                                    query.push_kv(&::aws_smithy_http::query::fmt_string(k), &::aws_smithy_http::query::fmt_string(inner_2));
  196         -
                                }
  197         -
                            }
  198         -
                        }
  199         -
                    }
  200         -
                }
  201         -
                if let ::std::option::Option::Some(inner_3) = &_input.qux {
  202         -
                    {
  203         -
                        query.push_kv("corge", &::aws_smithy_http::query::fmt_string(inner_3));
  204         -
                    }
         212  +
                let mut uri = "/StringListMap".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.qux {
         215  +
                    query_params.push(("corge".to_string(), val.to_string()));
         216  +
                }
         217  +
                if let Some(ref map) = input.foo {
         218  +
                    for (k, v) in map {
         219  +
                        if matches!(k.as_str(), "corge") {
         220  +
                            continue;
         221  +
                        }
         222  +
                        for item in v {
         223  +
                            query_params.push((k.clone(), item.clone()));
         224  +
                        }
         225  +
                    }
         226  +
                }
         227  +
                if !query_params.is_empty() {
         228  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         229  +
                    let pairs: Vec<String> = query_params
         230  +
                        .iter()
         231  +
                        .map(|(k, v)| {
         232  +
                            format!(
         233  +
                                "{}={}",
         234  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         235  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         236  +
                            )
         237  +
                        })
         238  +
                        .collect();
         239  +
                    uri.push_str(&pairs.join("&"));
  205    240   
                }
  206         -
                ::std::result::Result::Ok(())
         241  +
                request.set_uri(uri.as_str()).expect("valid URI");
  207    242   
            }
  208         -
            #[allow(clippy::unnecessary_wraps)]
  209         -
            fn update_http_builder(
  210         -
                input: &crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput,
  211         -
                builder: ::http_1x::request::Builder,
  212         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  213         -
                let mut uri = ::std::string::String::new();
  214         -
                uri_base(input, &mut uri)?;
  215         -
                uri_query(input, &mut uri)?;
  216         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  217         -
            }
  218         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  219         -
            builder
  220         -
        };
  221         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  222    243   
  223         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         244  +
            return ::std::result::Result::Ok(request);
         245  +
        } else {
         246  +
            let mut request = protocol
         247  +
                .serialize_request(&input, QueryParamsAsStringListMap::INPUT_SCHEMA, "", _cfg)
         248  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         249  +
         250  +
            return ::std::result::Result::Ok(request);
         251  +
        }
  224    252   
    }
  225    253   
}
  226    254   
#[derive(Debug)]
  227    255   
struct QueryParamsAsStringListMapEndpointParamsInterceptor;
  228    256   
  229    257   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryParamsAsStringListMapEndpointParamsInterceptor {
  230    258   
    fn name(&self) -> &'static str {
  231    259   
        "QueryParamsAsStringListMapEndpointParamsInterceptor"
  232    260   
    }
  233    261   

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

@@ -22,22 +151,176 @@
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Map,
   44     44   
    "foo",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_query_params();
   48     48   
static QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_QUX, &QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_FOO],
   52         -
);
          52  +
)
          53  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StringListMap", None));
   53     54   
impl QueryParamsAsStringListMapInput {
   54     55   
    /// The schema for this shape.
   55     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA;
   56     57   
}
   57     58   
impl ::aws_smithy_schema::serde::SerializableStruct for QueryParamsAsStringListMapInput {
   58     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     60   
    fn serialize_members(
   60     61   
        &self,
   61     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     64   
        if let Some(ref val) = self.qux {
   64     65   
            ser.write_string(&QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_QUX, val)?;
   65     66   
        }
   66     67   
        if let Some(ref val) = self.foo {
   67     68   
            ser.write_map(
   68     69   
                &QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_FOO,
   69     70   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     71   
                    for (key, value) in val {
   71     72   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   72         -
                        todo!("schema: unsupported map value type");
          73  +
          74  +
                        ser.write_list(
          75  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
          76  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          77  +
                                for item in value {
          78  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          79  +
                                }
          80  +
                                Ok(())
          81  +
                            },
          82  +
                        )?;
   73     83   
                    }
   74     84   
                    Ok(())
   75     85   
                },
   76     86   
            )?;
   77     87   
        }
   78     88   
        Ok(())
   79     89   
    }
   80     90   
}
   81     91   
impl QueryParamsAsStringListMapInput {
   82     92   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   83         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   84         -
        deserializer: &mut D,
          93  +
    pub fn deserialize(
          94  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   85     95   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   86     96   
        #[allow(unused_variables, unused_mut)]
   87     97   
        let mut builder = Self::builder();
   88     98   
        #[allow(
   89     99   
            unused_variables,
   90    100   
            unreachable_code,
   91    101   
            clippy::single_match,
   92    102   
            clippy::match_single_binding,
   93    103   
            clippy::diverging_sub_expression
   94    104   
        )]
   95         -
        deserializer.read_struct(&QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA, (), |_, member, deser| {
         105  +
        deserializer.read_struct(&QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA, &mut |member, deser| {
   96    106   
            match member.member_index() {
   97    107   
                Some(0) => {
   98    108   
                    builder.qux = Some(deser.read_string(member)?);
   99    109   
                }
  100    110   
                Some(1) => {
  101    111   
                    builder.foo = Some({
  102         -
                        let container = if let Some(cap) = deser.container_size() {
  103         -
                            std::collections::HashMap::with_capacity(cap)
  104         -
                        } else {
  105         -
                            std::collections::HashMap::new()
  106         -
                        };
  107         -
                        deser.read_map(member, container, |mut map, key, deser| {
  108         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  109         -
                            Ok(map)
  110         -
                        })?
         112  +
                        let mut container = std::collections::HashMap::new();
         113  +
                        deser.read_map(member, &mut |key, deser| {
         114  +
                            container.insert(key, {
         115  +
                                let mut list = Vec::new();
         116  +
                                deser.read_list(member, &mut |deser| {
         117  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         118  +
                                    Ok(())
         119  +
                                })?;
         120  +
                                list
         121  +
                            });
         122  +
                            Ok(())
         123  +
                        })?;
         124  +
                        container
  111    125   
                    });
  112    126   
                }
  113    127   
                _ => {}
  114    128   
            }
  115    129   
            Ok(())
  116    130   
        })?;
  117    131   
        builder
  118    132   
            .build()
  119    133   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  120    134   
    }
  121    135   
}
         136  +
impl QueryParamsAsStringListMapInput {
         137  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         138  +
    pub fn deserialize_with_response(
         139  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         140  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         141  +
        _status: u16,
         142  +
        _body: &[u8],
         143  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         144  +
        Self::deserialize(deserializer)
         145  +
    }
         146  +
}
  122    147   
impl QueryParamsAsStringListMapInput {
  123    148   
    /// Creates a new builder-style object to manufacture [`QueryParamsAsStringListMapInput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput).
  124    149   
    pub fn builder() -> crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder {
  125    150   
        crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder::default()
  126    151   
    }
  127    152   
}
  128    153   
  129    154   
/// A builder for [`QueryParamsAsStringListMapInput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput).
  130    155   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  131    156   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_params_as_string_list_map/_query_params_as_string_list_map_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 QueryParamsAsStringListMapOutput {
   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(&QUERYPARAMSASSTRINGLISTMAPOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&QUERYPARAMSASSTRINGLISTMAPOUTPUT_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 QueryParamsAsStringListMapOutput {
          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 QueryParamsAsStringListMapOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`QueryParamsAsStringListMapOutput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput).
   51     62   
    pub fn builder() -> crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapOutputBuilder {
   52     63   
        crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`QueryParamsAsStringListMapOutput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_precedence.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 `QueryPrecedence`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct QueryPrecedence;
    6      6   
impl QueryPrecedence {
    7      7   
    /// Creates a new `QueryPrecedence`
    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::query_precedence::QueryPrecedenceInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::query_precedence::QueryPrecedenceOutput::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::query_precedence::QueryPrecedenceInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::query_precedence::QueryPrecedenceOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::query_precedence::QueryPrecedenceError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +251,277 @@
  130    134   
                crate::operation::query_precedence::QueryPrecedenceError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct QueryPrecedenceResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryPrecedenceResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::query_precedence::QueryPrecedenceError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, QueryPrecedence::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::query_precedence::QueryPrecedenceOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct QueryPrecedenceRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryPrecedenceRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::query_precedence::QueryPrecedenceInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::query_precedence::QueryPrecedenceInput,
  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, "/Precedence").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::query_precedence::QueryPrecedenceInput,
  186         -
                mut output: &mut ::std::string::String,
  187         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  189         -
                let protected_params = ["bar"];
  190         -
                if let ::std::option::Option::Some(inner_1) = &_input.baz {
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        if protocol.supports_http_bindings() {
         206  +
            let mut request = protocol
         207  +
                .serialize_body(&input, QueryPrecedence::INPUT_SCHEMA, "", _cfg)
         208  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  191    209   
            {
  192         -
                        for (k, v) in inner_1 {
  193         -
                            if !protected_params.contains(&k.as_str()) {
  194         -
                                query.push_kv(&::aws_smithy_http::query::fmt_string(k), &::aws_smithy_http::query::fmt_string(v));
  195         -
                            }
  196         -
                        }
  197         -
                    }
  198         -
                }
  199         -
                if let ::std::option::Option::Some(inner_2) = &_input.foo {
  200         -
                    {
  201         -
                        query.push_kv("bar", &::aws_smithy_http::query::fmt_string(inner_2));
  202         -
                    }
         210  +
                let mut uri = "/Precedence".to_string();
         211  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         212  +
                if let Some(ref val) = input.foo {
         213  +
                    query_params.push(("bar".to_string(), val.to_string()));
         214  +
                }
         215  +
                if let Some(ref map) = input.baz {
         216  +
                    for (k, v) in map {
         217  +
                        if matches!(k.as_str(), "bar") {
         218  +
                            continue;
         219  +
                        }
         220  +
                        query_params.push((k.clone(), v.clone()));
         221  +
                    }
         222  +
                }
         223  +
                if !query_params.is_empty() {
         224  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         225  +
                    let pairs: Vec<String> = query_params
         226  +
                        .iter()
         227  +
                        .map(|(k, v)| {
         228  +
                            format!(
         229  +
                                "{}={}",
         230  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         231  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         232  +
                            )
         233  +
                        })
         234  +
                        .collect();
         235  +
                    uri.push_str(&pairs.join("&"));
  203    236   
                }
  204         -
                ::std::result::Result::Ok(())
         237  +
                request.set_uri(uri.as_str()).expect("valid URI");
  205    238   
            }
  206         -
            #[allow(clippy::unnecessary_wraps)]
  207         -
            fn update_http_builder(
  208         -
                input: &crate::operation::query_precedence::QueryPrecedenceInput,
  209         -
                builder: ::http_1x::request::Builder,
  210         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  211         -
                let mut uri = ::std::string::String::new();
  212         -
                uri_base(input, &mut uri)?;
  213         -
                uri_query(input, &mut uri)?;
  214         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  215         -
            }
  216         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  217         -
            builder
  218         -
        };
  219         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  220    239   
  221         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         240  +
            return ::std::result::Result::Ok(request);
         241  +
        } else {
         242  +
            let mut request = protocol
         243  +
                .serialize_request(&input, QueryPrecedence::INPUT_SCHEMA, "", _cfg)
         244  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         245  +
         246  +
            return ::std::result::Result::Ok(request);
         247  +
        }
  222    248   
    }
  223    249   
}
  224    250   
#[derive(Debug)]
  225    251   
struct QueryPrecedenceEndpointParamsInterceptor;
  226    252   
  227    253   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryPrecedenceEndpointParamsInterceptor {
  228    254   
    fn name(&self) -> &'static str {
  229    255   
        "QueryPrecedenceEndpointParamsInterceptor"
  230    256   
    }
  231    257   

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

@@ -22,22 +151,153 @@
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Map,
   44     44   
    "baz",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_query_params();
   48     48   
static QUERYPRECEDENCEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    QUERYPRECEDENCEINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&QUERYPRECEDENCEINPUT_MEMBER_FOO, &QUERYPRECEDENCEINPUT_MEMBER_BAZ],
   52         -
);
          52  +
)
          53  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/Precedence", None));
   53     54   
impl QueryPrecedenceInput {
   54     55   
    /// The schema for this shape.
   55     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &QUERYPRECEDENCEINPUT_SCHEMA;
   56     57   
}
   57     58   
impl ::aws_smithy_schema::serde::SerializableStruct for QueryPrecedenceInput {
   58     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     60   
    fn serialize_members(
   60     61   
        &self,
   61     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     64   
        if let Some(ref val) = self.foo {
   64     65   
            ser.write_string(&QUERYPRECEDENCEINPUT_MEMBER_FOO, val)?;
   65     66   
        }
   66     67   
        if let Some(ref val) = self.baz {
   67     68   
            ser.write_map(
   68     69   
                &QUERYPRECEDENCEINPUT_MEMBER_BAZ,
   69     70   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     71   
                    for (key, value) in val {
   71     72   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   72     73   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   73     74   
                    }
   74     75   
                    Ok(())
   75     76   
                },
   76     77   
            )?;
   77     78   
        }
   78     79   
        Ok(())
   79     80   
    }
   80     81   
}
   81     82   
impl QueryPrecedenceInput {
   82     83   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   83         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   84         -
        deserializer: &mut D,
          84  +
    pub fn deserialize(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   85     86   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   86     87   
        #[allow(unused_variables, unused_mut)]
   87     88   
        let mut builder = Self::builder();
   88     89   
        #[allow(
   89     90   
            unused_variables,
   90     91   
            unreachable_code,
   91     92   
            clippy::single_match,
   92     93   
            clippy::match_single_binding,
   93     94   
            clippy::diverging_sub_expression
   94     95   
        )]
   95         -
        deserializer.read_struct(&QUERYPRECEDENCEINPUT_SCHEMA, (), |_, member, deser| {
          96  +
        deserializer.read_struct(&QUERYPRECEDENCEINPUT_SCHEMA, &mut |member, deser| {
   96     97   
            match member.member_index() {
   97     98   
                Some(0) => {
   98     99   
                    builder.foo = Some(deser.read_string(member)?);
   99    100   
                }
  100    101   
                Some(1) => {
  101         -
                    builder.baz = Some({
  102         -
                        let container = if let Some(cap) = deser.container_size() {
  103         -
                            std::collections::HashMap::with_capacity(cap)
  104         -
                        } else {
  105         -
                            std::collections::HashMap::new()
  106         -
                        };
  107         -
                        deser.read_map(member, container, |mut map, key, deser| {
  108         -
                            map.insert(key, deser.read_string(member)?);
  109         -
                            Ok(map)
  110         -
                        })?
  111         -
                    });
         102  +
                    builder.baz = Some(deser.read_string_string_map(member)?);
  112    103   
                }
  113    104   
                _ => {}
  114    105   
            }
  115    106   
            Ok(())
  116    107   
        })?;
  117    108   
        builder
  118    109   
            .build()
  119    110   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  120    111   
    }
  121    112   
}
         113  +
impl QueryPrecedenceInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         115  +
    pub fn deserialize_with_response(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         118  +
        _status: u16,
         119  +
        _body: &[u8],
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        Self::deserialize(deserializer)
         122  +
    }
         123  +
}
  122    124   
impl QueryPrecedenceInput {
  123    125   
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
  124    126   
    pub fn builder() -> crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
  125    127   
        crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder::default()
  126    128   
    }
  127    129   
}
  128    130   
  129    131   
/// A builder for [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
  130    132   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  131    133   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_precedence/_query_precedence_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 QueryPrecedenceOutput {
   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(&QUERYPRECEDENCEOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&QUERYPRECEDENCEOUTPUT_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 QueryPrecedenceOutput {
          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 QueryPrecedenceOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
   51     62   
    pub fn builder() -> crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder {
   52     63   
        crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes.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 `RecursiveShapes`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct RecursiveShapes;
    6      6   
impl RecursiveShapes {
    7      7   
    /// Creates a new `RecursiveShapes`
    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::recursive_shapes::RecursiveShapesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::recursive_shapes::RecursiveShapesOutput::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::recursive_shapes::RecursiveShapesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::recursive_shapes::RecursiveShapesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::recursive_shapes::RecursiveShapesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +232,239 @@
  130    134   
                crate::operation::recursive_shapes::RecursiveShapesError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct RecursiveShapesResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RecursiveShapesResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::recursive_shapes::RecursiveShapesError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, RecursiveShapes::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::recursive_shapes::RecursiveShapesOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct RecursiveShapesRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RecursiveShapesRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::recursive_shapes::RecursiveShapesInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::recursive_shapes::RecursiveShapesInput,
  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, "/RecursiveShapes").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::recursive_shapes::RecursiveShapesInput,
  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("PUT").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/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_recursive_shapes::ser_recursive_shapes_input(&input)?);
  198         -
        if let Some(content_length) = body.content_length() {
  199         -
            let content_length = content_length.to_string();
  200         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  201         -
        }
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, RecursiveShapes::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  203    210   
    }
  204    211   
}
  205    212   
#[derive(Debug)]
  206    213   
struct RecursiveShapesEndpointParamsInterceptor;
  207    214   
  208    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RecursiveShapesEndpointParamsInterceptor {
  209    216   
    fn name(&self) -> &'static str {
  210    217   
        "RecursiveShapesEndpointParamsInterceptor"
  211    218   
    }
  212    219   
@@ -315,322 +375,392 @@
  335    342   
            .expect("the config must have a deserializer");
  336    343   
  337    344   
        let parsed = de.deserialize_streaming(&mut http_response);
  338    345   
        let parsed = parsed.unwrap_or_else(|| {
  339    346   
            let http_response = http_response.map(|body| {
  340    347   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  341    348   
                    body.bytes().unwrap(),
  342    349   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  343    350   
                )))
  344    351   
            });
  345         -
            de.deserialize_nonstreaming(&http_response)
         352  +
            // Build a config bag with the protocol for schema-based deserialization
         353  +
            #[allow(unused_mut)]
         354  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         355  +
            {
         356  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         357  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         358  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         359  +
                ));
         360  +
                test_cfg.push_shared_layer(layer.freeze());
         361  +
            }
         362  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  346    363   
        });
  347    364   
        let parsed = parsed
  348    365   
            .expect("should be successful response")
  349    366   
            .downcast::<crate::operation::recursive_shapes::RecursiveShapesOutput>()
  350    367   
            .unwrap();
  351    368   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  352    369   
    }
  353    370   
}
  354    371   
  355    372   
/// Error type for the `RecursiveShapesError` operation.

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

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

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

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.nested {
   46     46   
            ser.write_struct(&RECURSIVESHAPESOUTPUT_MEMBER_NESTED, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl RecursiveShapesOutput {
   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(&RECURSIVESHAPESOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&RECURSIVESHAPESOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.nested = Some(crate::types::RecursiveShapesInputOutputNested1::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl RecursiveShapesOutput {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl RecursiveShapesOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`RecursiveShapesOutput`](crate::operation::recursive_shapes::RecursiveShapesOutput).
   79     90   
    pub fn builder() -> crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder {
   80     91   
        crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`RecursiveShapesOutput`](crate::operation::recursive_shapes::RecursiveShapesOutput).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]