Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/config.rs

@@ -10,10 +69,73 @@
   30     30   
            config: self.cloneable.clone(),
   31     31   
            runtime_components: self.runtime_components.clone(),
   32     32   
            runtime_plugins: self.runtime_plugins.clone(),
   33     33   
            behavior_version: self.behavior_version,
   34     34   
        }
   35     35   
    }
   36     36   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     37   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     38   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     39   
    }
          40  +
    /// Returns the client protocol used for serialization and deserialization.
          41  +
    pub fn protocol(&self) -> ::std::option::Option<&::aws_smithy_schema::protocol::SharedClientProtocol> {
          42  +
        self.config.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
          43  +
    }
   40     44   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     45   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     46   
        self.runtime_components.http_client()
   43     47   
    }
   44     48   
    /// Return the auth schemes configured on this service config
   45     49   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     50   
        self.runtime_components.auth_schemes()
   47     51   
    }
   48     52   
   49     53   
    /// Return the auth scheme resolver configured on this service config
@@ -105,109 +185,208 @@
  125    129   
    ///
  126    130   
    pub fn new() -> Self {
  127    131   
        Self::default()
  128    132   
    }
  129    133   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  130    134   
    /// but not those in runtime components.
  131    135   
    #[allow(unused)]
  132    136   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  133    137   
        let mut builder = Self::new();
  134    138   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         139  +
        if let ::std::option::Option::Some(protocol) = config_bag.load::<::aws_smithy_schema::protocol::SharedClientProtocol>().cloned() {
         140  +
            builder.set_protocol(::std::option::Option::Some(protocol));
         141  +
        }
  135    142   
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  136    143   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  137    144   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  138    145   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  139    146   
        builder
  140    147   
    }
  141    148   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  142    149   
    /// to configure protection for stalled streams.
  143    150   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  144    151   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  145    152   
        self
  146    153   
    }
  147    154   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  148    155   
    /// to configure protection for stalled streams.
  149    156   
    pub fn set_stalled_stream_protection(
  150    157   
        &mut self,
  151    158   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  152    159   
    ) -> &mut Self {
  153    160   
        self.config.store_or_unset(stalled_stream_protection_config);
  154    161   
        self
  155    162   
    }
         163  +
    /// Sets the client protocol to use for serialization and deserialization.
         164  +
    ///
         165  +
    /// This overrides the default protocol determined by the service model,
         166  +
    /// enabling runtime protocol selection.
         167  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         168  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         169  +
            protocol,
         170  +
        )));
         171  +
        self
         172  +
    }
         173  +
         174  +
    /// Sets the client protocol to use for serialization and deserialization.
         175  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         176  +
        self.config.store_or_unset(protocol);
         177  +
        self
         178  +
    }
  156    179   
    /// Sets the HTTP client to use when making requests.
  157    180   
    ///
  158    181   
    /// # Examples
  159    182   
    /// ```no_run
  160    183   
    /// # #[cfg(test)]
  161    184   
    /// # mod tests {
  162    185   
    /// # #[test]
  163    186   
    /// # fn example() {
  164    187   
    /// use std::time::Duration;
  165    188   
    /// use query_compat_test::config::Config;
@@ -1116,1139 +1175,1203 @@
 1136   1159   
#[derive(::std::fmt::Debug)]
 1137   1160   
pub(crate) struct ServiceRuntimePlugin {
 1138   1161   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1139   1162   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1140   1163   
}
 1141   1164   
 1142   1165   
impl ServiceRuntimePlugin {
 1143   1166   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1144   1167   
        let config = {
 1145   1168   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("QueryCompatService");
        1169  +
            if _service_config.protocol().is_none() {
        1170  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1171  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("QueryCompatService"),
        1172  +
                ));
        1173  +
            }
 1146   1174   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1147   1175   
            ::std::option::Option::Some(cfg.freeze())
 1148   1176   
        };
 1149   1177   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1150   1178   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1151   1179   
            use crate::config::auth::ResolveAuthScheme;
 1152   1180   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1153   1181   
        }));
 1154   1182   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1155   1183   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/lib.rs

@@ -94,94 +130,128 @@
  114    114   
/// Primitives such as `Blob` or `DateTime` used by other types.
  115    115   
pub mod primitives;
  116    116   
  117    117   
/// All operations that this crate can perform.
  118    118   
pub mod operation;
  119    119   
  120    120   
pub(crate) mod protocol_serde;
  121    121   
  122    122   
mod sdk_feature_tracker;
  123    123   
  124         -
mod serialization_settings;
  125         -
  126    124   
mod aws_query_compatible_errors;
  127    125   
  128    126   
mod json_errors;
  129    127   
  130    128   
pub use client::Client;

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

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/operation/operation/_operation_input.rs

@@ -23,23 +108,119 @@
   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.message {
   46     46   
            ser.write_string(&OPERATIONINPUT_MEMBER_MESSAGE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl OperationInput {
   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(&OPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&OPERATIONINPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.message = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        builder
   75     75   
            .build()
   76     76   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     77   
    }
   78     78   
}
          79  +
impl OperationInput {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          81  +
    pub fn deserialize_with_response(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          83  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          84  +
        _status: u16,
          85  +
        _body: &[u8],
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        Self::deserialize(deserializer)
          88  +
    }
          89  +
}
   79     90   
impl OperationInput {
   80     91   
    /// Creates a new builder-style object to manufacture [`OperationInput`](crate::operation::operation::OperationInput).
   81     92   
    pub fn builder() -> crate::operation::operation::builders::OperationInputBuilder {
   82     93   
        crate::operation::operation::builders::OperationInputBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`OperationInput`](crate::operation::operation::OperationInput).
   87     98   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88     99   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/operation/operation/_operation_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.message {
   46     46   
            ser.write_string(&OPERATIONOUTPUT_MEMBER_MESSAGE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl OperationOutput {
   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(&OPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&OPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.message = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl OperationOutput {
          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 OperationOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`OperationOutput`](crate::operation::operation::OperationOutput).
   79     90   
    pub fn builder() -> crate::operation::operation::builders::OperationOutputBuilder {
   80     91   
        crate::operation::operation::builders::OperationOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`OperationOutput`](crate::operation::operation::OperationOutput).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

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

@@ -1,1 +41,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn type_erase_result<O, E>(
    3         -
    result: ::std::result::Result<O, E>,
    4         -
) -> ::std::result::Result<
    5         -
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6         -
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7         -
>
    8         -
where
    9         -
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10         -
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11         -
{
   12         -
    result
   13         -
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14         -
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15         -
        .map_err(::std::convert::Into::into)
   16         -
}
   17         -
   18      2   
pub fn parse_http_error_metadata(
   19      3   
    _response_status: u16,
   20      4   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21      5   
    response_body: &[u8],
   22      6   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23      7   
    let mut builder = crate::json_errors::parse_error_metadata(response_body, response_headers)?;
   24      8   
    if let Some((error_code, error_type)) = crate::aws_query_compatible_errors::parse_aws_query_compatible_error(response_headers) {
   25      9   
        builder = builder.code(error_code);
   26     10   
        builder = builder.custom("type", error_type);
   27     11   
    }
   28     12   
    Ok(builder)
   29     13   
}
   30         -
   31         -
pub(crate) mod shape_operation;
   32         -
   33         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   34         -
    if data.is_empty() {
   35         -
        b"{}"
   36         -
    } else {
   37         -
        data
   38         -
    }
   39         -
}
   40         -
   41         -
pub(crate) mod shape_operation_input;

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/protocol_serde/shape_operation.rs

@@ -1,0 +73,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::operation::OperationOutput, crate::operation::operation::OperationError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::operation::OperationError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::operation::OperationError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_operation_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::operation::OperationOutput, crate::operation::operation::OperationError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::operation::builders::OperationOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_operation::de_operation(_response_body, output)
   25         -
            .map_err(crate::operation::operation::OperationError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_operation_input(
   31         -
    input: &crate::operation::operation::OperationInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_operation_input::ser_operation_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_operation(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::operation::builders::OperationOutputBuilder,
   43         -
) -> ::std::result::Result<crate::operation::operation::builders::OperationOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   44         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   45         -
    let tokens = &mut tokens_owned;
   46         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   47         -
    loop {
   48         -
        match tokens.next().transpose()? {
   49         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   51         -
                "message" => {
   52         -
                    builder = builder.set_message(
   53         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   54         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   55         -
                            .transpose()?,
   56         -
                    );
   57         -
                }
   58         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   59         -
            },
   60         -
            other => {
   61         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   62         -
                    "expected object key or end object, found: {other:?}"
   63         -
                )))
   64         -
            }
   65         -
        }
   66         -
    }
   67         -
    if tokens.next().is_some() {
   68         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   69         -
            "found more JSON tokens after completing parsing",
   70         -
        ));
   71         -
    }
   72         -
    Ok(builder)
   73         -
}

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/protocol_serde/shape_operation_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_operation_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::operation::OperationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.message {
    7         -
        object.key("message").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/codegen-client-test/query-compat-test/rust-client-codegen/src/serialization_settings.rs

@@ -1,0 +89,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/*
    3         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4         -
 * SPDX-License-Identifier: Apache-2.0
    5         -
 */
    6         -
    7         -
#![allow(dead_code)]
    8         -
    9         -
use aws_smithy_http::header::set_request_header_if_absent;
   10         -
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12         -
   13         -
/// Configuration for how default protocol headers are serialized
   14         -
#[derive(Clone, Debug, Default)]
   15         -
pub(crate) struct HeaderSerializationSettings {
   16         -
    omit_default_content_length: bool,
   17         -
    omit_default_content_type: bool,
   18         -
}
   19         -
   20         -
impl HeaderSerializationSettings {
   21         -
    /// Creates new [`HeaderSerializationSettings`]
   22         -
    pub(crate) fn new() -> Self {
   23         -
        Default::default()
   24         -
    }
   25         -
   26         -
    /// Omit the default `Content-Length` header during serialization
   27         -
    pub(crate) fn omit_default_content_length(self) -> Self {
   28         -
        Self {
   29         -
            omit_default_content_length: true,
   30         -
            ..self
   31         -
        }
   32         -
    }
   33         -
   34         -
    /// Omit the default `Content-Type` header during serialization
   35         -
    pub(crate) fn omit_default_content_type(self) -> Self {
   36         -
        Self {
   37         -
            omit_default_content_type: true,
   38         -
            ..self
   39         -
        }
   40         -
    }
   41         -
   42         -
    /// Returns true if the given default header name should be serialized
   43         -
    fn include_header(&self, header: &HeaderName) -> bool {
   44         -
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45         -
    }
   46         -
   47         -
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(
   49         -
        &self,
   50         -
        mut request: http_1x::request::Builder,
   51         -
        header_name: HeaderName,
   52         -
        value: &str,
   53         -
    ) -> http_1x::request::Builder {
   54         -
        if self.include_header(&header_name) {
   55         -
            request = set_request_header_if_absent(request, header_name, value);
   56         -
        }
   57         -
        request
   58         -
    }
   59         -
}
   60         -
   61         -
impl Storable for HeaderSerializationSettings {
   62         -
    type Storer = StoreReplace<Self>;
   63         -
}
   64         -
   65         -
#[cfg(test)]
   66         -
mod tests {
   67         -
    use super::*;
   68         -
   69         -
    #[test]
   70         -
    fn test_include_header() {
   71         -
        let settings = HeaderSerializationSettings::default();
   72         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   73         -
        assert!(settings.include_header(&CONTENT_TYPE));
   74         -
   75         -
        let settings = HeaderSerializationSettings::default().omit_default_content_length();
   76         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   77         -
        assert!(settings.include_header(&CONTENT_TYPE));
   78         -
   79         -
        let settings = HeaderSerializationSettings::default().omit_default_content_type();
   80         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   81         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   82         -
   83         -
        let settings = HeaderSerializationSettings::default()
   84         -
            .omit_default_content_type()
   85         -
            .omit_default_content_length();
   86         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   87         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   88         -
    }
   89         -
}

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

@@ -10,10 +69,73 @@
   30     30   
            config: self.cloneable.clone(),
   31     31   
            runtime_components: self.runtime_components.clone(),
   32     32   
            runtime_plugins: self.runtime_plugins.clone(),
   33     33   
            behavior_version: self.behavior_version,
   34     34   
        }
   35     35   
    }
   36     36   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     37   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     38   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     39   
    }
          40  +
    /// Returns the client protocol used for serialization and deserialization.
          41  +
    pub fn protocol(&self) -> ::std::option::Option<&::aws_smithy_schema::protocol::SharedClientProtocol> {
          42  +
        self.config.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
          43  +
    }
   40     44   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     45   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     46   
        self.runtime_components.http_client()
   43     47   
    }
   44     48   
    /// Return the auth schemes configured on this service config
   45     49   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     50   
        self.runtime_components.auth_schemes()
   47     51   
    }
   48     52   
   49     53   
    /// Return the auth scheme resolver configured on this service config
@@ -105,109 +201,224 @@
  125    129   
    ///
  126    130   
    pub fn new() -> Self {
  127    131   
        Self::default()
  128    132   
    }
  129    133   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  130    134   
    /// but not those in runtime components.
  131    135   
    #[allow(unused)]
  132    136   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  133    137   
        let mut builder = Self::new();
  134    138   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         139  +
        if let ::std::option::Option::Some(protocol) = config_bag.load::<::aws_smithy_schema::protocol::SharedClientProtocol>().cloned() {
         140  +
            builder.set_protocol(::std::option::Option::Some(protocol));
         141  +
        }
  135    142   
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  136    143   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  137    144   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  138    145   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  139    146   
        builder
  140    147   
    }
  141    148   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  142    149   
    /// to configure protection for stalled streams.
  143    150   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  144    151   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  145    152   
        self
  146    153   
    }
  147    154   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  148    155   
    /// to configure protection for stalled streams.
  149    156   
    pub fn set_stalled_stream_protection(
  150    157   
        &mut self,
  151    158   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  152    159   
    ) -> &mut Self {
  153    160   
        self.config.store_or_unset(stalled_stream_protection_config);
  154    161   
        self
  155    162   
    }
  156    163   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  157    164   
    pub fn idempotency_token_provider(
  158    165   
        mut self,
  159    166   
        idempotency_token_provider: impl ::std::convert::Into<crate::idempotency_token::IdempotencyTokenProvider>,
  160    167   
    ) -> Self {
  161    168   
        self.set_idempotency_token_provider(::std::option::Option::Some(idempotency_token_provider.into()));
  162    169   
        self
  163    170   
    }
  164    171   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  165    172   
    pub fn set_idempotency_token_provider(
  166    173   
        &mut self,
  167    174   
        idempotency_token_provider: ::std::option::Option<crate::idempotency_token::IdempotencyTokenProvider>,
  168    175   
    ) -> &mut Self {
  169    176   
        self.config.store_or_unset(idempotency_token_provider);
  170    177   
        self
  171    178   
    }
         179  +
    /// Sets the client protocol to use for serialization and deserialization.
         180  +
    ///
         181  +
    /// This overrides the default protocol determined by the service model,
         182  +
    /// enabling runtime protocol selection.
         183  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         184  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         185  +
            protocol,
         186  +
        )));
         187  +
        self
         188  +
    }
         189  +
         190  +
    /// Sets the client protocol to use for serialization and deserialization.
         191  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         192  +
        self.config.store_or_unset(protocol);
         193  +
        self
         194  +
    }
  172    195   
    /// Sets the HTTP client to use when making requests.
  173    196   
    ///
  174    197   
    /// # Examples
  175    198   
    /// ```no_run
  176    199   
    /// # #[cfg(test)]
  177    200   
    /// # mod tests {
  178    201   
    /// # #[test]
  179    202   
    /// # fn example() {
  180    203   
    /// use std::time::Duration;
  181    204   
    /// use rest_json::config::Config;
@@ -1132,1155 +1191,1219 @@
 1152   1175   
pub(crate) struct ServiceRuntimePlugin {
 1153   1176   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1154   1177   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1155   1178   
}
 1156   1179   
 1157   1180   
impl ServiceRuntimePlugin {
 1158   1181   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1159   1182   
        let config = {
 1160   1183   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RestJson");
 1161   1184   
            cfg.store_put(crate::idempotency_token::default_provider());
        1185  +
            if _service_config.protocol().is_none() {
        1186  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1187  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1188  +
                ));
        1189  +
            }
 1162   1190   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1163   1191   
            ::std::option::Option::Some(cfg.freeze())
 1164   1192   
        };
 1165   1193   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1166   1194   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1167   1195   
            use crate::config::auth::ResolveAuthScheme;
 1168   1196   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1169   1197   
        }));
 1170   1198   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1171   1199   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());

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

@@ -109,109 +145,143 @@
  129    129   
  130    130   
mod idempotency_token;
  131    131   
  132    132   
/// All operations that this crate can perform.
  133    133   
pub mod operation;
  134    134   
  135    135   
pub(crate) mod protocol_serde;
  136    136   
  137    137   
mod sdk_feature_tracker;
  138    138   
  139         -
mod serialization_settings;
         139  +
mod json_errors;
  140    140   
  141    141   
mod serde_util;
  142    142   
  143         -
mod json_errors;
  144         -
  145    143   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/all_query_string_types.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 `AllQueryStringTypes`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct AllQueryStringTypes;
    6      6   
impl AllQueryStringTypes {
    7      7   
    /// Creates a new `AllQueryStringTypes`
    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::all_query_string_types::AllQueryStringTypesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::all_query_string_types::AllQueryStringTypesOutput::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::all_query_string_types::AllQueryStringTypesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::all_query_string_types::AllQueryStringTypesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::all_query_string_types::AllQueryStringTypesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +393,403 @@
  130    134   
                crate::operation::all_query_string_types::AllQueryStringTypesError,
  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 AllQueryStringTypesResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AllQueryStringTypesResponseDeserializer {
  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());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         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  +
            })?;
         160  +
         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::all_query_string_types::AllQueryStringTypesError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_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, AllQueryStringTypes::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::all_query_string_types::AllQueryStringTypesOutput::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 AllQueryStringTypesRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AllQueryStringTypesRequestSerializer {
  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::all_query_string_types::AllQueryStringTypesInput>()
  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::all_query_string_types::AllQueryStringTypesInput,
  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, "/AllQueryStringTypesInput").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::all_query_string_types::AllQueryStringTypesInput,
  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 = [
  190         -
                    "String",
  191         -
                    "StringList",
  192         -
                    "StringSet",
  193         -
                    "Byte",
  194         -
                    "Short",
  195         -
                    "Integer",
  196         -
                    "IntegerList",
  197         -
                    "IntegerSet",
  198         -
                    "Long",
  199         -
                    "Float",
  200         -
                    "Double",
  201         -
                    "DoubleList",
  202         -
                    "Boolean",
  203         -
                    "BooleanList",
  204         -
                    "Timestamp",
  205         -
                    "TimestampList",
  206         -
                    "Enum",
  207         -
                    "EnumList",
  208         -
                    "IntegerEnum",
  209         -
                    "IntegerEnumList",
  210         -
                ];
  211         -
                if let ::std::option::Option::Some(inner_1) = &_input.query_params_map_of_string_list {
  212         -
                    {
  213         -
                        for (k, v) in inner_1 {
  214         -
                            for inner_2 in v {
  215         -
                                if !protected_params.contains(&k.as_str()) {
  216         -
                                    query.push_kv(&::aws_smithy_http::query::fmt_string(k), &::aws_smithy_http::query::fmt_string(inner_2));
  217         -
                                }
  218         -
                            }
  219         -
                        }
  220         -
                    }
         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, AllQueryStringTypes::INPUT_SCHEMA, "", _cfg)
         208  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         209  +
            {
         210  +
                let mut uri = "/AllQueryStringTypesInput".to_string();
         211  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         212  +
                if let Some(ref val) = input.query_string {
         213  +
                    query_params.push(("String".to_string(), val.to_string()));
  221    214   
                }
  222         -
                if let ::std::option::Option::Some(inner_3) = &_input.query_string {
  223         -
                    {
  224         -
                        query.push_kv("String", &::aws_smithy_http::query::fmt_string(inner_3));
         215  +
                if let Some(ref val) = input.query_string_list {
         216  +
                    for item in val {
         217  +
                        query_params.push(("StringList".to_string(), item.to_string()));
  225    218   
                    }
  226    219   
                }
  227         -
                if let ::std::option::Option::Some(inner_4) = &_input.query_string_list {
  228         -
                    {
  229         -
                        for inner_5 in inner_4 {
  230         -
                            query.push_kv("StringList", &::aws_smithy_http::query::fmt_string(inner_5));
  231         -
                        }
         220  +
                if let Some(ref val) = input.query_string_set {
         221  +
                    for item in val {
         222  +
                        query_params.push(("StringSet".to_string(), item.to_string()));
  232    223   
                    }
  233    224   
                }
  234         -
                if let ::std::option::Option::Some(inner_6) = &_input.query_string_set {
  235         -
                    {
  236         -
                        for inner_7 in inner_6 {
  237         -
                            query.push_kv("StringSet", &::aws_smithy_http::query::fmt_string(inner_7));
  238         -
                        }
  239         -
                    }
         225  +
                if let Some(ref val) = input.query_byte {
         226  +
                    query_params.push(("Byte".to_string(), val.to_string()));
  240    227   
                }
  241         -
                if let ::std::option::Option::Some(inner_8) = &_input.query_byte {
  242         -
                    {
  243         -
                        query.push_kv("Byte", ::aws_smithy_types::primitive::Encoder::from(*inner_8).encode());
  244         -
                    }
         228  +
                if let Some(ref val) = input.query_short {
         229  +
                    query_params.push(("Short".to_string(), val.to_string()));
  245    230   
                }
  246         -
                if let ::std::option::Option::Some(inner_9) = &_input.query_short {
  247         -
                    {
  248         -
                        query.push_kv("Short", ::aws_smithy_types::primitive::Encoder::from(*inner_9).encode());
         231  +
                if let Some(ref val) = input.query_integer {
         232  +
                    query_params.push(("Integer".to_string(), val.to_string()));
         233  +
                }
         234  +
                if let Some(ref val) = input.query_integer_list {
         235  +
                    for item in val {
         236  +
                        query_params.push(("IntegerList".to_string(), item.to_string()));
  249    237   
                    }
  250    238   
                }
  251         -
                if let ::std::option::Option::Some(inner_10) = &_input.query_integer {
  252         -
                    {
  253         -
                        query.push_kv("Integer", ::aws_smithy_types::primitive::Encoder::from(*inner_10).encode());
         239  +
                if let Some(ref val) = input.query_integer_set {
         240  +
                    for item in val {
         241  +
                        query_params.push(("IntegerSet".to_string(), item.to_string()));
  254    242   
                    }
  255    243   
                }
  256         -
                if let ::std::option::Option::Some(inner_11) = &_input.query_integer_list {
  257         -
                    {
  258         -
                        for inner_12 in inner_11 {
  259         -
                            query.push_kv("IntegerList", ::aws_smithy_types::primitive::Encoder::from(*inner_12).encode());
         244  +
                if let Some(ref val) = input.query_long {
         245  +
                    query_params.push(("Long".to_string(), val.to_string()));
         246  +
                }
         247  +
                if let Some(ref val) = input.query_float {
         248  +
                    query_params.push(("Float".to_string(), {
         249  +
                        let s = val.to_string();
         250  +
                        match s.as_str() {
         251  +
                            "inf" => "Infinity".to_string(),
         252  +
                            "-inf" => "-Infinity".to_string(),
         253  +
                            _ => s,
  260    254   
                        }
  261         -
                    }
         255  +
                    }));
  262    256   
                }
  263         -
                if let ::std::option::Option::Some(inner_13) = &_input.query_integer_set {
  264         -
                    {
  265         -
                        for inner_14 in inner_13 {
  266         -
                            query.push_kv("IntegerSet", ::aws_smithy_types::primitive::Encoder::from(*inner_14).encode());
         257  +
                if let Some(ref val) = input.query_double {
         258  +
                    query_params.push(("Double".to_string(), {
         259  +
                        let s = val.to_string();
         260  +
                        match s.as_str() {
         261  +
                            "inf" => "Infinity".to_string(),
         262  +
                            "-inf" => "-Infinity".to_string(),
         263  +
                            _ => s,
  267    264   
                        }
  268         -
                    }
         265  +
                    }));
  269    266   
                }
  270         -
                if let ::std::option::Option::Some(inner_15) = &_input.query_long {
  271         -
                    {
  272         -
                        query.push_kv("Long", ::aws_smithy_types::primitive::Encoder::from(*inner_15).encode());
         267  +
                if let Some(ref val) = input.query_double_list {
         268  +
                    for item in val {
         269  +
                        query_params.push(("DoubleList".to_string(), {
         270  +
                            let s = item.to_string();
         271  +
                            match s.as_str() {
         272  +
                                "inf" => "Infinity".to_string(),
         273  +
                                "-inf" => "-Infinity".to_string(),
         274  +
                                _ => s,
         275  +
                            }
         276  +
                        }));
  273    277   
                    }
  274    278   
                }
  275         -
                if let ::std::option::Option::Some(inner_16) = &_input.query_float {
  276         -
                    {
  277         -
                        query.push_kv("Float", ::aws_smithy_types::primitive::Encoder::from(*inner_16).encode());
  278         -
                    }
         279  +
                if let Some(ref val) = input.query_boolean {
         280  +
                    query_params.push(("Boolean".to_string(), val.to_string()));
  279    281   
                }
  280         -
                if let ::std::option::Option::Some(inner_17) = &_input.query_double {
  281         -
                    {
  282         -
                        query.push_kv("Double", ::aws_smithy_types::primitive::Encoder::from(*inner_17).encode());
         282  +
                if let Some(ref val) = input.query_boolean_list {
         283  +
                    for item in val {
         284  +
                        query_params.push(("BooleanList".to_string(), item.to_string()));
  283    285   
                    }
  284    286   
                }
  285         -
                if let ::std::option::Option::Some(inner_18) = &_input.query_double_list {
  286         -
                    {
  287         -
                        for inner_19 in inner_18 {
  288         -
                            query.push_kv("DoubleList", ::aws_smithy_types::primitive::Encoder::from(*inner_19).encode());
  289         -
                        }
  290         -
                    }
         287  +
                if let Some(ref val) = input.query_timestamp {
         288  +
                    query_params.push((
         289  +
                        "Timestamp".to_string(),
         290  +
                        val.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
         291  +
                    ));
  291    292   
                }
  292         -
                if let ::std::option::Option::Some(inner_20) = &_input.query_boolean {
  293         -
                    {
  294         -
                        query.push_kv("Boolean", ::aws_smithy_types::primitive::Encoder::from(*inner_20).encode());
         293  +
                if let Some(ref val) = input.query_timestamp_list {
         294  +
                    for item in val {
         295  +
                        query_params.push((
         296  +
                            "TimestampList".to_string(),
         297  +
                            item.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
         298  +
                        ));
  295    299   
                    }
  296    300   
                }
  297         -
                if let ::std::option::Option::Some(inner_21) = &_input.query_boolean_list {
  298         -
                    {
  299         -
                        for inner_22 in inner_21 {
  300         -
                            query.push_kv("BooleanList", ::aws_smithy_types::primitive::Encoder::from(*inner_22).encode());
  301         -
                        }
  302         -
                    }
         301  +
                if let Some(ref val) = input.query_enum {
         302  +
                    query_params.push(("Enum".to_string(), val.as_str().to_string()));
  303    303   
                }
  304         -
                if let ::std::option::Option::Some(inner_23) = &_input.query_timestamp {
  305         -
                    {
  306         -
                        query.push_kv(
  307         -
                            "Timestamp",
  308         -
                            &::aws_smithy_http::query::fmt_timestamp(inner_23, ::aws_smithy_types::date_time::Format::DateTime)?,
  309         -
                        );
         304  +
                if let Some(ref val) = input.query_enum_list {
         305  +
                    for item in val {
         306  +
                        query_params.push(("EnumList".to_string(), item.as_str().to_string()));
  310    307   
                    }
  311    308   
                }
  312         -
                if let ::std::option::Option::Some(inner_24) = &_input.query_timestamp_list {
  313         -
                    {
  314         -
                        for inner_25 in inner_24 {
  315         -
                            query.push_kv(
  316         -
                                "TimestampList",
  317         -
                                &::aws_smithy_http::query::fmt_timestamp(inner_25, ::aws_smithy_types::date_time::Format::DateTime)?,
  318         -
                            );
  319         -
                        }
  320         -
                    }
         309  +
                if let Some(ref val) = input.query_integer_enum {
         310  +
                    query_params.push(("IntegerEnum".to_string(), val.to_string()));
  321    311   
                }
  322         -
                if let ::std::option::Option::Some(inner_26) = &_input.query_enum {
  323         -
                    {
  324         -
                        query.push_kv("Enum", &::aws_smithy_http::query::fmt_string(inner_26.as_str()));
         312  +
                if let Some(ref val) = input.query_integer_enum_list {
         313  +
                    for item in val {
         314  +
                        query_params.push(("IntegerEnumList".to_string(), item.to_string()));
  325    315   
                    }
  326    316   
                }
  327         -
                if let ::std::option::Option::Some(inner_27) = &_input.query_enum_list {
  328         -
                    {
  329         -
                        for inner_28 in inner_27 {
  330         -
                            query.push_kv("EnumList", &::aws_smithy_http::query::fmt_string(inner_28.as_str()));
         317  +
                if let Some(ref map) = input.query_params_map_of_string_list {
         318  +
                    for (k, v) in map {
         319  +
                        if matches!(
         320  +
                            k.as_str(),
         321  +
                            "String"
         322  +
                                | "StringList"
         323  +
                                | "StringSet"
         324  +
                                | "Byte"
         325  +
                                | "Short"
         326  +
                                | "Integer"
         327  +
                                | "IntegerList"
         328  +
                                | "IntegerSet"
         329  +
                                | "Long"
         330  +
                                | "Float"
         331  +
                                | "Double"
         332  +
                                | "DoubleList"
         333  +
                                | "Boolean"
         334  +
                                | "BooleanList"
         335  +
                                | "Timestamp"
         336  +
                                | "TimestampList"
         337  +
                                | "Enum"
         338  +
                                | "EnumList"
         339  +
                                | "IntegerEnum"
         340  +
                                | "IntegerEnumList"
         341  +
                        ) {
         342  +
                            continue;
  331    343   
                        }
  332         -
                    }
  333         -
                }
  334         -
                if let ::std::option::Option::Some(inner_29) = &_input.query_integer_enum {
  335         -
                    {
  336         -
                        query.push_kv("IntegerEnum", ::aws_smithy_types::primitive::Encoder::from(*inner_29).encode());
  337         -
                    }
  338         -
                }
  339         -
                if let ::std::option::Option::Some(inner_30) = &_input.query_integer_enum_list {
  340         -
                    {
  341         -
                        for inner_31 in inner_30 {
  342         -
                            query.push_kv("IntegerEnumList", ::aws_smithy_types::primitive::Encoder::from(*inner_31).encode());
         344  +
                        for item in v {
         345  +
                            query_params.push((k.clone(), item.clone()));
  343    346   
                        }
  344    347   
                    }
  345    348   
                }
  346         -
                ::std::result::Result::Ok(())
  347         -
            }
  348         -
            #[allow(clippy::unnecessary_wraps)]
  349         -
            fn update_http_builder(
  350         -
                input: &crate::operation::all_query_string_types::AllQueryStringTypesInput,
  351         -
                builder: ::http_1x::request::Builder,
  352         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  353         -
                let mut uri = ::std::string::String::new();
  354         -
                uri_base(input, &mut uri)?;
  355         -
                uri_query(input, &mut uri)?;
  356         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         349  +
                if !query_params.is_empty() {
         350  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         351  +
                    let pairs: Vec<String> = query_params
         352  +
                        .iter()
         353  +
                        .map(|(k, v)| {
         354  +
                            format!(
         355  +
                                "{}={}",
         356  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         357  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         358  +
                            )
         359  +
                        })
         360  +
                        .collect();
         361  +
                    uri.push_str(&pairs.join("&"));
         362  +
                }
         363  +
                request.set_uri(uri.as_str()).expect("valid URI");
  357    364   
            }
  358         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  359         -
            builder
  360         -
        };
  361         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  362    365   
  363         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         366  +
            return ::std::result::Result::Ok(request);
         367  +
        } else {
         368  +
            let mut request = protocol
         369  +
                .serialize_request(&input, AllQueryStringTypes::INPUT_SCHEMA, "", _cfg)
         370  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         371  +
         372  +
            return ::std::result::Result::Ok(request);
         373  +
        }
  364    374   
    }
  365    375   
}
  366    376   
#[derive(Debug)]
  367    377   
struct AllQueryStringTypesEndpointParamsInterceptor;
  368    378   
  369    379   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AllQueryStringTypesEndpointParamsInterceptor {
  370    380   
    fn name(&self) -> &'static str {
  371    381   
        "AllQueryStringTypesEndpointParamsInterceptor"
  372    382   
    }
  373    383   

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

@@ -138,138 +448,449 @@
  158    158   
    "aws.protocoltests.restjson.synthetic",
  159    159   
    "AllQueryStringTypesInput",
  160    160   
);
  161    161   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  162    162   
    ::aws_smithy_schema::ShapeId::from_static(
  163    163   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryString",
  164    164   
        "aws.protocoltests.restjson.synthetic",
  165    165   
        "AllQueryStringTypesInput",
  166    166   
    ),
  167    167   
    ::aws_smithy_schema::ShapeType::String,
  168         -
    "query_string",
         168  +
    "queryString",
  169    169   
    0,
  170    170   
)
  171    171   
.with_http_query("String");
  172    172   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  173    173   
    ::aws_smithy_schema::ShapeId::from_static(
  174    174   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryStringList",
  175    175   
        "aws.protocoltests.restjson.synthetic",
  176    176   
        "AllQueryStringTypesInput",
  177    177   
    ),
  178    178   
    ::aws_smithy_schema::ShapeType::List,
  179         -
    "query_string_list",
         179  +
    "queryStringList",
  180    180   
    1,
  181    181   
)
  182    182   
.with_http_query("StringList");
  183    183   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  184    184   
    ::aws_smithy_schema::ShapeId::from_static(
  185    185   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryStringSet",
  186    186   
        "aws.protocoltests.restjson.synthetic",
  187    187   
        "AllQueryStringTypesInput",
  188    188   
    ),
  189    189   
    ::aws_smithy_schema::ShapeType::List,
  190         -
    "query_string_set",
         190  +
    "queryStringSet",
  191    191   
    2,
  192    192   
)
  193    193   
.with_http_query("StringSet");
  194    194   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  195    195   
    ::aws_smithy_schema::ShapeId::from_static(
  196    196   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryByte",
  197    197   
        "aws.protocoltests.restjson.synthetic",
  198    198   
        "AllQueryStringTypesInput",
  199    199   
    ),
  200    200   
    ::aws_smithy_schema::ShapeType::Byte,
  201         -
    "query_byte",
         201  +
    "queryByte",
  202    202   
    3,
  203    203   
)
  204    204   
.with_http_query("Byte");
  205    205   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  206    206   
    ::aws_smithy_schema::ShapeId::from_static(
  207    207   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryShort",
  208    208   
        "aws.protocoltests.restjson.synthetic",
  209    209   
        "AllQueryStringTypesInput",
  210    210   
    ),
  211    211   
    ::aws_smithy_schema::ShapeType::Short,
  212         -
    "query_short",
         212  +
    "queryShort",
  213    213   
    4,
  214    214   
)
  215    215   
.with_http_query("Short");
  216    216   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  217    217   
    ::aws_smithy_schema::ShapeId::from_static(
  218    218   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryInteger",
  219    219   
        "aws.protocoltests.restjson.synthetic",
  220    220   
        "AllQueryStringTypesInput",
  221    221   
    ),
  222    222   
    ::aws_smithy_schema::ShapeType::Integer,
  223         -
    "query_integer",
         223  +
    "queryInteger",
  224    224   
    5,
  225    225   
)
  226    226   
.with_http_query("Integer");
  227    227   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  228    228   
    ::aws_smithy_schema::ShapeId::from_static(
  229    229   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryIntegerList",
  230    230   
        "aws.protocoltests.restjson.synthetic",
  231    231   
        "AllQueryStringTypesInput",
  232    232   
    ),
  233    233   
    ::aws_smithy_schema::ShapeType::List,
  234         -
    "query_integer_list",
         234  +
    "queryIntegerList",
  235    235   
    6,
  236    236   
)
  237    237   
.with_http_query("IntegerList");
  238    238   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  239    239   
    ::aws_smithy_schema::ShapeId::from_static(
  240    240   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryIntegerSet",
  241    241   
        "aws.protocoltests.restjson.synthetic",
  242    242   
        "AllQueryStringTypesInput",
  243    243   
    ),
  244    244   
    ::aws_smithy_schema::ShapeType::List,
  245         -
    "query_integer_set",
         245  +
    "queryIntegerSet",
  246    246   
    7,
  247    247   
)
  248    248   
.with_http_query("IntegerSet");
  249    249   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  250    250   
    ::aws_smithy_schema::ShapeId::from_static(
  251    251   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryLong",
  252    252   
        "aws.protocoltests.restjson.synthetic",
  253    253   
        "AllQueryStringTypesInput",
  254    254   
    ),
  255    255   
    ::aws_smithy_schema::ShapeType::Long,
  256         -
    "query_long",
         256  +
    "queryLong",
  257    257   
    8,
  258    258   
)
  259    259   
.with_http_query("Long");
  260    260   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  261    261   
    ::aws_smithy_schema::ShapeId::from_static(
  262    262   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryFloat",
  263    263   
        "aws.protocoltests.restjson.synthetic",
  264    264   
        "AllQueryStringTypesInput",
  265    265   
    ),
  266    266   
    ::aws_smithy_schema::ShapeType::Float,
  267         -
    "query_float",
         267  +
    "queryFloat",
  268    268   
    9,
  269    269   
)
  270    270   
.with_http_query("Float");
  271    271   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  272    272   
    ::aws_smithy_schema::ShapeId::from_static(
  273    273   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryDouble",
  274    274   
        "aws.protocoltests.restjson.synthetic",
  275    275   
        "AllQueryStringTypesInput",
  276    276   
    ),
  277    277   
    ::aws_smithy_schema::ShapeType::Double,
  278         -
    "query_double",
         278  +
    "queryDouble",
  279    279   
    10,
  280    280   
)
  281    281   
.with_http_query("Double");
  282    282   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_DOUBLE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  283    283   
    ::aws_smithy_schema::ShapeId::from_static(
  284    284   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryDoubleList",
  285    285   
        "aws.protocoltests.restjson.synthetic",
  286    286   
        "AllQueryStringTypesInput",
  287    287   
    ),
  288    288   
    ::aws_smithy_schema::ShapeType::List,
  289         -
    "query_double_list",
         289  +
    "queryDoubleList",
  290    290   
    11,
  291    291   
)
  292    292   
.with_http_query("DoubleList");
  293    293   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  294    294   
    ::aws_smithy_schema::ShapeId::from_static(
  295    295   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryBoolean",
  296    296   
        "aws.protocoltests.restjson.synthetic",
  297    297   
        "AllQueryStringTypesInput",
  298    298   
    ),
  299    299   
    ::aws_smithy_schema::ShapeType::Boolean,
  300         -
    "query_boolean",
         300  +
    "queryBoolean",
  301    301   
    12,
  302    302   
)
  303    303   
.with_http_query("Boolean");
  304    304   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  305    305   
    ::aws_smithy_schema::ShapeId::from_static(
  306    306   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryBooleanList",
  307    307   
        "aws.protocoltests.restjson.synthetic",
  308    308   
        "AllQueryStringTypesInput",
  309    309   
    ),
  310    310   
    ::aws_smithy_schema::ShapeType::List,
  311         -
    "query_boolean_list",
         311  +
    "queryBooleanList",
  312    312   
    13,
  313    313   
)
  314    314   
.with_http_query("BooleanList");
  315    315   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  316    316   
    ::aws_smithy_schema::ShapeId::from_static(
  317    317   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryTimestamp",
  318    318   
        "aws.protocoltests.restjson.synthetic",
  319    319   
        "AllQueryStringTypesInput",
  320    320   
    ),
  321    321   
    ::aws_smithy_schema::ShapeType::Timestamp,
  322         -
    "query_timestamp",
         322  +
    "queryTimestamp",
  323    323   
    14,
  324    324   
)
  325    325   
.with_http_query("Timestamp");
  326    326   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  327    327   
    ::aws_smithy_schema::ShapeId::from_static(
  328    328   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryTimestampList",
  329    329   
        "aws.protocoltests.restjson.synthetic",
  330    330   
        "AllQueryStringTypesInput",
  331    331   
    ),
  332    332   
    ::aws_smithy_schema::ShapeType::List,
  333         -
    "query_timestamp_list",
         333  +
    "queryTimestampList",
  334    334   
    15,
  335    335   
)
  336    336   
.with_http_query("TimestampList");
  337    337   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  338    338   
    ::aws_smithy_schema::ShapeId::from_static(
  339    339   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryEnum",
  340    340   
        "aws.protocoltests.restjson.synthetic",
  341    341   
        "AllQueryStringTypesInput",
  342    342   
    ),
  343    343   
    ::aws_smithy_schema::ShapeType::String,
  344         -
    "query_enum",
         344  +
    "queryEnum",
  345    345   
    16,
  346    346   
)
  347    347   
.with_http_query("Enum");
  348    348   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  349    349   
    ::aws_smithy_schema::ShapeId::from_static(
  350    350   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryEnumList",
  351    351   
        "aws.protocoltests.restjson.synthetic",
  352    352   
        "AllQueryStringTypesInput",
  353    353   
    ),
  354    354   
    ::aws_smithy_schema::ShapeType::List,
  355         -
    "query_enum_list",
         355  +
    "queryEnumList",
  356    356   
    17,
  357    357   
)
  358    358   
.with_http_query("EnumList");
  359    359   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  360    360   
    ::aws_smithy_schema::ShapeId::from_static(
  361    361   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryIntegerEnum",
  362    362   
        "aws.protocoltests.restjson.synthetic",
  363    363   
        "AllQueryStringTypesInput",
  364    364   
    ),
  365    365   
    ::aws_smithy_schema::ShapeType::Integer,
  366         -
    "query_integer_enum",
         366  +
    "queryIntegerEnum",
  367    367   
    18,
  368    368   
)
  369    369   
.with_http_query("IntegerEnum");
  370    370   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  371    371   
    ::aws_smithy_schema::ShapeId::from_static(
  372    372   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryIntegerEnumList",
  373    373   
        "aws.protocoltests.restjson.synthetic",
  374    374   
        "AllQueryStringTypesInput",
  375    375   
    ),
  376    376   
    ::aws_smithy_schema::ShapeType::List,
  377         -
    "query_integer_enum_list",
         377  +
    "queryIntegerEnumList",
  378    378   
    19,
  379    379   
)
  380    380   
.with_http_query("IntegerEnumList");
  381    381   
static ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_PARAMS_MAP_OF_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  382    382   
    ::aws_smithy_schema::ShapeId::from_static(
  383    383   
        "aws.protocoltests.restjson.synthetic#AllQueryStringTypesInput$queryParamsMapOfStringList",
  384    384   
        "aws.protocoltests.restjson.synthetic",
  385    385   
        "AllQueryStringTypesInput",
  386    386   
    ),
  387    387   
    ::aws_smithy_schema::ShapeType::Map,
  388         -
    "query_params_map_of_string_list",
         388  +
    "queryParamsMapOfStringList",
  389    389   
    20,
  390    390   
)
  391    391   
.with_http_query_params();
  392    392   
static ALLQUERYSTRINGTYPESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  393    393   
    ALLQUERYSTRINGTYPESINPUT_SCHEMA_ID,
  394    394   
    ::aws_smithy_schema::ShapeType::Structure,
  395    395   
    &[
  396    396   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING,
  397    397   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING_LIST,
  398    398   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_STRING_SET,
  399    399   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BYTE,
  400    400   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_SHORT,
  401    401   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER,
  402    402   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_LIST,
  403    403   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_SET,
  404    404   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_LONG,
  405    405   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_FLOAT,
  406    406   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_DOUBLE,
  407    407   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_DOUBLE_LIST,
  408    408   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BOOLEAN,
  409    409   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_BOOLEAN_LIST,
  410    410   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_TIMESTAMP,
  411    411   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_TIMESTAMP_LIST,
  412    412   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_ENUM,
  413    413   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_ENUM_LIST,
  414    414   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_ENUM,
  415    415   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_INTEGER_ENUM_LIST,
  416    416   
        &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_PARAMS_MAP_OF_STRING_LIST,
  417    417   
    ],
  418         -
);
         418  +
)
         419  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/AllQueryStringTypesInput", None));
  419    420   
impl AllQueryStringTypesInput {
  420    421   
    /// The schema for this shape.
  421    422   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ALLQUERYSTRINGTYPESINPUT_SCHEMA;
  422    423   
}
  423    424   
impl ::aws_smithy_schema::serde::SerializableStruct for AllQueryStringTypesInput {
  424    425   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  425    426   
    fn serialize_members(
  426    427   
        &self,
  427    428   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  428    429   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -537,538 +793,756 @@
  557    558   
                    Ok(())
  558    559   
                },
  559    560   
            )?;
  560    561   
        }
  561    562   
        if let Some(ref val) = self.query_params_map_of_string_list {
  562    563   
            ser.write_map(
  563    564   
                &ALLQUERYSTRINGTYPESINPUT_MEMBER_QUERY_PARAMS_MAP_OF_STRING_LIST,
  564    565   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  565    566   
                    for (key, value) in val {
  566    567   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  567         -
                        todo!("schema: unsupported map value type");
         568  +
         569  +
                        ser.write_list(
         570  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         571  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         572  +
                                for item in value {
         573  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         574  +
                                }
         575  +
                                Ok(())
         576  +
                            },
         577  +
                        )?;
  568    578   
                    }
  569    579   
                    Ok(())
  570    580   
                },
  571    581   
            )?;
  572    582   
        }
  573    583   
        Ok(())
  574    584   
    }
  575    585   
}
  576    586   
impl AllQueryStringTypesInput {
  577    587   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  578         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  579         -
        deserializer: &mut D,
         588  +
    pub fn deserialize(
         589  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  580    590   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  581    591   
        #[allow(unused_variables, unused_mut)]
  582    592   
        let mut builder = Self::builder();
  583    593   
        #[allow(
  584    594   
            unused_variables,
  585    595   
            unreachable_code,
  586    596   
            clippy::single_match,
  587    597   
            clippy::match_single_binding,
  588    598   
            clippy::diverging_sub_expression
  589    599   
        )]
  590         -
        deserializer.read_struct(&ALLQUERYSTRINGTYPESINPUT_SCHEMA, (), |_, member, deser| {
         600  +
        deserializer.read_struct(&ALLQUERYSTRINGTYPESINPUT_SCHEMA, &mut |member, deser| {
  591    601   
            match member.member_index() {
  592    602   
                Some(0) => {
  593    603   
                    builder.query_string = Some(deser.read_string(member)?);
  594    604   
                }
  595    605   
                Some(1) => {
  596         -
                    builder.query_string_list = Some({
  597         -
                        let container = if let Some(cap) = deser.container_size() {
  598         -
                            Vec::with_capacity(cap)
  599         -
                        } else {
  600         -
                            Vec::new()
  601         -
                        };
  602         -
                        deser.read_list(member, container, |mut list, deser| {
  603         -
                            list.push(deser.read_string(member)?);
  604         -
                            Ok(list)
  605         -
                        })?
  606         -
                    });
         606  +
                    builder.query_string_list = Some(deser.read_string_list(member)?);
  607    607   
                }
  608    608   
                Some(2) => {
  609         -
                    builder.query_string_set = Some({
  610         -
                        let container = if let Some(cap) = deser.container_size() {
  611         -
                            Vec::with_capacity(cap)
  612         -
                        } else {
  613         -
                            Vec::new()
  614         -
                        };
  615         -
                        deser.read_list(member, container, |mut list, deser| {
  616         -
                            list.push(deser.read_string(member)?);
  617         -
                            Ok(list)
  618         -
                        })?
  619         -
                    });
         609  +
                    builder.query_string_set = Some(deser.read_string_list(member)?);
  620    610   
                }
  621    611   
                Some(3) => {
  622    612   
                    builder.query_byte = Some(deser.read_byte(member)?);
  623    613   
                }
  624    614   
                Some(4) => {
  625    615   
                    builder.query_short = Some(deser.read_short(member)?);
  626    616   
                }
  627    617   
                Some(5) => {
  628    618   
                    builder.query_integer = Some(deser.read_integer(member)?);
  629    619   
                }
  630    620   
                Some(6) => {
  631         -
                    builder.query_integer_list = Some({
  632         -
                        let container = if let Some(cap) = deser.container_size() {
  633         -
                            Vec::with_capacity(cap)
  634         -
                        } else {
  635         -
                            Vec::new()
  636         -
                        };
  637         -
                        deser.read_list(member, container, |mut list, deser| {
  638         -
                            list.push(deser.read_integer(member)?);
  639         -
                            Ok(list)
  640         -
                        })?
  641         -
                    });
         621  +
                    builder.query_integer_list = Some(deser.read_integer_list(member)?);
  642    622   
                }
  643    623   
                Some(7) => {
  644         -
                    builder.query_integer_set = Some({
  645         -
                        let container = if let Some(cap) = deser.container_size() {
  646         -
                            Vec::with_capacity(cap)
  647         -
                        } else {
  648         -
                            Vec::new()
  649         -
                        };
  650         -
                        deser.read_list(member, container, |mut list, deser| {
  651         -
                            list.push(deser.read_integer(member)?);
  652         -
                            Ok(list)
  653         -
                        })?
  654         -
                    });
         624  +
                    builder.query_integer_set = Some(deser.read_integer_list(member)?);
  655    625   
                }
  656    626   
                Some(8) => {
  657    627   
                    builder.query_long = Some(deser.read_long(member)?);
  658    628   
                }
  659    629   
                Some(9) => {
  660    630   
                    builder.query_float = Some(deser.read_float(member)?);
  661    631   
                }
  662    632   
                Some(10) => {
  663    633   
                    builder.query_double = Some(deser.read_double(member)?);
  664    634   
                }
  665    635   
                Some(11) => {
  666    636   
                    builder.query_double_list = Some({
  667         -
                        let container = if let Some(cap) = deser.container_size() {
  668         -
                            Vec::with_capacity(cap)
  669         -
                        } else {
  670         -
                            Vec::new()
  671         -
                        };
  672         -
                        deser.read_list(member, container, |mut list, deser| {
  673         -
                            list.push(deser.read_double(member)?);
  674         -
                            Ok(list)
  675         -
                        })?
         637  +
                        let mut container = Vec::new();
         638  +
                        deser.read_list(member, &mut |deser| {
         639  +
                            container.push(deser.read_double(member)?);
         640  +
                            Ok(())
         641  +
                        })?;
         642  +
                        container
  676    643   
                    });
  677    644   
                }
  678    645   
                Some(12) => {
  679    646   
                    builder.query_boolean = Some(deser.read_boolean(member)?);
  680    647   
                }
  681    648   
                Some(13) => {
  682    649   
                    builder.query_boolean_list = Some({
  683         -
                        let container = if let Some(cap) = deser.container_size() {
  684         -
                            Vec::with_capacity(cap)
  685         -
                        } else {
  686         -
                            Vec::new()
  687         -
                        };
  688         -
                        deser.read_list(member, container, |mut list, deser| {
  689         -
                            list.push(deser.read_boolean(member)?);
  690         -
                            Ok(list)
  691         -
                        })?
         650  +
                        let mut container = Vec::new();
         651  +
                        deser.read_list(member, &mut |deser| {
         652  +
                            container.push(deser.read_boolean(member)?);
         653  +
                            Ok(())
         654  +
                        })?;
         655  +
                        container
  692    656   
                    });
  693    657   
                }
  694    658   
                Some(14) => {
  695    659   
                    builder.query_timestamp = Some(deser.read_timestamp(member)?);
  696    660   
                }
  697    661   
                Some(15) => {
  698    662   
                    builder.query_timestamp_list = Some({
  699         -
                        let container = if let Some(cap) = deser.container_size() {
  700         -
                            Vec::with_capacity(cap)
  701         -
                        } else {
  702         -
                            Vec::new()
  703         -
                        };
  704         -
                        deser.read_list(member, container, |mut list, deser| {
  705         -
                            list.push(deser.read_timestamp(member)?);
  706         -
                            Ok(list)
  707         -
                        })?
         663  +
                        let mut container = Vec::new();
         664  +
                        deser.read_list(member, &mut |deser| {
         665  +
                            container.push(deser.read_timestamp(member)?);
         666  +
                            Ok(())
         667  +
                        })?;
         668  +
                        container
  708    669   
                    });
  709    670   
                }
  710    671   
                Some(16) => {
  711    672   
                    builder.query_enum = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  712    673   
                }
  713    674   
                Some(17) => {
  714    675   
                    builder.query_enum_list = Some({
  715         -
                        let container = if let Some(cap) = deser.container_size() {
  716         -
                            Vec::with_capacity(cap)
  717         -
                        } else {
  718         -
                            Vec::new()
  719         -
                        };
  720         -
                        deser.read_list(member, container, |mut list, deser| {
  721         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  722         -
                            Ok(list)
  723         -
                        })?
         676  +
                        let mut container = Vec::new();
         677  +
                        deser.read_list(member, &mut |deser| {
         678  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         679  +
                            Ok(())
         680  +
                        })?;
         681  +
                        container
  724    682   
                    });
  725    683   
                }
  726    684   
                Some(18) => {
  727    685   
                    builder.query_integer_enum = Some(deser.read_integer(member)?);
  728    686   
                }
  729    687   
                Some(19) => {
  730         -
                    builder.query_integer_enum_list = Some({
  731         -
                        let container = if let Some(cap) = deser.container_size() {
  732         -
                            Vec::with_capacity(cap)
  733         -
                        } else {
  734         -
                            Vec::new()
  735         -
                        };
  736         -
                        deser.read_list(member, container, |mut list, deser| {
  737         -
                            list.push(deser.read_integer(member)?);
  738         -
                            Ok(list)
  739         -
                        })?
  740         -
                    });
         688  +
                    builder.query_integer_enum_list = Some(deser.read_integer_list(member)?);
  741    689   
                }
  742    690   
                Some(20) => {
  743    691   
                    builder.query_params_map_of_string_list = Some({
  744         -
                        let container = if let Some(cap) = deser.container_size() {
  745         -
                            std::collections::HashMap::with_capacity(cap)
  746         -
                        } else {
  747         -
                            std::collections::HashMap::new()
  748         -
                        };
  749         -
                        deser.read_map(member, container, |mut map, key, deser| {
  750         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  751         -
                            Ok(map)
  752         -
                        })?
         692  +
                        let mut container = std::collections::HashMap::new();
         693  +
                        deser.read_map(member, &mut |key, deser| {
         694  +
                            container.insert(key, {
         695  +
                                let mut list = Vec::new();
         696  +
                                deser.read_list(member, &mut |deser| {
         697  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         698  +
                                    Ok(())
         699  +
                                })?;
         700  +
                                list
         701  +
                            });
         702  +
                            Ok(())
         703  +
                        })?;
         704  +
                        container
  753    705   
                    });
  754    706   
                }
  755    707   
                _ => {}
  756    708   
            }
  757    709   
            Ok(())
  758    710   
        })?;
  759    711   
        builder
  760    712   
            .build()
  761    713   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  762    714   
    }
  763    715   
}
         716  +
impl AllQueryStringTypesInput {
         717  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         718  +
    pub fn deserialize_with_response(
         719  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         720  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         721  +
        _status: u16,
         722  +
        _body: &[u8],
         723  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         724  +
        Self::deserialize(deserializer)
         725  +
    }
         726  +
}
  764    727   
impl AllQueryStringTypesInput {
  765    728   
    /// Creates a new builder-style object to manufacture [`AllQueryStringTypesInput`](crate::operation::all_query_string_types::AllQueryStringTypesInput).
  766    729   
    pub fn builder() -> crate::operation::all_query_string_types::builders::AllQueryStringTypesInputBuilder {
  767    730   
        crate::operation::all_query_string_types::builders::AllQueryStringTypesInputBuilder::default()
  768    731   
    }
  769    732   
}
  770    733   
  771    734   
/// A builder for [`AllQueryStringTypesInput`](crate::operation::all_query_string_types::AllQueryStringTypesInput).
  772    735   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  773    736   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/all_query_string_types/_all_query_string_types_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 AllQueryStringTypesOutput {
   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(&ALLQUERYSTRINGTYPESOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&ALLQUERYSTRINGTYPESOUTPUT_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 AllQueryStringTypesOutput {
          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 AllQueryStringTypesOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`AllQueryStringTypesOutput`](crate::operation::all_query_string_types::AllQueryStringTypesOutput).
   51     62   
    pub fn builder() -> crate::operation::all_query_string_types::builders::AllQueryStringTypesOutputBuilder {
   52     63   
        crate::operation::all_query_string_types::builders::AllQueryStringTypesOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`AllQueryStringTypesOutput`](crate::operation::all_query_string_types::AllQueryStringTypesOutput).
   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/constant_and_variable_query_string.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ConstantAndVariableQueryString`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ConstantAndVariableQueryString;
    6      6   
impl ConstantAndVariableQueryString {
    7      7   
    /// Creates a new `ConstantAndVariableQueryString`
    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::constant_and_variable_query_string::ConstantAndVariableQueryStringInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringOutput::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::constant_and_variable_query_string::ConstantAndVariableQueryStringInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +249,274 @@
  130    136   
                crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringError,
  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 ConstantAndVariableQueryStringResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ConstantAndVariableQueryStringResponseDeserializer {
  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());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         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  +
            })?;
         162  +
         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::constant_and_variable_query_string::ConstantAndVariableQueryStringError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_response(
  154         -
                status, headers, body,
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, ConstantAndVariableQueryString::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::constant_and_variable_query_string::ConstantAndVariableQueryStringOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  155    184   
            )
  156         -
        };
  157         -
        crate::protocol_serde::type_erase_result(parse_result)
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  158    190   
    }
  159    191   
}
  160    192   
#[derive(Debug)]
  161    193   
struct ConstantAndVariableQueryStringRequestSerializer;
  162    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ConstantAndVariableQueryStringRequestSerializer {
  163    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  164    196   
    fn serialize_input(
  165    197   
        &self,
  166    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  167    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  168    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  169    201   
        let input = input
  170    202   
            .downcast::<crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringInput>()
  171    203   
            .expect("correct type");
  172         -
        let _header_serialization_settings = _cfg
  173         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  174         -
            .cloned()
  175         -
            .unwrap_or_default();
  176         -
        let mut request_builder = {
  177         -
            #[allow(clippy::uninlined_format_args)]
  178         -
            fn uri_base(
  179         -
                _input: &crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringInput,
  180         -
                output: &mut ::std::string::String,
  181         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182         -
                use ::std::fmt::Write as _;
  183         -
                ::std::write!(output, "/ConstantAndVariableQueryString").expect("formatting should succeed");
  184         -
                ::std::result::Result::Ok(())
  185         -
            }
  186         -
            fn uri_query(
  187         -
                _input: &crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringInput,
  188         -
                mut output: &mut ::std::string::String,
  189         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  190         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  191         -
                query.push_kv("foo", "bar");
  192         -
                if let ::std::option::Option::Some(inner_1) = &_input.baz {
  193         -
                    {
  194         -
                        query.push_kv("baz", &::aws_smithy_http::query::fmt_string(inner_1));
  195         -
                    }
         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, ConstantAndVariableQueryString::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/ConstantAndVariableQueryString?foo=bar".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.baz {
         215  +
                    query_params.push(("baz".to_string(), val.to_string()));
  196    216   
                }
  197         -
                if let ::std::option::Option::Some(inner_2) = &_input.maybe_set {
  198         -
                    {
  199         -
                        query.push_kv("maybeSet", &::aws_smithy_http::query::fmt_string(inner_2));
  200         -
                    }
         217  +
                if let Some(ref val) = input.maybe_set {
         218  +
                    query_params.push(("maybeSet".to_string(), val.to_string()));
  201    219   
                }
  202         -
                ::std::result::Result::Ok(())
  203         -
            }
  204         -
            #[allow(clippy::unnecessary_wraps)]
  205         -
            fn update_http_builder(
  206         -
                input: &crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringInput,
  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("GET").uri(uri))
         220  +
                if !query_params.is_empty() {
         221  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         222  +
                    let pairs: Vec<String> = query_params
         223  +
                        .iter()
         224  +
                        .map(|(k, v)| {
         225  +
                            format!(
         226  +
                                "{}={}",
         227  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         228  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         229  +
                            )
         230  +
                        })
         231  +
                        .collect();
         232  +
                    uri.push_str(&pairs.join("&"));
         233  +
                }
         234  +
                request.set_uri(uri.as_str()).expect("valid URI");
  213    235   
            }
  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    236   
  219         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         237  +
            return ::std::result::Result::Ok(request);
         238  +
        } else {
         239  +
            let mut request = protocol
         240  +
                .serialize_request(&input, ConstantAndVariableQueryString::INPUT_SCHEMA, "", _cfg)
         241  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         242  +
         243  +
            return ::std::result::Result::Ok(request);
         244  +
        }
  220    245   
    }
  221    246   
}
  222    247   
#[derive(Debug)]
  223    248   
struct ConstantAndVariableQueryStringEndpointParamsInterceptor;
  224    249   
  225    250   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ConstantAndVariableQueryStringEndpointParamsInterceptor {
  226    251   
    fn name(&self) -> &'static str {
  227    252   
        "ConstantAndVariableQueryStringEndpointParamsInterceptor"
  228    253   
    }
  229    254