Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

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

@@ -68,68 +219,219 @@
   88     88   
    0,
   89     89   
)
   90     90   
.with_http_header("X-Foo");
   91     91   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_STRING_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   92     92   
    ::aws_smithy_schema::ShapeId::from_static(
   93     93   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$stringValue",
   94     94   
        "aws.protocoltests.restxml.xmlns.synthetic",
   95     95   
        "SimpleScalarPropertiesOutput",
   96     96   
    ),
   97     97   
    ::aws_smithy_schema::ShapeType::String,
   98         -
    "string_value",
          98  +
    "stringValue",
   99     99   
    1,
  100    100   
);
  101    101   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  102    102   
    ::aws_smithy_schema::ShapeId::from_static(
  103    103   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$trueBooleanValue",
  104    104   
        "aws.protocoltests.restxml.xmlns.synthetic",
  105    105   
        "SimpleScalarPropertiesOutput",
  106    106   
    ),
  107    107   
    ::aws_smithy_schema::ShapeType::Boolean,
  108         -
    "true_boolean_value",
         108  +
    "trueBooleanValue",
  109    109   
    2,
  110    110   
);
  111    111   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FALSE_BOOLEAN_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  112    112   
    ::aws_smithy_schema::ShapeId::from_static(
  113    113   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$falseBooleanValue",
  114    114   
        "aws.protocoltests.restxml.xmlns.synthetic",
  115    115   
        "SimpleScalarPropertiesOutput",
  116    116   
    ),
  117    117   
    ::aws_smithy_schema::ShapeType::Boolean,
  118         -
    "false_boolean_value",
         118  +
    "falseBooleanValue",
  119    119   
    3,
  120    120   
);
  121    121   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_BYTE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  122    122   
    ::aws_smithy_schema::ShapeId::from_static(
  123    123   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$byteValue",
  124    124   
        "aws.protocoltests.restxml.xmlns.synthetic",
  125    125   
        "SimpleScalarPropertiesOutput",
  126    126   
    ),
  127    127   
    ::aws_smithy_schema::ShapeType::Byte,
  128         -
    "byte_value",
         128  +
    "byteValue",
  129    129   
    4,
  130    130   
);
  131    131   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_SHORT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  132    132   
    ::aws_smithy_schema::ShapeId::from_static(
  133    133   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$shortValue",
  134    134   
        "aws.protocoltests.restxml.xmlns.synthetic",
  135    135   
        "SimpleScalarPropertiesOutput",
  136    136   
    ),
  137    137   
    ::aws_smithy_schema::ShapeType::Short,
  138         -
    "short_value",
         138  +
    "shortValue",
  139    139   
    5,
  140    140   
);
  141    141   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_INTEGER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  142    142   
    ::aws_smithy_schema::ShapeId::from_static(
  143    143   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$integerValue",
  144    144   
        "aws.protocoltests.restxml.xmlns.synthetic",
  145    145   
        "SimpleScalarPropertiesOutput",
  146    146   
    ),
  147    147   
    ::aws_smithy_schema::ShapeType::Integer,
  148         -
    "integer_value",
         148  +
    "integerValue",
  149    149   
    6,
  150    150   
);
  151    151   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_LONG_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  152    152   
    ::aws_smithy_schema::ShapeId::from_static(
  153    153   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$longValue",
  154    154   
        "aws.protocoltests.restxml.xmlns.synthetic",
  155    155   
        "SimpleScalarPropertiesOutput",
  156    156   
    ),
  157    157   
    ::aws_smithy_schema::ShapeType::Long,
  158         -
    "long_value",
         158  +
    "longValue",
  159    159   
    7,
  160    160   
);
  161    161   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FLOAT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  162    162   
    ::aws_smithy_schema::ShapeId::from_static(
  163    163   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$floatValue",
  164    164   
        "aws.protocoltests.restxml.xmlns.synthetic",
  165    165   
        "SimpleScalarPropertiesOutput",
  166    166   
    ),
  167    167   
    ::aws_smithy_schema::ShapeType::Float,
  168         -
    "float_value",
         168  +
    "floatValue",
  169    169   
    8,
  170    170   
);
  171    171   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  172    172   
    ::aws_smithy_schema::ShapeId::from_static(
  173    173   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$Nested",
  174    174   
        "aws.protocoltests.restxml.xmlns.synthetic",
  175    175   
        "SimpleScalarPropertiesOutput",
  176    176   
    ),
  177    177   
    ::aws_smithy_schema::ShapeType::Structure,
  178         -
    "nested",
         178  +
    "Nested",
  179    179   
    9,
  180    180   
)
  181    181   
.with_xml_namespace();
  182    182   
static SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static(
  184    184   
        "aws.protocoltests.restxml.xmlns.synthetic#SimpleScalarPropertiesOutput$doubleValue",
  185    185   
        "aws.protocoltests.restxml.xmlns.synthetic",
  186    186   
        "SimpleScalarPropertiesOutput",
  187    187   
    ),
  188    188   
    ::aws_smithy_schema::ShapeType::Double,
  189         -
    "double_value",
         189  +
    "doubleValue",
  190    190   
    10,
  191    191   
)
  192    192   
.with_xml_name("DoubleDribble");
  193    193   
static SIMPLESCALARPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  194    194   
    SIMPLESCALARPROPERTIESOUTPUT_SCHEMA_ID,
  195    195   
    ::aws_smithy_schema::ShapeType::Structure,
  196    196   
    &[
  197    197   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_FOO,
  198    198   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_STRING_VALUE,
  199    199   
        &SIMPLESCALARPROPERTIESOUTPUT_MEMBER_TRUE_BOOLEAN_VALUE,
@@ -228,228 +341,403 @@
  248    248   
            ser.write_struct(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_NESTED, val)?;
  249    249   
        }
  250    250   
        if let Some(ref val) = self.double_value {
  251    251   
            ser.write_double(&SIMPLESCALARPROPERTIESOUTPUT_MEMBER_DOUBLE_VALUE, *val)?;
  252    252   
        }
  253    253   
        Ok(())
  254    254   
    }
  255    255   
}
  256    256   
impl SimpleScalarPropertiesOutput {
  257    257   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  258         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  259         -
        deserializer: &mut D,
         258  +
    pub fn deserialize(
         259  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  260    260   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  261    261   
        #[allow(unused_variables, unused_mut)]
  262    262   
        let mut builder = Self::builder();
  263    263   
        #[allow(
  264    264   
            unused_variables,
  265    265   
            unreachable_code,
  266    266   
            clippy::single_match,
  267    267   
            clippy::match_single_binding,
  268    268   
            clippy::diverging_sub_expression
  269    269   
        )]
  270         -
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, (), |_, member, deser| {
         270  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
  271    271   
            match member.member_index() {
  272    272   
                Some(0) => {
  273    273   
                    builder.foo = Some(deser.read_string(member)?);
  274    274   
                }
  275    275   
                Some(1) => {
  276    276   
                    builder.string_value = Some(deser.read_string(member)?);
  277    277   
                }
  278    278   
                Some(2) => {
  279    279   
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
  280    280   
                }
  281    281   
                Some(3) => {
  282    282   
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
  283    283   
                }
  284    284   
                Some(4) => {
  285    285   
                    builder.byte_value = Some(deser.read_byte(member)?);
  286    286   
                }
  287    287   
                Some(5) => {
  288    288   
                    builder.short_value = Some(deser.read_short(member)?);
  289    289   
                }
  290    290   
                Some(6) => {
  291    291   
                    builder.integer_value = Some(deser.read_integer(member)?);
  292    292   
                }
  293    293   
                Some(7) => {
  294    294   
                    builder.long_value = Some(deser.read_long(member)?);
  295    295   
                }
  296    296   
                Some(8) => {
  297    297   
                    builder.float_value = Some(deser.read_float(member)?);
  298    298   
                }
  299    299   
                Some(9) => {
  300    300   
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
  301    301   
                }
  302    302   
                Some(10) => {
  303    303   
                    builder.double_value = Some(deser.read_double(member)?);
  304    304   
                }
  305    305   
                _ => {}
  306    306   
            }
  307    307   
            Ok(())
  308    308   
        })?;
  309    309   
        Ok(builder.build())
  310    310   
    }
  311    311   
}
         312  +
impl SimpleScalarPropertiesOutput {
         313  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         314  +
    /// Header-bound members are read directly from headers, avoiding runtime
         315  +
    /// member iteration overhead. Body members are read via the deserializer.
         316  +
    pub fn deserialize_with_response(
         317  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         318  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         319  +
        _status: u16,
         320  +
        _body: &[u8],
         321  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         322  +
        #[allow(unused_variables, unused_mut)]
         323  +
        let mut builder = Self::builder();
         324  +
        if let Some(val) = headers.get("X-Foo") {
         325  +
            builder.foo = Some(val.to_string());
         326  +
        }
         327  +
        #[allow(
         328  +
            unused_variables,
         329  +
            unreachable_code,
         330  +
            clippy::single_match,
         331  +
            clippy::match_single_binding,
         332  +
            clippy::diverging_sub_expression
         333  +
        )]
         334  +
        deserializer.read_struct(&SIMPLESCALARPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
         335  +
            match member.member_index() {
         336  +
                Some(0) => { /* read from headers above */ }
         337  +
                Some(1) => {
         338  +
                    builder.string_value = Some(deser.read_string(member)?);
         339  +
                }
         340  +
                Some(2) => {
         341  +
                    builder.true_boolean_value = Some(deser.read_boolean(member)?);
         342  +
                }
         343  +
                Some(3) => {
         344  +
                    builder.false_boolean_value = Some(deser.read_boolean(member)?);
         345  +
                }
         346  +
                Some(4) => {
         347  +
                    builder.byte_value = Some(deser.read_byte(member)?);
         348  +
                }
         349  +
                Some(5) => {
         350  +
                    builder.short_value = Some(deser.read_short(member)?);
         351  +
                }
         352  +
                Some(6) => {
         353  +
                    builder.integer_value = Some(deser.read_integer(member)?);
         354  +
                }
         355  +
                Some(7) => {
         356  +
                    builder.long_value = Some(deser.read_long(member)?);
         357  +
                }
         358  +
                Some(8) => {
         359  +
                    builder.float_value = Some(deser.read_float(member)?);
         360  +
                }
         361  +
                Some(9) => {
         362  +
                    builder.nested = Some(crate::types::NestedWithNamespace::deserialize(deser)?);
         363  +
                }
         364  +
                Some(10) => {
         365  +
                    builder.double_value = Some(deser.read_double(member)?);
         366  +
                }
         367  +
                _ => {}
         368  +
            }
         369  +
            Ok(())
         370  +
        })?;
         371  +
        Ok(builder.build())
         372  +
    }
         373  +
}
  312    374   
impl SimpleScalarPropertiesOutput {
  313    375   
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  314    376   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder {
  315    377   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default()
  316    378   
    }
  317    379   
}
  318    380   
  319    381   
/// A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
  320    382   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  321    383   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/types/_nested_with_namespace.rs

@@ -1,1 +108,119 @@
   17     17   
    "aws.protocoltests.restxml.xmlns",
   18     18   
    "NestedWithNamespace",
   19     19   
);
   20     20   
static NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.xmlns#NestedWithNamespace$attrField",
   23     23   
        "aws.protocoltests.restxml.xmlns",
   24     24   
        "NestedWithNamespace",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "attr_field",
          27  +
    "attrField",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_name("xsi:someName")
   31     31   
.with_xml_attribute();
   32     32   
static NESTEDWITHNAMESPACE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    NESTEDWITHNAMESPACE_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD],
   36     36   
);
   37     37   
impl NestedWithNamespace {
   38     38   
    /// The schema for this shape.
   39     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &NESTEDWITHNAMESPACE_SCHEMA;
   40     40   
}
   41     41   
impl ::aws_smithy_schema::serde::SerializableStruct for NestedWithNamespace {
   42     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     43   
    fn serialize_members(
   44     44   
        &self,
   45     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     47   
        if let Some(ref val) = self.attr_field {
   48     48   
            ser.write_string(&NESTEDWITHNAMESPACE_MEMBER_ATTR_FIELD, val)?;
   49     49   
        }
   50     50   
        Ok(())
   51     51   
    }
   52     52   
}
   53     53   
impl NestedWithNamespace {
   54     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     58   
        #[allow(unused_variables, unused_mut)]
   59     59   
        let mut builder = Self::builder();
   60     60   
        #[allow(
   61     61   
            unused_variables,
   62     62   
            unreachable_code,
   63     63   
            clippy::single_match,
   64     64   
            clippy::match_single_binding,
   65     65   
            clippy::diverging_sub_expression
   66     66   
        )]
   67         -
        deserializer.read_struct(&NESTEDWITHNAMESPACE_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&NESTEDWITHNAMESPACE_SCHEMA, &mut |member, deser| {
   68     68   
            match member.member_index() {
   69     69   
                Some(0) => {
   70     70   
                    builder.attr_field = Some(deser.read_string(member)?);
   71     71   
                }
   72     72   
                _ => {}
   73     73   
            }
   74     74   
            Ok(())
   75     75   
        })?;
   76     76   
        Ok(builder.build())
   77     77   
    }
   78     78   
}
          79  +
impl NestedWithNamespace {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          81  +
    pub fn deserialize_with_response(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          83  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          84  +
        _status: u16,
          85  +
        _body: &[u8],
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        Self::deserialize(deserializer)
          88  +
    }
          89  +
}
   79     90   
impl NestedWithNamespace {
   80     91   
    /// Creates a new builder-style object to manufacture [`NestedWithNamespace`](crate::types::NestedWithNamespace).
   81     92   
    pub fn builder() -> crate::types::builders::NestedWithNamespaceBuilder {
   82     93   
        crate::types::builders::NestedWithNamespaceBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`NestedWithNamespace`](crate::types::NestedWithNamespace).
   87     98   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88     99   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/empty_input_output.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 `EmptyInputOutput`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EmptyInputOutput;
    6      6   
impl EmptyInputOutput {
    7      7   
    /// Creates a new `EmptyInputOutput`
    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::empty_input_output::EmptyInputOutputInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::empty_input_output::EmptyInputOutputOutput::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::empty_input_output::EmptyInputOutputInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::empty_input_output::EmptyInputOutputOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::empty_input_output::EmptyInputOutputError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct EmptyInputOutputResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyInputOutputResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_empty_input_output::de_empty_input_output_http_error(status, headers, body)
  146    151   
        } else {
@@ -285,290 +385,398 @@
  305    310   
            .expect("the config must have a deserializer");
  306    311   
  307    312   
        let parsed = de.deserialize_streaming(&mut http_response);
  308    313   
        let parsed = parsed.unwrap_or_else(|| {
  309    314   
            let http_response = http_response.map(|body| {
  310    315   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  311    316   
                    body.bytes().unwrap(),
  312    317   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  313    318   
                )))
  314    319   
            });
  315         -
            de.deserialize_nonstreaming(&http_response)
         320  +
            // Build a config bag with the protocol for schema-based deserialization
         321  +
            #[allow(unused_mut)]
         322  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         323  +
         324  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  316    325   
        });
  317    326   
        let parsed = parsed
  318    327   
            .expect("should be successful response")
  319    328   
            .downcast::<crate::operation::empty_input_output::EmptyInputOutputOutput>()
  320    329   
            .unwrap();
  321    330   
    }
  322    331   
  323    332   
    /// When output structure is empty the client should accept an empty body
  324    333   
    /// Test ID: empty_output_no_body
  325    334   
    #[::tokio::test]
  326    335   
    #[::tracing_test::traced_test]
  327    336   
    async fn empty_output_no_body_response() {
  328    337   
        let expected_output = crate::operation::empty_input_output::EmptyInputOutputOutput::builder().build();
  329    338   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  330    339   
            ::http_1x::response::Builder::new()
  331    340   
                .header("Content-Type", "application/cbor")
  332    341   
                .header("smithy-protocol", "rpc-v2-cbor")
  333    342   
                .status(200)
  334    343   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  335    344   
                .unwrap(),
  336    345   
        )
  337    346   
        .unwrap();
  338    347   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  339    348   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  340    349   
  341    350   
        let op = crate::operation::empty_input_output::EmptyInputOutput::new();
  342    351   
        let config = op.config().expect("the operation has config");
  343    352   
        let de = config
  344    353   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  345    354   
            .expect("the config must have a deserializer");
  346    355   
  347    356   
        let parsed = de.deserialize_streaming(&mut http_response);
  348    357   
        let parsed = parsed.unwrap_or_else(|| {
  349    358   
            let http_response = http_response.map(|body| {
  350    359   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  351    360   
                    body.bytes().unwrap(),
  352    361   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  353    362   
                )))
  354    363   
            });
  355         -
            de.deserialize_nonstreaming(&http_response)
         364  +
            // Build a config bag with the protocol for schema-based deserialization
         365  +
            #[allow(unused_mut)]
         366  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         367  +
         368  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  356    369   
        });
  357    370   
        let parsed = parsed
  358    371   
            .expect("should be successful response")
  359    372   
            .downcast::<crate::operation::empty_input_output::EmptyInputOutputOutput>()
  360    373   
            .unwrap();
  361    374   
    }
  362    375   
}
  363    376   
  364    377   
/// Error type for the `EmptyInputOutputError` operation.
  365    378   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/empty_input_output/_empty_input_output_input.rs

@@ -1,1 +69,82 @@
   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 EmptyInputOutputInput {
   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(&EMPTYINPUTOUTPUTINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&EMPTYINPUTOUTPUTINPUT_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 EmptyInputOutputInput {
          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 EmptyInputOutputInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`EmptyInputOutputInput`](crate::operation::empty_input_output::EmptyInputOutputInput).
   53     66   
    pub fn builder() -> crate::operation::empty_input_output::builders::EmptyInputOutputInputBuilder {
   54     67   
        crate::operation::empty_input_output::builders::EmptyInputOutputInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`EmptyInputOutputInput`](crate::operation::empty_input_output::EmptyInputOutputInput).
   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/rpcv2Cbor/rust-client-codegen/src/operation/empty_input_output/_empty_input_output_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 EmptyInputOutputOutput {
   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(&EMPTYINPUTOUTPUTOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&EMPTYINPUTOUTPUTOUTPUT_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 EmptyInputOutputOutput {
          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 EmptyInputOutputOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`EmptyInputOutputOutput`](crate::operation::empty_input_output::EmptyInputOutputOutput).
   51     62   
    pub fn builder() -> crate::operation::empty_input_output::builders::EmptyInputOutputOutputBuilder {
   52     63   
        crate::operation::empty_input_output::builders::EmptyInputOutputOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`EmptyInputOutputOutput`](crate::operation::empty_input_output::EmptyInputOutputOutput).
   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/rpcv2Cbor/rust-client-codegen/src/operation/float16.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 `Float16`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct Float16;
    6      6   
impl Float16 {
    7      7   
    /// Creates a new `Float16`
    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::float16::Float16Input::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::float16::Float16Output::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::float16::Float16Input,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::float16::Float16Output,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::float16::Float16Error,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -100,104 +159,164 @@
  120    124   
        ::std::borrow::Cow::Owned(rcb)
  121    125   
    }
  122    126   
}
  123    127   
  124    128   
#[derive(Debug)]
  125    129   
struct Float16ResponseDeserializer;
  126    130   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for Float16ResponseDeserializer {
  127    131   
    fn deserialize_nonstreaming(
  128    132   
        &self,
  129    133   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         134  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  130    135   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  131    136   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  132    137   
        let headers = response.headers();
  133    138   
        let body = response.body().bytes().expect("body loaded");
  134    139   
        #[allow(unused_mut)]
  135    140   
        let mut force_error = false;
  136    141   
  137    142   
        let parse_result = if !success && status != 200 || force_error {
  138    143   
            crate::protocol_serde::shape_float16::de_float16_http_error(status, headers, body)
  139    144   
        } else {
@@ -242,247 +500,525 @@
  262    267   
            .expect("the config must have a deserializer");
  263    268   
  264    269   
        let parsed = de.deserialize_streaming(&mut http_response);
  265    270   
        let parsed = parsed.unwrap_or_else(|| {
  266    271   
            let http_response = http_response.map(|body| {
  267    272   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  268    273   
                    body.bytes().unwrap(),
  269    274   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  270    275   
                )))
  271    276   
            });
  272         -
            de.deserialize_nonstreaming(&http_response)
         277  +
            // Build a config bag with the protocol for schema-based deserialization
         278  +
            #[allow(unused_mut)]
         279  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         280  +
         281  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  273    282   
        });
  274    283   
        let parsed = parsed
  275    284   
            .expect("should be successful response")
  276    285   
            .downcast::<crate::operation::float16::Float16Output>()
  277    286   
            .unwrap();
  278    287   
        assert!(
  279    288   
            parsed.value.float_equals(&expected_output.value),
  280    289   
            "Unexpected value for `value` {:?} vs. {:?}",
  281    290   
            expected_output.value,
  282    291   
            parsed.value
  283    292   
        );
  284    293   
    }
  285    294   
  286    295   
    /// Ensures that clients can correctly parse float16 -Inf.
  287    296   
    /// Test ID: RpcV2CborFloat16NegInf
  288    297   
    #[::tokio::test]
  289    298   
    #[::tracing_test::traced_test]
  290    299   
    async fn rpc_v2_cbor_float16_neg_inf_response() {
  291    300   
        let expected_output = crate::operation::float16::Float16Output::builder()
  292    301   
            .set_value(::std::option::Option::Some(
  293    302   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  294    303   
            ))
  295    304   
            .build();
  296    305   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  297    306   
            ::http_1x::response::Builder::new()
  298    307   
                .header("Content-Type", "application/cbor")
  299    308   
                .header("smithy-protocol", "rpc-v2-cbor")
  300    309   
                .status(200)
  301    310   
                .body(::aws_smithy_types::body::SdkBody::from("oWV2YWx1Zfn8AA=="))
  302    311   
                .unwrap(),
  303    312   
        )
  304    313   
        .unwrap();
  305    314   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  306    315   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  307    316   
  308    317   
        let op = crate::operation::float16::Float16::new();
  309    318   
        let config = op.config().expect("the operation has config");
  310    319   
        let de = config
  311    320   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  312    321   
            .expect("the config must have a deserializer");
  313    322   
  314    323   
        let parsed = de.deserialize_streaming(&mut http_response);
  315    324   
        let parsed = parsed.unwrap_or_else(|| {
  316    325   
            let http_response = http_response.map(|body| {
  317    326   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  318    327   
                    body.bytes().unwrap(),
  319    328   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  320    329   
                )))
  321    330   
            });
  322         -
            de.deserialize_nonstreaming(&http_response)
         331  +
            // Build a config bag with the protocol for schema-based deserialization
         332  +
            #[allow(unused_mut)]
         333  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         334  +
         335  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  323    336   
        });
  324    337   
        let parsed = parsed
  325    338   
            .expect("should be successful response")
  326    339   
            .downcast::<crate::operation::float16::Float16Output>()
  327    340   
            .unwrap();
  328    341   
        assert!(
  329    342   
            parsed.value.float_equals(&expected_output.value),
  330    343   
            "Unexpected value for `value` {:?} vs. {:?}",
  331    344   
            expected_output.value,
  332    345   
            parsed.value
  333    346   
        );
  334    347   
    }
  335    348   
  336    349   
    /// Ensures that clients can correctly parse float16 NaN with high LSB.
  337    350   
    /// Test ID: RpcV2CborFloat16LSBNaN
  338    351   
    #[::tokio::test]
  339    352   
    #[::tracing_test::traced_test]
  340    353   
    async fn rpc_v2_cbor_float16_lsb_na_n_response() {
  341    354   
        let expected_output = crate::operation::float16::Float16Output::builder()
  342    355   
            .set_value(::std::option::Option::Some(
  343    356   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  344    357   
            ))
  345    358   
            .build();
  346    359   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  347    360   
            ::http_1x::response::Builder::new()
  348    361   
                .header("Content-Type", "application/cbor")
  349    362   
                .header("smithy-protocol", "rpc-v2-cbor")
  350    363   
                .status(200)
  351    364   
                .body(::aws_smithy_types::body::SdkBody::from("oWV2YWx1Zfl8AQ=="))
  352    365   
                .unwrap(),
  353    366   
        )
  354    367   
        .unwrap();
  355    368   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  356    369   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  357    370   
  358    371   
        let op = crate::operation::float16::Float16::new();
  359    372   
        let config = op.config().expect("the operation has config");
  360    373   
        let de = config
  361    374   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  362    375   
            .expect("the config must have a deserializer");
  363    376   
  364    377   
        let parsed = de.deserialize_streaming(&mut http_response);
  365    378   
        let parsed = parsed.unwrap_or_else(|| {
  366    379   
            let http_response = http_response.map(|body| {
  367    380   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  368    381   
                    body.bytes().unwrap(),
  369    382   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  370    383   
                )))
  371    384   
            });
  372         -
            de.deserialize_nonstreaming(&http_response)
         385  +
            // Build a config bag with the protocol for schema-based deserialization
         386  +
            #[allow(unused_mut)]
         387  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         388  +
         389  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  373    390   
        });
  374    391   
        let parsed = parsed
  375    392   
            .expect("should be successful response")
  376    393   
            .downcast::<crate::operation::float16::Float16Output>()
  377    394   
            .unwrap();
  378    395   
        assert!(
  379    396   
            parsed.value.float_equals(&expected_output.value),
  380    397   
            "Unexpected value for `value` {:?} vs. {:?}",
  381    398   
            expected_output.value,
  382    399   
            parsed.value
  383    400   
        );
  384    401   
    }
  385    402   
  386    403   
    /// Ensures that clients can correctly parse float16 NaN with high MSB.
  387    404   
    /// Test ID: RpcV2CborFloat16MSBNaN
  388    405   
    #[::tokio::test]
  389    406   
    #[::tracing_test::traced_test]
  390    407   
    async fn rpc_v2_cbor_float16_msb_na_n_response() {
  391    408   
        let expected_output = crate::operation::float16::Float16Output::builder()
  392    409   
            .set_value(::std::option::Option::Some(
  393    410   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  394    411   
            ))
  395    412   
            .build();
  396    413   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  397    414   
            ::http_1x::response::Builder::new()
  398    415   
                .header("Content-Type", "application/cbor")
  399    416   
                .header("smithy-protocol", "rpc-v2-cbor")
  400    417   
                .status(200)
  401    418   
                .body(::aws_smithy_types::body::SdkBody::from("oWV2YWx1Zfl+AA=="))
  402    419   
                .unwrap(),
  403    420   
        )
  404    421   
        .unwrap();
  405    422   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  406    423   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  407    424   
  408    425   
        let op = crate::operation::float16::Float16::new();
  409    426   
        let config = op.config().expect("the operation has config");
  410    427   
        let de = config
  411    428   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  412    429   
            .expect("the config must have a deserializer");
  413    430   
  414    431   
        let parsed = de.deserialize_streaming(&mut http_response);
  415    432   
        let parsed = parsed.unwrap_or_else(|| {
  416    433   
            let http_response = http_response.map(|body| {
  417    434   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  418    435   
                    body.bytes().unwrap(),
  419    436   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  420    437   
                )))
  421    438   
            });
  422         -
            de.deserialize_nonstreaming(&http_response)
         439  +
            // Build a config bag with the protocol for schema-based deserialization
         440  +
            #[allow(unused_mut)]
         441  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         442  +
         443  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  423    444   
        });
  424    445   
        let parsed = parsed
  425    446   
            .expect("should be successful response")
  426    447   
            .downcast::<crate::operation::float16::Float16Output>()
  427    448   
            .unwrap();
  428    449   
        assert!(
  429    450   
            parsed.value.float_equals(&expected_output.value),
  430    451   
            "Unexpected value for `value` {:?} vs. {:?}",
  431    452   
            expected_output.value,
  432    453   
            parsed.value
  433    454   
        );
  434    455   
    }
  435    456   
  436    457   
    /// Ensures that clients can correctly parse a subnormal float16.
  437    458   
    /// Test ID: RpcV2CborFloat16Subnormal
  438    459   
    #[::tokio::test]
  439    460   
    #[::tracing_test::traced_test]
  440    461   
    async fn rpc_v2_cbor_float16_subnormal_response() {
  441    462   
        let expected_output = crate::operation::float16::Float16Output::builder()
  442    463   
            .set_value(::std::option::Option::Some(4.76837158203125E-6_f64))
  443    464   
            .build();
  444    465   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  445    466   
            ::http_1x::response::Builder::new()
  446    467   
                .header("Content-Type", "application/cbor")
  447    468   
                .header("smithy-protocol", "rpc-v2-cbor")
  448    469   
                .status(200)
  449    470   
                .body(::aws_smithy_types::body::SdkBody::from("oWV2YWx1ZfkAUA=="))
  450    471   
                .unwrap(),
  451    472   
        )
  452    473   
        .unwrap();
  453    474   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  454    475   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  455    476   
  456    477   
        let op = crate::operation::float16::Float16::new();
  457    478   
        let config = op.config().expect("the operation has config");
  458    479   
        let de = config
  459    480   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  460    481   
            .expect("the config must have a deserializer");
  461    482   
  462    483   
        let parsed = de.deserialize_streaming(&mut http_response);
  463    484   
        let parsed = parsed.unwrap_or_else(|| {
  464    485   
            let http_response = http_response.map(|body| {
  465    486   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  466    487   
                    body.bytes().unwrap(),
  467    488   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  468    489   
                )))
  469    490   
            });
  470         -
            de.deserialize_nonstreaming(&http_response)
         491  +
            // Build a config bag with the protocol for schema-based deserialization
         492  +
            #[allow(unused_mut)]
         493  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         494  +
         495  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  471    496   
        });
  472    497   
        let parsed = parsed
  473    498   
            .expect("should be successful response")
  474    499   
            .downcast::<crate::operation::float16::Float16Output>()
  475    500   
            .unwrap();
  476    501   
        assert!(
  477    502   
            parsed.value.float_equals(&expected_output.value),
  478    503   
            "Unexpected value for `value` {:?} vs. {:?}",
  479    504   
            expected_output.value,
  480    505   
            parsed.value

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/float16/_float16_input.rs

@@ -1,1 +67,80 @@
   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 Float16Input {
   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(&FLOAT16INPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&FLOAT16INPUT_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 Float16Input {
          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 Float16Input {
   52     65   
    /// Creates a new builder-style object to manufacture [`Float16Input`](crate::operation::float16::Float16Input).
   53     66   
    pub fn builder() -> crate::operation::float16::builders::Float16InputBuilder {
   54     67   
        crate::operation::float16::builders::Float16InputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`Float16Input`](crate::operation::float16::Float16Input).
   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/rpcv2Cbor/rust-client-codegen/src/operation/float16/_float16_output.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/fractional_seconds.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 `FractionalSeconds`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct FractionalSeconds;
    6      6   
impl FractionalSeconds {
    7      7   
    /// Creates a new `FractionalSeconds`
    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::fractional_seconds::FractionalSecondsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::fractional_seconds::FractionalSecondsOutput::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::fractional_seconds::FractionalSecondsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::fractional_seconds::FractionalSecondsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::fractional_seconds::FractionalSecondsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct FractionalSecondsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FractionalSecondsResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_error(status, headers, body)
  146    151   
        } else {
@@ -250,255 +310,319 @@
  270    275   
            .expect("the config must have a deserializer");
  271    276   
  272    277   
        let parsed = de.deserialize_streaming(&mut http_response);
  273    278   
        let parsed = parsed.unwrap_or_else(|| {
  274    279   
            let http_response = http_response.map(|body| {
  275    280   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  276    281   
                    body.bytes().unwrap(),
  277    282   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  278    283   
                )))
  279    284   
            });
  280         -
            de.deserialize_nonstreaming(&http_response)
         285  +
            // Build a config bag with the protocol for schema-based deserialization
         286  +
            #[allow(unused_mut)]
         287  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         288  +
         289  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  281    290   
        });
  282    291   
        let parsed = parsed
  283    292   
            .expect("should be successful response")
  284    293   
            .downcast::<crate::operation::fractional_seconds::FractionalSecondsOutput>()
  285    294   
            .unwrap();
  286    295   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  287    296   
    }
  288    297   
}
  289    298   
  290    299   
/// Error type for the `FractionalSecondsError` operation.

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/fractional_seconds/_fractional_seconds_input.rs

@@ -1,1 +69,82 @@
   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 FractionalSecondsInput {
   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(&FRACTIONALSECONDSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&FRACTIONALSECONDSINPUT_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 FractionalSecondsInput {
          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 FractionalSecondsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`FractionalSecondsInput`](crate::operation::fractional_seconds::FractionalSecondsInput).
   53     66   
    pub fn builder() -> crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder {
   54     67   
        crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`FractionalSecondsInput`](crate::operation::fractional_seconds::FractionalSecondsInput).
   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/rpcv2Cbor/rust-client-codegen/src/operation/fractional_seconds/_fractional_seconds_output.rs

@@ -1,1 +106,118 @@
   19     19   
);
   20     20   
static FRACTIONALSECONDSOUTPUT_MEMBER_DATETIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "smithy.protocoltests.rpcv2Cbor.synthetic#FractionalSecondsOutput$datetime",
   23     23   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   24     24   
        "FractionalSecondsOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "datetime",
   28     28   
    0,
   29         -
);
          29  +
)
          30  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   30     31   
static FRACTIONALSECONDSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     32   
    FRACTIONALSECONDSOUTPUT_SCHEMA_ID,
   32     33   
    ::aws_smithy_schema::ShapeType::Structure,
   33     34   
    &[&FRACTIONALSECONDSOUTPUT_MEMBER_DATETIME],
   34     35   
);
   35     36   
impl FractionalSecondsOutput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FRACTIONALSECONDSOUTPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for FractionalSecondsOutput {
   40     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     42   
    fn serialize_members(
   42     43   
        &self,
   43     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     46   
        if let Some(ref val) = self.datetime {
   46     47   
            ser.write_timestamp(&FRACTIONALSECONDSOUTPUT_MEMBER_DATETIME, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl FractionalSecondsOutput {
   52     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     57   
        #[allow(unused_variables, unused_mut)]
   57     58   
        let mut builder = Self::builder();
   58     59   
        #[allow(
   59     60   
            unused_variables,
   60     61   
            unreachable_code,
   61     62   
            clippy::single_match,
   62     63   
            clippy::match_single_binding,
   63     64   
            clippy::diverging_sub_expression
   64     65   
        )]
   65         -
        deserializer.read_struct(&FRACTIONALSECONDSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&FRACTIONALSECONDSOUTPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.datetime = Some(deser.read_timestamp(member)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
   74     75   
        Ok(builder.build())
   75     76   
    }
   76     77   
}
          78  +
impl FractionalSecondsOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   77     89   
impl FractionalSecondsOutput {
   78     90   
    /// Creates a new builder-style object to manufacture [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
   79     91   
    pub fn builder() -> crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder {
   80     92   
        crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder::default()
   81     93   
    }
   82     94   
}
   83     95   
   84     96   
/// A builder for [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
   85     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     98   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/greeting_with_errors.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 `GreetingWithErrors`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GreetingWithErrors;
    6      6   
impl GreetingWithErrors {
    7      7   
    /// Creates a new `GreetingWithErrors`
    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::greeting_with_errors::GreetingWithErrorsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::greeting_with_errors::GreetingWithErrorsOutput::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::greeting_with_errors::GreetingWithErrorsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct GreetingWithErrorsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  146    151   
        } else {
@@ -250,255 +409,426 @@
  270    275   
            .expect("the config must have a deserializer");
  271    276   
  272    277   
        let parsed = de.deserialize_streaming(&mut http_response);
  273    278   
        let parsed = parsed.unwrap_or_else(|| {
  274    279   
            let http_response = http_response.map(|body| {
  275    280   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  276    281   
                    body.bytes().unwrap(),
  277    282   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  278    283   
                )))
  279    284   
            });
  280         -
            de.deserialize_nonstreaming(&http_response)
         285  +
            // Build a config bag with the protocol for schema-based deserialization
         286  +
            #[allow(unused_mut)]
         287  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         288  +
         289  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  281    290   
        });
  282    291   
        let parsed = parsed.expect_err("should be error response");
  283    292   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  284    293   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  285    294   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting(parsed) = parsed {
  286    295   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  287    296   
        } else {
  288    297   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  289    298   
        }
  290    299   
    }
  291    300   
  292    301   
    /// Parses a complex error with no message member
  293    302   
    /// Test ID: RpcV2CborComplexError
  294    303   
    #[::tokio::test]
  295    304   
    #[::tracing_test::traced_test]
  296    305   
    async fn rpc_v2_cbor_complex_error_response() {
  297    306   
        let expected_output = crate::types::error::ComplexError::builder()
  298    307   
            .set_top_level(::std::option::Option::Some("Top level".to_owned()))
  299    308   
            .set_nested(::std::option::Option::Some(
  300    309   
                crate::types::ComplexNestedErrorData::builder()
  301    310   
                    .set_foo(::std::option::Option::Some("bar".to_owned()))
  302    311   
                    .build(),
  303    312   
            ))
  304    313   
            .build();
  305    314   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  306    315   
            ::http_1x::response::Builder::new()
  307    316   
                .header("Content-Type", "application/cbor")
  308    317   
                .header("smithy-protocol", "rpc-v2-cbor")
  309    318   
                .status(400)
  310    319   
                .body(::aws_smithy_types::body::SdkBody::from(
  311    320   
                    "v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3JoVG9wTGV2ZWxpVG9wIGxldmVsZk5lc3RlZL9jRm9vY2Jhcv//",
  312    321   
                ))
  313    322   
                .unwrap(),
  314    323   
        )
  315    324   
        .unwrap();
  316    325   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  317    326   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  318    327   
  319    328   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  320    329   
        let config = op.config().expect("the operation has config");
  321    330   
        let de = config
  322    331   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  323    332   
            .expect("the config must have a deserializer");
  324    333   
  325    334   
        let parsed = de.deserialize_streaming(&mut http_response);
  326    335   
        let parsed = parsed.unwrap_or_else(|| {
  327    336   
            let http_response = http_response.map(|body| {
  328    337   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  329    338   
                    body.bytes().unwrap(),
  330    339   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  331    340   
                )))
  332    341   
            });
  333         -
            de.deserialize_nonstreaming(&http_response)
         342  +
            // Build a config bag with the protocol for schema-based deserialization
         343  +
            #[allow(unused_mut)]
         344  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         345  +
         346  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  334    347   
        });
  335    348   
        let parsed = parsed.expect_err("should be error response");
  336    349   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  337    350   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  338    351   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError(parsed) = parsed {
  339    352   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  340    353   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  341    354   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  342    355   
        } else {
  343    356   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  344    357   
        }
  345    358   
    }
  346    359   
    /// Test ID: RpcV2CborEmptyComplexError
  347    360   
    #[::tokio::test]
  348    361   
    #[::tracing_test::traced_test]
  349    362   
    async fn rpc_v2_cbor_empty_complex_error_response() {
  350    363   
        let expected_output = crate::types::error::ComplexError::builder().build();
  351    364   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  352    365   
            ::http_1x::response::Builder::new()
  353    366   
                .header("Content-Type", "application/cbor")
  354    367   
                .header("smithy-protocol", "rpc-v2-cbor")
  355    368   
                .status(400)
  356    369   
                .body(::aws_smithy_types::body::SdkBody::from(
  357    370   
                    "v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3L/",
  358    371   
                ))
  359    372   
                .unwrap(),
  360    373   
        )
  361    374   
        .unwrap();
  362    375   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  363    376   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  364    377   
  365    378   
        let op = crate::operation::greeting_with_errors::GreetingWithErrors::new();
  366    379   
        let config = op.config().expect("the operation has config");
  367    380   
        let de = config
  368    381   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  369    382   
            .expect("the config must have a deserializer");
  370    383   
  371    384   
        let parsed = de.deserialize_streaming(&mut http_response);
  372    385   
        let parsed = parsed.unwrap_or_else(|| {
  373    386   
            let http_response = http_response.map(|body| {
  374    387   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  375    388   
                    body.bytes().unwrap(),
  376    389   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  377    390   
                )))
  378    391   
            });
  379         -
            de.deserialize_nonstreaming(&http_response)
         392  +
            // Build a config bag with the protocol for schema-based deserialization
         393  +
            #[allow(unused_mut)]
         394  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         395  +
         396  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  380    397   
        });
  381    398   
        let parsed = parsed.expect_err("should be error response");
  382    399   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  383    400   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  384    401   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError(parsed) = parsed {
  385    402   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  386    403   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  387    404   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  388    405   
        } else {
  389    406   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_input.rs

@@ -1,1 +70,83 @@
   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 GreetingWithErrorsInput {
   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(&GREETINGWITHERRORSINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&GREETINGWITHERRORSINPUT_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 GreetingWithErrorsInput {
          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 GreetingWithErrorsInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`GreetingWithErrorsInput`](crate::operation::greeting_with_errors::GreetingWithErrorsInput).
   53     66   
    pub fn builder() -> crate::operation::greeting_with_errors::builders::GreetingWithErrorsInputBuilder {
   54     67   
        crate::operation::greeting_with_errors::builders::GreetingWithErrorsInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`GreetingWithErrorsInput`](crate::operation::greeting_with_errors::GreetingWithErrorsInput).
   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/rpcv2Cbor/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_output.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/no_input_output.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 `NoInputOutput`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct NoInputOutput;
    6      6   
impl NoInputOutput {
    7      7   
    /// Creates a new `NoInputOutput`
    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::no_input_output::NoInputOutputInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::no_input_output::NoInputOutputOutput::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::no_input_output::NoInputOutputInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::no_input_output::NoInputOutputOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::no_input_output::NoInputOutputError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +166,171 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct NoInputOutputResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputOutputResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_no_input_output::de_no_input_output_http_error(status, headers, body)
  146    151   
        } else {
@@ -274,279 +415,432 @@
  294    299   
            .expect("the config must have a deserializer");
  295    300   
  296    301   
        let parsed = de.deserialize_streaming(&mut http_response);
  297    302   
        let parsed = parsed.unwrap_or_else(|| {
  298    303   
            let http_response = http_response.map(|body| {
  299    304   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  300    305   
                    body.bytes().unwrap(),
  301    306   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  302    307   
                )))
  303    308   
            });
  304         -
            de.deserialize_nonstreaming(&http_response)
         309  +
            // Build a config bag with the protocol for schema-based deserialization
         310  +
            #[allow(unused_mut)]
         311  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         312  +
         313  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  305    314   
        });
  306    315   
        let parsed = parsed
  307    316   
            .expect("should be successful response")
  308    317   
            .downcast::<crate::operation::no_input_output::NoInputOutputOutput>()
  309    318   
            .unwrap();
  310    319   
    }
  311    320   
  312    321   
    /// Clients should accept a CBOR empty struct if there is no output.
  313    322   
    /// Test ID: NoOutputClientAllowsEmptyCbor
  314    323   
    #[::tokio::test]
  315    324   
    #[::tracing_test::traced_test]
  316    325   
    async fn no_output_client_allows_empty_cbor_response() {
  317    326   
        let expected_output = crate::operation::no_input_output::NoInputOutputOutput::builder().build();
  318    327   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  319    328   
            ::http_1x::response::Builder::new()
  320    329   
                .header("Content-Type", "application/cbor")
  321    330   
                .header("smithy-protocol", "rpc-v2-cbor")
  322    331   
                .status(200)
  323    332   
                .body(::aws_smithy_types::body::SdkBody::from("v/8="))
  324    333   
                .unwrap(),
  325    334   
        )
  326    335   
        .unwrap();
  327    336   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  328    337   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  329    338   
  330    339   
        let op = crate::operation::no_input_output::NoInputOutput::new();
  331    340   
        let config = op.config().expect("the operation has config");
  332    341   
        let de = config
  333    342   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  334    343   
            .expect("the config must have a deserializer");
  335    344   
  336    345   
        let parsed = de.deserialize_streaming(&mut http_response);
  337    346   
        let parsed = parsed.unwrap_or_else(|| {
  338    347   
            let http_response = http_response.map(|body| {
  339    348   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  340    349   
                    body.bytes().unwrap(),
  341    350   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  342    351   
                )))
  343    352   
            });
  344         -
            de.deserialize_nonstreaming(&http_response)
         353  +
            // Build a config bag with the protocol for schema-based deserialization
         354  +
            #[allow(unused_mut)]
         355  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         356  +
         357  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  345    358   
        });
  346    359   
        let parsed = parsed
  347    360   
            .expect("should be successful response")
  348    361   
            .downcast::<crate::operation::no_input_output::NoInputOutputOutput>()
  349    362   
            .unwrap();
  350    363   
    }
  351    364   
  352    365   
    /// Clients should accept an empty body if there is no output and
  353    366   
    /// should not raise an error if the `Content-Type` header is set.
  354    367   
    /// Test ID: NoOutputClientAllowsEmptyBody
  355    368   
    #[::tokio::test]
  356    369   
    #[::tracing_test::traced_test]
  357    370   
    async fn no_output_client_allows_empty_body_response() {
  358    371   
        let expected_output = crate::operation::no_input_output::NoInputOutputOutput::builder().build();
  359    372   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  360    373   
            ::http_1x::response::Builder::new()
  361    374   
                .header("Content-Type", "application/cbor")
  362    375   
                .header("smithy-protocol", "rpc-v2-cbor")
  363    376   
                .status(200)
  364    377   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  365    378   
                .unwrap(),
  366    379   
        )
  367    380   
        .unwrap();
  368    381   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  369    382   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  370    383   
  371    384   
        let op = crate::operation::no_input_output::NoInputOutput::new();
  372    385   
        let config = op.config().expect("the operation has config");
  373    386   
        let de = config
  374    387   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  375    388   
            .expect("the config must have a deserializer");
  376    389   
  377    390   
        let parsed = de.deserialize_streaming(&mut http_response);
  378    391   
        let parsed = parsed.unwrap_or_else(|| {
  379    392   
            let http_response = http_response.map(|body| {
  380    393   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  381    394   
                    body.bytes().unwrap(),
  382    395   
                    ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
  383    396   
                )))
  384    397   
            });
  385         -
            de.deserialize_nonstreaming(&http_response)
         398  +
            // Build a config bag with the protocol for schema-based deserialization
         399  +
            #[allow(unused_mut)]
         400  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         401  +
         402  +
            de.deserialize_nonstreaming(&http_response, &test_cfg)
  386    403   
        });
  387    404   
        let parsed = parsed
  388    405   
            .expect("should be successful response")
  389    406   
            .downcast::<crate::operation::no_input_output::NoInputOutputOutput>()
  390    407   
            .unwrap();
  391    408   
    }
  392    409   
}
  393    410   
  394    411   
/// Error type for the `NoInputOutputError` operation.
  395    412   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/no_input_output/_no_input_output_input.rs

@@ -1,1 +69,82 @@
   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 NoInputOutputInput {
   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(&NOINPUTOUTPUTINPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&NOINPUTOUTPUTINPUT_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 NoInputOutputInput {
          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 NoInputOutputInput {
   52     65   
    /// Creates a new builder-style object to manufacture [`NoInputOutputInput`](crate::operation::no_input_output::NoInputOutputInput).
   53     66   
    pub fn builder() -> crate::operation::no_input_output::builders::NoInputOutputInputBuilder {
   54     67   
        crate::operation::no_input_output::builders::NoInputOutputInputBuilder::default()
   55     68   
    }
   56     69   
}
   57     70   
   58     71   
/// A builder for [`NoInputOutputInput`](crate::operation::no_input_output::NoInputOutputInput).
   59     72   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     73   
#[non_exhaustive]