Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/simple_struct_operation/_simple_struct_operation_output.rs

@@ -224,224 +394,394 @@
  244    244   
    "timestamp",
  245    245   
    9,
  246    246   
);
  247    247   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  248    248   
    ::aws_smithy_schema::ShapeId::from_static(
  249    249   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$enum",
  250    250   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  251    251   
        "SimpleStructOperationOutput",
  252    252   
    ),
  253    253   
    ::aws_smithy_schema::ShapeType::String,
  254         -
    "r##enum",
         254  +
    "enum",
  255    255   
    10,
  256    256   
);
  257    257   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  258    258   
    ::aws_smithy_schema::ShapeId::from_static(
  259    259   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredBlob",
  260    260   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  261    261   
        "SimpleStructOperationOutput",
  262    262   
    ),
  263    263   
    ::aws_smithy_schema::ShapeType::Blob,
  264         -
    "required_blob",
         264  +
    "requiredBlob",
  265    265   
    11,
  266    266   
);
  267    267   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  268    268   
    ::aws_smithy_schema::ShapeId::from_static(
  269    269   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredBoolean",
  270    270   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  271    271   
        "SimpleStructOperationOutput",
  272    272   
    ),
  273    273   
    ::aws_smithy_schema::ShapeType::Boolean,
  274         -
    "required_boolean",
         274  +
    "requiredBoolean",
  275    275   
    12,
  276    276   
);
  277    277   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  278    278   
    ::aws_smithy_schema::ShapeId::from_static(
  279    279   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredString",
  280    280   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  281    281   
        "SimpleStructOperationOutput",
  282    282   
    ),
  283    283   
    ::aws_smithy_schema::ShapeType::String,
  284         -
    "required_string",
         284  +
    "requiredString",
  285    285   
    13,
  286    286   
);
  287    287   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  288    288   
    ::aws_smithy_schema::ShapeId::from_static(
  289    289   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredByte",
  290    290   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  291    291   
        "SimpleStructOperationOutput",
  292    292   
    ),
  293    293   
    ::aws_smithy_schema::ShapeType::Byte,
  294         -
    "required_byte",
         294  +
    "requiredByte",
  295    295   
    14,
  296    296   
);
  297    297   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  298    298   
    ::aws_smithy_schema::ShapeId::from_static(
  299    299   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredShort",
  300    300   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  301    301   
        "SimpleStructOperationOutput",
  302    302   
    ),
  303    303   
    ::aws_smithy_schema::ShapeType::Short,
  304         -
    "required_short",
         304  +
    "requiredShort",
  305    305   
    15,
  306    306   
);
  307    307   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  308    308   
    ::aws_smithy_schema::ShapeId::from_static(
  309    309   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredInteger",
  310    310   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  311    311   
        "SimpleStructOperationOutput",
  312    312   
    ),
  313    313   
    ::aws_smithy_schema::ShapeType::Integer,
  314         -
    "required_integer",
         314  +
    "requiredInteger",
  315    315   
    16,
  316    316   
);
  317    317   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  318    318   
    ::aws_smithy_schema::ShapeId::from_static(
  319    319   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredLong",
  320    320   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  321    321   
        "SimpleStructOperationOutput",
  322    322   
    ),
  323    323   
    ::aws_smithy_schema::ShapeType::Long,
  324         -
    "required_long",
         324  +
    "requiredLong",
  325    325   
    17,
  326    326   
);
  327    327   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  328    328   
    ::aws_smithy_schema::ShapeId::from_static(
  329    329   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredFloat",
  330    330   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  331    331   
        "SimpleStructOperationOutput",
  332    332   
    ),
  333    333   
    ::aws_smithy_schema::ShapeType::Float,
  334         -
    "required_float",
         334  +
    "requiredFloat",
  335    335   
    18,
  336    336   
);
  337    337   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  338    338   
    ::aws_smithy_schema::ShapeId::from_static(
  339    339   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredDouble",
  340    340   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  341    341   
        "SimpleStructOperationOutput",
  342    342   
    ),
  343    343   
    ::aws_smithy_schema::ShapeType::Double,
  344         -
    "required_double",
         344  +
    "requiredDouble",
  345    345   
    19,
  346    346   
);
  347    347   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  348    348   
    ::aws_smithy_schema::ShapeId::from_static(
  349    349   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredTimestamp",
  350    350   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  351    351   
        "SimpleStructOperationOutput",
  352    352   
    ),
  353    353   
    ::aws_smithy_schema::ShapeType::Timestamp,
  354         -
    "required_timestamp",
         354  +
    "requiredTimestamp",
  355    355   
    20,
  356    356   
);
  357    357   
static SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  358    358   
    ::aws_smithy_schema::ShapeId::from_static(
  359    359   
        "smithy.protocoltests.rpcv2Cbor.synthetic#SimpleStructOperationOutput$requiredEnum",
  360    360   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
  361    361   
        "SimpleStructOperationOutput",
  362    362   
    ),
  363    363   
    ::aws_smithy_schema::ShapeType::String,
  364         -
    "required_enum",
         364  +
    "requiredEnum",
  365    365   
    21,
  366    366   
);
  367    367   
static SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  368    368   
    SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA_ID,
  369    369   
    ::aws_smithy_schema::ShapeType::Structure,
  370    370   
    &[
  371    371   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BLOB,
  372    372   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BOOLEAN,
  373    373   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_STRING,
  374    374   
        &SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_BYTE,
@@ -457,457 +529,529 @@
  477    477   
        }
  478    478   
        {
  479    479   
            let val = &self.required_enum;
  480    480   
            ser.write_string(&SIMPLESTRUCTOPERATIONOUTPUT_MEMBER_REQUIRED_ENUM, val.as_str())?;
  481    481   
        }
  482    482   
        Ok(())
  483    483   
    }
  484    484   
}
  485    485   
impl SimpleStructOperationOutput {
  486    486   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  487         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  488         -
        deserializer: &mut D,
         487  +
    pub fn deserialize(
         488  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  489    489   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  490    490   
        #[allow(unused_variables, unused_mut)]
  491    491   
        let mut builder = Self::builder();
  492    492   
        #[allow(
  493    493   
            unused_variables,
  494    494   
            unreachable_code,
  495    495   
            clippy::single_match,
  496    496   
            clippy::match_single_binding,
  497    497   
            clippy::diverging_sub_expression
  498    498   
        )]
  499         -
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
         499  +
        deserializer.read_struct(&SIMPLESTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
  500    500   
            match member.member_index() {
  501    501   
                Some(0) => {
  502    502   
                    builder.blob = Some(deser.read_blob(member)?);
  503    503   
                }
  504    504   
                Some(1) => {
  505    505   
                    builder.boolean = Some(deser.read_boolean(member)?);
  506    506   
                }
  507    507   
                Some(2) => {
  508    508   
                    builder.string = Some(deser.read_string(member)?);
  509    509   
                }
@@ -541,541 +605,626 @@
  561    561   
                Some(20) => {
  562    562   
                    builder.required_timestamp = Some(deser.read_timestamp(member)?);
  563    563   
                }
  564    564   
                Some(21) => {
  565    565   
                    builder.required_enum = Some(crate::types::Suit::from(deser.read_string(member)?.as_str()));
  566    566   
                }
  567    567   
                _ => {}
  568    568   
            }
  569    569   
            Ok(())
  570    570   
        })?;
         571  +
        builder.required_blob = builder.required_blob.or(Some(::aws_smithy_types::Blob::new("")));
         572  +
        builder.required_boolean = builder.required_boolean.or(Some(false));
         573  +
        builder.required_string = builder.required_string.or(Some(String::new()));
         574  +
        builder.required_byte = builder.required_byte.or(Some(0i8));
         575  +
        builder.required_short = builder.required_short.or(Some(0i16));
         576  +
        builder.required_integer = builder.required_integer.or(Some(0i32));
         577  +
        builder.required_long = builder.required_long.or(Some(0i64));
         578  +
        builder.required_float = builder.required_float.or(Some(0.0f32));
         579  +
        builder.required_double = builder.required_double.or(Some(0.0f64));
         580  +
        builder.required_timestamp = builder.required_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  571    581   
        builder
  572    582   
            .build()
  573    583   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  574    584   
    }
  575    585   
}
         586  +
impl SimpleStructOperationOutput {
         587  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         588  +
    pub fn deserialize_with_response(
         589  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         590  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         591  +
        _status: u16,
         592  +
        _body: &[u8],
         593  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         594  +
        Self::deserialize(deserializer)
         595  +
    }
         596  +
}
  576    597   
impl SimpleStructOperationOutput {
  577    598   
    /// Creates a new builder-style object to manufacture [`SimpleStructOperationOutput`](crate::operation::simple_struct_operation::SimpleStructOperationOutput).
  578    599   
    pub fn builder() -> crate::operation::simple_struct_operation::builders::SimpleStructOperationOutputBuilder {
  579    600   
        crate::operation::simple_struct_operation::builders::SimpleStructOperationOutputBuilder::default()
  580    601   
    }
  581    602   
}
  582    603   
  583    604   
/// A builder for [`SimpleStructOperationOutput`](crate::operation::simple_struct_operation::SimpleStructOperationOutput).
  584    605   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  585    606   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/single_member_struct_operation.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `SingleMemberStructOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SingleMemberStructOperation;
    6      6   
impl SingleMemberStructOperation {
    7      7   
    /// Creates a new `SingleMemberStructOperation`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::single_member_struct_operation::SingleMemberStructOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::single_member_struct_operation::SingleMemberStructOperationOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::single_member_struct_operation::SingleMemberStructOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::single_member_struct_operation::SingleMemberStructOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::single_member_struct_operation::SingleMemberStructOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::single_member_struct_operation::SingleMemberStructOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct SingleMemberStructOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SingleMemberStructOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_single_member_struct_operation::de_single_member_struct_operation_http_error(status, headers, body)
  152    159   
        } else {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/single_member_struct_operation/_single_member_struct_operation_input.rs

@@ -23,23 +108,119 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.message {
   46     46   
            ser.write_string(&SINGLEMEMBERSTRUCTOPERATIONINPUT_MEMBER_MESSAGE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl SingleMemberStructOperationInput {
   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(&SINGLEMEMBERSTRUCTOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&SINGLEMEMBERSTRUCTOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.message = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        builder
   75     75   
            .build()
   76     76   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     77   
    }
   78     78   
}
          79  +
impl SingleMemberStructOperationInput {
          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 SingleMemberStructOperationInput {
   80     91   
    /// Creates a new builder-style object to manufacture [`SingleMemberStructOperationInput`](crate::operation::single_member_struct_operation::SingleMemberStructOperationInput).
   81     92   
    pub fn builder() -> crate::operation::single_member_struct_operation::builders::SingleMemberStructOperationInputBuilder {
   82     93   
        crate::operation::single_member_struct_operation::builders::SingleMemberStructOperationInputBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`SingleMemberStructOperationInput`](crate::operation::single_member_struct_operation::SingleMemberStructOperationInput).
   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_extras/rust-client-codegen/src/operation/single_member_struct_operation/_single_member_struct_operation_output.rs

@@ -23,23 +106,117 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.message {
   46     46   
            ser.write_string(&SINGLEMEMBERSTRUCTOPERATIONOUTPUT_MEMBER_MESSAGE, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl SingleMemberStructOperationOutput {
   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(&SINGLEMEMBERSTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&SINGLEMEMBERSTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.message = Some(deser.read_string(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl SingleMemberStructOperationOutput {
          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 SingleMemberStructOperationOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`SingleMemberStructOperationOutput`](crate::operation::single_member_struct_operation::SingleMemberStructOperationOutput).
   79     90   
    pub fn builder() -> crate::operation::single_member_struct_operation::builders::SingleMemberStructOperationOutputBuilder {
   80     91   
        crate::operation::single_member_struct_operation::builders::SingleMemberStructOperationOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`SingleMemberStructOperationOutput`](crate::operation::single_member_struct_operation::SingleMemberStructOperationOutput).
   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_extras/rust-client-codegen/src/operation/streaming_operation.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `StreamingOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingOperation;
    6      6   
impl StreamingOperation {
    7      7   
    /// Creates a new `StreamingOperation`
    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::streaming_operation::StreamingOperationInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::streaming_operation::StreamingOperationOutput::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::streaming_operation::StreamingOperationInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::streaming_operation::StreamingOperationOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::streaming_operation::StreamingOperationError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -125,129 +187,192 @@
  145    149   
  146    150   
        // If this is an error, defer to the non-streaming parser
  147    151   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    152   
            return ::std::option::Option::None;
  149    153   
        }
  150    154   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    155   
            crate::protocol_serde::shape_streaming_operation::de_streaming_operation_http_response(response),
  152    156   
        ))
  153    157   
    }
  154    158   
  155         -
    fn deserialize_nonstreaming(
         159  +
    fn deserialize_nonstreaming_with_config(
  156    160   
        &self,
  157    161   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         162  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  158    163   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  159    164   
        // For streaming operations, we only hit this case if its an error
  160    165   
        let body = response.body().bytes().expect("body loaded");
  161    166   
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_streaming_operation::de_streaming_operation_http_error(
  162    167   
            response.status().as_u16(),
  163    168   
            response.headers(),
  164    169   
            body,
  165    170   
        ))
  166    171   
    }
  167    172   
}

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation/_streaming_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation/_streaming_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_data.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `StreamingOperationWithInitialData`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingOperationWithInitialData;
    6      6   
impl StreamingOperationWithInitialData {
    7      7   
    /// Creates a new `StreamingOperationWithInitialData`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -125,131 +187,194 @@
  145    151   
  146    152   
        // If this is an error, defer to the non-streaming parser
  147    153   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    154   
            return ::std::option::Option::None;
  149    155   
        }
  150    156   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    157   
            crate::protocol_serde::shape_streaming_operation_with_initial_data::de_streaming_operation_with_initial_data_http_response(response),
  152    158   
        ))
  153    159   
    }
  154    160   
  155         -
    fn deserialize_nonstreaming(
         161  +
    fn deserialize_nonstreaming_with_config(
  156    162   
        &self,
  157    163   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         164  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  158    165   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  159    166   
        // For streaming operations, we only hit this case if its an error
  160    167   
        let body = response.body().bytes().expect("body loaded");
  161    168   
        crate::protocol_serde::type_erase_result(
  162    169   
            crate::protocol_serde::shape_streaming_operation_with_initial_data::de_streaming_operation_with_initial_data_http_error(
  163    170   
                response.status().as_u16(),
  164    171   
                response.headers(),
  165    172   
                body,
  166    173   
            ),
  167    174   
        )

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_data/_streaming_operation_with_initial_data_input.rs

@@ -3,3 +137,145 @@
   23     23   
    "smithy.protocoltests.rpcv2Cbor.synthetic",
   24     24   
    "StreamingOperationWithInitialDataInput",
   25     25   
);
   26     26   
static STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_INITIAL_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithInitialDataInput$initialData",
   29     29   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   30     30   
        "StreamingOperationWithInitialDataInput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "initial_data",
          33  +
    "initialData",
   34     34   
    0,
   35     35   
);
   36     36   
static STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithInitialDataInput$events",
   39     39   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   40     40   
        "StreamingOperationWithInitialDataInput",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Union,
   43     43   
    "events",
   44     44   
    1,
   45     45   
);
   46     46   
static STREAMINGOPERATIONWITHINITIALDATAINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    STREAMINGOPERATIONWITHINITIALDATAINPUT_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_INITIAL_DATA,
   51     51   
        &STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_EVENTS,
   52     52   
    ],
   53     53   
);
   54     54   
impl StreamingOperationWithInitialDataInput {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGOPERATIONWITHINITIALDATAINPUT_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingOperationWithInitialDataInput {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.initial_data {
   65     65   
            ser.write_string(&STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_INITIAL_DATA, val)?;
   66     66   
        }
   67         -
        {
   68         -
            let val = &self.events;
   69         -
            ser.write_null(&STREAMINGOPERATIONWITHINITIALDATAINPUT_MEMBER_EVENTS)?;
   70         -
        }
   71     67   
        Ok(())
   72     68   
    }
   73     69   
}
   74     70   
impl StreamingOperationWithInitialDataInput {
   75     71   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   76         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   77         -
        deserializer: &mut D,
          72  +
    pub fn deserialize(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   78     74   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   79     75   
        #[allow(unused_variables, unused_mut)]
   80     76   
        let mut builder = Self::builder();
   81     77   
        #[allow(
   82     78   
            unused_variables,
   83     79   
            unreachable_code,
   84     80   
            clippy::single_match,
   85     81   
            clippy::match_single_binding,
   86     82   
            clippy::diverging_sub_expression
   87     83   
        )]
   88         -
        deserializer.read_struct(&STREAMINGOPERATIONWITHINITIALDATAINPUT_SCHEMA, (), |_, member, deser| {
          84  +
        deserializer.read_struct(&STREAMINGOPERATIONWITHINITIALDATAINPUT_SCHEMA, &mut |member, deser| {
   89     85   
            match member.member_index() {
   90     86   
                Some(0) => {
   91     87   
                    builder.initial_data = Some(deser.read_string(member)?);
   92     88   
                }
   93     89   
                Some(1) => {
   94     90   
                    builder.events = Some({
   95     91   
                        let _ = member;
   96         -
                        todo!("deserialize aggregate")
          92  +
                        todo!("deserialize streaming union")
   97     93   
                    });
   98     94   
                }
   99     95   
                _ => {}
  100     96   
            }
  101     97   
            Ok(())
  102     98   
        })?;
          99  +
        builder.initial_data = builder.initial_data.or(Some(String::new()));
  103    100   
        builder
  104    101   
            .build()
  105    102   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  106    103   
    }
  107    104   
}
         105  +
impl StreamingOperationWithInitialDataInput {
         106  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         107  +
    pub fn deserialize_with_response(
         108  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         109  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         110  +
        _status: u16,
         111  +
        _body: &[u8],
         112  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         113  +
        Self::deserialize(deserializer)
         114  +
    }
         115  +
}
  108    116   
impl StreamingOperationWithInitialDataInput {
  109    117   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialDataInput`](crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataInput).
  110    118   
    pub fn builder() -> crate::operation::streaming_operation_with_initial_data::builders::StreamingOperationWithInitialDataInputBuilder {
  111    119   
        crate::operation::streaming_operation_with_initial_data::builders::StreamingOperationWithInitialDataInputBuilder::default()
  112    120   
    }
  113    121   
    #[allow(unused)]
  114    122   
    pub(crate) fn into_builder(
  115    123   
        self,
  116    124   
    ) -> crate::operation::streaming_operation_with_initial_data::builders::StreamingOperationWithInitialDataInputBuilder {
  117    125   
        Self::builder().set_initial_data(self.initial_data).events(self.events)

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_data/_streaming_operation_with_initial_data_output.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_response.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `StreamingOperationWithInitialResponse`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingOperationWithInitialResponse;
    6      6   
impl StreamingOperationWithInitialResponse {
    7      7   
    /// Creates a new `StreamingOperationWithInitialResponse`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -127,133 +189,196 @@
  147    153   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    154   
            return ::std::option::Option::None;
  149    155   
        }
  150    156   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    157   
            crate::protocol_serde::shape_streaming_operation_with_initial_response::de_streaming_operation_with_initial_response_http_response(
  152    158   
                response,
  153    159   
            ),
  154    160   
        ))
  155    161   
    }
  156    162   
  157         -
    fn deserialize_nonstreaming(
         163  +
    fn deserialize_nonstreaming_with_config(
  158    164   
        &self,
  159    165   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         166  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  160    167   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  161    168   
        // For streaming operations, we only hit this case if its an error
  162    169   
        let body = response.body().bytes().expect("body loaded");
  163    170   
        crate::protocol_serde::type_erase_result(
  164    171   
            crate::protocol_serde::shape_streaming_operation_with_initial_response::de_streaming_operation_with_initial_response_http_error(
  165    172   
                response.status().as_u16(),
  166    173   
                response.headers(),
  167    174   
                body,
  168    175   
            ),
  169    176   
        )

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_response/_streaming_operation_with_initial_response_input.rs

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_response/_streaming_operation_with_initial_response_output.rs

@@ -4,4 +139,147 @@
   24     24   
    "smithy.protocoltests.rpcv2Cbor.synthetic",
   25     25   
    "StreamingOperationWithInitialResponseOutput",
   26     26   
);
   27     27   
static STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_RESPONSE_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   28     28   
    ::aws_smithy_schema::ShapeId::from_static(
   29     29   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithInitialResponseOutput$responseData",
   30     30   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   31     31   
        "StreamingOperationWithInitialResponseOutput",
   32     32   
    ),
   33     33   
    ::aws_smithy_schema::ShapeType::String,
   34         -
    "response_data",
          34  +
    "responseData",
   35     35   
    0,
   36     36   
);
   37     37   
static STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithInitialResponseOutput$events",
   40     40   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   41     41   
        "StreamingOperationWithInitialResponseOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::Union,
   44     44   
    "events",
   45     45   
    1,
   46     46   
);
   47     47   
static STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   48     48   
    STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_SCHEMA_ID,
   49     49   
    ::aws_smithy_schema::ShapeType::Structure,
   50     50   
    &[
   51     51   
        &STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_RESPONSE_DATA,
   52     52   
        &STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_EVENTS,
   53     53   
    ],
   54     54   
);
   55     55   
impl StreamingOperationWithInitialResponseOutput {
   56     56   
    /// The schema for this shape.
   57     57   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_SCHEMA;
   58     58   
}
   59     59   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingOperationWithInitialResponseOutput {
   60     60   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   61     61   
    fn serialize_members(
   62     62   
        &self,
   63     63   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   64     64   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   65     65   
        {
   66     66   
            let val = &self.response_data;
   67     67   
            ser.write_string(&STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_RESPONSE_DATA, val)?;
   68     68   
        }
   69         -
        {
   70         -
            let val = &self.events;
   71         -
            ser.write_null(&STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_MEMBER_EVENTS)?;
   72         -
        }
   73     69   
        Ok(())
   74     70   
    }
   75     71   
}
   76     72   
impl StreamingOperationWithInitialResponseOutput {
   77     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   78         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   79         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   80     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   81     77   
        #[allow(unused_variables, unused_mut)]
   82     78   
        let mut builder = Self::builder();
   83     79   
        #[allow(
   84     80   
            unused_variables,
   85     81   
            unreachable_code,
   86     82   
            clippy::single_match,
   87     83   
            clippy::match_single_binding,
   88     84   
            clippy::diverging_sub_expression
   89     85   
        )]
   90         -
        deserializer.read_struct(&STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&STREAMINGOPERATIONWITHINITIALRESPONSEOUTPUT_SCHEMA, &mut |member, deser| {
   91     87   
            match member.member_index() {
   92     88   
                Some(0) => {
   93     89   
                    builder.response_data = Some(deser.read_string(member)?);
   94     90   
                }
   95     91   
                Some(1) => {
   96     92   
                    builder.events = Some({
   97     93   
                        let _ = member;
   98         -
                        todo!("deserialize aggregate")
          94  +
                        todo!("deserialize streaming union")
   99     95   
                    });
  100     96   
                }
  101     97   
                _ => {}
  102     98   
            }
  103     99   
            Ok(())
  104    100   
        })?;
         101  +
        builder.response_data = builder.response_data.or(Some(String::new()));
  105    102   
        builder
  106    103   
            .build()
  107    104   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  108    105   
    }
  109    106   
}
         107  +
impl StreamingOperationWithInitialResponseOutput {
         108  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         109  +
    pub fn deserialize_with_response(
         110  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         111  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         112  +
        _status: u16,
         113  +
        _body: &[u8],
         114  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         115  +
        Self::deserialize(deserializer)
         116  +
    }
         117  +
}
  110    118   
impl StreamingOperationWithInitialResponseOutput {
  111    119   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialResponseOutput`](crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseOutput).
  112    120   
    pub fn builder() -> crate::operation::streaming_operation_with_initial_response::builders::StreamingOperationWithInitialResponseOutputBuilder {
  113    121   
        crate::operation::streaming_operation_with_initial_response::builders::StreamingOperationWithInitialResponseOutputBuilder::default()
  114    122   
    }
  115    123   
    #[allow(unused)]
  116    124   
    pub(crate) fn into_builder(
  117    125   
        self,
  118    126   
    ) -> crate::operation::streaming_operation_with_initial_response::builders::StreamingOperationWithInitialResponseOutputBuilder {
  119    127   
        Self::builder().response_data(self.response_data).events(self.events)

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_optional_data.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `StreamingOperationWithOptionalData`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamingOperationWithOptionalData;
    6      6   
impl StreamingOperationWithOptionalData {
    7      7   
    /// Creates a new `StreamingOperationWithOptionalData`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -125,131 +187,194 @@
  145    151   
  146    152   
        // If this is an error, defer to the non-streaming parser
  147    153   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    154   
            return ::std::option::Option::None;
  149    155   
        }
  150    156   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    157   
            crate::protocol_serde::shape_streaming_operation_with_optional_data::de_streaming_operation_with_optional_data_http_response(response),
  152    158   
        ))
  153    159   
    }
  154    160   
  155         -
    fn deserialize_nonstreaming(
         161  +
    fn deserialize_nonstreaming_with_config(
  156    162   
        &self,
  157    163   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         164  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  158    165   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  159    166   
        // For streaming operations, we only hit this case if its an error
  160    167   
        let body = response.body().bytes().expect("body loaded");
  161    168   
        crate::protocol_serde::type_erase_result(
  162    169   
            crate::protocol_serde::shape_streaming_operation_with_optional_data::de_streaming_operation_with_optional_data_http_error(
  163    170   
                response.status().as_u16(),
  164    171   
                response.headers(),
  165    172   
                body,
  166    173   
            ),
  167    174   
        )

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_optional_data/_streaming_operation_with_optional_data_input.rs

@@ -3,3 +137,144 @@
   23     23   
    "smithy.protocoltests.rpcv2Cbor.synthetic",
   24     24   
    "StreamingOperationWithOptionalDataInput",
   25     25   
);
   26     26   
static STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_OPTIONAL_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithOptionalDataInput$optionalData",
   29     29   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   30     30   
        "StreamingOperationWithOptionalDataInput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "optional_data",
          33  +
    "optionalData",
   34     34   
    0,
   35     35   
);
   36     36   
static STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithOptionalDataInput$events",
   39     39   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   40     40   
        "StreamingOperationWithOptionalDataInput",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Union,
   43     43   
    "events",
   44     44   
    1,
   45     45   
);
   46     46   
static STREAMINGOPERATIONWITHOPTIONALDATAINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    STREAMINGOPERATIONWITHOPTIONALDATAINPUT_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_OPTIONAL_DATA,
   51     51   
        &STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_EVENTS,
   52     52   
    ],
   53     53   
);
   54     54   
impl StreamingOperationWithOptionalDataInput {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGOPERATIONWITHOPTIONALDATAINPUT_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingOperationWithOptionalDataInput {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.optional_data {
   65     65   
            ser.write_string(&STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_OPTIONAL_DATA, val)?;
   66     66   
        }
   67         -
        {
   68         -
            let val = &self.events;
   69         -
            ser.write_null(&STREAMINGOPERATIONWITHOPTIONALDATAINPUT_MEMBER_EVENTS)?;
   70         -
        }
   71     67   
        Ok(())
   72     68   
    }
   73     69   
}
   74     70   
impl StreamingOperationWithOptionalDataInput {
   75     71   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   76         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   77         -
        deserializer: &mut D,
          72  +
    pub fn deserialize(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   78     74   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   79     75   
        #[allow(unused_variables, unused_mut)]
   80     76   
        let mut builder = Self::builder();
   81     77   
        #[allow(
   82     78   
            unused_variables,
   83     79   
            unreachable_code,
   84     80   
            clippy::single_match,
   85     81   
            clippy::match_single_binding,
   86     82   
            clippy::diverging_sub_expression
   87     83   
        )]
   88         -
        deserializer.read_struct(&STREAMINGOPERATIONWITHOPTIONALDATAINPUT_SCHEMA, (), |_, member, deser| {
          84  +
        deserializer.read_struct(&STREAMINGOPERATIONWITHOPTIONALDATAINPUT_SCHEMA, &mut |member, deser| {
   89     85   
            match member.member_index() {
   90     86   
                Some(0) => {
   91     87   
                    builder.optional_data = Some(deser.read_string(member)?);
   92     88   
                }
   93     89   
                Some(1) => {
   94     90   
                    builder.events = Some({
   95     91   
                        let _ = member;
   96         -
                        todo!("deserialize aggregate")
          92  +
                        todo!("deserialize streaming union")
   97     93   
                    });
   98     94   
                }
   99     95   
                _ => {}
  100     96   
            }
  101     97   
            Ok(())
  102     98   
        })?;
  103     99   
        builder
  104    100   
            .build()
  105    101   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  106    102   
    }
  107    103   
}
         104  +
impl StreamingOperationWithOptionalDataInput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         106  +
    pub fn deserialize_with_response(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         108  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         109  +
        _status: u16,
         110  +
        _body: &[u8],
         111  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         112  +
        Self::deserialize(deserializer)
         113  +
    }
         114  +
}
  108    115   
impl StreamingOperationWithOptionalDataInput {
  109    116   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataInput`](crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataInput).
  110    117   
    pub fn builder() -> crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataInputBuilder {
  111    118   
        crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataInputBuilder::default()
  112    119   
    }
  113    120   
    #[allow(unused)]
  114    121   
    pub(crate) fn into_builder(
  115    122   
        self,
  116    123   
    ) -> crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataInputBuilder {
  117    124   
        Self::builder().set_optional_data(self.optional_data).events(self.events)

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_optional_data/_streaming_operation_with_optional_data_output.rs

@@ -3,3 +137,144 @@
   23     23   
    "smithy.protocoltests.rpcv2Cbor.synthetic",
   24     24   
    "StreamingOperationWithOptionalDataOutput",
   25     25   
);
   26     26   
static STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_OPTIONAL_RESPONSE_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithOptionalDataOutput$optionalResponseData",
   29     29   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   30     30   
        "StreamingOperationWithOptionalDataOutput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "optional_response_data",
          33  +
    "optionalResponseData",
   34     34   
    0,
   35     35   
);
   36     36   
static STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static(
   38     38   
        "smithy.protocoltests.rpcv2Cbor.synthetic#StreamingOperationWithOptionalDataOutput$events",
   39     39   
        "smithy.protocoltests.rpcv2Cbor.synthetic",
   40     40   
        "StreamingOperationWithOptionalDataOutput",
   41     41   
    ),
   42     42   
    ::aws_smithy_schema::ShapeType::Union,
   43     43   
    "events",
   44     44   
    1,
   45     45   
);
   46     46   
static STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   47     47   
    STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_SCHEMA_ID,
   48     48   
    ::aws_smithy_schema::ShapeType::Structure,
   49     49   
    &[
   50     50   
        &STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_OPTIONAL_RESPONSE_DATA,
   51     51   
        &STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_EVENTS,
   52     52   
    ],
   53     53   
);
   54     54   
impl StreamingOperationWithOptionalDataOutput {
   55     55   
    /// The schema for this shape.
   56     56   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_SCHEMA;
   57     57   
}
   58     58   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamingOperationWithOptionalDataOutput {
   59     59   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   60     60   
    fn serialize_members(
   61     61   
        &self,
   62     62   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   63     63   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        if let Some(ref val) = self.optional_response_data {
   65     65   
            ser.write_string(&STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_OPTIONAL_RESPONSE_DATA, val)?;
   66     66   
        }
   67         -
        {
   68         -
            let val = &self.events;
   69         -
            ser.write_null(&STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_MEMBER_EVENTS)?;
   70         -
        }
   71     67   
        Ok(())
   72     68   
    }
   73     69   
}
   74     70   
impl StreamingOperationWithOptionalDataOutput {
   75     71   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   76         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   77         -
        deserializer: &mut D,
          72  +
    pub fn deserialize(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   78     74   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   79     75   
        #[allow(unused_variables, unused_mut)]
   80     76   
        let mut builder = Self::builder();
   81     77   
        #[allow(
   82     78   
            unused_variables,
   83     79   
            unreachable_code,
   84     80   
            clippy::single_match,
   85     81   
            clippy::match_single_binding,
   86     82   
            clippy::diverging_sub_expression
   87     83   
        )]
   88         -
        deserializer.read_struct(&STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_SCHEMA, (), |_, member, deser| {
          84  +
        deserializer.read_struct(&STREAMINGOPERATIONWITHOPTIONALDATAOUTPUT_SCHEMA, &mut |member, deser| {
   89     85   
            match member.member_index() {
   90     86   
                Some(0) => {
   91     87   
                    builder.optional_response_data = Some(deser.read_string(member)?);
   92     88   
                }
   93     89   
                Some(1) => {
   94     90   
                    builder.events = Some({
   95     91   
                        let _ = member;
   96         -
                        todo!("deserialize aggregate")
          92  +
                        todo!("deserialize streaming union")
   97     93   
                    });
   98     94   
                }
   99     95   
                _ => {}
  100     96   
            }
  101     97   
            Ok(())
  102     98   
        })?;
  103     99   
        builder
  104    100   
            .build()
  105    101   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  106    102   
    }
  107    103   
}
         104  +
impl StreamingOperationWithOptionalDataOutput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         106  +
    pub fn deserialize_with_response(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         108  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         109  +
        _status: u16,
         110  +
        _body: &[u8],
         111  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         112  +
        Self::deserialize(deserializer)
         113  +
    }
         114  +
}
  108    115   
impl StreamingOperationWithOptionalDataOutput {
  109    116   
    /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataOutput`](crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataOutput).
  110    117   
    pub fn builder() -> crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataOutputBuilder {
  111    118   
        crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataOutputBuilder::default()
  112    119   
    }
  113    120   
    #[allow(unused)]
  114    121   
    pub(crate) fn into_builder(
  115    122   
        self,
  116    123   
    ) -> crate::operation::streaming_operation_with_optional_data::builders::StreamingOperationWithOptionalDataOutputBuilder {
  117    124   
        Self::builder()