Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/match_.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 `Match`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct Match;
    6      6   
impl Match {
    7      7   
    /// Creates a new `Match`
    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::match_::MatchInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::match_::MatchOutput::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::match_::MatchInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::match_::MatchOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::match_::MatchError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -92,96 +217,249 @@
  112    116   
                crate::operation::match_::MatchError,
  113    117   
            >::new());
  114    118   
  115    119   
        ::std::borrow::Cow::Owned(rcb)
  116    120   
    }
  117    121   
}
  118    122   
  119    123   
#[derive(Debug)]
  120    124   
struct MatchResponseDeserializer;
  121    125   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MatchResponseDeserializer {
  122         -
    fn deserialize_nonstreaming(
         126  +
    fn deserialize_nonstreaming_with_config(
  123    127   
        &self,
  124    128   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         129  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  125    130   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  126    131   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         132  +
        #[allow(unused_mut)]
         133  +
        let mut force_error = false;
         134  +
         135  +
        if !success && status != 200 || force_error {
  127    136   
            let headers = response.headers();
  128    137   
            let body = response.body().bytes().expect("body loaded");
  129    138   
            #[allow(unused_mut)]
  130         -
        let mut force_error = false;
         139  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         140  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         141  +
            })?;
  131    142   
  132         -
        let parse_result = if !success && status != 200 || force_error {
  133         -
            crate::protocol_serde::shape_match::de_match_http_error(status, headers, body)
  134         -
        } else {
  135         -
            crate::protocol_serde::shape_match::de_match_http_response(status, headers, body)
         143  +
            let generic = generic_builder.build();
         144  +
            let error_code = match generic.code() {
         145  +
                ::std::option::Option::Some(code) => code,
         146  +
                ::std::option::Option::None => {
         147  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         148  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::match_::MatchError::unhandled(generic)),
         149  +
                    ))
         150  +
                }
         151  +
            };
         152  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         153  +
            let protocol = _cfg
         154  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         155  +
                .expect("a SharedClientProtocol is required");
         156  +
            let err = match error_code {
         157  +
                "ValidationException" => crate::operation::match_::MatchError::ValidationException({
         158  +
                    let mut tmp = match protocol
         159  +
                        .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
         160  +
                        .and_then(|mut deser| {
         161  +
                            crate::types::error::ValidationException::deserialize_with_response(
         162  +
                                &mut *deser,
         163  +
                                response.headers(),
         164  +
                                response.status().into(),
         165  +
                                body,
         166  +
                            )
         167  +
                        }) {
         168  +
                        ::std::result::Result::Ok(val) => val,
         169  +
                        ::std::result::Result::Err(e) => {
         170  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         171  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         172  +
                            ))
         173  +
                        }
         174  +
                    };
         175  +
                    tmp.meta = generic;
         176  +
                    tmp
         177  +
                }),
         178  +
                _ => crate::operation::match_::MatchError::generic(generic),
  136    179   
            };
  137         -
        crate::protocol_serde::type_erase_result(parse_result)
         180  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         181  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         182  +
            ))
         183  +
        } else {
         184  +
            let protocol = _cfg
         185  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         186  +
                .expect("a SharedClientProtocol is required");
         187  +
            let mut deser = protocol.deserialize_response(response, Match::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         188  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         189  +
            })?;
         190  +
            let body = response.body().bytes().expect("body loaded");
         191  +
            let output =
         192  +
                crate::operation::match_::MatchOutput::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
         193  +
                    .map_err(|e| {
         194  +
                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
         195  +
                            e,
         196  +
                        ))
         197  +
                    })?;
         198  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         199  +
        }
  138    200   
    }
  139    201   
}
  140    202   
#[derive(Debug)]
  141    203   
struct MatchRequestSerializer;
  142    204   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MatchRequestSerializer {
  143    205   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  144    206   
    fn serialize_input(
  145    207   
        &self,
  146    208   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  147    209   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  148    210   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  149    211   
        let input = input.downcast::<crate::operation::match_::MatchInput>().expect("correct type");
  150         -
        let _header_serialization_settings = _cfg
  151         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  152         -
            .cloned()
  153         -
            .unwrap_or_default();
  154         -
        let mut request_builder = {
  155         -
            #[allow(clippy::uninlined_format_args)]
  156         -
            fn uri_base(
  157         -
                _input: &crate::operation::match_::MatchInput,
  158         -
                output: &mut ::std::string::String,
  159         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  160         -
                use ::std::fmt::Write as _;
  161         -
                ::std::write!(output, "/").expect("formatting should succeed");
  162         -
                ::std::result::Result::Ok(())
  163         -
            }
  164         -
            #[allow(clippy::unnecessary_wraps)]
  165         -
            fn update_http_builder(
  166         -
                input: &crate::operation::match_::MatchInput,
  167         -
                builder: ::http_1x::request::Builder,
  168         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  169         -
                let mut uri = ::std::string::String::new();
  170         -
                uri_base(input, &mut uri)?;
  171         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  172         -
            }
  173         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  174         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  175         -
            builder = _header_serialization_settings.set_default_header(
  176         -
                builder,
  177         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  178         -
                "Config.Match",
  179         -
            );
  180         -
            builder
  181         -
        };
  182         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_match::ser_match_input(&input)?);
  183         -
        if let Some(content_length) = body.content_length() {
  184         -
            let content_length = content_length.to_string();
  185         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  186         -
        }
  187         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         212  +
        let protocol = _cfg
         213  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         214  +
            .expect("a SharedClientProtocol is required");
         215  +
        let mut request = protocol
         216  +
            .serialize_request(&input, Match::INPUT_SCHEMA, "", _cfg)
         217  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         218  +
         219  +
        return ::std::result::Result::Ok(request);
  188    220   
    }
  189    221   
}
  190    222   
#[derive(Debug)]
  191    223   
struct MatchEndpointParamsInterceptor;
  192    224   
  193    225   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MatchEndpointParamsInterceptor {
  194    226   
    fn name(&self) -> &'static str {
  195    227   
        "MatchEndpointParamsInterceptor"
  196    228   
    }
  197    229   

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/match_/_match_input.rs

@@ -38,38 +255,266 @@
   58     58   
    #[allow(missing_docs)] // documentation missing in model
   59     59   
    pub fn send_value(&self) -> ::std::option::Option<&str> {
   60     60   
        self.send_value.as_deref()
   61     61   
    }
   62     62   
}
   63     63   
static MATCHINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   64     64   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput", "crate.synthetic", "MatchInput");
   65     65   
static MATCHINPUT_MEMBER_AS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   66     66   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$as", "crate.synthetic", "MatchInput"),
   67     67   
    ::aws_smithy_schema::ShapeType::Integer,
   68         -
    "r##as",
          68  +
    "as",
   69     69   
    0,
   70     70   
);
   71     71   
static MATCHINPUT_MEMBER_ASYNC: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   72     72   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$async", "crate.synthetic", "MatchInput"),
   73     73   
    ::aws_smithy_schema::ShapeType::Boolean,
   74         -
    "r##async",
          74  +
    "async",
   75     75   
    1,
   76     76   
);
   77     77   
static MATCHINPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$enum", "crate.synthetic", "MatchInput"),
   79     79   
    ::aws_smithy_schema::ShapeType::String,
   80         -
    "r##enum",
          80  +
    "enum",
   81     81   
    2,
   82     82   
);
   83     83   
static MATCHINPUT_MEMBER_SELF_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$self", "crate.synthetic", "MatchInput"),
   85     85   
    ::aws_smithy_schema::ShapeType::Boolean,
   86         -
    "self_",
          86  +
    "self",
   87     87   
    3,
   88     88   
);
   89     89   
static MATCHINPUT_MEMBER_CRATE_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   90     90   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$crate", "crate.synthetic", "MatchInput"),
   91     91   
    ::aws_smithy_schema::ShapeType::Boolean,
   92         -
    "crate_",
          92  +
    "crate",
   93     93   
    4,
   94     94   
);
   95     95   
static MATCHINPUT_MEMBER_SUPER_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   96     96   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$super", "crate.synthetic", "MatchInput"),
   97     97   
    ::aws_smithy_schema::ShapeType::Boolean,
   98         -
    "super_",
          98  +
    "super",
   99     99   
    5,
  100    100   
);
  101    101   
static MATCHINPUT_MEMBER_BUILD_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  102    102   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$build", "crate.synthetic", "MatchInput"),
  103    103   
    ::aws_smithy_schema::ShapeType::String,
  104         -
    "build_value",
         104  +
    "build",
  105    105   
    6,
  106    106   
);
  107    107   
static MATCHINPUT_MEMBER_DEFAULT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  108    108   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$default", "crate.synthetic", "MatchInput"),
  109    109   
    ::aws_smithy_schema::ShapeType::String,
  110         -
    "default_value",
         110  +
    "default",
  111    111   
    7,
  112    112   
);
  113    113   
static MATCHINPUT_MEMBER_SEND_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  114    114   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#MatchInput$send", "crate.synthetic", "MatchInput"),
  115    115   
    ::aws_smithy_schema::ShapeType::String,
  116         -
    "send_value",
         116  +
    "send",
  117    117   
    8,
  118    118   
);
  119    119   
static MATCHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  120    120   
    MATCHINPUT_SCHEMA_ID,
  121    121   
    ::aws_smithy_schema::ShapeType::Structure,
  122    122   
    &[
  123    123   
        &MATCHINPUT_MEMBER_AS,
  124    124   
        &MATCHINPUT_MEMBER_ASYNC,
  125    125   
        &MATCHINPUT_MEMBER_ENUM,
  126    126   
        &MATCHINPUT_MEMBER_SELF_,
  127    127   
        &MATCHINPUT_MEMBER_CRATE_,
  128    128   
        &MATCHINPUT_MEMBER_SUPER_,
  129    129   
        &MATCHINPUT_MEMBER_BUILD_VALUE,
  130    130   
        &MATCHINPUT_MEMBER_DEFAULT_VALUE,
  131    131   
        &MATCHINPUT_MEMBER_SEND_VALUE,
  132    132   
    ],
  133    133   
);
  134    134   
impl MatchInput {
  135    135   
    /// The schema for this shape.
  136    136   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MATCHINPUT_SCHEMA;
  137    137   
}
  138    138   
impl ::aws_smithy_schema::serde::SerializableStruct for MatchInput {
  139    139   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  140    140   
    fn serialize_members(
  141    141   
        &self,
  142    142   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  143    143   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  144    144   
        if let Some(ref val) = self.r#as {
  145    145   
            ser.write_integer(&MATCHINPUT_MEMBER_AS, *val)?;
  146    146   
        }
  147    147   
        if let Some(ref val) = self.r#async {
  148    148   
            ser.write_boolean(&MATCHINPUT_MEMBER_ASYNC, *val)?;
  149    149   
        }
  150    150   
        if let Some(ref val) = self.r#enum {
  151    151   
            ser.write_string(&MATCHINPUT_MEMBER_ENUM, val.as_str())?;
  152    152   
        }
  153    153   
        if let Some(ref val) = self.self_ {
  154    154   
            ser.write_boolean(&MATCHINPUT_MEMBER_SELF_, *val)?;
  155    155   
        }
  156    156   
        if let Some(ref val) = self.crate_ {
  157    157   
            ser.write_boolean(&MATCHINPUT_MEMBER_CRATE_, *val)?;
  158    158   
        }
  159    159   
        if let Some(ref val) = self.super_ {
  160    160   
            ser.write_boolean(&MATCHINPUT_MEMBER_SUPER_, *val)?;
  161    161   
        }
  162    162   
        if let Some(ref val) = self.build_value {
  163    163   
            ser.write_string(&MATCHINPUT_MEMBER_BUILD_VALUE, val)?;
  164    164   
        }
  165    165   
        if let Some(ref val) = self.default_value {
  166    166   
            ser.write_string(&MATCHINPUT_MEMBER_DEFAULT_VALUE, val)?;
  167    167   
        }
  168    168   
        if let Some(ref val) = self.send_value {
  169    169   
            ser.write_string(&MATCHINPUT_MEMBER_SEND_VALUE, val)?;
  170    170   
        }
  171    171   
        Ok(())
  172    172   
    }
  173    173   
}
  174    174   
impl MatchInput {
  175    175   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  176         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  177         -
        deserializer: &mut D,
         176  +
    pub fn deserialize(
         177  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  178    178   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  179    179   
        #[allow(unused_variables, unused_mut)]
  180    180   
        let mut builder = Self::builder();
  181    181   
        #[allow(
  182    182   
            unused_variables,
  183    183   
            unreachable_code,
  184    184   
            clippy::single_match,
  185    185   
            clippy::match_single_binding,
  186    186   
            clippy::diverging_sub_expression
  187    187   
        )]
  188         -
        deserializer.read_struct(&MATCHINPUT_SCHEMA, (), |_, member, deser| {
         188  +
        deserializer.read_struct(&MATCHINPUT_SCHEMA, &mut |member, deser| {
  189    189   
            match member.member_index() {
  190    190   
                Some(0) => {
  191    191   
                    builder.r#as = Some(deser.read_integer(member)?);
  192    192   
                }
  193    193   
                Some(1) => {
  194    194   
                    builder.r#async = Some(deser.read_boolean(member)?);
  195    195   
                }
  196    196   
                Some(2) => {
  197    197   
                    builder.r#enum = Some(crate::types::UnknownVariantCollidingEnum::from(deser.read_string(member)?.as_str()));
  198    198   
                }
  199    199   
                Some(3) => {
  200    200   
                    builder.self_ = Some(deser.read_boolean(member)?);
  201    201   
                }
  202    202   
                Some(4) => {
  203    203   
                    builder.crate_ = Some(deser.read_boolean(member)?);
  204    204   
                }
  205    205   
                Some(5) => {
  206    206   
                    builder.super_ = Some(deser.read_boolean(member)?);
  207    207   
                }
  208    208   
                Some(6) => {
  209    209   
                    builder.build_value = Some(deser.read_string(member)?);
  210    210   
                }
  211    211   
                Some(7) => {
  212    212   
                    builder.default_value = Some(deser.read_string(member)?);
  213    213   
                }
  214    214   
                Some(8) => {
  215    215   
                    builder.send_value = Some(deser.read_string(member)?);
  216    216   
                }
  217    217   
                _ => {}
  218    218   
            }
  219    219   
            Ok(())
  220    220   
        })?;
  221    221   
        builder
  222    222   
            .build()
  223    223   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  224    224   
    }
  225    225   
}
         226  +
impl MatchInput {
         227  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         228  +
    pub fn deserialize_with_response(
         229  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         230  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         231  +
        _status: u16,
         232  +
        _body: &[u8],
         233  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         234  +
        Self::deserialize(deserializer)
         235  +
    }
         236  +
}
  226    237   
impl MatchInput {
  227    238   
    /// Creates a new builder-style object to manufacture [`MatchInput`](crate::operation::match_::MatchInput).
  228    239   
    pub fn builder() -> crate::operation::match_::builders::MatchInputBuilder {
  229    240   
        crate::operation::match_::builders::MatchInputBuilder::default()
  230    241   
    }
  231    242   
}
  232    243   
  233    244   
/// A builder for [`MatchInput`](crate::operation::match_::MatchInput).
  234    245   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  235    246   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/match_/_match_output.rs

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

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

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/option/_option_input.rs

@@ -16,16 +101,112 @@
   36     36   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   37     37   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   38     38   
        if let Some(ref val) = self.pv_member {
   39     39   
            ser.write_boolean(&OPTIONINPUT_MEMBER_PV_MEMBER, *val)?;
   40     40   
        }
   41     41   
        Ok(())
   42     42   
    }
   43     43   
}
   44     44   
impl OptionInput {
   45     45   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   46         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   47         -
        deserializer: &mut D,
          46  +
    pub fn deserialize(
          47  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   48     48   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        #[allow(unused_variables, unused_mut)]
   50     50   
        let mut builder = Self::builder();
   51     51   
        #[allow(
   52     52   
            unused_variables,
   53     53   
            unreachable_code,
   54     54   
            clippy::single_match,
   55     55   
            clippy::match_single_binding,
   56     56   
            clippy::diverging_sub_expression
   57     57   
        )]
   58         -
        deserializer.read_struct(&OPTIONINPUT_SCHEMA, (), |_, member, deser| {
          58  +
        deserializer.read_struct(&OPTIONINPUT_SCHEMA, &mut |member, deser| {
   59     59   
            match member.member_index() {
   60     60   
                Some(0) => {
   61     61   
                    builder.pv_member = Some(deser.read_boolean(member)?);
   62     62   
                }
   63     63   
                _ => {}
   64     64   
            }
   65     65   
            Ok(())
   66     66   
        })?;
   67     67   
        builder
   68     68   
            .build()
   69     69   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   70     70   
    }
   71     71   
}
          72  +
impl OptionInput {
          73  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          74  +
    pub fn deserialize_with_response(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          76  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          77  +
        _status: u16,
          78  +
        _body: &[u8],
          79  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          80  +
        Self::deserialize(deserializer)
          81  +
    }
          82  +
}
   72     83   
impl OptionInput {
   73     84   
    /// Creates a new builder-style object to manufacture [`OptionInput`](crate::operation::option::OptionInput).
   74     85   
    pub fn builder() -> crate::operation::option::builders::OptionInputBuilder {
   75     86   
        crate::operation::option::builders::OptionInputBuilder::default()
   76     87   
    }
   77     88   
}
   78     89   
   79     90   
/// A builder for [`OptionInput`](crate::operation::option::OptionInput).
   80     91   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   81     92   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/option/_option_output.rs

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

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/reserved_words_as_members.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 `ReservedWordsAsMembers`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ReservedWordsAsMembers;
    6      6   
impl ReservedWordsAsMembers {
    7      7   
    /// Creates a new `ReservedWordsAsMembers`
    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::reserved_words_as_members::ReservedWordsAsMembersInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::reserved_words_as_members::ReservedWordsAsMembersOutput::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::reserved_words_as_members::ReservedWordsAsMembersInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::reserved_words_as_members::ReservedWordsAsMembersOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::reserved_words_as_members::ReservedWordsAsMembersError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +233,269 @@
  124    128   
                crate::operation::reserved_words_as_members::ReservedWordsAsMembersError,
  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 ReservedWordsAsMembersResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ReservedWordsAsMembersResponseDeserializer {
  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_reserved_words_as_members::de_reserved_words_as_members_http_error(status, headers, body)
  146         -
        } else {
  147         -
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_response(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            let error_code = match generic.code() {
         157  +
                ::std::option::Option::Some(code) => code,
         158  +
                ::std::option::Option::None => {
         159  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         160  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         161  +
                            crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::unhandled(generic),
         162  +
                        ),
         163  +
                    ))
         164  +
                }
  148    165   
            };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         166  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         167  +
            let protocol = _cfg
         168  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         169  +
                .expect("a SharedClientProtocol is required");
         170  +
            let err = match error_code {
         171  +
                "ValidationException" => crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::ValidationException({
         172  +
                    let mut tmp = match protocol
         173  +
                        .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
         174  +
                        .and_then(|mut deser| {
         175  +
                            crate::types::error::ValidationException::deserialize_with_response(
         176  +
                                &mut *deser,
         177  +
                                response.headers(),
         178  +
                                response.status().into(),
         179  +
                                body,
         180  +
                            )
         181  +
                        }) {
         182  +
                        ::std::result::Result::Ok(val) => val,
         183  +
                        ::std::result::Result::Err(e) => {
         184  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         185  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         186  +
                            ))
         187  +
                        }
         188  +
                    };
         189  +
                    tmp.meta = generic;
         190  +
                    tmp
         191  +
                }),
         192  +
                _ => crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::generic(generic),
         193  +
            };
         194  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         195  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         196  +
            ))
         197  +
        } else {
         198  +
            let protocol = _cfg
         199  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         200  +
                .expect("a SharedClientProtocol is required");
         201  +
            let mut deser = protocol
         202  +
                .deserialize_response(response, ReservedWordsAsMembers::OUTPUT_SCHEMA, _cfg)
         203  +
                .map_err(|e| {
         204  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         205  +
                })?;
         206  +
            let body = response.body().bytes().expect("body loaded");
         207  +
            let output = crate::operation::reserved_words_as_members::ReservedWordsAsMembersOutput::deserialize_with_response(
         208  +
                &mut *deser,
         209  +
                response.headers(),
         210  +
                response.status().into(),
         211  +
                body,
         212  +
            )
         213  +
            .map_err(|e| {
         214  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         215  +
            })?;
         216  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         217  +
        }
  150    218   
    }
  151    219   
}
  152    220   
#[derive(Debug)]
  153    221   
struct ReservedWordsAsMembersRequestSerializer;
  154    222   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ReservedWordsAsMembersRequestSerializer {
  155    223   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    224   
    fn serialize_input(
  157    225   
        &self,
  158    226   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    227   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    228   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    229   
        let input = input
  162    230   
            .downcast::<crate::operation::reserved_words_as_members::ReservedWordsAsMembersInput>()
  163    231   
            .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::reserved_words_as_members::ReservedWordsAsMembersInput,
  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::reserved_words_as_members::ReservedWordsAsMembersInput,
  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.1");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "Config.ReservedWordsAsMembers",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  197         -
            crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_input(&input)?,
  198         -
        );
  199         -
        if let Some(content_length) = body.content_length() {
  200         -
            let content_length = content_length.to_string();
  201         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  202         -
        }
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         232  +
        let protocol = _cfg
         233  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         234  +
            .expect("a SharedClientProtocol is required");
         235  +
        let mut request = protocol
         236  +
            .serialize_request(&input, ReservedWordsAsMembers::INPUT_SCHEMA, "", _cfg)
         237  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         238  +
         239  +
        return ::std::result::Result::Ok(request);
  204    240   
    }
  205    241   
}
  206    242   
#[derive(Debug)]
  207    243   
struct ReservedWordsAsMembersEndpointParamsInterceptor;
  208    244   
  209    245   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ReservedWordsAsMembersEndpointParamsInterceptor {
  210    246   
    fn name(&self) -> &'static str {
  211    247   
        "ReservedWordsAsMembersEndpointParamsInterceptor"
  212    248   
    }
  213    249   

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/reserved_words_as_members/_reserved_words_as_members_input.rs

@@ -45,45 +294,305 @@
   65     65   
    "crate.synthetic",
   66     66   
    "ReservedWordsAsMembersInput",
   67     67   
);
   68     68   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_AS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   69     69   
    ::aws_smithy_schema::ShapeId::from_static(
   70     70   
        "crate.synthetic#ReservedWordsAsMembersInput$as",
   71     71   
        "crate.synthetic",
   72     72   
        "ReservedWordsAsMembersInput",
   73     73   
    ),
   74     74   
    ::aws_smithy_schema::ShapeType::Integer,
   75         -
    "r##as",
          75  +
    "as",
   76     76   
    0,
   77     77   
);
   78     78   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_ASYNC: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   79     79   
    ::aws_smithy_schema::ShapeId::from_static(
   80     80   
        "crate.synthetic#ReservedWordsAsMembersInput$async",
   81     81   
        "crate.synthetic",
   82     82   
        "ReservedWordsAsMembersInput",
   83     83   
    ),
   84     84   
    ::aws_smithy_schema::ShapeType::Boolean,
   85         -
    "r##async",
          85  +
    "async",
   86     86   
    1,
   87     87   
);
   88     88   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   89     89   
    ::aws_smithy_schema::ShapeId::from_static(
   90     90   
        "crate.synthetic#ReservedWordsAsMembersInput$enum",
   91     91   
        "crate.synthetic",
   92     92   
        "ReservedWordsAsMembersInput",
   93     93   
    ),
   94     94   
    ::aws_smithy_schema::ShapeType::String,
   95         -
    "r##enum",
          95  +
    "enum",
   96     96   
    2,
   97     97   
);
   98     98   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_SELF_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99     99   
    ::aws_smithy_schema::ShapeId::from_static(
  100    100   
        "crate.synthetic#ReservedWordsAsMembersInput$self",
  101    101   
        "crate.synthetic",
  102    102   
        "ReservedWordsAsMembersInput",
  103    103   
    ),
  104    104   
    ::aws_smithy_schema::ShapeType::Boolean,
  105         -
    "self_",
         105  +
    "self",
  106    106   
    3,
  107    107   
);
  108    108   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_CRATE_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    109   
    ::aws_smithy_schema::ShapeId::from_static(
  110    110   
        "crate.synthetic#ReservedWordsAsMembersInput$crate",
  111    111   
        "crate.synthetic",
  112    112   
        "ReservedWordsAsMembersInput",
  113    113   
    ),
  114    114   
    ::aws_smithy_schema::ShapeType::Boolean,
  115         -
    "crate_",
         115  +
    "crate",
  116    116   
    4,
  117    117   
);
  118    118   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_SUPER_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  119    119   
    ::aws_smithy_schema::ShapeId::from_static(
  120    120   
        "crate.synthetic#ReservedWordsAsMembersInput$super",
  121    121   
        "crate.synthetic",
  122    122   
        "ReservedWordsAsMembersInput",
  123    123   
    ),
  124    124   
    ::aws_smithy_schema::ShapeType::Boolean,
  125         -
    "super_",
         125  +
    "super",
  126    126   
    5,
  127    127   
);
  128    128   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_BUILD_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  129    129   
    ::aws_smithy_schema::ShapeId::from_static(
  130    130   
        "crate.synthetic#ReservedWordsAsMembersInput$build",
  131    131   
        "crate.synthetic",
  132    132   
        "ReservedWordsAsMembersInput",
  133    133   
    ),
  134    134   
    ::aws_smithy_schema::ShapeType::String,
  135         -
    "build_value",
         135  +
    "build",
  136    136   
    6,
  137    137   
);
  138    138   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_DEFAULT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  139    139   
    ::aws_smithy_schema::ShapeId::from_static(
  140    140   
        "crate.synthetic#ReservedWordsAsMembersInput$default",
  141    141   
        "crate.synthetic",
  142    142   
        "ReservedWordsAsMembersInput",
  143    143   
    ),
  144    144   
    ::aws_smithy_schema::ShapeType::String,
  145         -
    "default_value",
         145  +
    "default",
  146    146   
    7,
  147    147   
);
  148    148   
static RESERVEDWORDSASMEMBERSINPUT_MEMBER_SEND_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  149    149   
    ::aws_smithy_schema::ShapeId::from_static(
  150    150   
        "crate.synthetic#ReservedWordsAsMembersInput$send",
  151    151   
        "crate.synthetic",
  152    152   
        "ReservedWordsAsMembersInput",
  153    153   
    ),
  154    154   
    ::aws_smithy_schema::ShapeType::String,
  155         -
    "send_value",
         155  +
    "send",
  156    156   
    8,
  157    157   
);
  158    158   
static RESERVEDWORDSASMEMBERSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  159    159   
    RESERVEDWORDSASMEMBERSINPUT_SCHEMA_ID,
  160    160   
    ::aws_smithy_schema::ShapeType::Structure,
  161    161   
    &[
  162    162   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_AS,
  163    163   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_ASYNC,
  164    164   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_ENUM,
  165    165   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_SELF_,
  166    166   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_CRATE_,
  167    167   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_SUPER_,
  168    168   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_BUILD_VALUE,
  169    169   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_DEFAULT_VALUE,
  170    170   
        &RESERVEDWORDSASMEMBERSINPUT_MEMBER_SEND_VALUE,
  171    171   
    ],
  172    172   
);
  173    173   
impl ReservedWordsAsMembersInput {
  174    174   
    /// The schema for this shape.
  175    175   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RESERVEDWORDSASMEMBERSINPUT_SCHEMA;
  176    176   
}
  177    177   
impl ::aws_smithy_schema::serde::SerializableStruct for ReservedWordsAsMembersInput {
  178    178   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  179    179   
    fn serialize_members(
  180    180   
        &self,
  181    181   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  182    182   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  183    183   
        if let Some(ref val) = self.r#as {
  184    184   
            ser.write_integer(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_AS, *val)?;
  185    185   
        }
  186    186   
        if let Some(ref val) = self.r#async {
  187    187   
            ser.write_boolean(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_ASYNC, *val)?;
  188    188   
        }
  189    189   
        if let Some(ref val) = self.r#enum {
  190    190   
            ser.write_string(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_ENUM, val.as_str())?;
  191    191   
        }
  192    192   
        if let Some(ref val) = self.self_ {
  193    193   
            ser.write_boolean(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_SELF_, *val)?;
  194    194   
        }
  195    195   
        if let Some(ref val) = self.crate_ {
  196    196   
            ser.write_boolean(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_CRATE_, *val)?;
  197    197   
        }
  198    198   
        if let Some(ref val) = self.super_ {
  199    199   
            ser.write_boolean(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_SUPER_, *val)?;
  200    200   
        }
  201    201   
        if let Some(ref val) = self.build_value {
  202    202   
            ser.write_string(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_BUILD_VALUE, val)?;
  203    203   
        }
  204    204   
        if let Some(ref val) = self.default_value {
  205    205   
            ser.write_string(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_DEFAULT_VALUE, val)?;
  206    206   
        }
  207    207   
        if let Some(ref val) = self.send_value {
  208    208   
            ser.write_string(&RESERVEDWORDSASMEMBERSINPUT_MEMBER_SEND_VALUE, val)?;
  209    209   
        }
  210    210   
        Ok(())
  211    211   
    }
  212    212   
}
  213    213   
impl ReservedWordsAsMembersInput {
  214    214   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  215         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  216         -
        deserializer: &mut D,
         215  +
    pub fn deserialize(
         216  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  217    217   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  218    218   
        #[allow(unused_variables, unused_mut)]
  219    219   
        let mut builder = Self::builder();
  220    220   
        #[allow(
  221    221   
            unused_variables,
  222    222   
            unreachable_code,
  223    223   
            clippy::single_match,
  224    224   
            clippy::match_single_binding,
  225    225   
            clippy::diverging_sub_expression
  226    226   
        )]
  227         -
        deserializer.read_struct(&RESERVEDWORDSASMEMBERSINPUT_SCHEMA, (), |_, member, deser| {
         227  +
        deserializer.read_struct(&RESERVEDWORDSASMEMBERSINPUT_SCHEMA, &mut |member, deser| {
  228    228   
            match member.member_index() {
  229    229   
                Some(0) => {
  230    230   
                    builder.r#as = Some(deser.read_integer(member)?);
  231    231   
                }
  232    232   
                Some(1) => {
  233    233   
                    builder.r#async = Some(deser.read_boolean(member)?);
  234    234   
                }
  235    235   
                Some(2) => {
  236    236   
                    builder.r#enum = Some(crate::types::UnknownVariantCollidingEnum::from(deser.read_string(member)?.as_str()));
  237    237   
                }
  238    238   
                Some(3) => {
  239    239   
                    builder.self_ = Some(deser.read_boolean(member)?);
  240    240   
                }
  241    241   
                Some(4) => {
  242    242   
                    builder.crate_ = Some(deser.read_boolean(member)?);
  243    243   
                }
  244    244   
                Some(5) => {
  245    245   
                    builder.super_ = Some(deser.read_boolean(member)?);
  246    246   
                }
  247    247   
                Some(6) => {
  248    248   
                    builder.build_value = Some(deser.read_string(member)?);
  249    249   
                }
  250    250   
                Some(7) => {
  251    251   
                    builder.default_value = Some(deser.read_string(member)?);
  252    252   
                }
  253    253   
                Some(8) => {
  254    254   
                    builder.send_value = Some(deser.read_string(member)?);
  255    255   
                }
  256    256   
                _ => {}
  257    257   
            }
  258    258   
            Ok(())
  259    259   
        })?;
  260    260   
        builder
  261    261   
            .build()
  262    262   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  263    263   
    }
  264    264   
}
         265  +
impl ReservedWordsAsMembersInput {
         266  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         267  +
    pub fn deserialize_with_response(
         268  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         269  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         270  +
        _status: u16,
         271  +
        _body: &[u8],
         272  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         273  +
        Self::deserialize(deserializer)
         274  +
    }
         275  +
}
  265    276   
impl ReservedWordsAsMembersInput {
  266    277   
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersInput`](crate::operation::reserved_words_as_members::ReservedWordsAsMembersInput).
  267    278   
    pub fn builder() -> crate::operation::reserved_words_as_members::builders::ReservedWordsAsMembersInputBuilder {
  268    279   
        crate::operation::reserved_words_as_members::builders::ReservedWordsAsMembersInputBuilder::default()
  269    280   
    }
  270    281   
}
  271    282   
  272    283   
/// A builder for [`ReservedWordsAsMembersInput`](crate::operation::reserved_words_as_members::ReservedWordsAsMembersInput).
  273    284   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  274    285   
#[non_exhaustive]

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

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/result/_result_input.rs

@@ -16,16 +101,112 @@
   36     36   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   37     37   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   38     38   
        if let Some(ref val) = self.pv_member {
   39     39   
            ser.write_boolean(&RESULTINPUT_MEMBER_PV_MEMBER, *val)?;
   40     40   
        }
   41     41   
        Ok(())
   42     42   
    }
   43     43   
}
   44     44   
impl ResultInput {
   45     45   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   46         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   47         -
        deserializer: &mut D,
          46  +
    pub fn deserialize(
          47  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   48     48   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        #[allow(unused_variables, unused_mut)]
   50     50   
        let mut builder = Self::builder();
   51     51   
        #[allow(
   52     52   
            unused_variables,
   53     53   
            unreachable_code,
   54     54   
            clippy::single_match,
   55     55   
            clippy::match_single_binding,
   56     56   
            clippy::diverging_sub_expression
   57     57   
        )]
   58         -
        deserializer.read_struct(&RESULTINPUT_SCHEMA, (), |_, member, deser| {
          58  +
        deserializer.read_struct(&RESULTINPUT_SCHEMA, &mut |member, deser| {
   59     59   
            match member.member_index() {
   60     60   
                Some(0) => {
   61     61   
                    builder.pv_member = Some(deser.read_boolean(member)?);
   62     62   
                }
   63     63   
                _ => {}
   64     64   
            }
   65     65   
            Ok(())
   66     66   
        })?;
   67     67   
        builder
   68     68   
            .build()
   69     69   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   70     70   
    }
   71     71   
}
          72  +
impl ResultInput {
          73  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          74  +
    pub fn deserialize_with_response(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          76  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          77  +
        _status: u16,
          78  +
        _body: &[u8],
          79  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          80  +
        Self::deserialize(deserializer)
          81  +
    }
          82  +
}
   72     83   
impl ResultInput {
   73     84   
    /// Creates a new builder-style object to manufacture [`ResultInput`](crate::operation::result::ResultInput).
   74     85   
    pub fn builder() -> crate::operation::result::builders::ResultInputBuilder {
   75     86   
        crate::operation::result::builders::ResultInputBuilder::default()
   76     87   
    }
   77     88   
}
   78     89   
   79     90   
/// A builder for [`ResultInput`](crate::operation::result::ResultInput).
   80     91   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   81     92   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/result/_result_output.rs

@@ -16,16 +99,110 @@
   36     36   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   37     37   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   38     38   
        if let Some(ref val) = self.pv_member {
   39     39   
            ser.write_boolean(&RESULTOUTPUT_MEMBER_PV_MEMBER, *val)?;
   40     40   
        }
   41     41   
        Ok(())
   42     42   
    }
   43     43   
}
   44     44   
impl ResultOutput {
   45     45   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   46         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   47         -
        deserializer: &mut D,
          46  +
    pub fn deserialize(
          47  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   48     48   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        #[allow(unused_variables, unused_mut)]
   50     50   
        let mut builder = Self::builder();
   51     51   
        #[allow(
   52     52   
            unused_variables,
   53     53   
            unreachable_code,
   54     54   
            clippy::single_match,
   55     55   
            clippy::match_single_binding,
   56     56   
            clippy::diverging_sub_expression
   57     57   
        )]
   58         -
        deserializer.read_struct(&RESULTOUTPUT_SCHEMA, (), |_, member, deser| {
          58  +
        deserializer.read_struct(&RESULTOUTPUT_SCHEMA, &mut |member, deser| {
   59     59   
            match member.member_index() {
   60     60   
                Some(0) => {
   61     61   
                    builder.pv_member = Some(deser.read_boolean(member)?);
   62     62   
                }
   63     63   
                _ => {}
   64     64   
            }
   65     65   
            Ok(())
   66     66   
        })?;
   67     67   
        Ok(builder.build())
   68     68   
    }
   69     69   
}
          70  +
impl ResultOutput {
          71  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          72  +
    pub fn deserialize_with_response(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          74  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          75  +
        _status: u16,
          76  +
        _body: &[u8],
          77  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          78  +
        Self::deserialize(deserializer)
          79  +
    }
          80  +
}
   70     81   
impl ResultOutput {
   71     82   
    /// Creates a new builder-style object to manufacture [`ResultOutput`](crate::operation::result::ResultOutput).
   72     83   
    pub fn builder() -> crate::operation::result::builders::ResultOutputBuilder {
   73     84   
        crate::operation::result::builders::ResultOutputBuilder::default()
   74     85   
    }
   75     86   
}
   76     87   
   77     88   
/// A builder for [`ResultOutput`](crate::operation::result::ResultOutput).
   78     89   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   79     90   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/rpc_echo.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 `RPCEcho`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct RPCEcho;
    6      6   
impl RPCEcho {
    7      7   
    /// Creates a new `RPCEcho`
    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::rpc_echo::RpcEchoInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::rpc_echo::RpcEchoOutput::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::rpc_echo::RpcEchoInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::rpc_echo::RpcEchoOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::rpc_echo::RPCEchoError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -97,101 +222,254 @@
  117    121   
                crate::operation::rpc_echo::RPCEchoError,
  118    122   
            >::new());
  119    123   
  120    124   
        ::std::borrow::Cow::Owned(rcb)
  121    125   
    }
  122    126   
}
  123    127   
  124    128   
#[derive(Debug)]
  125    129   
struct RPCEchoResponseDeserializer;
  126    130   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RPCEchoResponseDeserializer {
  127         -
    fn deserialize_nonstreaming(
         131  +
    fn deserialize_nonstreaming_with_config(
  128    132   
        &self,
  129    133   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         134  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  130    135   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  131    136   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         137  +
        #[allow(unused_mut)]
         138  +
        let mut force_error = false;
         139  +
         140  +
        if !success && status != 200 || force_error {
  132    141   
            let headers = response.headers();
  133    142   
            let body = response.body().bytes().expect("body loaded");
  134    143   
            #[allow(unused_mut)]
  135         -
        let mut force_error = false;
         144  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         145  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         146  +
            })?;
  136    147   
  137         -
        let parse_result = if !success && status != 200 || force_error {
  138         -
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_error(status, headers, body)
  139         -
        } else {
  140         -
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_response(status, headers, body)
         148  +
            let generic = generic_builder.build();
         149  +
            let error_code = match generic.code() {
         150  +
                ::std::option::Option::Some(code) => code,
         151  +
                ::std::option::Option::None => {
         152  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         153  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::rpc_echo::RPCEchoError::unhandled(generic)),
         154  +
                    ))
         155  +
                }
  141    156   
            };
  142         -
        crate::protocol_serde::type_erase_result(parse_result)
         157  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         158  +
            let protocol = _cfg
         159  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         160  +
                .expect("a SharedClientProtocol is required");
         161  +
            let err = match error_code {
         162  +
                "ValidationException" => crate::operation::rpc_echo::RPCEchoError::ValidationException({
         163  +
                    let mut tmp = match protocol
         164  +
                        .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
         165  +
                        .and_then(|mut deser| {
         166  +
                            crate::types::error::ValidationException::deserialize_with_response(
         167  +
                                &mut *deser,
         168  +
                                response.headers(),
         169  +
                                response.status().into(),
         170  +
                                body,
         171  +
                            )
         172  +
                        }) {
         173  +
                        ::std::result::Result::Ok(val) => val,
         174  +
                        ::std::result::Result::Err(e) => {
         175  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         176  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         177  +
                            ))
         178  +
                        }
         179  +
                    };
         180  +
                    tmp.meta = generic;
         181  +
                    tmp
         182  +
                }),
         183  +
                _ => crate::operation::rpc_echo::RPCEchoError::generic(generic),
         184  +
            };
         185  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         186  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         187  +
            ))
         188  +
        } else {
         189  +
            let protocol = _cfg
         190  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         191  +
                .expect("a SharedClientProtocol is required");
         192  +
            let mut deser = protocol.deserialize_response(response, RPCEcho::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         193  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         194  +
            })?;
         195  +
            let body = response.body().bytes().expect("body loaded");
         196  +
            let output =
         197  +
                crate::operation::rpc_echo::RpcEchoOutput::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
         198  +
                    .map_err(|e| {
         199  +
                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
         200  +
                            e,
         201  +
                        ))
         202  +
                    })?;
         203  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         204  +
        }
  143    205   
    }
  144    206   
}
  145    207   
#[derive(Debug)]
  146    208   
struct RPCEchoRequestSerializer;
  147    209   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RPCEchoRequestSerializer {
  148    210   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  149    211   
    fn serialize_input(
  150    212   
        &self,
  151    213   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  152    214   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  153    215   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  154    216   
        let input = input.downcast::<crate::operation::rpc_echo::RpcEchoInput>().expect("correct type");
  155         -
        let _header_serialization_settings = _cfg
  156         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  157         -
            .cloned()
  158         -
            .unwrap_or_default();
  159         -
        let mut request_builder = {
  160         -
            #[allow(clippy::uninlined_format_args)]
  161         -
            fn uri_base(
  162         -
                _input: &crate::operation::rpc_echo::RpcEchoInput,
  163         -
                output: &mut ::std::string::String,
  164         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  165         -
                use ::std::fmt::Write as _;
  166         -
                ::std::write!(output, "/").expect("formatting should succeed");
  167         -
                ::std::result::Result::Ok(())
  168         -
            }
  169         -
            #[allow(clippy::unnecessary_wraps)]
  170         -
            fn update_http_builder(
  171         -
                input: &crate::operation::rpc_echo::RpcEchoInput,
  172         -
                builder: ::http_1x::request::Builder,
  173         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  174         -
                let mut uri = ::std::string::String::new();
  175         -
                uri_base(input, &mut uri)?;
  176         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  177         -
            }
  178         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  179         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  180         -
            builder = _header_serialization_settings.set_default_header(
  181         -
                builder,
  182         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  183         -
                "Config.RPCEcho",
  184         -
            );
  185         -
            builder
  186         -
        };
  187         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_input(&input)?);
  188         -
        if let Some(content_length) = body.content_length() {
  189         -
            let content_length = content_length.to_string();
  190         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  191         -
        }
  192         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         217  +
        let protocol = _cfg
         218  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         219  +
            .expect("a SharedClientProtocol is required");
         220  +
        let mut request = protocol
         221  +
            .serialize_request(&input, RPCEcho::INPUT_SCHEMA, "", _cfg)
         222  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         223  +
         224  +
        return ::std::result::Result::Ok(request);
  193    225   
    }
  194    226   
}
  195    227   
#[derive(Debug)]
  196    228   
struct RPCEchoEndpointParamsInterceptor;
  197    229   
  198    230   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RPCEchoEndpointParamsInterceptor {
  199    231   
    fn name(&self) -> &'static str {
  200    232   
        "RPCEchoEndpointParamsInterceptor"
  201    233   
    }
  202    234   

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/rpc_echo/_rpc_echo_input.rs

@@ -38,38 +255,266 @@
   58     58   
    #[allow(missing_docs)] // documentation missing in model
   59     59   
    pub fn send_value(&self) -> ::std::option::Option<&str> {
   60     60   
        self.send_value.as_deref()
   61     61   
    }
   62     62   
}
   63     63   
static RPCECHOINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   64     64   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput", "crate.synthetic", "RPCEchoInput");
   65     65   
static RPCECHOINPUT_MEMBER_AS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   66     66   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$as", "crate.synthetic", "RPCEchoInput"),
   67     67   
    ::aws_smithy_schema::ShapeType::Integer,
   68         -
    "r##as",
          68  +
    "as",
   69     69   
    0,
   70     70   
);
   71     71   
static RPCECHOINPUT_MEMBER_ASYNC: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   72     72   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$async", "crate.synthetic", "RPCEchoInput"),
   73     73   
    ::aws_smithy_schema::ShapeType::Boolean,
   74         -
    "r##async",
          74  +
    "async",
   75     75   
    1,
   76     76   
);
   77     77   
static RPCECHOINPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$enum", "crate.synthetic", "RPCEchoInput"),
   79     79   
    ::aws_smithy_schema::ShapeType::String,
   80         -
    "r##enum",
          80  +
    "enum",
   81     81   
    2,
   82     82   
);
   83     83   
static RPCECHOINPUT_MEMBER_SELF_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$self", "crate.synthetic", "RPCEchoInput"),
   85     85   
    ::aws_smithy_schema::ShapeType::Boolean,
   86         -
    "self_",
          86  +
    "self",
   87     87   
    3,
   88     88   
);
   89     89   
static RPCECHOINPUT_MEMBER_CRATE_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   90     90   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$crate", "crate.synthetic", "RPCEchoInput"),
   91     91   
    ::aws_smithy_schema::ShapeType::Boolean,
   92         -
    "crate_",
          92  +
    "crate",
   93     93   
    4,
   94     94   
);
   95     95   
static RPCECHOINPUT_MEMBER_SUPER_: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   96     96   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$super", "crate.synthetic", "RPCEchoInput"),
   97     97   
    ::aws_smithy_schema::ShapeType::Boolean,
   98         -
    "super_",
          98  +
    "super",
   99     99   
    5,
  100    100   
);
  101    101   
static RPCECHOINPUT_MEMBER_BUILD_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  102    102   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$build", "crate.synthetic", "RPCEchoInput"),
  103    103   
    ::aws_smithy_schema::ShapeType::String,
  104         -
    "build_value",
         104  +
    "build",
  105    105   
    6,
  106    106   
);
  107    107   
static RPCECHOINPUT_MEMBER_DEFAULT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  108    108   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$default", "crate.synthetic", "RPCEchoInput"),
  109    109   
    ::aws_smithy_schema::ShapeType::String,
  110         -
    "default_value",
         110  +
    "default",
  111    111   
    7,
  112    112   
);
  113    113   
static RPCECHOINPUT_MEMBER_SEND_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  114    114   
    ::aws_smithy_schema::ShapeId::from_static("crate.synthetic#RPCEchoInput$send", "crate.synthetic", "RPCEchoInput"),
  115    115   
    ::aws_smithy_schema::ShapeType::String,
  116         -
    "send_value",
         116  +
    "send",
  117    117   
    8,
  118    118   
);
  119    119   
static RPCECHOINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  120    120   
    RPCECHOINPUT_SCHEMA_ID,
  121    121   
    ::aws_smithy_schema::ShapeType::Structure,
  122    122   
    &[
  123    123   
        &RPCECHOINPUT_MEMBER_AS,
  124    124   
        &RPCECHOINPUT_MEMBER_ASYNC,
  125    125   
        &RPCECHOINPUT_MEMBER_ENUM,
  126    126   
        &RPCECHOINPUT_MEMBER_SELF_,
  127    127   
        &RPCECHOINPUT_MEMBER_CRATE_,
  128    128   
        &RPCECHOINPUT_MEMBER_SUPER_,
  129    129   
        &RPCECHOINPUT_MEMBER_BUILD_VALUE,
  130    130   
        &RPCECHOINPUT_MEMBER_DEFAULT_VALUE,
  131    131   
        &RPCECHOINPUT_MEMBER_SEND_VALUE,
  132    132   
    ],
  133    133   
);
  134    134   
impl RpcEchoInput {
  135    135   
    /// The schema for this shape.
  136    136   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RPCECHOINPUT_SCHEMA;
  137    137   
}
  138    138   
impl ::aws_smithy_schema::serde::SerializableStruct for RpcEchoInput {
  139    139   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  140    140   
    fn serialize_members(
  141    141   
        &self,
  142    142   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  143    143   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  144    144   
        if let Some(ref val) = self.r#as {
  145    145   
            ser.write_integer(&RPCECHOINPUT_MEMBER_AS, *val)?;
  146    146   
        }
  147    147   
        if let Some(ref val) = self.r#async {
  148    148   
            ser.write_boolean(&RPCECHOINPUT_MEMBER_ASYNC, *val)?;
  149    149   
        }
  150    150   
        if let Some(ref val) = self.r#enum {
  151    151   
            ser.write_string(&RPCECHOINPUT_MEMBER_ENUM, val.as_str())?;
  152    152   
        }
  153    153   
        if let Some(ref val) = self.self_ {
  154    154   
            ser.write_boolean(&RPCECHOINPUT_MEMBER_SELF_, *val)?;
  155    155   
        }
  156    156   
        if let Some(ref val) = self.crate_ {
  157    157   
            ser.write_boolean(&RPCECHOINPUT_MEMBER_CRATE_, *val)?;
  158    158   
        }
  159    159   
        if let Some(ref val) = self.super_ {
  160    160   
            ser.write_boolean(&RPCECHOINPUT_MEMBER_SUPER_, *val)?;
  161    161   
        }
  162    162   
        if let Some(ref val) = self.build_value {
  163    163   
            ser.write_string(&RPCECHOINPUT_MEMBER_BUILD_VALUE, val)?;
  164    164   
        }
  165    165   
        if let Some(ref val) = self.default_value {
  166    166   
            ser.write_string(&RPCECHOINPUT_MEMBER_DEFAULT_VALUE, val)?;
  167    167   
        }
  168    168   
        if let Some(ref val) = self.send_value {
  169    169   
            ser.write_string(&RPCECHOINPUT_MEMBER_SEND_VALUE, val)?;
  170    170   
        }
  171    171   
        Ok(())
  172    172   
    }
  173    173   
}
  174    174   
impl RpcEchoInput {
  175    175   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  176         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  177         -
        deserializer: &mut D,
         176  +
    pub fn deserialize(
         177  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  178    178   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  179    179   
        #[allow(unused_variables, unused_mut)]
  180    180   
        let mut builder = Self::builder();
  181    181   
        #[allow(
  182    182   
            unused_variables,
  183    183   
            unreachable_code,
  184    184   
            clippy::single_match,
  185    185   
            clippy::match_single_binding,
  186    186   
            clippy::diverging_sub_expression
  187    187   
        )]
  188         -
        deserializer.read_struct(&RPCECHOINPUT_SCHEMA, (), |_, member, deser| {
         188  +
        deserializer.read_struct(&RPCECHOINPUT_SCHEMA, &mut |member, deser| {
  189    189   
            match member.member_index() {
  190    190   
                Some(0) => {
  191    191   
                    builder.r#as = Some(deser.read_integer(member)?);
  192    192   
                }
  193    193   
                Some(1) => {
  194    194   
                    builder.r#async = Some(deser.read_boolean(member)?);
  195    195   
                }
  196    196   
                Some(2) => {
  197    197   
                    builder.r#enum = Some(crate::types::UnknownVariantCollidingEnum::from(deser.read_string(member)?.as_str()));
  198    198   
                }
  199    199   
                Some(3) => {
  200    200   
                    builder.self_ = Some(deser.read_boolean(member)?);
  201    201   
                }
  202    202   
                Some(4) => {
  203    203   
                    builder.crate_ = Some(deser.read_boolean(member)?);
  204    204   
                }
  205    205   
                Some(5) => {
  206    206   
                    builder.super_ = Some(deser.read_boolean(member)?);
  207    207   
                }
  208    208   
                Some(6) => {
  209    209   
                    builder.build_value = Some(deser.read_string(member)?);
  210    210   
                }
  211    211   
                Some(7) => {
  212    212   
                    builder.default_value = Some(deser.read_string(member)?);
  213    213   
                }
  214    214   
                Some(8) => {
  215    215   
                    builder.send_value = Some(deser.read_string(member)?);
  216    216   
                }
  217    217   
                _ => {}
  218    218   
            }
  219    219   
            Ok(())
  220    220   
        })?;
  221    221   
        builder
  222    222   
            .build()
  223    223   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  224    224   
    }
  225    225   
}
         226  +
impl RpcEchoInput {
         227  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         228  +
    pub fn deserialize_with_response(
         229  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         230  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         231  +
        _status: u16,
         232  +
        _body: &[u8],
         233  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         234  +
        Self::deserialize(deserializer)
         235  +
    }
         236  +
}
  226    237   
impl RpcEchoInput {
  227    238   
    /// Creates a new builder-style object to manufacture [`RpcEchoInput`](crate::operation::rpc_echo::RpcEchoInput).
  228    239   
    pub fn builder() -> crate::operation::rpc_echo::builders::RpcEchoInputBuilder {
  229    240   
        crate::operation::rpc_echo::builders::RpcEchoInputBuilder::default()
  230    241   
    }
  231    242   
}
  232    243   
  233    244   
/// A builder for [`RpcEchoInput`](crate::operation::rpc_echo::RpcEchoInput).
  234    245   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  235    246   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/rpc_echo/_rpc_echo_output.rs

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

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/structure_name_punning.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 `StructureNamePunning`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StructureNamePunning;
    6      6   
impl StructureNamePunning {
    7      7   
    /// Creates a new `StructureNamePunning`
    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::structure_name_punning::StructureNamePunningInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::structure_name_punning::StructureNamePunningOutput::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::structure_name_punning::StructureNamePunningInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::structure_name_punning::StructureNamePunningOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::structure_name_punning::StructureNamePunningError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +233,233 @@
  124    128   
                crate::operation::structure_name_punning::StructureNamePunningError,
  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 StructureNamePunningResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StructureNamePunningResponseDeserializer {
  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_structure_name_punning::de_structure_name_punning_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::structure_name_punning::StructureNamePunningError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, StructureNamePunning::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::structure_name_punning::StructureNamePunningOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct StructureNamePunningRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StructureNamePunningRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::structure_name_punning::StructureNamePunningInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::structure_name_punning::StructureNamePunningInput,
  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::structure_name_punning::StructureNamePunningInput,
  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.1");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "Config.StructureNamePunning",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_input(
  197         -
            &input,
  198         -
        )?);
  199         -
        if let Some(content_length) = body.content_length() {
  200         -
            let content_length = content_length.to_string();
  201         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  202         -
        }
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, StructureNamePunning::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         202  +
         203  +
        return ::std::result::Result::Ok(request);
  204    204   
    }
  205    205   
}
  206    206   
#[derive(Debug)]
  207    207   
struct StructureNamePunningEndpointParamsInterceptor;
  208    208   
  209    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StructureNamePunningEndpointParamsInterceptor {
  210    210   
    fn name(&self) -> &'static str {
  211    211   
        "StructureNamePunningEndpointParamsInterceptor"
  212    212   
    }
  213    213