Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

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

@@ -65,65 +235,235 @@
   85     85   
    "aws.protocoltests.json10.synthetic",
   86     86   
    "OperationWithRequiredMembersOutput",
   87     87   
);
   88     88   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   89     89   
    ::aws_smithy_schema::ShapeId::from_static(
   90     90   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredString",
   91     91   
        "aws.protocoltests.json10.synthetic",
   92     92   
        "OperationWithRequiredMembersOutput",
   93     93   
    ),
   94     94   
    ::aws_smithy_schema::ShapeType::String,
   95         -
    "required_string",
          95  +
    "requiredString",
   96     96   
    0,
   97     97   
);
   98     98   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99     99   
    ::aws_smithy_schema::ShapeId::from_static(
  100    100   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredBoolean",
  101    101   
        "aws.protocoltests.json10.synthetic",
  102    102   
        "OperationWithRequiredMembersOutput",
  103    103   
    ),
  104    104   
    ::aws_smithy_schema::ShapeType::Boolean,
  105         -
    "required_boolean",
         105  +
    "requiredBoolean",
  106    106   
    1,
  107    107   
);
  108    108   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    109   
    ::aws_smithy_schema::ShapeId::from_static(
  110    110   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredList",
  111    111   
        "aws.protocoltests.json10.synthetic",
  112    112   
        "OperationWithRequiredMembersOutput",
  113    113   
    ),
  114    114   
    ::aws_smithy_schema::ShapeType::List,
  115         -
    "required_list",
         115  +
    "requiredList",
  116    116   
    2,
  117    117   
);
  118    118   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  119    119   
    ::aws_smithy_schema::ShapeId::from_static(
  120    120   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredTimestamp",
  121    121   
        "aws.protocoltests.json10.synthetic",
  122    122   
        "OperationWithRequiredMembersOutput",
  123    123   
    ),
  124    124   
    ::aws_smithy_schema::ShapeType::Timestamp,
  125         -
    "required_timestamp",
         125  +
    "requiredTimestamp",
  126    126   
    3,
  127    127   
);
  128    128   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  129    129   
    ::aws_smithy_schema::ShapeId::from_static(
  130    130   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredBlob",
  131    131   
        "aws.protocoltests.json10.synthetic",
  132    132   
        "OperationWithRequiredMembersOutput",
  133    133   
    ),
  134    134   
    ::aws_smithy_schema::ShapeType::Blob,
  135         -
    "required_blob",
         135  +
    "requiredBlob",
  136    136   
    4,
  137    137   
);
  138    138   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  139    139   
    ::aws_smithy_schema::ShapeId::from_static(
  140    140   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredByte",
  141    141   
        "aws.protocoltests.json10.synthetic",
  142    142   
        "OperationWithRequiredMembersOutput",
  143    143   
    ),
  144    144   
    ::aws_smithy_schema::ShapeType::Byte,
  145         -
    "required_byte",
         145  +
    "requiredByte",
  146    146   
    5,
  147    147   
);
  148    148   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  149    149   
    ::aws_smithy_schema::ShapeId::from_static(
  150    150   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredShort",
  151    151   
        "aws.protocoltests.json10.synthetic",
  152    152   
        "OperationWithRequiredMembersOutput",
  153    153   
    ),
  154    154   
    ::aws_smithy_schema::ShapeType::Short,
  155         -
    "required_short",
         155  +
    "requiredShort",
  156    156   
    6,
  157    157   
);
  158    158   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  159    159   
    ::aws_smithy_schema::ShapeId::from_static(
  160    160   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredInteger",
  161    161   
        "aws.protocoltests.json10.synthetic",
  162    162   
        "OperationWithRequiredMembersOutput",
  163    163   
    ),
  164    164   
    ::aws_smithy_schema::ShapeType::Integer,
  165         -
    "required_integer",
         165  +
    "requiredInteger",
  166    166   
    7,
  167    167   
);
  168    168   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  169    169   
    ::aws_smithy_schema::ShapeId::from_static(
  170    170   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredLong",
  171    171   
        "aws.protocoltests.json10.synthetic",
  172    172   
        "OperationWithRequiredMembersOutput",
  173    173   
    ),
  174    174   
    ::aws_smithy_schema::ShapeType::Long,
  175         -
    "required_long",
         175  +
    "requiredLong",
  176    176   
    8,
  177    177   
);
  178    178   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  179    179   
    ::aws_smithy_schema::ShapeId::from_static(
  180    180   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredFloat",
  181    181   
        "aws.protocoltests.json10.synthetic",
  182    182   
        "OperationWithRequiredMembersOutput",
  183    183   
    ),
  184    184   
    ::aws_smithy_schema::ShapeType::Float,
  185         -
    "required_float",
         185  +
    "requiredFloat",
  186    186   
    9,
  187    187   
);
  188    188   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  189    189   
    ::aws_smithy_schema::ShapeId::from_static(
  190    190   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredDouble",
  191    191   
        "aws.protocoltests.json10.synthetic",
  192    192   
        "OperationWithRequiredMembersOutput",
  193    193   
    ),
  194    194   
    ::aws_smithy_schema::ShapeType::Double,
  195         -
    "required_double",
         195  +
    "requiredDouble",
  196    196   
    10,
  197    197   
);
  198    198   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  199    199   
    ::aws_smithy_schema::ShapeId::from_static(
  200    200   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersOutput$requiredMap",
  201    201   
        "aws.protocoltests.json10.synthetic",
  202    202   
        "OperationWithRequiredMembersOutput",
  203    203   
    ),
  204    204   
    ::aws_smithy_schema::ShapeType::Map,
  205         -
    "required_map",
         205  +
    "requiredMap",
  206    206   
    11,
  207    207   
);
  208    208   
static OPERATIONWITHREQUIREDMEMBERSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  209    209   
    OPERATIONWITHREQUIREDMEMBERSOUTPUT_SCHEMA_ID,
  210    210   
    ::aws_smithy_schema::ShapeType::Structure,
  211    211   
    &[
  212    212   
        &OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_STRING,
  213    213   
        &OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_BOOLEAN,
  214    214   
        &OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_LIST,
  215    215   
        &OPERATIONWITHREQUIREDMEMBERSOUTPUT_MEMBER_REQUIRED_TIMESTAMP,
@@ -278,278 +416,419 @@
  298    298   
                    }
  299    299   
                    Ok(())
  300    300   
                },
  301    301   
            )?;
  302    302   
        }
  303    303   
        Ok(())
  304    304   
    }
  305    305   
}
  306    306   
impl OperationWithRequiredMembersOutput {
  307    307   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  308         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  309         -
        deserializer: &mut D,
         308  +
    pub fn deserialize(
         309  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  310    310   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  311    311   
        #[allow(unused_variables, unused_mut)]
  312    312   
        let mut builder = Self::builder();
  313    313   
        #[allow(
  314    314   
            unused_variables,
  315    315   
            unreachable_code,
  316    316   
            clippy::single_match,
  317    317   
            clippy::match_single_binding,
  318    318   
            clippy::diverging_sub_expression
  319    319   
        )]
  320         -
        deserializer.read_struct(&OPERATIONWITHREQUIREDMEMBERSOUTPUT_SCHEMA, (), |_, member, deser| {
         320  +
        deserializer.read_struct(&OPERATIONWITHREQUIREDMEMBERSOUTPUT_SCHEMA, &mut |member, deser| {
  321    321   
            match member.member_index() {
  322    322   
                Some(0) => {
  323    323   
                    builder.required_string = Some(deser.read_string(member)?);
  324    324   
                }
  325    325   
                Some(1) => {
  326    326   
                    builder.required_boolean = Some(deser.read_boolean(member)?);
  327    327   
                }
  328    328   
                Some(2) => {
  329         -
                    builder.required_list = Some({
  330         -
                        let container = if let Some(cap) = deser.container_size() {
  331         -
                            Vec::with_capacity(cap)
  332         -
                        } else {
  333         -
                            Vec::new()
  334         -
                        };
  335         -
                        deser.read_list(member, container, |mut list, deser| {
  336         -
                            list.push(deser.read_string(member)?);
  337         -
                            Ok(list)
  338         -
                        })?
  339         -
                    });
         329  +
                    builder.required_list = Some(deser.read_string_list(member)?);
  340    330   
                }
  341    331   
                Some(3) => {
  342    332   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  343    333   
                }
  344    334   
                Some(4) => {
  345    335   
                    builder.required_blob = Some(deser.read_blob(member)?);
  346    336   
                }
  347    337   
                Some(5) => {
  348    338   
                    builder.required_byte = Some(deser.read_byte(member)?);
  349    339   
                }
  350    340   
                Some(6) => {
  351    341   
                    builder.required_short = Some(deser.read_short(member)?);
  352    342   
                }
  353    343   
                Some(7) => {
  354    344   
                    builder.required_integer = Some(deser.read_integer(member)?);
  355    345   
                }
  356    346   
                Some(8) => {
  357    347   
                    builder.required_long = Some(deser.read_long(member)?);
  358    348   
                }
  359    349   
                Some(9) => {
  360    350   
                    builder.required_float = Some(deser.read_float(member)?);
  361    351   
                }
  362    352   
                Some(10) => {
  363    353   
                    builder.required_double = Some(deser.read_double(member)?);
  364    354   
                }
  365    355   
                Some(11) => {
  366         -
                    builder.required_map = Some({
  367         -
                        let container = if let Some(cap) = deser.container_size() {
  368         -
                            std::collections::HashMap::with_capacity(cap)
  369         -
                        } else {
  370         -
                            std::collections::HashMap::new()
  371         -
                        };
  372         -
                        deser.read_map(member, container, |mut map, key, deser| {
  373         -
                            map.insert(key, deser.read_string(member)?);
  374         -
                            Ok(map)
  375         -
                        })?
  376         -
                    });
         356  +
                    builder.required_map = Some(deser.read_string_string_map(member)?);
  377    357   
                }
  378    358   
                _ => {}
  379    359   
            }
  380    360   
            Ok(())
  381    361   
        })?;
         362  +
        builder.required_string = builder.required_string.or(Some(String::new()));
         363  +
        builder.required_boolean = builder.required_boolean.or(Some(false));
         364  +
        builder.required_list = builder.required_list.or(Some(Vec::new()));
         365  +
        builder.required_timestamp = builder.required_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         366  +
        builder.required_blob = builder.required_blob.or(Some(::aws_smithy_types::Blob::new("")));
         367  +
        builder.required_byte = builder.required_byte.or(Some(0i8));
         368  +
        builder.required_short = builder.required_short.or(Some(0i16));
         369  +
        builder.required_integer = builder.required_integer.or(Some(0i32));
         370  +
        builder.required_long = builder.required_long.or(Some(0i64));
         371  +
        builder.required_float = builder.required_float.or(Some(0.0f32));
         372  +
        builder.required_double = builder.required_double.or(Some(0.0f64));
         373  +
        builder.required_map = builder.required_map.or(Some(::std::collections::HashMap::new()));
  382    374   
        builder
  383    375   
            .build()
  384    376   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  385    377   
    }
  386    378   
}
         379  +
impl OperationWithRequiredMembersOutput {
         380  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         381  +
    pub fn deserialize_with_response(
         382  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         383  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         384  +
        _status: u16,
         385  +
        _body: &[u8],
         386  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         387  +
        Self::deserialize(deserializer)
         388  +
    }
         389  +
}
  387    390   
impl OperationWithRequiredMembersOutput {
  388    391   
    /// Creates a new builder-style object to manufacture [`OperationWithRequiredMembersOutput`](crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput).
  389    392   
    pub fn builder() -> crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder {
  390    393   
        crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder::default()
  391    394   
    }
  392    395   
}
  393    396   
  394    397   
/// A builder for [`OperationWithRequiredMembersOutput`](crate::operation::operation_with_required_members::OperationWithRequiredMembersOutput).
  395    398   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  396    399   
#[non_exhaustive]

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_required_members_with_defaults/_operation_with_required_members_with_defaults_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/operation_with_required_members_with_defaults/_operation_with_required_members_with_defaults_output.rs

@@ -77,77 +268,268 @@
   97     97   
    "aws.protocoltests.json10.synthetic",
   98     98   
    "OperationWithRequiredMembersWithDefaultsOutput",
   99     99   
);
  100    100   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  101    101   
    ::aws_smithy_schema::ShapeId::from_static(
  102    102   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredString",
  103    103   
        "aws.protocoltests.json10.synthetic",
  104    104   
        "OperationWithRequiredMembersWithDefaultsOutput",
  105    105   
    ),
  106    106   
    ::aws_smithy_schema::ShapeType::String,
  107         -
    "required_string",
         107  +
    "requiredString",
  108    108   
    0,
  109    109   
);
  110    110   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredBoolean",
  113    113   
        "aws.protocoltests.json10.synthetic",
  114    114   
        "OperationWithRequiredMembersWithDefaultsOutput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::Boolean,
  117         -
    "required_boolean",
         117  +
    "requiredBoolean",
  118    118   
    1,
  119    119   
);
  120    120   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredList",
  123    123   
        "aws.protocoltests.json10.synthetic",
  124    124   
        "OperationWithRequiredMembersWithDefaultsOutput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::List,
  127         -
    "required_list",
         127  +
    "requiredList",
  128    128   
    2,
  129    129   
);
  130    130   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema =
  131    131   
    ::aws_smithy_schema::Schema::new_member(
  132    132   
        ::aws_smithy_schema::ShapeId::from_static(
  133    133   
            "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredTimestamp",
  134    134   
            "aws.protocoltests.json10.synthetic",
  135    135   
            "OperationWithRequiredMembersWithDefaultsOutput",
  136    136   
        ),
  137    137   
        ::aws_smithy_schema::ShapeType::Timestamp,
  138         -
        "required_timestamp",
         138  +
        "requiredTimestamp",
  139    139   
        3,
  140    140   
    );
  141    141   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  142    142   
    ::aws_smithy_schema::ShapeId::from_static(
  143    143   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredBlob",
  144    144   
        "aws.protocoltests.json10.synthetic",
  145    145   
        "OperationWithRequiredMembersWithDefaultsOutput",
  146    146   
    ),
  147    147   
    ::aws_smithy_schema::ShapeType::Blob,
  148         -
    "required_blob",
         148  +
    "requiredBlob",
  149    149   
    4,
  150    150   
);
  151    151   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  152    152   
    ::aws_smithy_schema::ShapeId::from_static(
  153    153   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredByte",
  154    154   
        "aws.protocoltests.json10.synthetic",
  155    155   
        "OperationWithRequiredMembersWithDefaultsOutput",
  156    156   
    ),
  157    157   
    ::aws_smithy_schema::ShapeType::Byte,
  158         -
    "required_byte",
         158  +
    "requiredByte",
  159    159   
    5,
  160    160   
);
  161    161   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  162    162   
    ::aws_smithy_schema::ShapeId::from_static(
  163    163   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredShort",
  164    164   
        "aws.protocoltests.json10.synthetic",
  165    165   
        "OperationWithRequiredMembersWithDefaultsOutput",
  166    166   
    ),
  167    167   
    ::aws_smithy_schema::ShapeType::Short,
  168         -
    "required_short",
         168  +
    "requiredShort",
  169    169   
    6,
  170    170   
);
  171    171   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  172    172   
    ::aws_smithy_schema::ShapeId::from_static(
  173    173   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredInteger",
  174    174   
        "aws.protocoltests.json10.synthetic",
  175    175   
        "OperationWithRequiredMembersWithDefaultsOutput",
  176    176   
    ),
  177    177   
    ::aws_smithy_schema::ShapeType::Integer,
  178         -
    "required_integer",
         178  +
    "requiredInteger",
  179    179   
    7,
  180    180   
);
  181    181   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  182    182   
    ::aws_smithy_schema::ShapeId::from_static(
  183    183   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredLong",
  184    184   
        "aws.protocoltests.json10.synthetic",
  185    185   
        "OperationWithRequiredMembersWithDefaultsOutput",
  186    186   
    ),
  187    187   
    ::aws_smithy_schema::ShapeType::Long,
  188         -
    "required_long",
         188  +
    "requiredLong",
  189    189   
    8,
  190    190   
);
  191    191   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  192    192   
    ::aws_smithy_schema::ShapeId::from_static(
  193    193   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredFloat",
  194    194   
        "aws.protocoltests.json10.synthetic",
  195    195   
        "OperationWithRequiredMembersWithDefaultsOutput",
  196    196   
    ),
  197    197   
    ::aws_smithy_schema::ShapeType::Float,
  198         -
    "required_float",
         198  +
    "requiredFloat",
  199    199   
    9,
  200    200   
);
  201    201   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  202    202   
    ::aws_smithy_schema::ShapeId::from_static(
  203    203   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredDouble",
  204    204   
        "aws.protocoltests.json10.synthetic",
  205    205   
        "OperationWithRequiredMembersWithDefaultsOutput",
  206    206   
    ),
  207    207   
    ::aws_smithy_schema::ShapeType::Double,
  208         -
    "required_double",
         208  +
    "requiredDouble",
  209    209   
    10,
  210    210   
);
  211    211   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  212    212   
    ::aws_smithy_schema::ShapeId::from_static(
  213    213   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredMap",
  214    214   
        "aws.protocoltests.json10.synthetic",
  215    215   
        "OperationWithRequiredMembersWithDefaultsOutput",
  216    216   
    ),
  217    217   
    ::aws_smithy_schema::ShapeType::Map,
  218         -
    "required_map",
         218  +
    "requiredMap",
  219    219   
    11,
  220    220   
);
  221    221   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  222    222   
    ::aws_smithy_schema::ShapeId::from_static(
  223    223   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredEnum",
  224    224   
        "aws.protocoltests.json10.synthetic",
  225    225   
        "OperationWithRequiredMembersWithDefaultsOutput",
  226    226   
    ),
  227    227   
    ::aws_smithy_schema::ShapeType::String,
  228         -
    "required_enum",
         228  +
    "requiredEnum",
  229    229   
    12,
  230    230   
);
  231    231   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_INT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  232    232   
    ::aws_smithy_schema::ShapeId::from_static(
  233    233   
        "aws.protocoltests.json10.synthetic#OperationWithRequiredMembersWithDefaultsOutput$requiredIntEnum",
  234    234   
        "aws.protocoltests.json10.synthetic",
  235    235   
        "OperationWithRequiredMembersWithDefaultsOutput",
  236    236   
    ),
  237    237   
    ::aws_smithy_schema::ShapeType::Integer,
  238         -
    "required_int_enum",
         238  +
    "requiredIntEnum",
  239    239   
    13,
  240    240   
);
  241    241   
static OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  242    242   
    OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_SCHEMA_ID,
  243    243   
    ::aws_smithy_schema::ShapeType::Structure,
  244    244   
    &[
  245    245   
        &OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_STRING,
  246    246   
        &OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_BOOLEAN,
  247    247   
        &OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_LIST,
  248    248   
        &OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_TIMESTAMP,
@@ -321,321 +463,454 @@
  341    341   
        }
  342    342   
        {
  343    343   
            let val = &self.required_int_enum;
  344    344   
            ser.write_integer(&OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_MEMBER_REQUIRED_INT_ENUM, *val)?;
  345    345   
        }
  346    346   
        Ok(())
  347    347   
    }
  348    348   
}
  349    349   
impl OperationWithRequiredMembersWithDefaultsOutput {
  350    350   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  351         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  352         -
        deserializer: &mut D,
         351  +
    pub fn deserialize(
         352  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  353    353   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  354    354   
        #[allow(unused_variables, unused_mut)]
  355    355   
        let mut builder = Self::builder();
  356    356   
        #[allow(
  357    357   
            unused_variables,
  358    358   
            unreachable_code,
  359    359   
            clippy::single_match,
  360    360   
            clippy::match_single_binding,
  361    361   
            clippy::diverging_sub_expression
  362    362   
        )]
  363         -
        deserializer.read_struct(&OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_SCHEMA, (), |_, member, deser| {
         363  +
        deserializer.read_struct(&OPERATIONWITHREQUIREDMEMBERSWITHDEFAULTSOUTPUT_SCHEMA, &mut |member, deser| {
  364    364   
            match member.member_index() {
  365    365   
                Some(0) => {
  366    366   
                    builder.required_string = Some(deser.read_string(member)?);
  367    367   
                }
  368    368   
                Some(1) => {
  369    369   
                    builder.required_boolean = Some(deser.read_boolean(member)?);
  370    370   
                }
  371    371   
                Some(2) => {
  372         -
                    builder.required_list = Some({
  373         -
                        let container = if let Some(cap) = deser.container_size() {
  374         -
                            Vec::with_capacity(cap)
  375         -
                        } else {
  376         -
                            Vec::new()
  377         -
                        };
  378         -
                        deser.read_list(member, container, |mut list, deser| {
  379         -
                            list.push(deser.read_string(member)?);
  380         -
                            Ok(list)
  381         -
                        })?
  382         -
                    });
         372  +
                    builder.required_list = Some(deser.read_string_list(member)?);
  383    373   
                }
  384    374   
                Some(3) => {
  385    375   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  386    376   
                }
  387    377   
                Some(4) => {
  388    378   
                    builder.required_blob = Some(deser.read_blob(member)?);
  389    379   
                }
  390    380   
                Some(5) => {
  391    381   
                    builder.required_byte = Some(deser.read_byte(member)?);
  392    382   
                }
  393    383   
                Some(6) => {
  394    384   
                    builder.required_short = Some(deser.read_short(member)?);
  395    385   
                }
  396    386   
                Some(7) => {
  397    387   
                    builder.required_integer = Some(deser.read_integer(member)?);
  398    388   
                }
  399    389   
                Some(8) => {
  400    390   
                    builder.required_long = Some(deser.read_long(member)?);
  401    391   
                }
  402    392   
                Some(9) => {
  403    393   
                    builder.required_float = Some(deser.read_float(member)?);
  404    394   
                }
  405    395   
                Some(10) => {
  406    396   
                    builder.required_double = Some(deser.read_double(member)?);
  407    397   
                }
  408    398   
                Some(11) => {
  409         -
                    builder.required_map = Some({
  410         -
                        let container = if let Some(cap) = deser.container_size() {
  411         -
                            std::collections::HashMap::with_capacity(cap)
  412         -
                        } else {
  413         -
                            std::collections::HashMap::new()
  414         -
                        };
  415         -
                        deser.read_map(member, container, |mut map, key, deser| {
  416         -
                            map.insert(key, deser.read_string(member)?);
  417         -
                            Ok(map)
  418         -
                        })?
  419         -
                    });
         399  +
                    builder.required_map = Some(deser.read_string_string_map(member)?);
  420    400   
                }
  421    401   
                Some(12) => {
  422    402   
                    builder.required_enum = Some(crate::types::RequiredEnum::from(deser.read_string(member)?.as_str()));
  423    403   
                }
  424    404   
                Some(13) => {
  425    405   
                    builder.required_int_enum = Some(deser.read_integer(member)?);
  426    406   
                }
  427    407   
                _ => {}
  428    408   
            }
  429    409   
            Ok(())
  430    410   
        })?;
  431    411   
        Ok(builder.build())
  432    412   
    }
  433    413   
}
         414  +
impl OperationWithRequiredMembersWithDefaultsOutput {
         415  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         416  +
    pub fn deserialize_with_response(
         417  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         418  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         419  +
        _status: u16,
         420  +
        _body: &[u8],
         421  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         422  +
        Self::deserialize(deserializer)
         423  +
    }
         424  +
}
  434    425   
impl OperationWithRequiredMembersWithDefaultsOutput {
  435    426   
    /// Creates a new builder-style object to manufacture [`OperationWithRequiredMembersWithDefaultsOutput`](crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsOutput).
  436    427   
    pub fn builder(
  437    428   
    ) -> crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder {
  438    429   
        crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder::default()
  439    430   
    }
  440    431   
}
  441    432   
  442    433   
/// A builder for [`OperationWithRequiredMembersWithDefaultsOutput`](crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsOutput).
  443    434   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]

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

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/put_with_content_encoding/_put_with_content_encoding_output.rs

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

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `QueryIncompatibleOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct QueryIncompatibleOperation;
    6      6   
impl QueryIncompatibleOperation {
    7      7   
    /// Creates a new `QueryIncompatibleOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +236,241 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct QueryIncompatibleOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryIncompatibleOperationResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_query_incompatible_operation::de_query_incompatible_operation_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_query_incompatible_operation::de_query_incompatible_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, QueryIncompatibleOperation::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::query_incompatible_operation::QueryIncompatibleOperationOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct QueryIncompatibleOperationRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryIncompatibleOperationRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonRpc10.QueryIncompatibleOperation",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_query_incompatible_operation::ser_query_incompatible_operation_input(&input)?,
  204         -
        );
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, QueryIncompatibleOperation::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  205    210   
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  207    212   
    }
  208    213   
}
  209    214   
#[derive(Debug)]
  210    215   
struct QueryIncompatibleOperationEndpointParamsInterceptor;
  211    216   
  212    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryIncompatibleOperationEndpointParamsInterceptor {
  213    218   
    fn name(&self) -> &'static str {
  214    219   
        "QueryIncompatibleOperationEndpointParamsInterceptor"
  215    220   
    }
  216    221   

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/query_incompatible_operation/_query_incompatible_operation_input.rs

@@ -1,1 +72,85 @@
   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 QueryIncompatibleOperationInput {
   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(&QUERYINCOMPATIBLEOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&QUERYINCOMPATIBLEOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   41     41   
            match member.member_index() {
   42     42   
                _ => {}
   43     43   
            }
   44     44   
            Ok(())
   45     45   
        })?;
   46     46   
        builder
   47     47   
            .build()
   48     48   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     49   
    }
   50     50   
}
          51  +
impl QueryIncompatibleOperationInput {
          52  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          53  +
    pub fn deserialize_with_response(
          54  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          55  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          56  +
        _status: u16,
          57  +
        _body: &[u8],
          58  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          59  +
        Self::builder()
          60  +
            .build()
          61  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          62  +
    }
          63  +
}
   51     64   
impl QueryIncompatibleOperationInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`QueryIncompatibleOperationInput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput).
   53     66   
    pub fn builder() -> crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationInputBuilder {
   54     67   
        crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`QueryIncompatibleOperationInput`](crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput).
   59     72   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     73   
#[non_exhaustive]

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties.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 `SimpleScalarProperties`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SimpleScalarProperties;
    6      6   
impl SimpleScalarProperties {
    7      7   
    /// Creates a new `SimpleScalarProperties`
    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::simple_scalar_properties::SimpleScalarPropertiesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::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::simple_scalar_properties::SimpleScalarPropertiesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -113,117 +239,239 @@
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct SimpleScalarPropertiesResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarPropertiesResponseDeserializer {
  140    144   
    fn deserialize_nonstreaming(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, SimpleScalarProperties::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct SimpleScalarPropertiesRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SimpleScalarPropertiesRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonRpc10.SimpleScalarProperties",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_input(&input)?,
  204         -
        );
  205         -
        if let Some(content_length) = body.content_length() {
  206         -
            let content_length = content_length.to_string();
  207         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  208         -
        }
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, SimpleScalarProperties::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  210    210   
    }
  211    211   
}
  212    212   
#[derive(Debug)]
  213    213   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  214    214   
  215    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  216    216   
    fn name(&self) -> &'static str {
  217    217   
        "SimpleScalarPropertiesEndpointParamsInterceptor"
  218    218   
    }
  219    219   
@@ -388,388 +568,598 @@
  408    408   
            .expect("the config must have a deserializer");
  409    409   
  410    410   
        let parsed = de.deserialize_streaming(&mut http_response);
  411    411   
        let parsed = parsed.unwrap_or_else(|| {
  412    412   
            let http_response = http_response.map(|body| {
  413    413   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  414    414   
                    body.bytes().unwrap(),
  415    415   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  416    416   
                )))
  417    417   
            });
  418         -
            de.deserialize_nonstreaming(&http_response)
         418  +
            // Build a config bag with the protocol for schema-based deserialization
         419  +
            #[allow(unused_mut)]
         420  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         421  +
            {
         422  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         423  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         424  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         425  +
                ));
         426  +
                test_cfg.push_shared_layer(layer.freeze());
         427  +
            }
         428  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  419    429   
        });
  420    430   
        let parsed = parsed
  421    431   
            .expect("should be successful response")
  422    432   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  423    433   
            .unwrap();
  424    434   
        assert!(
  425    435   
            parsed.float_value.float_equals(&expected_output.float_value),
  426    436   
            "Unexpected value for `float_value` {:?} vs. {:?}",
  427    437   
            expected_output.float_value,
  428    438   
            parsed.float_value
  429    439   
        );
  430    440   
        assert!(
  431    441   
            parsed.double_value.float_equals(&expected_output.double_value),
  432    442   
            "Unexpected value for `double_value` {:?} vs. {:?}",
  433    443   
            expected_output.double_value,
  434    444   
            parsed.double_value
  435    445   
        );
  436    446   
    }
  437    447   
  438    448   
    /// Supports handling Infinity float values.
  439    449   
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
  440    450   
    #[::tokio::test]
  441    451   
    #[::tracing_test::traced_test]
  442    452   
    async fn aws_json10_supports_infinity_float_inputs_response() {
  443    453   
        let expected_output = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::builder()
  444    454   
            .set_float_value(::std::option::Option::Some(
  445    455   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  446    456   
            ))
  447    457   
            .set_double_value(::std::option::Option::Some(
  448    458   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  449    459   
            ))
  450    460   
            .build();
  451    461   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  452    462   
            ::http_1x::response::Builder::new()
  453    463   
                .header("Content-Type", "application/x-amz-json-1.0")
  454    464   
                .status(200)
  455    465   
                .body(::aws_smithy_types::body::SdkBody::from(
  456    466   
                    "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}",
  457    467   
                ))
  458    468   
                .unwrap(),
  459    469   
        )
  460    470   
        .unwrap();
  461    471   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  462    472   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  463    473   
  464    474   
        let op = crate::operation::simple_scalar_properties::SimpleScalarProperties::new();
  465    475   
        let config = op.config().expect("the operation has config");
  466    476   
        let de = config
  467    477   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  468    478   
            .expect("the config must have a deserializer");
  469    479   
  470    480   
        let parsed = de.deserialize_streaming(&mut http_response);
  471    481   
        let parsed = parsed.unwrap_or_else(|| {
  472    482   
            let http_response = http_response.map(|body| {
  473    483   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  474    484   
                    body.bytes().unwrap(),
  475    485   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  476    486   
                )))
  477    487   
            });
  478         -
            de.deserialize_nonstreaming(&http_response)
         488  +
            // Build a config bag with the protocol for schema-based deserialization
         489  +
            #[allow(unused_mut)]
         490  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         491  +
            {
         492  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         493  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         494  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         495  +
                ));
         496  +
                test_cfg.push_shared_layer(layer.freeze());
         497  +
            }
         498  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  479    499   
        });
  480    500   
        let parsed = parsed
  481    501   
            .expect("should be successful response")
  482    502   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  483    503   
            .unwrap();
  484    504   
        assert!(
  485    505   
            parsed.float_value.float_equals(&expected_output.float_value),
  486    506   
            "Unexpected value for `float_value` {:?} vs. {:?}",
  487    507   
            expected_output.float_value,
  488    508   
            parsed.float_value
  489    509   
        );
  490    510   
        assert!(
  491    511   
            parsed.double_value.float_equals(&expected_output.double_value),
  492    512   
            "Unexpected value for `double_value` {:?} vs. {:?}",
  493    513   
            expected_output.double_value,
  494    514   
            parsed.double_value
  495    515   
        );
  496    516   
    }
  497    517   
  498    518   
    /// Supports handling -Infinity float values.
  499    519   
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
  500    520   
    #[::tokio::test]
  501    521   
    #[::tracing_test::traced_test]
  502    522   
    async fn aws_json10_supports_negative_infinity_float_inputs_response() {
  503    523   
        let expected_output = crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput::builder()
  504    524   
            .set_float_value(::std::option::Option::Some(
  505    525   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  506    526   
            ))
  507    527   
            .set_double_value(::std::option::Option::Some(
  508    528   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  509    529   
            ))
  510    530   
            .build();
  511    531   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  512    532   
            ::http_1x::response::Builder::new()
  513    533   
                .header("Content-Type", "application/x-amz-json-1.0")
  514    534   
                .status(200)
  515    535   
                .body(::aws_smithy_types::body::SdkBody::from(
  516    536   
                    "{\n    \"floatValue\": \"-Infinity\",\n    \"doubleValue\": \"-Infinity\"\n}",
  517    537   
                ))
  518    538   
                .unwrap(),
  519    539   
        )
  520    540   
        .unwrap();
  521    541   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  522    542   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  523    543   
  524    544   
        let op = crate::operation::simple_scalar_properties::SimpleScalarProperties::new();
  525    545   
        let config = op.config().expect("the operation has config");
  526    546   
        let de = config
  527    547   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  528    548   
            .expect("the config must have a deserializer");
  529    549   
  530    550   
        let parsed = de.deserialize_streaming(&mut http_response);
  531    551   
        let parsed = parsed.unwrap_or_else(|| {
  532    552   
            let http_response = http_response.map(|body| {
  533    553   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  534    554   
                    body.bytes().unwrap(),
  535    555   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  536    556   
                )))
  537    557   
            });
  538         -
            de.deserialize_nonstreaming(&http_response)
         558  +
            // Build a config bag with the protocol for schema-based deserialization
         559  +
            #[allow(unused_mut)]
         560  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         561  +
            {
         562  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         563  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         564  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("JsonRpc10"),
         565  +
                ));
         566  +
                test_cfg.push_shared_layer(layer.freeze());
         567  +
            }
         568  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  539    569   
        });
  540    570   
        let parsed = parsed
  541    571   
            .expect("should be successful response")
  542    572   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput>()
  543    573   
            .unwrap();
  544    574   
        assert!(
  545    575   
            parsed.float_value.float_equals(&expected_output.float_value),
  546    576   
            "Unexpected value for `float_value` {:?} vs. {:?}",
  547    577   
            expected_output.float_value,
  548    578   
            parsed.float_value

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_input.rs

@@ -3,3 +133,144 @@
   23     23   
    "aws.protocoltests.json10.synthetic",
   24     24   
    "SimpleScalarPropertiesInput",
   25     25   
);
   26     26   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesInput$floatValue",
   29     29   
        "aws.protocoltests.json10.synthetic",
   30     30   
        "SimpleScalarPropertiesInput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::Float,
   33         -
    "float_value",
          33  +
    "floatValue",
   34     34   
    0,
   35     35   
);
   36     36   
static SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesInput$doubleValue",
   39     39   
        "aws.protocoltests.json10.synthetic",
   40     40   
        "SimpleScalarPropertiesInput",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Double,
   43         -
    "double_value",
          43  +
    "doubleValue",
   44     44   
    1,
   45     45   
);
   46     46   
static SIMPLESCALARPROPERTIESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    SIMPLESCALARPROPERTIESINPUT_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE,
   51     51   
        &SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE,
   52     52   
    ],
   53     53   
);
   54     54   
impl SimpleScalarPropertiesInput {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLESCALARPROPERTIESINPUT_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleScalarPropertiesInput {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.float_value {
   65     65   
            ser.write_float(&SIMPLESCALARPROPERTIESINPUT_MEMBER_FLOAT_VALUE, *val)?;
   66     66   
        }
   67     67   
        if let Some(ref val) = self.double_value {
   68     68   
            ser.write_double(&SIMPLESCALARPROPERTIESINPUT_MEMBER_DOUBLE_VALUE, *val)?;
   69     69   
        }
   70     70   
        Ok(())
   71     71   
    }
   72     72   
}
   73     73   
impl SimpleScalarPropertiesInput {
   74     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     78   
        #[allow(unused_variables, unused_mut)]
   79     79   
        let mut builder = Self::builder();
   80     80   
        #[allow(
   81     81   
            unused_variables,
   82     82   
            unreachable_code,
   83     83   
            clippy::single_match,
   84     84   
            clippy::match_single_binding,
   85     85   
            clippy::diverging_sub_expression
   86     86   
        )]
   87         -
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESINPUT_SCHEMA, &mut |member, deser| {
   88     88   
            match member.member_index() {
   89     89   
                Some(0) => {
   90     90   
                    builder.float_value = Some(deser.read_float(member)?);
   91     91   
                }
   92     92   
                Some(1) => {
   93     93   
                    builder.double_value = Some(deser.read_double(member)?);
   94     94   
                }
   95     95   
                _ => {}
   96     96   
            }
   97     97   
            Ok(())
   98     98   
        })?;
   99     99   
        builder
  100    100   
            .build()
  101    101   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  102    102   
    }
  103    103   
}
         104  +
impl SimpleScalarPropertiesInput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         106  +
    pub fn deserialize_with_response(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         108  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         109  +
        _status: u16,
         110  +
        _body: &[u8],
         111  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         112  +
        Self::deserialize(deserializer)
         113  +
    }
         114  +
}
  104    115   
impl SimpleScalarPropertiesInput {
  105    116   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
  106    117   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
  107    118   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder::default()
  108    119   
    }
  109    120   
}
  110    121   
  111    122   
/// A builder for [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
  112    123   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  113    124   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_output.rs

@@ -3,3 +131,142 @@
   23     23   
    "aws.protocoltests.json10.synthetic",
   24     24   
    "SimpleScalarPropertiesOutput",
   25     25   
);
   26     26   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesOutput$floatValue",
   29     29   
        "aws.protocoltests.json10.synthetic",
   30     30   
        "SimpleScalarPropertiesOutput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::Float,
   33         -
    "float_value",
          33  +
    "floatValue",
   34     34   
    0,
   35     35   
);
   36     36   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "aws.protocoltests.json10.synthetic#SimpleScalarPropertiesOutput$doubleValue",
   39     39   
        "aws.protocoltests.json10.synthetic",
   40     40   
        "SimpleScalarPropertiesOutput",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Double,
   43         -
    "double_value",
          43  +
    "doubleValue",
   44     44   
    1,
   45     45   
);
   46     46   
static SIMPLESCALARPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    SIMPLESCALARPROPERTIESOUTPUT_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE,
   51     51   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE,
   52     52   
    ],
   53     53   
);
   54     54   
impl SimpleScalarPropertiesOutput {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLESCALARPROPERTIESOUTPUT_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleScalarPropertiesOutput {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.float_value {
   65     65   
            ser.write_float(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE, *val)?;
   66     66   
        }
   67     67   
        if let Some(ref val) = self.double_value {
   68     68   
            ser.write_double(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE, *val)?;
   69     69   
        }
   70     70   
        Ok(())
   71     71   
    }
   72     72   
}
   73     73   
impl SimpleScalarPropertiesOutput {
   74     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     78   
        #[allow(unused_variables, unused_mut)]
   79     79   
        let mut builder = Self::builder();
   80     80   
        #[allow(
   81     81   
            unused_variables,
   82     82   
            unreachable_code,
   83     83   
            clippy::single_match,
   84     84   
            clippy::match_single_binding,
   85     85   
            clippy::diverging_sub_expression
   86     86   
        )]
   87         -
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
   88     88   
            match member.member_index() {
   89     89   
                Some(0) => {
   90     90   
                    builder.float_value = Some(deser.read_float(member)?);
   91     91   
                }
   92     92   
                Some(1) => {
   93     93   
                    builder.double_value = Some(deser.read_double(member)?);
   94     94   
                }
   95     95   
                _ => {}
   96     96   
            }
   97     97   
            Ok(())
   98     98   
        })?;
   99     99   
        Ok(builder.build())
  100    100   
    }
  101    101   
}
         102  +
impl SimpleScalarPropertiesOutput {
         103  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         104  +
    pub fn deserialize_with_response(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         106  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         107  +
        _status: u16,
         108  +
        _body: &[u8],
         109  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         110  +
        Self::deserialize(deserializer)
         111  +
    }
         112  +
}
  102    113   
impl SimpleScalarPropertiesOutput {
  103    114   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  104    115   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder {
  105    116   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default()
  106    117   
    }
  107    118   
}
  108    119   
  109    120   
/// A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  110    121   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  111    122   
#[non_exhaustive]

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

@@ -1,1 +118,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn type_erase_result<O, E>(
    3         -
    result: ::std::result::Result<O, E>,
    4         -
) -> ::std::result::Result<
    5         -
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6         -
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7         -
>
    8         -
where
    9         -
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10         -
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11         -
{
   12         -
    result
   13         -
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14         -
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15         -
        .map_err(::std::convert::Into::into)
   16         -
}
   17         -
   18      2   
pub fn parse_http_error_metadata(
   19      3   
    _response_status: u16,
   20      4   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21      5   
    response_body: &[u8],
   22      6   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23      7   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24      8   
}
   25         -
   26         -
pub(crate) mod shape_content_type_parameters;
   27         -
   28         -
pub(crate) mod shape_empty_input_and_empty_output;
   29         -
   30         -
pub(crate) mod shape_endpoint_operation;
   31         -
   32         -
pub(crate) mod shape_endpoint_with_host_label_operation;
   33         -
   34         -
pub(crate) mod shape_greeting_with_errors;
   35         -
   36         -
pub(crate) mod shape_host_with_path_operation;
   37         -
   38         -
pub(crate) mod shape_json_unions;
   39         -
   40         -
pub(crate) mod shape_no_input_and_no_output;
   41         -
   42         -
pub(crate) mod shape_no_input_and_output;
   43         -
   44         -
pub(crate) mod shape_operation_with_defaults;
   45         -
   46         -
pub(crate) mod shape_operation_with_nested_structure;
   47         -
   48         -
pub(crate) mod shape_operation_with_required_members;
   49         -
   50         -
pub(crate) mod shape_operation_with_required_members_with_defaults;
   51         -
   52         -
pub(crate) mod shape_put_with_content_encoding;
   53         -
   54         -
pub(crate) mod shape_query_incompatible_operation;
   55         -
   56         -
pub(crate) mod shape_simple_scalar_properties;
   57         -
   58         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   59         -
    if data.is_empty() {
   60         -
        b"{}"
   61         -
    } else {
   62         -
        data
   63         -
    }
   64         -
}
   65         -
   66         -
pub(crate) mod shape_complex_error;
   67         -
   68         -
pub(crate) mod shape_content_type_parameters_input;
   69         -
   70         -
pub(crate) mod shape_endpoint_with_host_label_operation_input;
   71         -
   72         -
pub(crate) mod shape_foo_error;
   73         -
   74         -
pub(crate) mod shape_greeting_with_errors_input;
   75         -
   76         -
pub(crate) mod shape_invalid_greeting;
   77         -
   78         -
pub(crate) mod shape_json_unions_input;
   79         -
   80         -
pub(crate) mod shape_operation_with_defaults_input;
   81         -
   82         -
pub(crate) mod shape_operation_with_nested_structure_input;
   83         -
   84         -
pub(crate) mod shape_put_with_content_encoding_input;
   85         -
   86         -
pub(crate) mod shape_simple_scalar_properties_input;
   87         -
   88         -
pub(crate) mod shape_client_optional_defaults;
   89         -
   90         -
pub(crate) mod shape_complex_nested_error_data;
   91         -
   92         -
pub(crate) mod shape_defaults;
   93         -
   94         -
pub(crate) mod shape_dialog;
   95         -
   96         -
pub(crate) mod shape_dialog_list;
   97         -
   98         -
pub(crate) mod shape_dialog_map;
   99         -
  100         -
pub(crate) mod shape_my_union;
  101         -
  102         -
pub(crate) mod shape_required_string_list;
  103         -
  104         -
pub(crate) mod shape_required_string_map;
  105         -
  106         -
pub(crate) mod shape_test_string_list;
  107         -
  108         -
pub(crate) mod shape_test_string_map;
  109         -
  110         -
pub(crate) mod shape_top_level;
  111         -
  112         -
pub(crate) mod shape_farewell;
  113         -
  114         -
pub(crate) mod shape_greeting_struct;
  115         -
  116         -
pub(crate) mod shape_string_list;
  117         -
  118         -
pub(crate) mod shape_string_map;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_client_optional_defaults.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_client_optional_defaults(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ClientOptionalDefaults,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.member {
    7         -
        object.key("member").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_complex_error.rs

@@ -1,0 +47,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ComplexErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ComplexErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "TopLevel" => {
   14         -
                    builder = builder.set_top_level(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                "Nested" => {
   21         -
                    builder = builder.set_nested(crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(
   22         -
                        tokens, _value,
   23         -
                    )?);
   24         -
                }
   25         -
                "Message" => {
   26         -
                    builder = builder.set_message(
   27         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                            .transpose()?,
   30         -
                    );
   31         -
                }
   32         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
            },
   34         -
            other => {
   35         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36         -
                    "expected object key or end object, found: {other:?}"
   37         -
                )))
   38         -
            }
   39         -
        }
   40         -
    }
   41         -
    if tokens.next().is_some() {
   42         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "found more JSON tokens after completing parsing",
   44         -
        ));
   45         -
    }
   46         -
    Ok(builder)
   47         -
}