Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/types/_something_else.rs

@@ -24,24 +220,222 @@
   44     44   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse", "naming_obs_structs", "SomethingElse");
   45     45   
static SOMETHINGELSE_MEMBER_RESULT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   46     46   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse$result", "naming_obs_structs", "SomethingElse"),
   47     47   
    ::aws_smithy_schema::ShapeType::Structure,
   48     48   
    "result",
   49     49   
    0,
   50     50   
);
   51     51   
static SOMETHINGELSE_MEMBER_RESULT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   52     52   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse$resultList", "naming_obs_structs", "SomethingElse"),
   53     53   
    ::aws_smithy_schema::ShapeType::List,
   54         -
    "result_list",
          54  +
    "resultList",
   55     55   
    1,
   56     56   
);
   57     57   
static SOMETHINGELSE_MEMBER_OPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   58     58   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse$option", "naming_obs_structs", "SomethingElse"),
   59     59   
    ::aws_smithy_schema::ShapeType::Structure,
   60     60   
    "option",
   61     61   
    2,
   62     62   
);
   63     63   
static SOMETHINGELSE_MEMBER_OPTION_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   64     64   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse$optionList", "naming_obs_structs", "SomethingElse"),
   65     65   
    ::aws_smithy_schema::ShapeType::List,
   66         -
    "option_list",
          66  +
    "optionList",
   67     67   
    3,
   68     68   
);
   69     69   
static SOMETHINGELSE_MEMBER_SOME_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   70     70   
    ::aws_smithy_schema::ShapeId::from_static("naming_obs_structs#SomethingElse$someUnion", "naming_obs_structs", "SomethingElse"),
   71     71   
    ::aws_smithy_schema::ShapeType::Union,
   72         -
    "some_union",
          72  +
    "someUnion",
   73     73   
    4,
   74     74   
);
   75     75   
static SOMETHINGELSE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   76     76   
    SOMETHINGELSE_SCHEMA_ID,
   77     77   
    ::aws_smithy_schema::ShapeType::Structure,
   78     78   
    &[
   79     79   
        &SOMETHINGELSE_MEMBER_RESULT,
   80     80   
        &SOMETHINGELSE_MEMBER_RESULT_LIST,
   81     81   
        &SOMETHINGELSE_MEMBER_OPTION,
   82     82   
        &SOMETHINGELSE_MEMBER_OPTION_LIST,
   83     83   
        &SOMETHINGELSE_MEMBER_SOME_UNION,
   84     84   
    ],
   85     85   
);
   86     86   
impl SomethingElse {
   87     87   
    /// The schema for this shape.
   88     88   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SOMETHINGELSE_SCHEMA;
   89     89   
}
   90     90   
impl ::aws_smithy_schema::serde::SerializableStruct for SomethingElse {
   91     91   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   92     92   
    fn serialize_members(
   93     93   
        &self,
   94     94   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   95     95   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   96     96   
        if let Some(ref val) = self.result {
   97     97   
            ser.write_struct(&SOMETHINGELSE_MEMBER_RESULT, val)?;
   98     98   
        }
   99     99   
        if let Some(ref val) = self.result_list {
  100    100   
            ser.write_list(
  101    101   
                &SOMETHINGELSE_MEMBER_RESULT_LIST,
  102    102   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  103    103   
                    for item in val {
  104    104   
                        ser.write_struct(crate::types::Result::SCHEMA, item)?;
  105    105   
                    }
  106    106   
                    Ok(())
  107    107   
                },
  108    108   
            )?;
  109    109   
        }
  110    110   
        if let Some(ref val) = self.option {
  111    111   
            ser.write_struct(&SOMETHINGELSE_MEMBER_OPTION, val)?;
  112    112   
        }
  113    113   
        if let Some(ref val) = self.option_list {
  114    114   
            ser.write_list(
  115    115   
                &SOMETHINGELSE_MEMBER_OPTION_LIST,
  116    116   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  117    117   
                    for item in val {
  118    118   
                        ser.write_struct(crate::types::Result::SCHEMA, item)?;
  119    119   
                    }
  120    120   
                    Ok(())
  121    121   
                },
  122    122   
            )?;
  123    123   
        }
  124    124   
        if let Some(ref val) = self.some_union {
  125         -
            ser.write_null(&SOMETHINGELSE_MEMBER_SOME_UNION)?;
         125  +
            ser.write_struct(&SOMETHINGELSE_MEMBER_SOME_UNION, val)?;
  126    126   
        }
  127    127   
        Ok(())
  128    128   
    }
  129    129   
}
  130    130   
impl SomethingElse {
  131    131   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  132         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  133         -
        deserializer: &mut D,
         132  +
    pub fn deserialize(
         133  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  134    134   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  135    135   
        #[allow(unused_variables, unused_mut)]
  136    136   
        let mut builder = Self::builder();
  137    137   
        #[allow(
  138    138   
            unused_variables,
  139    139   
            unreachable_code,
  140    140   
            clippy::single_match,
  141    141   
            clippy::match_single_binding,
  142    142   
            clippy::diverging_sub_expression
  143    143   
        )]
  144         -
        deserializer.read_struct(&SOMETHINGELSE_SCHEMA, (), |_, member, deser| {
         144  +
        deserializer.read_struct(&SOMETHINGELSE_SCHEMA, &mut |member, deser| {
  145    145   
            match member.member_index() {
  146    146   
                Some(0) => {
  147    147   
                    builder.result = Some(crate::types::Result::deserialize(deser)?);
  148    148   
                }
  149    149   
                Some(1) => {
  150    150   
                    builder.result_list = Some({
  151         -
                        let container = if let Some(cap) = deser.container_size() {
  152         -
                            Vec::with_capacity(cap)
  153         -
                        } else {
  154         -
                            Vec::new()
  155         -
                        };
  156         -
                        deser.read_list(member, container, |mut list, deser| {
  157         -
                            list.push(crate::types::Result::deserialize(deser)?);
  158         -
                            Ok(list)
  159         -
                        })?
         151  +
                        let mut container = Vec::new();
         152  +
                        deser.read_list(member, &mut |deser| {
         153  +
                            container.push(crate::types::Result::deserialize(deser)?);
         154  +
                            Ok(())
         155  +
                        })?;
         156  +
                        container
  160    157   
                    });
  161    158   
                }
  162    159   
                Some(2) => {
  163    160   
                    builder.option = Some(crate::types::Option::deserialize(deser)?);
  164    161   
                }
  165    162   
                Some(3) => {
  166    163   
                    builder.option_list = Some({
  167         -
                        let container = if let Some(cap) = deser.container_size() {
  168         -
                            Vec::with_capacity(cap)
  169         -
                        } else {
  170         -
                            Vec::new()
  171         -
                        };
  172         -
                        deser.read_list(member, container, |mut list, deser| {
  173         -
                            list.push(crate::types::Result::deserialize(deser)?);
  174         -
                            Ok(list)
  175         -
                        })?
         164  +
                        let mut container = Vec::new();
         165  +
                        deser.read_list(member, &mut |deser| {
         166  +
                            container.push(crate::types::Result::deserialize(deser)?);
         167  +
                            Ok(())
         168  +
                        })?;
         169  +
                        container
  176    170   
                    });
  177    171   
                }
  178    172   
                Some(4) => {
  179         -
                    builder.some_union = Some({
  180         -
                        let _ = member;
  181         -
                        todo!("deserialize aggregate")
  182         -
                    });
         173  +
                    builder.some_union = Some(crate::types::SomeUnion::deserialize(deser)?);
  183    174   
                }
  184    175   
                _ => {}
  185    176   
            }
  186    177   
            Ok(())
  187    178   
        })?;
  188    179   
        Ok(builder.build())
  189    180   
    }
  190    181   
}
         182  +
impl SomethingElse {
         183  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         184  +
    pub fn deserialize_with_response(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         186  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         187  +
        _status: u16,
         188  +
        _body: &[u8],
         189  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         190  +
        Self::deserialize(deserializer)
         191  +
    }
         192  +
}
  191    193   
impl SomethingElse {
  192    194   
    /// Creates a new builder-style object to manufacture [`SomethingElse`](crate::types::SomethingElse).
  193    195   
    pub fn builder() -> crate::types::builders::SomethingElseBuilder {
  194    196   
        crate::types::builders::SomethingElseBuilder::default()
  195    197   
    }
  196    198   
}
  197    199   
  198    200   
/// A builder for [`SomethingElse`](crate::types::SomethingElse).
  199    201   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  200    202   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/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 pokemon_service_awsjson_client::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("PokemonService");
        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("PokemonService"),
        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/pokemon-service-awsjson-client/rust-client-codegen/src/lib.rs

@@ -83,83 +119,117 @@
  103    103   
  104    104   
mod event_stream_serde;
  105    105   
  106    106   
/// All operations that this crate can perform.
  107    107   
pub mod operation;
  108    108   
  109    109   
pub(crate) mod protocol_serde;
  110    110   
  111    111   
mod sdk_feature_tracker;
  112    112   
  113         -
mod serialization_settings;
         113  +
mod json_errors;
  114    114   
  115    115   
mod serde_util;
  116    116   
  117         -
mod json_errors;
  118         -
  119    117   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon.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 `CapturePokemon`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CapturePokemon;
    6      6   
impl CapturePokemon {
    7      7   
    /// Creates a new `CapturePokemon`
    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::capture_pokemon::CapturePokemonInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::capture_pokemon::CapturePokemonOutput::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::capture_pokemon::CapturePokemonInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::capture_pokemon::CapturePokemonOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::capture_pokemon::CapturePokemonError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -119,123 +251,369 @@
  139    143   
  140    144   
        // If this is an error, defer to the non-streaming parser
  141    145   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  142    146   
            return ::std::option::Option::None;
  143    147   
        }
  144    148   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  145    149   
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_response(response),
  146    150   
        ))
  147    151   
    }
  148    152   
  149         -
    fn deserialize_nonstreaming(
         153  +
    fn deserialize_nonstreaming_with_config(
  150    154   
        &self,
  151    155   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         156  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  152    157   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  153    158   
        // For streaming operations, we only hit this case if its an error
  154    159   
        let body = response.body().bytes().expect("body loaded");
  155         -
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_error(
  156         -
            response.status().as_u16(),
         160  +
        let status = response.status().as_u16();
         161  +
        let headers = response.headers();
         162  +
        #[allow(unused_mut)]
         163  +
        let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         164  +
            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         165  +
        })?;
         166  +
         167  +
        let generic = generic_builder.build();
         168  +
        let error_code = match generic.code() {
         169  +
            ::std::option::Option::Some(code) => code,
         170  +
            ::std::option::Option::None => {
         171  +
                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         172  +
                    ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::capture_pokemon::CapturePokemonError::unhandled(generic)),
         173  +
                ))
         174  +
            }
         175  +
        };
         176  +
        let _error_message = generic.message().map(|msg| msg.to_owned());
         177  +
        let protocol = _cfg
         178  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         179  +
            .expect("a SharedClientProtocol is required");
         180  +
        let err = match error_code {
         181  +
            "UnsupportedRegionError" => crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError({
         182  +
                let mut tmp = match protocol
         183  +
                    .deserialize_response(response, crate::types::error::UnsupportedRegionError::SCHEMA, _cfg)
         184  +
                    .and_then(|mut deser| {
         185  +
                        crate::types::error::UnsupportedRegionError::deserialize_with_response(
         186  +
                            &mut *deser,
         187  +
                            response.headers(),
         188  +
                            response.status().into(),
         189  +
                            body,
         190  +
                        )
         191  +
                    }) {
         192  +
                    ::std::result::Result::Ok(val) => val,
         193  +
                    ::std::result::Result::Err(e) => {
         194  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         195  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         196  +
                        ))
         197  +
                    }
         198  +
                };
         199  +
                tmp.meta = generic;
         200  +
                if tmp.message.is_none() {
         201  +
                    tmp.message = _error_message;
         202  +
                }
         203  +
                tmp
         204  +
            }),
         205  +
            "ThrottlingError" => crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError({
         206  +
                let mut tmp = match protocol
         207  +
                    .deserialize_response(response, crate::types::error::ThrottlingError::SCHEMA, _cfg)
         208  +
                    .and_then(|mut deser| {
         209  +
                        crate::types::error::ThrottlingError::deserialize_with_response(
         210  +
                            &mut *deser,
         211  +
                            response.headers(),
         212  +
                            response.status().into(),
         213  +
                            body,
         214  +
                        )
         215  +
                    }) {
         216  +
                    ::std::result::Result::Ok(val) => val,
         217  +
                    ::std::result::Result::Err(e) => {
         218  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         219  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         220  +
                        ))
         221  +
                    }
         222  +
                };
         223  +
                tmp.meta = generic;
         224  +
                if tmp.message.is_none() {
         225  +
                    tmp.message = _error_message;
         226  +
                }
         227  +
                tmp
         228  +
            }),
         229  +
            "ValidationException" => crate::operation::capture_pokemon::CapturePokemonError::ValidationError({
         230  +
                let mut tmp = match protocol
         231  +
                    .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         232  +
                    .and_then(|mut deser| {
         233  +
                        crate::types::error::ValidationError::deserialize_with_response(
         234  +
                            &mut *deser,
         235  +
                            response.headers(),
         236  +
                            response.status().into(),
         237  +
                            body,
         238  +
                        )
         239  +
                    }) {
         240  +
                    ::std::result::Result::Ok(val) => val,
         241  +
                    ::std::result::Result::Err(e) => {
         242  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         243  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         244  +
                        ))
         245  +
                    }
         246  +
                };
         247  +
                tmp.meta = generic;
         248  +
                tmp
         249  +
            }),
         250  +
            "MasterBallUnsuccessful" => crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful({
         251  +
                let mut tmp = match protocol
         252  +
                    .deserialize_response(response, crate::types::error::MasterBallUnsuccessful::SCHEMA, _cfg)
         253  +
                    .and_then(|mut deser| {
         254  +
                        crate::types::error::MasterBallUnsuccessful::deserialize_with_response(
         255  +
                            &mut *deser,
  157    256   
                            response.headers(),
         257  +
                            response.status().into(),
  158    258   
                            body,
         259  +
                        )
         260  +
                    }) {
         261  +
                    ::std::result::Result::Ok(val) => val,
         262  +
                    ::std::result::Result::Err(e) => {
         263  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         264  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         265  +
                        ))
         266  +
                    }
         267  +
                };
         268  +
                tmp.meta = generic;
         269  +
                if tmp.message.is_none() {
         270  +
                    tmp.message = _error_message;
         271  +
                }
         272  +
                tmp
         273  +
            }),
         274  +
            "InvalidPokeballError" => crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError({
         275  +
                let mut tmp = match protocol
         276  +
                    .deserialize_response(response, crate::types::error::InvalidPokeballError::SCHEMA, _cfg)
         277  +
                    .and_then(|mut deser| {
         278  +
                        crate::types::error::InvalidPokeballError::deserialize_with_response(
         279  +
                            &mut *deser,
         280  +
                            response.headers(),
         281  +
                            response.status().into(),
         282  +
                            body,
         283  +
                        )
         284  +
                    }) {
         285  +
                    ::std::result::Result::Ok(val) => val,
         286  +
                    ::std::result::Result::Err(e) => {
         287  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         288  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         289  +
                        ))
         290  +
                    }
         291  +
                };
         292  +
                tmp.meta = generic;
         293  +
                if tmp.message.is_none() {
         294  +
                    tmp.message = _error_message;
         295  +
                }
         296  +
                tmp
         297  +
            }),
         298  +
            _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic),
         299  +
        };
         300  +
        ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         301  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
  159    302   
        ))
  160    303   
    }
  161    304   
}
  162    305   
#[derive(Debug)]
  163    306   
struct CapturePokemonRequestSerializer;
  164    307   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CapturePokemonRequestSerializer {
  165    308   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    309   
    fn serialize_input(
  167    310   
        &self,
  168    311   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    312   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    313   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    314   
        let input = input
  172    315   
            .downcast::<crate::operation::capture_pokemon::CapturePokemonInput>()
  173    316   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::capture_pokemon::CapturePokemonInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                ::std::write!(output, "/").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::capture_pokemon::CapturePokemonInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  196         -
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  199         -
            builder = _header_serialization_settings.set_default_header(
  200         -
                builder,
  201         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  202         -
                "PokemonService.CapturePokemon",
  203         -
            );
  204         -
            builder
  205         -
        };
  206         -
        let body = ::aws_smithy_types::body::SdkBody::from({
         317  +
        let protocol = _cfg
         318  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         319  +
            .expect("a SharedClientProtocol is required");
         320  +
        let mut request = protocol
         321  +
            .serialize_request(&input, CapturePokemon::INPUT_SCHEMA, "", _cfg)
         322  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         323  +
        *request.body_mut() = ::aws_smithy_types::body::SdkBody::from({
  207    324   
            let error_marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventErrorMarshaller::new();
  208    325   
            let marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventMarshaller::new();
  209    326   
            let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
  210    327   
            _cfg.interceptor_state().store_put(signer_sender);
  211    328   
            ::aws_smithy_types::body::SdkBody::from_body_1_x(::http_body_util::StreamBody::new(input.events.into_body_stream(
  212    329   
                marshaller,
  213    330   
                error_marshaller,
  214    331   
                signer,
  215    332   
            )))
  216    333   
        });
  217         -
        if let Some(content_length) = body.content_length() {
  218         -
            let content_length = content_length.to_string();
  219         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  220         -
        }
  221         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         334  +
        // The protocol may have set Content-Length based on the initial empty body.
         335  +
        // Remove it since the event stream body has unknown length.
         336  +
        request.headers_mut().remove("Content-Length");
         337  +
        request.headers_mut().insert("Content-Type", "application/x-amz-json-1.0");
         338  +
         339  +
        return ::std::result::Result::Ok(request);
  222    340   
    }
  223    341   
}
  224    342   
#[derive(Debug)]
  225    343   
struct CapturePokemonEndpointParamsInterceptor;
  226    344   
  227    345   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CapturePokemonEndpointParamsInterceptor {
  228    346   
    fn name(&self) -> &'static str {
  229    347   
        "CapturePokemonEndpointParamsInterceptor"
  230    348   
    }
  231    349   

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/_capture_pokemon_input.rs

@@ -23,23 +120,127 @@
   43     43   
impl CapturePokemonInput {
   44     44   
    /// The schema for this shape.
   45     45   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CAPTUREPOKEMONINPUT_SCHEMA;
   46     46   
}
   47     47   
impl ::aws_smithy_schema::serde::SerializableStruct for CapturePokemonInput {
   48     48   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   49     49   
    fn serialize_members(
   50     50   
        &self,
   51     51   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   52     52   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   53         -
        {
   54         -
            let val = &self.events;
   55         -
            ser.write_null(&CAPTUREPOKEMONINPUT_MEMBER_EVENTS)?;
   56         -
        }
   57     53   
        Ok(())
   58     54   
    }
   59     55   
}
   60     56   
impl CapturePokemonInput {
   61     57   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   62         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   63         -
        deserializer: &mut D,
          58  +
    pub fn deserialize(
          59  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   64     60   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   65     61   
        #[allow(unused_variables, unused_mut)]
   66     62   
        let mut builder = Self::builder();
   67     63   
        #[allow(
   68     64   
            unused_variables,
   69     65   
            unreachable_code,
   70     66   
            clippy::single_match,
   71     67   
            clippy::match_single_binding,
   72     68   
            clippy::diverging_sub_expression
   73     69   
        )]
   74         -
        deserializer.read_struct(&CAPTUREPOKEMONINPUT_SCHEMA, (), |_, member, deser| {
          70  +
        deserializer.read_struct(&CAPTUREPOKEMONINPUT_SCHEMA, &mut |member, deser| {
   75     71   
            match member.member_index() {
   76     72   
                Some(0) => {
   77     73   
                    builder.events = Some({
   78     74   
                        let _ = member;
   79         -
                        todo!("deserialize aggregate")
          75  +
                        todo!("deserialize streaming union")
   80     76   
                    });
   81     77   
                }
   82     78   
                _ => {}
   83     79   
            }
   84     80   
            Ok(())
   85     81   
        })?;
   86     82   
        builder
   87     83   
            .build()
   88     84   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   89     85   
    }
   90     86   
}
          87  +
impl CapturePokemonInput {
          88  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          89  +
    pub fn deserialize_with_response(
          90  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          91  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          92  +
        _status: u16,
          93  +
        _body: &[u8],
          94  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          95  +
        Self::deserialize(deserializer)
          96  +
    }
          97  +
}
   91     98   
impl CapturePokemonInput {
   92     99   
    /// Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
   93    100   
    pub fn builder() -> crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
   94    101   
        crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder::default()
   95    102   
    }
   96    103   
    #[allow(unused)]
   97    104   
    pub(crate) fn into_builder(self) -> crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
   98    105   
        Self::builder().events(self.events)
   99    106   
    }
  100    107   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/_capture_pokemon_output.rs

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

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_input.rs

@@ -1,1 +67,81 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct CheckHealthInput {}
    6      6   
static CHECKHEALTHINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "com.aws.example.synthetic#CheckHealthInput",
    8      8   
    "com.aws.example.synthetic",
    9      9   
    "CheckHealthInput",
   10     10   
);
   11     11   
static CHECKHEALTHINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(CHECKHEALTHINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(CHECKHEALTHINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/ping", None));
   13     14   
impl CheckHealthInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CHECKHEALTHINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for CheckHealthInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl CheckHealthInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&CHECKHEALTHINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&CHECKHEALTHINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl CheckHealthInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl CheckHealthInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
   53     67   
    pub fn builder() -> crate::operation::check_health::builders::CheckHealthInputBuilder {
   54     68   
        crate::operation::check_health::builders::CheckHealthInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_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 CheckHealthOutput {
   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(&CHECKHEALTHOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&CHECKHEALTHOUTPUT_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 CheckHealthOutput {
          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 CheckHealthOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
   51     62   
    pub fn builder() -> crate::operation::check_health::builders::CheckHealthOutputBuilder {
   52     63   
        crate::operation::check_health::builders::CheckHealthOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
   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/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing.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 `DoNothing`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct DoNothing;
    6      6   
impl DoNothing {
    7      7   
    /// Creates a new `DoNothing`
    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::do_nothing::DoNothingInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::do_nothing::DoNothingOutput::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::do_nothing::DoNothingInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::do_nothing::DoNothingOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::do_nothing::DoNothingError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +226,227 @@
  124    128   
                crate::operation::do_nothing::DoNothingError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct DoNothingResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DoNothingResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::do_nothing::DoNothingError::generic(generic)),
         158  +
            ))
  146    159   
        } else {
  147         -
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         160  +
            let protocol = _cfg
         161  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         162  +
                .expect("a SharedClientProtocol is required");
         163  +
            let mut deser = protocol.deserialize_response(response, DoNothing::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         164  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         165  +
            })?;
         166  +
            let body = response.body().bytes().expect("body loaded");
         167  +
            let output = crate::operation::do_nothing::DoNothingOutput::deserialize_with_response(
         168  +
                &mut *deser,
         169  +
                response.headers(),
         170  +
                response.status().into(),
         171  +
                body,
         172  +
            )
         173  +
            .map_err(|e| {
         174  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
            })?;
         176  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         177  +
        }
  150    178   
    }
  151    179   
}
  152    180   
#[derive(Debug)]
  153    181   
struct DoNothingRequestSerializer;
  154    182   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DoNothingRequestSerializer {
  155    183   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    184   
    fn serialize_input(
  157    185   
        &self,
  158    186   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    187   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    188   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    189   
        let input = input.downcast::<crate::operation::do_nothing::DoNothingInput>().expect("correct type");
  162         -
        let _header_serialization_settings = _cfg
  163         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  164         -
            .cloned()
  165         -
            .unwrap_or_default();
  166         -
        let mut request_builder = {
  167         -
            #[allow(clippy::uninlined_format_args)]
  168         -
            fn uri_base(
  169         -
                _input: &crate::operation::do_nothing::DoNothingInput,
  170         -
                output: &mut ::std::string::String,
  171         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172         -
                use ::std::fmt::Write as _;
  173         -
                ::std::write!(output, "/").expect("formatting should succeed");
  174         -
                ::std::result::Result::Ok(())
  175         -
            }
  176         -
            #[allow(clippy::unnecessary_wraps)]
  177         -
            fn update_http_builder(
  178         -
                input: &crate::operation::do_nothing::DoNothingInput,
  179         -
                builder: ::http_1x::request::Builder,
  180         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181         -
                let mut uri = ::std::string::String::new();
  182         -
                uri_base(input, &mut uri)?;
  183         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184         -
            }
  185         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  186         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  187         -
            builder = _header_serialization_settings.set_default_header(
  188         -
                builder,
  189         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  190         -
                "PokemonService.DoNothing",
  191         -
            );
  192         -
            builder
  193         -
        };
  194         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_do_nothing::ser_do_nothing_input(&input)?);
         190  +
        let protocol = _cfg
         191  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         192  +
            .expect("a SharedClientProtocol is required");
         193  +
        let mut request = protocol
         194  +
            .serialize_request(&input, DoNothing::INPUT_SCHEMA, "", _cfg)
         195  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  195    196   
  196         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         197  +
        return ::std::result::Result::Ok(request);
  197    198   
    }
  198    199   
}
  199    200   
#[derive(Debug)]
  200    201   
struct DoNothingEndpointParamsInterceptor;
  201    202   
  202    203   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DoNothingEndpointParamsInterceptor {
  203    204   
    fn name(&self) -> &'static str {
  204    205   
        "DoNothingEndpointParamsInterceptor"
  205    206   
    }
  206    207   

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing/_do_nothing_input.rs

@@ -1,1 +64,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct DoNothingInput {}
    6      6   
static DONOTHINGINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
    7      7   
    ::aws_smithy_schema::ShapeId::from_static("com.aws.example.synthetic#DoNothingInput", "com.aws.example.synthetic", "DoNothingInput");
    8      8   
static DONOTHINGINPUT_SCHEMA: ::aws_smithy_schema::Schema =
    9         -
    ::aws_smithy_schema::Schema::new_struct(DONOTHINGINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
           9  +
    ::aws_smithy_schema::Schema::new_struct(DONOTHINGINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          10  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/do-nothing", None));
   10     11   
impl DoNothingInput {
   11     12   
    /// The schema for this shape.
   12     13   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DONOTHINGINPUT_SCHEMA;
   13     14   
}
   14     15   
impl ::aws_smithy_schema::serde::SerializableStruct for DoNothingInput {
   15     16   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   16     17   
    fn serialize_members(
   17     18   
        &self,
   18     19   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   19     20   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   20     21   
        Ok(())
   21     22   
    }
   22     23   
}
   23     24   
impl DoNothingInput {
   24     25   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   25         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   26         -
        deserializer: &mut D,
          26  +
    pub fn deserialize(
          27  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   27     28   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   28     29   
        #[allow(unused_variables, unused_mut)]
   29     30   
        let mut builder = Self::builder();
   30     31   
        #[allow(
   31     32   
            unused_variables,
   32     33   
            unreachable_code,
   33     34   
            clippy::single_match,
   34     35   
            clippy::match_single_binding,
   35     36   
            clippy::diverging_sub_expression
   36     37   
        )]
   37         -
        deserializer.read_struct(&DONOTHINGINPUT_SCHEMA, (), |_, member, deser| {
          38  +
        deserializer.read_struct(&DONOTHINGINPUT_SCHEMA, &mut |member, deser| {
   38     39   
            match member.member_index() {
   39     40   
                _ => {}
   40     41   
            }
   41     42   
            Ok(())
   42     43   
        })?;
   43     44   
        builder
   44     45   
            .build()
   45     46   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   46     47   
    }
   47     48   
}
          49  +
impl DoNothingInput {
          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  +
        Self::builder()
          58  +
            .build()
          59  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          60  +
    }
          61  +
}
   48     62   
impl DoNothingInput {
   49     63   
    /// Creates a new builder-style object to manufacture [`DoNothingInput`](crate::operation::do_nothing::DoNothingInput).
   50     64   
    pub fn builder() -> crate::operation::do_nothing::builders::DoNothingInputBuilder {
   51     65   
        crate::operation::do_nothing::builders::DoNothingInputBuilder::default()
   52     66   
    }
   53     67   
}
   54     68   
   55     69   
/// A builder for [`DoNothingInput`](crate::operation::do_nothing::DoNothingInput).
   56     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   57     71   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing/_do_nothing_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 DoNothingOutput {
   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(&DONOTHINGOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&DONOTHINGOUTPUT_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 DoNothingOutput {
          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 DoNothingOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
   51     62   
    pub fn builder() -> crate::operation::do_nothing::builders::DoNothingOutputBuilder {
   52     63   
        crate::operation::do_nothing::builders::DoNothingOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
   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/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics.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 `GetServerStatistics`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetServerStatistics;
    6      6   
impl GetServerStatistics {
    7      7   
    /// Creates a new `GetServerStatistics`
    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::get_server_statistics::GetServerStatisticsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_server_statistics::GetServerStatisticsOutput::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::get_server_statistics::GetServerStatisticsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_server_statistics::GetServerStatisticsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +236,239 @@
  130    134   
                crate::operation::get_server_statistics::GetServerStatisticsError,
  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 GetServerStatisticsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetServerStatisticsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::get_server_statistics::GetServerStatisticsError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_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, GetServerStatistics::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::get_server_statistics::GetServerStatisticsOutput::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 GetServerStatisticsRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetServerStatisticsRequestSerializer {
  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::get_server_statistics::GetServerStatisticsInput>()
  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::get_server_statistics::GetServerStatisticsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::get_server_statistics::GetServerStatisticsInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "PokemonService.GetServerStatistics",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_input(
  203         -
            &input,
  204         -
        )?);
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, GetServerStatistics::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  205    208   
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         209  +
        return ::std::result::Result::Ok(request);
  207    210   
    }
  208    211   
}
  209    212   
#[derive(Debug)]
  210    213   
struct GetServerStatisticsEndpointParamsInterceptor;
  211    214   
  212    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetServerStatisticsEndpointParamsInterceptor {
  213    216   
    fn name(&self) -> &'static str {
  214    217   
        "GetServerStatisticsEndpointParamsInterceptor"
  215    218   
    }
  216    219   

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_input.rs

@@ -1,1 +70,84 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct GetServerStatisticsInput {}
    6      6   
static GETSERVERSTATISTICSINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "com.aws.example.synthetic#GetServerStatisticsInput",
    8      8   
    "com.aws.example.synthetic",
    9      9   
    "GetServerStatisticsInput",
   10     10   
);
   11     11   
static GETSERVERSTATISTICSINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(GETSERVERSTATISTICSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(GETSERVERSTATISTICSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/stats", None));
   13     14   
impl GetServerStatisticsInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETSERVERSTATISTICSINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for GetServerStatisticsInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl GetServerStatisticsInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&GETSERVERSTATISTICSINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&GETSERVERSTATISTICSINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl GetServerStatisticsInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl GetServerStatisticsInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
   53     67   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder {
   54     68   
        crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_output.rs

@@ -24,24 +109,121 @@
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        {
   46     46   
            let val = &self.calls_count;
   47     47   
            ser.write_long(&GETSERVERSTATISTICSOUTPUT_MEMBER_CALLS_COUNT, *val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl GetServerStatisticsOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&GETSERVERSTATISTICSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&GETSERVERSTATISTICSOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.calls_count = Some(deser.read_long(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
          75  +
        builder.calls_count = builder.calls_count.or(Some(0i64));
   75     76   
        builder
   76     77   
            .build()
   77     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     79   
    }
   79     80   
}
          81  +
impl GetServerStatisticsOutput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          83  +
    pub fn deserialize_with_response(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        _body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        Self::deserialize(deserializer)
          90  +
    }
          91  +
}
   80     92   
impl GetServerStatisticsOutput {
   81     93   
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
   82     94   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
   83     95   
        crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder::default()
   84     96   
    }
   85     97   
}
   86     98   
   87     99   
/// A builder for [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
   88    100   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    101   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde.rs

@@ -1,1 +0,52 @@
    8      8   
where
    9      9   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     10   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     11   
{
   12     12   
    result
   13     13   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     14   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     15   
        .map_err(::std::convert::Into::into)
   16     16   
}
   17     17   
   18         -
pub(crate) mod shape_capture_pokemon;
   19         -
   20     18   
pub fn parse_http_error_metadata(
   21     19   
    _response_status: u16,
   22     20   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   23     21   
    response_body: &[u8],
   24     22   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   25     23   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   26     24   
}
   27     25   
   28         -
pub(crate) mod shape_check_health;
   29         -
   30         -
pub(crate) mod shape_do_nothing;
   31         -
   32         -
pub(crate) mod shape_get_server_statistics;
          26  +
pub(crate) mod shape_capture_pokemon;
   33     27   
   34     28   
pub(crate) mod shape_capture_pokemon_output;
   35     29   
   36     30   
pub(crate) mod shape_capturing_event;
   37     31   
   38         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   39         -
    if data.is_empty() {
   40         -
        b"{}"
   41         -
    } else {
   42         -
        data
   43         -
    }
   44         -
}
   45         -
   46         -
pub(crate) mod shape_invalid_pokeball_error;
   47         -
   48     32   
pub(crate) mod shape_master_ball_unsuccessful;
   49     33   
   50         -
pub(crate) mod shape_throttling_error;
   51         -
   52         -
pub(crate) mod shape_unsupported_region_error;
   53         -
   54         -
pub(crate) mod shape_validation_exception;
   55         -
   56     34   
pub fn parse_event_stream_error_metadata(
   57     35   
    payload: &::bytes::Bytes,
   58     36   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   59     37   
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
   60     38   
}
   61     39   
   62     40   
pub(crate) mod shape_capturing_payload;
   63     41   
   64         -
pub(crate) mod shape_validation_exception_field_list;
          42  +
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
          43  +
    if data.is_empty() {
          44  +
        b"{}"
          45  +
    } else {
          46  +
        data
          47  +
    }
          48  +
}
          49  +
          50  +
pub(crate) mod shape_invalid_pokeball_error;
   65     51   
   66         -
pub(crate) mod shape_validation_exception_field;
          52  +
pub(crate) mod shape_throttling_error;