Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_timestamps/_json_timestamps_input.rs

@@ -43,43 +251,266 @@
   63     63   
    "normal",
   64     64   
    0,
   65     65   
);
   66     66   
static JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$dateTime",
   69     69   
        "aws.protocoltests.restjson.synthetic",
   70     70   
        "JsonTimestampsInput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Timestamp,
   73         -
    "date_time",
          73  +
    "dateTime",
   74     74   
    1,
   75     75   
)
   76     76   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   77     77   
static JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$dateTimeOnTarget",
   80     80   
        "aws.protocoltests.restjson.synthetic",
   81     81   
        "JsonTimestampsInput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Timestamp,
   84         -
    "date_time_on_target",
          84  +
    "dateTimeOnTarget",
   85     85   
    2,
   86         -
);
          86  +
)
          87  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   87     88   
static JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     89   
    ::aws_smithy_schema::ShapeId::from_static(
   89     90   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$epochSeconds",
   90     91   
        "aws.protocoltests.restjson.synthetic",
   91     92   
        "JsonTimestampsInput",
   92     93   
    ),
   93     94   
    ::aws_smithy_schema::ShapeType::Timestamp,
   94         -
    "epoch_seconds",
          95  +
    "epochSeconds",
   95     96   
    3,
   96     97   
)
   97     98   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
   98     99   
static JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99    100   
    ::aws_smithy_schema::ShapeId::from_static(
  100    101   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$epochSecondsOnTarget",
  101    102   
        "aws.protocoltests.restjson.synthetic",
  102    103   
        "JsonTimestampsInput",
  103    104   
    ),
  104    105   
    ::aws_smithy_schema::ShapeType::Timestamp,
  105         -
    "epoch_seconds_on_target",
         106  +
    "epochSecondsOnTarget",
  106    107   
    4,
  107         -
);
         108  +
)
         109  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  108    110   
static JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    111   
    ::aws_smithy_schema::ShapeId::from_static(
  110    112   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$httpDate",
  111    113   
        "aws.protocoltests.restjson.synthetic",
  112    114   
        "JsonTimestampsInput",
  113    115   
    ),
  114    116   
    ::aws_smithy_schema::ShapeType::Timestamp,
  115         -
    "http_date",
         117  +
    "httpDate",
  116    118   
    5,
  117    119   
)
  118    120   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  119    121   
static JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  120    122   
    ::aws_smithy_schema::ShapeId::from_static(
  121    123   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsInput$httpDateOnTarget",
  122    124   
        "aws.protocoltests.restjson.synthetic",
  123    125   
        "JsonTimestampsInput",
  124    126   
    ),
  125    127   
    ::aws_smithy_schema::ShapeType::Timestamp,
  126         -
    "http_date_on_target",
         128  +
    "httpDateOnTarget",
  127    129   
    6,
  128         -
);
         130  +
)
         131  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  129    132   
static JSONTIMESTAMPSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  130    133   
    JSONTIMESTAMPSINPUT_SCHEMA_ID,
  131    134   
    ::aws_smithy_schema::ShapeType::Structure,
  132    135   
    &[
  133    136   
        &JSONTIMESTAMPSINPUT_MEMBER_NORMAL,
  134    137   
        &JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME,
  135    138   
        &JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET,
  136    139   
        &JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS,
  137    140   
        &JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET,
  138    141   
        &JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE,
  139    142   
        &JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET,
  140    143   
    ],
  141         -
);
         144  +
)
         145  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/JsonTimestamps", None));
  142    146   
impl JsonTimestampsInput {
  143    147   
    /// The schema for this shape.
  144    148   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONTIMESTAMPSINPUT_SCHEMA;
  145    149   
}
  146    150   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonTimestampsInput {
  147    151   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  148    152   
    fn serialize_members(
  149    153   
        &self,
  150    154   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  151    155   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  152    156   
        if let Some(ref val) = self.normal {
  153    157   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_NORMAL, val)?;
  154    158   
        }
  155    159   
        if let Some(ref val) = self.date_time {
  156    160   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME, val)?;
  157    161   
        }
  158    162   
        if let Some(ref val) = self.date_time_on_target {
  159    163   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_DATE_TIME_ON_TARGET, val)?;
  160    164   
        }
  161    165   
        if let Some(ref val) = self.epoch_seconds {
  162    166   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS, val)?;
  163    167   
        }
  164    168   
        if let Some(ref val) = self.epoch_seconds_on_target {
  165    169   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_EPOCH_SECONDS_ON_TARGET, val)?;
  166    170   
        }
  167    171   
        if let Some(ref val) = self.http_date {
  168    172   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE, val)?;
  169    173   
        }
  170    174   
        if let Some(ref val) = self.http_date_on_target {
  171    175   
            ser.write_timestamp(&JSONTIMESTAMPSINPUT_MEMBER_HTTP_DATE_ON_TARGET, val)?;
  172    176   
        }
  173    177   
        Ok(())
  174    178   
    }
  175    179   
}
  176    180   
impl JsonTimestampsInput {
  177    181   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  178         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  179         -
        deserializer: &mut D,
         182  +
    pub fn deserialize(
         183  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  180    184   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  181    185   
        #[allow(unused_variables, unused_mut)]
  182    186   
        let mut builder = Self::builder();
  183    187   
        #[allow(
  184    188   
            unused_variables,
  185    189   
            unreachable_code,
  186    190   
            clippy::single_match,
  187    191   
            clippy::match_single_binding,
  188    192   
            clippy::diverging_sub_expression
  189    193   
        )]
  190         -
        deserializer.read_struct(&JSONTIMESTAMPSINPUT_SCHEMA, (), |_, member, deser| {
         194  +
        deserializer.read_struct(&JSONTIMESTAMPSINPUT_SCHEMA, &mut |member, deser| {
  191    195   
            match member.member_index() {
  192    196   
                Some(0) => {
  193    197   
                    builder.normal = Some(deser.read_timestamp(member)?);
  194    198   
                }
  195    199   
                Some(1) => {
  196    200   
                    builder.date_time = Some(deser.read_timestamp(member)?);
  197    201   
                }
  198    202   
                Some(2) => {
  199    203   
                    builder.date_time_on_target = Some(deser.read_timestamp(member)?);
  200    204   
                }
  201    205   
                Some(3) => {
  202    206   
                    builder.epoch_seconds = Some(deser.read_timestamp(member)?);
  203    207   
                }
  204    208   
                Some(4) => {
  205    209   
                    builder.epoch_seconds_on_target = Some(deser.read_timestamp(member)?);
  206    210   
                }
  207    211   
                Some(5) => {
  208    212   
                    builder.http_date = Some(deser.read_timestamp(member)?);
  209    213   
                }
  210    214   
                Some(6) => {
  211    215   
                    builder.http_date_on_target = Some(deser.read_timestamp(member)?);
  212    216   
                }
  213    217   
                _ => {}
  214    218   
            }
  215    219   
            Ok(())
  216    220   
        })?;
  217    221   
        builder
  218    222   
            .build()
  219    223   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  220    224   
    }
  221    225   
}
         226  +
impl JsonTimestampsInput {
         227  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         228  +
    pub fn deserialize_with_response(
         229  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         230  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         231  +
        _status: u16,
         232  +
        _body: &[u8],
         233  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         234  +
        Self::deserialize(deserializer)
         235  +
    }
         236  +
}
  222    237   
impl JsonTimestampsInput {
  223    238   
    /// Creates a new builder-style object to manufacture [`JsonTimestampsInput`](crate::operation::json_timestamps::JsonTimestampsInput).
  224    239   
    pub fn builder() -> crate::operation::json_timestamps::builders::JsonTimestampsInputBuilder {
  225    240   
        crate::operation::json_timestamps::builders::JsonTimestampsInputBuilder::default()
  226    241   
    }
  227    242   
}
  228    243   
  229    244   
/// A builder for [`JsonTimestampsInput`](crate::operation::json_timestamps::JsonTimestampsInput).
  230    245   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  231    246   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_timestamps/_json_timestamps_output.rs

@@ -43,43 +249,263 @@
   63     63   
    "normal",
   64     64   
    0,
   65     65   
);
   66     66   
static JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$dateTime",
   69     69   
        "aws.protocoltests.restjson.synthetic",
   70     70   
        "JsonTimestampsOutput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Timestamp,
   73         -
    "date_time",
          73  +
    "dateTime",
   74     74   
    1,
   75     75   
)
   76     76   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   77     77   
static JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$dateTimeOnTarget",
   80     80   
        "aws.protocoltests.restjson.synthetic",
   81     81   
        "JsonTimestampsOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Timestamp,
   84         -
    "date_time_on_target",
          84  +
    "dateTimeOnTarget",
   85     85   
    2,
   86         -
);
          86  +
)
          87  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
   87     88   
static JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     89   
    ::aws_smithy_schema::ShapeId::from_static(
   89     90   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$epochSeconds",
   90     91   
        "aws.protocoltests.restjson.synthetic",
   91     92   
        "JsonTimestampsOutput",
   92     93   
    ),
   93     94   
    ::aws_smithy_schema::ShapeType::Timestamp,
   94         -
    "epoch_seconds",
          95  +
    "epochSeconds",
   95     96   
    3,
   96     97   
)
   97     98   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
   98     99   
static JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99    100   
    ::aws_smithy_schema::ShapeId::from_static(
  100    101   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$epochSecondsOnTarget",
  101    102   
        "aws.protocoltests.restjson.synthetic",
  102    103   
        "JsonTimestampsOutput",
  103    104   
    ),
  104    105   
    ::aws_smithy_schema::ShapeType::Timestamp,
  105         -
    "epoch_seconds_on_target",
         106  +
    "epochSecondsOnTarget",
  106    107   
    4,
  107         -
);
         108  +
)
         109  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  108    110   
static JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    111   
    ::aws_smithy_schema::ShapeId::from_static(
  110    112   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$httpDate",
  111    113   
        "aws.protocoltests.restjson.synthetic",
  112    114   
        "JsonTimestampsOutput",
  113    115   
    ),
  114    116   
    ::aws_smithy_schema::ShapeType::Timestamp,
  115         -
    "http_date",
         117  +
    "httpDate",
  116    118   
    5,
  117    119   
)
  118    120   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  119    121   
static JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  120    122   
    ::aws_smithy_schema::ShapeId::from_static(
  121    123   
        "aws.protocoltests.restjson.synthetic#JsonTimestampsOutput$httpDateOnTarget",
  122    124   
        "aws.protocoltests.restjson.synthetic",
  123    125   
        "JsonTimestampsOutput",
  124    126   
    ),
  125    127   
    ::aws_smithy_schema::ShapeType::Timestamp,
  126         -
    "http_date_on_target",
         128  +
    "httpDateOnTarget",
  127    129   
    6,
  128         -
);
         130  +
)
         131  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  129    132   
static JSONTIMESTAMPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  130    133   
    JSONTIMESTAMPSOUTPUT_SCHEMA_ID,
  131    134   
    ::aws_smithy_schema::ShapeType::Structure,
  132    135   
    &[
  133    136   
        &JSONTIMESTAMPSOUTPUT_MEMBER_NORMAL,
  134    137   
        &JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME,
  135    138   
        &JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET,
  136    139   
        &JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS,
  137    140   
        &JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET,
  138    141   
        &JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE,
  139    142   
        &JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET,
  140    143   
    ],
  141    144   
);
  142    145   
impl JsonTimestampsOutput {
  143    146   
    /// The schema for this shape.
  144    147   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONTIMESTAMPSOUTPUT_SCHEMA;
  145    148   
}
  146    149   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonTimestampsOutput {
  147    150   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  148    151   
    fn serialize_members(
  149    152   
        &self,
  150    153   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  151    154   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  152    155   
        if let Some(ref val) = self.normal {
  153    156   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_NORMAL, val)?;
  154    157   
        }
  155    158   
        if let Some(ref val) = self.date_time {
  156    159   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME, val)?;
  157    160   
        }
  158    161   
        if let Some(ref val) = self.date_time_on_target {
  159    162   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_DATE_TIME_ON_TARGET, val)?;
  160    163   
        }
  161    164   
        if let Some(ref val) = self.epoch_seconds {
  162    165   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS, val)?;
  163    166   
        }
  164    167   
        if let Some(ref val) = self.epoch_seconds_on_target {
  165    168   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_EPOCH_SECONDS_ON_TARGET, val)?;
  166    169   
        }
  167    170   
        if let Some(ref val) = self.http_date {
  168    171   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE, val)?;
  169    172   
        }
  170    173   
        if let Some(ref val) = self.http_date_on_target {
  171    174   
            ser.write_timestamp(&JSONTIMESTAMPSOUTPUT_MEMBER_HTTP_DATE_ON_TARGET, val)?;
  172    175   
        }
  173    176   
        Ok(())
  174    177   
    }
  175    178   
}
  176    179   
impl JsonTimestampsOutput {
  177    180   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  178         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  179         -
        deserializer: &mut D,
         181  +
    pub fn deserialize(
         182  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  180    183   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  181    184   
        #[allow(unused_variables, unused_mut)]
  182    185   
        let mut builder = Self::builder();
  183    186   
        #[allow(
  184    187   
            unused_variables,
  185    188   
            unreachable_code,
  186    189   
            clippy::single_match,
  187    190   
            clippy::match_single_binding,
  188    191   
            clippy::diverging_sub_expression
  189    192   
        )]
  190         -
        deserializer.read_struct(&JSONTIMESTAMPSOUTPUT_SCHEMA, (), |_, member, deser| {
         193  +
        deserializer.read_struct(&JSONTIMESTAMPSOUTPUT_SCHEMA, &mut |member, deser| {
  191    194   
            match member.member_index() {
  192    195   
                Some(0) => {
  193    196   
                    builder.normal = Some(deser.read_timestamp(member)?);
  194    197   
                }
  195    198   
                Some(1) => {
  196    199   
                    builder.date_time = Some(deser.read_timestamp(member)?);
  197    200   
                }
  198    201   
                Some(2) => {
  199    202   
                    builder.date_time_on_target = Some(deser.read_timestamp(member)?);
  200    203   
                }
  201    204   
                Some(3) => {
  202    205   
                    builder.epoch_seconds = Some(deser.read_timestamp(member)?);
  203    206   
                }
  204    207   
                Some(4) => {
  205    208   
                    builder.epoch_seconds_on_target = Some(deser.read_timestamp(member)?);
  206    209   
                }
  207    210   
                Some(5) => {
  208    211   
                    builder.http_date = Some(deser.read_timestamp(member)?);
  209    212   
                }
  210    213   
                Some(6) => {
  211    214   
                    builder.http_date_on_target = Some(deser.read_timestamp(member)?);
  212    215   
                }
  213    216   
                _ => {}
  214    217   
            }
  215    218   
            Ok(())
  216    219   
        })?;
  217    220   
        Ok(builder.build())
  218    221   
    }
  219    222   
}
         223  +
impl JsonTimestampsOutput {
         224  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         225  +
    pub fn deserialize_with_response(
         226  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         227  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         228  +
        _status: u16,
         229  +
        _body: &[u8],
         230  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         231  +
        Self::deserialize(deserializer)
         232  +
    }
         233  +
}
  220    234   
impl JsonTimestampsOutput {
  221    235   
    /// Creates a new builder-style object to manufacture [`JsonTimestampsOutput`](crate::operation::json_timestamps::JsonTimestampsOutput).
  222    236   
    pub fn builder() -> crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder {
  223    237   
        crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder::default()
  224    238   
    }
  225    239   
}
  226    240   
  227    241   
/// A builder for [`JsonTimestampsOutput`](crate::operation::json_timestamps::JsonTimestampsOutput).
  228    242   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  229    243   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions.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 `JsonUnions`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct JsonUnions;
    6      6   
impl JsonUnions {
    7      7   
    /// Creates a new `JsonUnions`
    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::json_unions::JsonUnionsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::json_unions::JsonUnionsOutput::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::json_unions::JsonUnionsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::json_unions::JsonUnionsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::json_unions::JsonUnionsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +224,229 @@
  124    128   
                crate::operation::json_unions::JsonUnionsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct JsonUnionsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonUnionsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_unions::JsonUnionsError::generic(
         158  +
                    generic,
         159  +
                )),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol.deserialize_response(response, JsonUnions::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         166  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         167  +
            })?;
         168  +
            let body = response.body().bytes().expect("body loaded");
         169  +
            let output = crate::operation::json_unions::JsonUnionsOutput::deserialize_with_response(
         170  +
                &mut *deser,
         171  +
                response.headers(),
         172  +
                response.status().into(),
         173  +
                body,
         174  +
            )
         175  +
            .map_err(|e| {
         176  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
            })?;
         178  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         179  +
        }
  150    180   
    }
  151    181   
}
  152    182   
#[derive(Debug)]
  153    183   
struct JsonUnionsRequestSerializer;
  154    184   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonUnionsRequestSerializer {
  155    185   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    186   
    fn serialize_input(
  157    187   
        &self,
  158    188   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    189   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    190   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    191   
        let input = input.downcast::<crate::operation::json_unions::JsonUnionsInput>().expect("correct type");
  162         -
        let _header_serialization_settings = _cfg
  163         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  164         -
            .cloned()
  165         -
            .unwrap_or_default();
  166         -
        let mut request_builder = {
  167         -
            #[allow(clippy::uninlined_format_args)]
  168         -
            fn uri_base(
  169         -
                _input: &crate::operation::json_unions::JsonUnionsInput,
  170         -
                output: &mut ::std::string::String,
  171         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172         -
                use ::std::fmt::Write as _;
  173         -
                ::std::write!(output, "/JsonUnions").expect("formatting should succeed");
  174         -
                ::std::result::Result::Ok(())
  175         -
            }
  176         -
            #[allow(clippy::unnecessary_wraps)]
  177         -
            fn update_http_builder(
  178         -
                input: &crate::operation::json_unions::JsonUnionsInput,
  179         -
                builder: ::http_1x::request::Builder,
  180         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181         -
                let mut uri = ::std::string::String::new();
  182         -
                uri_base(input, &mut uri)?;
  183         -
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  184         -
            }
  185         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  186         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  187         -
            builder
  188         -
        };
  189         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_input(&input)?);
  190         -
        if let Some(content_length) = body.content_length() {
  191         -
            let content_length = content_length.to_string();
  192         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  193         -
        }
  194         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         192  +
        let protocol = _cfg
         193  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         194  +
            .expect("a SharedClientProtocol is required");
         195  +
        let mut request = protocol
         196  +
            .serialize_request(&input, JsonUnions::INPUT_SCHEMA, "", _cfg)
         197  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         198  +
         199  +
        return ::std::result::Result::Ok(request);
  195    200   
    }
  196    201   
}
  197    202   
#[derive(Debug)]
  198    203   
struct JsonUnionsEndpointParamsInterceptor;
  199    204   
  200    205   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
  201    206   
    fn name(&self) -> &'static str {
  202    207   
        "JsonUnionsEndpointParamsInterceptor"
  203    208   
    }
  204    209   
@@ -603,608 +1073,1178 @@
  623    628   
            .expect("the config must have a deserializer");
  624    629   
  625    630   
        let parsed = de.deserialize_streaming(&mut http_response);
  626    631   
        let parsed = parsed.unwrap_or_else(|| {
  627    632   
            let http_response = http_response.map(|body| {
  628    633   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  629    634   
                    body.bytes().unwrap(),
  630    635   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  631    636   
                )))
  632    637   
            });
  633         -
            de.deserialize_nonstreaming(&http_response)
         638  +
            // Build a config bag with the protocol for schema-based deserialization
         639  +
            #[allow(unused_mut)]
         640  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         641  +
            {
         642  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         643  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         644  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         645  +
                ));
         646  +
                test_cfg.push_shared_layer(layer.freeze());
         647  +
            }
         648  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  634    649   
        });
  635    650   
        let parsed = parsed
  636    651   
            .expect("should be successful response")
  637    652   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  638    653   
            .unwrap();
  639    654   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  640    655   
    }
  641    656   
  642    657   
    /// Deserializes a boolean union value
  643    658   
    /// Test ID: RestJsonDeserializeBooleanUnionValue
  644    659   
    #[::tokio::test]
  645    660   
    #[::tracing_test::traced_test]
  646    661   
    async fn rest_json_deserialize_boolean_union_value_response() {
  647    662   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  648    663   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
  649    664   
            .build();
  650    665   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  651    666   
            ::http_1x::response::Builder::new()
  652    667   
                .header("Content-Type", "application/json")
  653    668   
                .status(200)
  654    669   
                .body(::aws_smithy_types::body::SdkBody::from(
  655    670   
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
  656    671   
                ))
  657    672   
                .unwrap(),
  658    673   
        )
  659    674   
        .unwrap();
  660    675   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  661    676   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  662    677   
  663    678   
        let op = crate::operation::json_unions::JsonUnions::new();
  664    679   
        let config = op.config().expect("the operation has config");
  665    680   
        let de = config
  666    681   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  667    682   
            .expect("the config must have a deserializer");
  668    683   
  669    684   
        let parsed = de.deserialize_streaming(&mut http_response);
  670    685   
        let parsed = parsed.unwrap_or_else(|| {
  671    686   
            let http_response = http_response.map(|body| {
  672    687   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  673    688   
                    body.bytes().unwrap(),
  674    689   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  675    690   
                )))
  676    691   
            });
  677         -
            de.deserialize_nonstreaming(&http_response)
         692  +
            // Build a config bag with the protocol for schema-based deserialization
         693  +
            #[allow(unused_mut)]
         694  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         695  +
            {
         696  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         697  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         698  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         699  +
                ));
         700  +
                test_cfg.push_shared_layer(layer.freeze());
         701  +
            }
         702  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  678    703   
        });
  679    704   
        let parsed = parsed
  680    705   
            .expect("should be successful response")
  681    706   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  682    707   
            .unwrap();
  683    708   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  684    709   
    }
  685    710   
  686    711   
    /// Deserializes a number union value
  687    712   
    /// Test ID: RestJsonDeserializeNumberUnionValue
  688    713   
    #[::tokio::test]
  689    714   
    #[::tracing_test::traced_test]
  690    715   
    async fn rest_json_deserialize_number_union_value_response() {
  691    716   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  692    717   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
  693    718   
            .build();
  694    719   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  695    720   
            ::http_1x::response::Builder::new()
  696    721   
                .header("Content-Type", "application/json")
  697    722   
                .status(200)
  698    723   
                .body(::aws_smithy_types::body::SdkBody::from(
  699    724   
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
  700    725   
                ))
  701    726   
                .unwrap(),
  702    727   
        )
  703    728   
        .unwrap();
  704    729   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  705    730   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  706    731   
  707    732   
        let op = crate::operation::json_unions::JsonUnions::new();
  708    733   
        let config = op.config().expect("the operation has config");
  709    734   
        let de = config
  710    735   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  711    736   
            .expect("the config must have a deserializer");
  712    737   
  713    738   
        let parsed = de.deserialize_streaming(&mut http_response);
  714    739   
        let parsed = parsed.unwrap_or_else(|| {
  715    740   
            let http_response = http_response.map(|body| {
  716    741   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  717    742   
                    body.bytes().unwrap(),
  718    743   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  719    744   
                )))
  720    745   
            });
  721         -
            de.deserialize_nonstreaming(&http_response)
         746  +
            // Build a config bag with the protocol for schema-based deserialization
         747  +
            #[allow(unused_mut)]
         748  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         749  +
            {
         750  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         751  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         752  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         753  +
                ));
         754  +
                test_cfg.push_shared_layer(layer.freeze());
         755  +
            }
         756  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  722    757   
        });
  723    758   
        let parsed = parsed
  724    759   
            .expect("should be successful response")
  725    760   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  726    761   
            .unwrap();
  727    762   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  728    763   
    }
  729    764   
  730    765   
    /// Deserializes a blob union value
  731    766   
    /// Test ID: RestJsonDeserializeBlobUnionValue
  732    767   
    #[::tokio::test]
  733    768   
    #[::tracing_test::traced_test]
  734    769   
    async fn rest_json_deserialize_blob_union_value_response() {
  735    770   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  736    771   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
  737    772   
                ::aws_smithy_types::Blob::new("foo"),
  738    773   
            )))
  739    774   
            .build();
  740    775   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  741    776   
            ::http_1x::response::Builder::new()
  742    777   
                .header("Content-Type", "application/json")
  743    778   
                .status(200)
  744    779   
                .body(::aws_smithy_types::body::SdkBody::from(
  745    780   
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
  746    781   
                ))
  747    782   
                .unwrap(),
  748    783   
        )
  749    784   
        .unwrap();
  750    785   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  751    786   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  752    787   
  753    788   
        let op = crate::operation::json_unions::JsonUnions::new();
  754    789   
        let config = op.config().expect("the operation has config");
  755    790   
        let de = config
  756    791   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  757    792   
            .expect("the config must have a deserializer");
  758    793   
  759    794   
        let parsed = de.deserialize_streaming(&mut http_response);
  760    795   
        let parsed = parsed.unwrap_or_else(|| {
  761    796   
            let http_response = http_response.map(|body| {
  762    797   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  763    798   
                    body.bytes().unwrap(),
  764    799   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  765    800   
                )))
  766    801   
            });
  767         -
            de.deserialize_nonstreaming(&http_response)
         802  +
            // Build a config bag with the protocol for schema-based deserialization
         803  +
            #[allow(unused_mut)]
         804  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         805  +
            {
         806  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         807  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         808  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         809  +
                ));
         810  +
                test_cfg.push_shared_layer(layer.freeze());
         811  +
            }
         812  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  768    813   
        });
  769    814   
        let parsed = parsed
  770    815   
            .expect("should be successful response")
  771    816   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  772    817   
            .unwrap();
  773    818   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  774    819   
    }
  775    820   
  776    821   
    /// Deserializes a timestamp union value
  777    822   
    /// Test ID: RestJsonDeserializeTimestampUnionValue
  778    823   
    #[::tokio::test]
  779    824   
    #[::tracing_test::traced_test]
  780    825   
    async fn rest_json_deserialize_timestamp_union_value_response() {
  781    826   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  782    827   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
  783    828   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  784    829   
            )))
  785    830   
            .build();
  786    831   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  787    832   
            ::http_1x::response::Builder::new()
  788    833   
                .header("Content-Type", "application/json")
  789    834   
                .status(200)
  790    835   
                .body(::aws_smithy_types::body::SdkBody::from(
  791    836   
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
  792    837   
                ))
  793    838   
                .unwrap(),
  794    839   
        )
  795    840   
        .unwrap();
  796    841   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  797    842   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  798    843   
  799    844   
        let op = crate::operation::json_unions::JsonUnions::new();
  800    845   
        let config = op.config().expect("the operation has config");
  801    846   
        let de = config
  802    847   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  803    848   
            .expect("the config must have a deserializer");
  804    849   
  805    850   
        let parsed = de.deserialize_streaming(&mut http_response);
  806    851   
        let parsed = parsed.unwrap_or_else(|| {
  807    852   
            let http_response = http_response.map(|body| {
  808    853   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  809    854   
                    body.bytes().unwrap(),
  810    855   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  811    856   
                )))
  812    857   
            });
  813         -
            de.deserialize_nonstreaming(&http_response)
         858  +
            // Build a config bag with the protocol for schema-based deserialization
         859  +
            #[allow(unused_mut)]
         860  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         861  +
            {
         862  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         863  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         864  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         865  +
                ));
         866  +
                test_cfg.push_shared_layer(layer.freeze());
         867  +
            }
         868  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  814    869   
        });
  815    870   
        let parsed = parsed
  816    871   
            .expect("should be successful response")
  817    872   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  818    873   
            .unwrap();
  819    874   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  820    875   
    }
  821    876   
  822    877   
    /// Deserializes an enum union value
  823    878   
    /// Test ID: RestJsonDeserializeEnumUnionValue
  824    879   
    #[::tokio::test]
  825    880   
    #[::tracing_test::traced_test]
  826    881   
    async fn rest_json_deserialize_enum_union_value_response() {
  827    882   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  828    883   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
  829    884   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  830    885   
            )))
  831    886   
            .build();
  832    887   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  833    888   
            ::http_1x::response::Builder::new()
  834    889   
                .header("Content-Type", "application/json")
  835    890   
                .status(200)
  836    891   
                .body(::aws_smithy_types::body::SdkBody::from(
  837    892   
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
  838    893   
                ))
  839    894   
                .unwrap(),
  840    895   
        )
  841    896   
        .unwrap();
  842    897   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  843    898   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  844    899   
  845    900   
        let op = crate::operation::json_unions::JsonUnions::new();
  846    901   
        let config = op.config().expect("the operation has config");
  847    902   
        let de = config
  848    903   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  849    904   
            .expect("the config must have a deserializer");
  850    905   
  851    906   
        let parsed = de.deserialize_streaming(&mut http_response);
  852    907   
        let parsed = parsed.unwrap_or_else(|| {
  853    908   
            let http_response = http_response.map(|body| {
  854    909   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  855    910   
                    body.bytes().unwrap(),
  856    911   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  857    912   
                )))
  858    913   
            });
  859         -
            de.deserialize_nonstreaming(&http_response)
         914  +
            // Build a config bag with the protocol for schema-based deserialization
         915  +
            #[allow(unused_mut)]
         916  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         917  +
            {
         918  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         919  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         920  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         921  +
                ));
         922  +
                test_cfg.push_shared_layer(layer.freeze());
         923  +
            }
         924  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  860    925   
        });
  861    926   
        let parsed = parsed
  862    927   
            .expect("should be successful response")
  863    928   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  864    929   
            .unwrap();
  865    930   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  866    931   
    }
  867    932   
  868    933   
    /// Deserializes a list union value
  869    934   
    /// Test ID: RestJsonDeserializeListUnionValue
  870    935   
    #[::tokio::test]
  871    936   
    #[::tracing_test::traced_test]
  872    937   
    async fn rest_json_deserialize_list_union_value_response() {
  873    938   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  874    939   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
  875    940   
                "foo".to_owned(),
  876    941   
                "bar".to_owned(),
  877    942   
            ])))
  878    943   
            .build();
  879    944   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  880    945   
            ::http_1x::response::Builder::new()
  881    946   
                .header("Content-Type", "application/json")
  882    947   
                .status(200)
  883    948   
                .body(::aws_smithy_types::body::SdkBody::from(
  884    949   
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
  885    950   
                ))
  886    951   
                .unwrap(),
  887    952   
        )
  888    953   
        .unwrap();
  889    954   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  890    955   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  891    956   
  892    957   
        let op = crate::operation::json_unions::JsonUnions::new();
  893    958   
        let config = op.config().expect("the operation has config");
  894    959   
        let de = config
  895    960   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  896    961   
            .expect("the config must have a deserializer");
  897    962   
  898    963   
        let parsed = de.deserialize_streaming(&mut http_response);
  899    964   
        let parsed = parsed.unwrap_or_else(|| {
  900    965   
            let http_response = http_response.map(|body| {
  901    966   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  902    967   
                    body.bytes().unwrap(),
  903    968   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  904    969   
                )))
  905    970   
            });
  906         -
            de.deserialize_nonstreaming(&http_response)
         971  +
            // Build a config bag with the protocol for schema-based deserialization
         972  +
            #[allow(unused_mut)]
         973  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         974  +
            {
         975  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         976  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         977  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         978  +
                ));
         979  +
                test_cfg.push_shared_layer(layer.freeze());
         980  +
            }
         981  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  907    982   
        });
  908    983   
        let parsed = parsed
  909    984   
            .expect("should be successful response")
  910    985   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  911    986   
            .unwrap();
  912    987   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  913    988   
    }
  914    989   
  915    990   
    /// Deserializes a map union value
  916    991   
    /// Test ID: RestJsonDeserializeMapUnionValue
  917    992   
    #[::tokio::test]
  918    993   
    #[::tracing_test::traced_test]
  919    994   
    async fn rest_json_deserialize_map_union_value_response() {
  920    995   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  921    996   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
  922    997   
                let mut ret = ::std::collections::HashMap::new();
  923    998   
                ret.insert("foo".to_owned(), "bar".to_owned());
  924    999   
                ret.insert("spam".to_owned(), "eggs".to_owned());
  925   1000   
                ret
  926   1001   
            })))
  927   1002   
            .build();
  928   1003   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
  929   1004   
        .header("Content-Type", "application/json")
  930   1005   
        .status(200)
  931   1006   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}"))
  932   1007   
                    .unwrap()
  933   1008   
                    ).unwrap();
  934   1009   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  935   1010   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  936   1011   
  937   1012   
        let op = crate::operation::json_unions::JsonUnions::new();
  938   1013   
        let config = op.config().expect("the operation has config");
  939   1014   
        let de = config
  940   1015   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  941   1016   
            .expect("the config must have a deserializer");
  942   1017   
  943   1018   
        let parsed = de.deserialize_streaming(&mut http_response);
  944   1019   
        let parsed = parsed.unwrap_or_else(|| {
  945   1020   
            let http_response = http_response.map(|body| {
  946   1021   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  947   1022   
                    body.bytes().unwrap(),
  948   1023   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  949   1024   
                )))
  950   1025   
            });
  951         -
            de.deserialize_nonstreaming(&http_response)
        1026  +
            // Build a config bag with the protocol for schema-based deserialization
        1027  +
            #[allow(unused_mut)]
        1028  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1029  +
            {
        1030  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1031  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1032  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1033  +
                ));
        1034  +
                test_cfg.push_shared_layer(layer.freeze());
        1035  +
            }
        1036  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  952   1037   
        });
  953   1038   
        let parsed = parsed
  954   1039   
            .expect("should be successful response")
  955   1040   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  956   1041   
            .unwrap();
  957   1042   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  958   1043   
    }
  959   1044   
  960   1045   
    /// Deserializes a structure union value
  961   1046   
    /// Test ID: RestJsonDeserializeStructureUnionValue
  962   1047   
    #[::tokio::test]
  963   1048   
    #[::tracing_test::traced_test]
  964   1049   
    async fn rest_json_deserialize_structure_union_value_response() {
  965   1050   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
  966   1051   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
  967   1052   
                crate::types::GreetingStruct::builder()
  968   1053   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
  969   1054   
                    .build(),
  970   1055   
            )))
  971   1056   
            .build();
  972   1057   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  973   1058   
            ::http_1x::response::Builder::new()
  974   1059   
                .header("Content-Type", "application/json")
  975   1060   
                .status(200)
  976   1061   
                .body(::aws_smithy_types::body::SdkBody::from(
  977   1062   
                    "{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}",
  978   1063   
                ))
  979   1064   
                .unwrap(),
  980   1065   
        )
  981   1066   
        .unwrap();
  982   1067   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  983   1068   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  984   1069   
  985   1070   
        let op = crate::operation::json_unions::JsonUnions::new();
  986   1071   
        let config = op.config().expect("the operation has config");
  987   1072   
        let de = config
  988   1073   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  989   1074   
            .expect("the config must have a deserializer");
  990   1075   
  991   1076   
        let parsed = de.deserialize_streaming(&mut http_response);
  992   1077   
        let parsed = parsed.unwrap_or_else(|| {
  993   1078   
            let http_response = http_response.map(|body| {
  994   1079   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  995   1080   
                    body.bytes().unwrap(),
  996   1081   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  997   1082   
                )))
  998   1083   
            });
  999         -
            de.deserialize_nonstreaming(&http_response)
        1084  +
            // Build a config bag with the protocol for schema-based deserialization
        1085  +
            #[allow(unused_mut)]
        1086  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1087  +
            {
        1088  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1089  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1090  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1091  +
                ));
        1092  +
                test_cfg.push_shared_layer(layer.freeze());
        1093  +
            }
        1094  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1000   1095   
        });
 1001   1096   
        let parsed = parsed
 1002   1097   
            .expect("should be successful response")
 1003   1098   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
 1004   1099   
            .unwrap();
 1005   1100   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
 1006   1101   
    }
 1007   1102   
 1008   1103   
    /// Ignores an unrecognized __type property
 1009   1104   
    /// Test ID: RestJsonDeserializeIgnoreType
 1010   1105   
    #[::tokio::test]
 1011   1106   
    #[::tracing_test::traced_test]
 1012   1107   
    async fn rest_json_deserialize_ignore_type_response() {
 1013   1108   
        let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
 1014   1109   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
 1015   1110   
                crate::types::GreetingStruct::builder()
 1016   1111   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
 1017   1112   
                    .build(),
 1018   1113   
            )))
 1019   1114   
            .build();
 1020   1115   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
 1021   1116   
        .header("Content-Type", "application/json")
 1022   1117   
        .status(200)
 1023   1118   
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"contents\": {\n        \"__type\": \"aws.protocoltests.json10#MyUnion\",\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}"))
 1024   1119   
                    .unwrap()
 1025   1120   
                    ).unwrap();
 1026   1121   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
 1027   1122   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
 1028   1123   
 1029   1124   
        let op = crate::operation::json_unions::JsonUnions::new();
 1030   1125   
        let config = op.config().expect("the operation has config");
 1031   1126   
        let de = config
 1032   1127   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
 1033   1128   
            .expect("the config must have a deserializer");
 1034   1129   
 1035   1130   
        let parsed = de.deserialize_streaming(&mut http_response);
 1036   1131   
        let parsed = parsed.unwrap_or_else(|| {
 1037   1132   
            let http_response = http_response.map(|body| {
 1038   1133   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 1039   1134   
                    body.bytes().unwrap(),
 1040   1135   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1041   1136   
                )))
 1042   1137   
            });
 1043         -
            de.deserialize_nonstreaming(&http_response)
        1138  +
            // Build a config bag with the protocol for schema-based deserialization
        1139  +
            #[allow(unused_mut)]
        1140  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        1141  +
            {
        1142  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
        1143  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1144  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1145  +
                ));
        1146  +
                test_cfg.push_shared_layer(layer.freeze());
        1147  +
            }
        1148  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
 1044   1149   
        });
 1045   1150   
        let parsed = parsed
 1046   1151   
            .expect("should be successful response")
 1047   1152   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
 1048   1153   
            .unwrap();
 1049   1154   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
 1050   1155   
    }
 1051   1156   
}
 1052   1157   
 1053   1158   
/// Error type for the `JsonUnionsError` operation.

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions/_json_unions_input.rs

@@ -5,5 +112,121 @@
   25     25   
        "JsonUnionsInput",
   26     26   
    ),
   27     27   
    ::aws_smithy_schema::ShapeType::Union,
   28     28   
    "contents",
   29     29   
    0,
   30     30   
);
   31     31   
static JSONUNIONSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    JSONUNIONSINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&JSONUNIONSINPUT_MEMBER_CONTENTS],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/JsonUnions", None));
   36     37   
impl JsonUnionsInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONUNIONSINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonUnionsInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.contents {
   47         -
            ser.write_null(&JSONUNIONSINPUT_MEMBER_CONTENTS)?;
          48  +
            ser.write_struct(&JSONUNIONSINPUT_MEMBER_CONTENTS, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl JsonUnionsInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&JSONUNIONSINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&JSONUNIONSINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69         -
                    builder.contents = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          70  +
                    builder.contents = Some(crate::types::MyUnion::deserialize(deser)?);
   73     71   
                }
   74     72   
                _ => {}
   75     73   
            }
   76     74   
            Ok(())
   77     75   
        })?;
   78     76   
        builder
   79     77   
            .build()
   80     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   81     79   
    }
   82     80   
}
          81  +
impl JsonUnionsInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          83  +
    pub fn deserialize_with_response(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        _body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        Self::deserialize(deserializer)
          90  +
    }
          91  +
}
   83     92   
impl JsonUnionsInput {
   84     93   
    /// Creates a new builder-style object to manufacture [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
   85     94   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsInputBuilder {
   86     95   
        crate::operation::json_unions::builders::JsonUnionsInputBuilder::default()
   87     96   
    }
   88     97   
}
   89     98   
   90     99   
/// A builder for [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
   91    100   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   92    101   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions/_json_unions_output.rs

@@ -17,17 +110,118 @@
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONUNIONSOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for JsonUnionsOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.contents {
   47         -
            ser.write_null(&JSONUNIONSOUTPUT_MEMBER_CONTENTS)?;
          47  +
            ser.write_struct(&JSONUNIONSOUTPUT_MEMBER_CONTENTS, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl JsonUnionsOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&JSONUNIONSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&JSONUNIONSOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69         -
                    builder.contents = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          69  +
                    builder.contents = Some(crate::types::MyUnion::deserialize(deser)?);
   73     70   
                }
   74     71   
                _ => {}
   75     72   
            }
   76     73   
            Ok(())
   77     74   
        })?;
   78     75   
        Ok(builder.build())
   79     76   
    }
   80     77   
}
          78  +
impl JsonUnionsOutput {
          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  +
}
   81     89   
impl JsonUnionsOutput {
   82     90   
    /// Creates a new builder-style object to manufacture [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
   83     91   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsOutputBuilder {
   84     92   
        crate::operation::json_unions::builders::JsonUnionsOutputBuilder::default()
   85     93   
    }
   86     94   
}
   87     95   
   88     96   
/// A builder for [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
   89     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90     98   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body/_malformed_accept_with_body_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body/_malformed_accept_with_body_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.hi {
   46     46   
            ser.write_string(&MALFORMEDACCEPTWITHBODYOUTPUT_MEMBER_HI, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl MalformedAcceptWithBodyOutput {
   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(&MALFORMEDACCEPTWITHBODYOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&MALFORMEDACCEPTWITHBODYOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.hi = 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 MalformedAcceptWithBodyOutput {
          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 MalformedAcceptWithBodyOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
   79     90   
    pub fn builder() -> crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder {
   80     91   
        crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
   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/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string.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 `MalformedAcceptWithGenericString`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedAcceptWithGenericString;
    6      6   
impl MalformedAcceptWithGenericString {
    7      7   
    /// Creates a new `MalformedAcceptWithGenericString`
    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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput::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::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +232,241 @@
  130    136   
                crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
  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 MalformedAcceptWithGenericStringResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithGenericStringResponseDeserializer {
  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         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_error(
  152         -
                status, headers, body,
  153         -
            )
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError::generic(generic),
         167  +
                ),
         168  +
            ))
  154    169   
        } else {
  155         -
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_response(
  156         -
                status, headers, body,
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, MalformedAcceptWithGenericString::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  157    184   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  160    190   
    }
  161    191   
}
  162    192   
#[derive(Debug)]
  163    193   
struct MalformedAcceptWithGenericStringRequestSerializer;
  164    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithGenericStringRequestSerializer {
  165    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    196   
    fn serialize_input(
  167    197   
        &self,
  168    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    201   
        let input = input
  172    202   
            .downcast::<crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput>()
  173    203   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                ::std::write!(output, "/MalformedAcceptWithGenericString").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  196         -
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder
  199         -
        };
  200         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, MalformedAcceptWithGenericString::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  201    210   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  203    212   
    }
  204    213   
}
  205    214   
#[derive(Debug)]
  206    215   
struct MalformedAcceptWithGenericStringEndpointParamsInterceptor;
  207    216   
  208    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithGenericStringEndpointParamsInterceptor {
  209    218   
    fn name(&self) -> &'static str {
  210    219   
        "MalformedAcceptWithGenericStringEndpointParamsInterceptor"
  211    220   
    }
  212    221   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string/_malformed_accept_with_generic_string_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string/_malformed_accept_with_generic_string_output.rs

@@ -24,24 +107,126 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.payload {
   47     47   
            ser.write_string(&MALFORMEDACCEPTWITHGENERICSTRINGOUTPUT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl MalformedAcceptWithGenericStringOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&MALFORMEDACCEPTWITHGENERICSTRINGOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&MALFORMEDACCEPTWITHGENERICSTRINGOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl MalformedAcceptWithGenericStringOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            let s = ::std::string::String::from_utf8_lossy(body).into_owned();
          92  +
            builder.payload = Some(s);
          93  +
        }
          94  +
        Ok(builder.build())
          95  +
    }
          96  +
}
   78     97   
impl MalformedAcceptWithGenericStringOutput {
   79     98   
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
   80     99   
    pub fn builder() -> crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringOutputBuilder {
   81    100   
        crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringOutputBuilder::default()
   82    101   
    }
   83    102   
}
   84    103   
   85    104   
/// A builder for [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
   86    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    106   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload.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 `MalformedAcceptWithPayload`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedAcceptWithPayload;
    6      6   
impl MalformedAcceptWithPayload {
    7      7   
    /// Creates a new `MalformedAcceptWithPayload`
    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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput::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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,241 @@
  130    136   
                crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
  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 MalformedAcceptWithPayloadResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithPayloadResponseDeserializer {
  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         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, MalformedAcceptWithPayload::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct MalformedAcceptWithPayloadRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithPayloadRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/MalformedAcceptWithPayload").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, MalformedAcceptWithPayload::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    210   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  199    212   
    }
  200    213   
}
  201    214   
#[derive(Debug)]
  202    215   
struct MalformedAcceptWithPayloadEndpointParamsInterceptor;
  203    216   
  204    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithPayloadEndpointParamsInterceptor {
  205    218   
    fn name(&self) -> &'static str {
  206    219   
        "MalformedAcceptWithPayloadEndpointParamsInterceptor"
  207    220   
    }
  208    221   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload/_malformed_accept_with_payload_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload/_malformed_accept_with_payload_output.rs

@@ -24,24 +107,125 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.payload {
   47     47   
            ser.write_blob(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl MalformedAcceptWithPayloadOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&MALFORMEDACCEPTWITHPAYLOADOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(deser.read_blob(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl MalformedAcceptWithPayloadOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            builder.payload = Some(::aws_smithy_types::Blob::new(body.to_vec()));
          92  +
        }
          93  +
        Ok(builder.build())
          94  +
    }
          95  +
}
   78     96   
impl MalformedAcceptWithPayloadOutput {
   79     97   
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
   80     98   
    pub fn builder() -> crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder {
   81     99   
        crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder::default()
   82    100   
    }
   83    101   
}
   84    102   
   85    103   
/// A builder for [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
   86    104   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    105   
#[non_exhaustive]

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_blob/_malformed_blob_input.rs

@@ -4,4 +108,120 @@
   24     24   
        "MalformedBlobInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Blob,
   27     27   
    "blob",
   28     28   
    0,
   29     29   
);
   30     30   
static MALFORMEDBLOBINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    MALFORMEDBLOBINPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&MALFORMEDBLOBINPUT_MEMBER_BLOB],
   34         -
);
          34  +
)
          35  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedBlob", None));
   35     36   
impl MalformedBlobInput {
   36     37   
    /// The schema for this shape.
   37     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDBLOBINPUT_SCHEMA;
   38     39   
}
   39     40   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedBlobInput {
   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.blob {
   46     47   
            ser.write_blob(&MALFORMEDBLOBINPUT_MEMBER_BLOB, val)?;
   47     48   
        }
   48     49   
        Ok(())
   49     50   
    }
   50     51   
}
   51     52   
impl MalformedBlobInput {
   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(&MALFORMEDBLOBINPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&MALFORMEDBLOBINPUT_SCHEMA, &mut |member, deser| {
   66     67   
            match member.member_index() {
   67     68   
                Some(0) => {
   68     69   
                    builder.blob = Some(deser.read_blob(member)?);
   69     70   
                }
   70     71   
                _ => {}
   71     72   
            }
   72     73   
            Ok(())
   73     74   
        })?;
   74     75   
        builder
   75     76   
            .build()
   76     77   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     78   
    }
   78     79   
}
          80  +
impl MalformedBlobInput {
          81  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          82  +
    pub fn deserialize_with_response(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        _body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        Self::deserialize(deserializer)
          89  +
    }
          90  +
}
   79     91   
impl MalformedBlobInput {
   80     92   
    /// Creates a new builder-style object to manufacture [`MalformedBlobInput`](crate::operation::malformed_blob::MalformedBlobInput).
   81     93   
    pub fn builder() -> crate::operation::malformed_blob::builders::MalformedBlobInputBuilder {
   82     94   
        crate::operation::malformed_blob::builders::MalformedBlobInputBuilder::default()
   83     95   
    }
   84     96   
}
   85     97   
   86     98   
/// A builder for [`MalformedBlobInput`](crate::operation::malformed_blob::MalformedBlobInput).
   87     99   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88    100   
#[non_exhaustive]