Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_global_table/_update_global_table_input.rs

@@ -5,5 +153,163 @@
   25     25   
    "com.amazonaws.dynamodb.synthetic",
   26     26   
    "UpdateGlobalTableInput",
   27     27   
);
   28     28   
static UPDATEGLOBALTABLEINPUT_MEMBER_GLOBAL_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   29     29   
    ::aws_smithy_schema::ShapeId::from_static(
   30     30   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableInput$GlobalTableName",
   31     31   
        "com.amazonaws.dynamodb.synthetic",
   32     32   
        "UpdateGlobalTableInput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::String,
   35         -
    "global_table_name",
          35  +
    "GlobalTableName",
   36     36   
    0,
   37     37   
);
   38     38   
static UPDATEGLOBALTABLEINPUT_MEMBER_REPLICA_UPDATES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableInput$ReplicaUpdates",
   41     41   
        "com.amazonaws.dynamodb.synthetic",
   42     42   
        "UpdateGlobalTableInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::List,
   45         -
    "replica_updates",
          45  +
    "ReplicaUpdates",
   46     46   
    1,
   47     47   
);
   48     48   
static UPDATEGLOBALTABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    UPDATEGLOBALTABLEINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &UPDATEGLOBALTABLEINPUT_MEMBER_GLOBAL_TABLE_NAME,
   53     53   
        &UPDATEGLOBALTABLEINPUT_MEMBER_REPLICA_UPDATES,
   54     54   
    ],
   55     55   
);
   56     56   
impl UpdateGlobalTableInput {
   57     57   
    /// The schema for this shape.
   58     58   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEGLOBALTABLEINPUT_SCHEMA;
   59     59   
}
   60     60   
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateGlobalTableInput {
   61     61   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     62   
    fn serialize_members(
   63     63   
        &self,
   64     64   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     65   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     66   
        if let Some(ref val) = self.global_table_name {
   67     67   
            ser.write_string(&UPDATEGLOBALTABLEINPUT_MEMBER_GLOBAL_TABLE_NAME, val)?;
   68     68   
        }
   69     69   
        if let Some(ref val) = self.replica_updates {
   70     70   
            ser.write_list(
   71     71   
                &UPDATEGLOBALTABLEINPUT_MEMBER_REPLICA_UPDATES,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::ReplicaUpdate::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        Ok(())
   81     81   
    }
   82     82   
}
   83     83   
impl UpdateGlobalTableInput {
   84     84   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   85         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   86         -
        deserializer: &mut D,
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   87     87   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   88     88   
        #[allow(unused_variables, unused_mut)]
   89     89   
        let mut builder = Self::builder();
   90     90   
        #[allow(
   91     91   
            unused_variables,
   92     92   
            unreachable_code,
   93     93   
            clippy::single_match,
   94     94   
            clippy::match_single_binding,
   95     95   
            clippy::diverging_sub_expression
   96     96   
        )]
   97         -
        deserializer.read_struct(&UPDATEGLOBALTABLEINPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&UPDATEGLOBALTABLEINPUT_SCHEMA, &mut |member, deser| {
   98     98   
            match member.member_index() {
   99     99   
                Some(0) => {
  100    100   
                    builder.global_table_name = Some(deser.read_string(member)?);
  101    101   
                }
  102    102   
                Some(1) => {
  103    103   
                    builder.replica_updates = Some({
  104         -
                        let container = if let Some(cap) = deser.container_size() {
  105         -
                            Vec::with_capacity(cap)
  106         -
                        } else {
  107         -
                            Vec::new()
  108         -
                        };
  109         -
                        deser.read_list(member, container, |mut list, deser| {
  110         -
                            list.push(crate::types::ReplicaUpdate::deserialize(deser)?);
  111         -
                            Ok(list)
  112         -
                        })?
         104  +
                        let mut container = Vec::new();
         105  +
                        deser.read_list(member, &mut |deser| {
         106  +
                            container.push(crate::types::ReplicaUpdate::deserialize(deser)?);
         107  +
                            Ok(())
         108  +
                        })?;
         109  +
                        container
  113    110   
                    });
  114    111   
                }
  115    112   
                _ => {}
  116    113   
            }
  117    114   
            Ok(())
  118    115   
        })?;
         116  +
        builder.global_table_name = builder.global_table_name.or(Some(String::new()));
         117  +
        builder.replica_updates = builder.replica_updates.or(Some(Vec::new()));
  119    118   
        builder
  120    119   
            .build()
  121    120   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  122    121   
    }
  123    122   
}
         123  +
impl UpdateGlobalTableInput {
         124  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         125  +
    pub fn deserialize_with_response(
         126  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         127  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         128  +
        _status: u16,
         129  +
        _body: &[u8],
         130  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         131  +
        Self::deserialize(deserializer)
         132  +
    }
         133  +
}
  124    134   
impl UpdateGlobalTableInput {
  125    135   
    /// Creates a new builder-style object to manufacture [`UpdateGlobalTableInput`](crate::operation::update_global_table::UpdateGlobalTableInput).
  126    136   
    pub fn builder() -> crate::operation::update_global_table::builders::UpdateGlobalTableInputBuilder {
  127    137   
        crate::operation::update_global_table::builders::UpdateGlobalTableInputBuilder::default()
  128    138   
    }
  129    139   
}
  130    140   
  131    141   
/// A builder for [`UpdateGlobalTableInput`](crate::operation::update_global_table::UpdateGlobalTableInput).
  132    142   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  133    143   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_global_table/_update_global_table_output.rs

@@ -1,1 +106,117 @@
   17     17   
    "com.amazonaws.dynamodb.synthetic",
   18     18   
    "UpdateGlobalTableOutput",
   19     19   
);
   20     20   
static UPDATEGLOBALTABLEOUTPUT_MEMBER_GLOBAL_TABLE_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableOutput$GlobalTableDescription",
   23     23   
        "com.amazonaws.dynamodb.synthetic",
   24     24   
        "UpdateGlobalTableOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27         -
    "global_table_description",
          27  +
    "GlobalTableDescription",
   28     28   
    0,
   29     29   
);
   30     30   
static UPDATEGLOBALTABLEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    UPDATEGLOBALTABLEOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&UPDATEGLOBALTABLEOUTPUT_MEMBER_GLOBAL_TABLE_DESCRIPTION],
   34     34   
);
   35     35   
impl UpdateGlobalTableOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEGLOBALTABLEOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateGlobalTableOutput {
   40     40   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     41   
    fn serialize_members(
   42     42   
        &self,
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.global_table_description {
   46     46   
            ser.write_struct(&UPDATEGLOBALTABLEOUTPUT_MEMBER_GLOBAL_TABLE_DESCRIPTION, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl UpdateGlobalTableOutput {
   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(&UPDATEGLOBALTABLEOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&UPDATEGLOBALTABLEOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.global_table_description = Some(crate::types::GlobalTableDescription::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl UpdateGlobalTableOutput {
          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 UpdateGlobalTableOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`UpdateGlobalTableOutput`](crate::operation::update_global_table::UpdateGlobalTableOutput).
   79     90   
    pub fn builder() -> crate::operation::update_global_table::builders::UpdateGlobalTableOutputBuilder {
   80     91   
        crate::operation::update_global_table::builders::UpdateGlobalTableOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`UpdateGlobalTableOutput`](crate::operation::update_global_table::UpdateGlobalTableOutput).
   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/dynamo/rust-client-codegen/src/operation/update_global_table_settings.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 `UpdateGlobalTableSettings`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct UpdateGlobalTableSettings;
    6      6   
impl UpdateGlobalTableSettings {
    7      7   
    /// Creates a new `UpdateGlobalTableSettings`
    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::update_global_table_settings::UpdateGlobalTableSettingsInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput::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::update_global_table_settings::UpdateGlobalTableSettingsInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +239,426 @@
  130    136   
                crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
  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 UpdateGlobalTableSettingsResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateGlobalTableSettingsResponseDeserializer {
  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_update_global_table_settings::de_update_global_table_settings_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  +
            let error_code = match generic.code() {
         165  +
                ::std::option::Option::Some(code) => code,
         166  +
                ::std::option::Option::None => {
         167  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         168  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         169  +
                            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled(generic),
         170  +
                        ),
         171  +
                    ))
         172  +
                }
         173  +
            };
         174  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         175  +
            let protocol = _cfg
         176  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         177  +
                .expect("a SharedClientProtocol is required");
         178  +
            let err = match error_code {
         179  +
                "GlobalTableNotFoundException" => {
         180  +
                    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::GlobalTableNotFoundError({
         181  +
                        let mut tmp = match protocol
         182  +
                            .deserialize_response(response, crate::types::error::GlobalTableNotFoundError::SCHEMA, _cfg)
         183  +
                            .and_then(|mut deser| {
         184  +
                                crate::types::error::GlobalTableNotFoundError::deserialize_with_response(
         185  +
                                    &mut *deser,
         186  +
                                    response.headers(),
         187  +
                                    response.status().into(),
         188  +
                                    body,
         189  +
                                )
         190  +
                            }) {
         191  +
                            ::std::result::Result::Ok(val) => val,
         192  +
                            ::std::result::Result::Err(e) => {
         193  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         194  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         195  +
                                ))
         196  +
                            }
         197  +
                        };
         198  +
                        tmp.meta = generic;
         199  +
                        if tmp.message.is_none() {
         200  +
                            tmp.message = _error_message;
         201  +
                        }
         202  +
                        tmp
         203  +
                    })
         204  +
                }
         205  +
                "IndexNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::IndexNotFoundError({
         206  +
                    let mut tmp = match protocol
         207  +
                        .deserialize_response(response, crate::types::error::IndexNotFoundError::SCHEMA, _cfg)
         208  +
                        .and_then(|mut deser| {
         209  +
                            crate::types::error::IndexNotFoundError::deserialize_with_response(
         210  +
                                &mut *deser,
         211  +
                                response.headers(),
         212  +
                                response.status().into(),
         213  +
                                body,
         214  +
                            )
         215  +
                        }) {
         216  +
                        ::std::result::Result::Ok(val) => val,
         217  +
                        ::std::result::Result::Err(e) => {
         218  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         219  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         220  +
                            ))
         221  +
                        }
         222  +
                    };
         223  +
                    tmp.meta = generic;
         224  +
                    if tmp.message.is_none() {
         225  +
                        tmp.message = _error_message;
         226  +
                    }
         227  +
                    tmp
         228  +
                }),
         229  +
                "InternalServerError" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InternalServerError({
         230  +
                    let mut tmp = match protocol
         231  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         232  +
                        .and_then(|mut deser| {
         233  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         234  +
                                &mut *deser,
         235  +
                                response.headers(),
         236  +
                                response.status().into(),
         237  +
                                body,
         238  +
                            )
         239  +
                        }) {
         240  +
                        ::std::result::Result::Ok(val) => val,
         241  +
                        ::std::result::Result::Err(e) => {
         242  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         243  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         244  +
                            ))
         245  +
                        }
         246  +
                    };
         247  +
                    tmp.meta = generic;
         248  +
                    if tmp.message.is_none() {
         249  +
                        tmp.message = _error_message;
         250  +
                    }
         251  +
                    tmp
         252  +
                }),
         253  +
                "InvalidEndpointException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InvalidEndpointError({
         254  +
                    let mut tmp = match protocol
         255  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         256  +
                        .and_then(|mut deser| {
         257  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         258  +
                                &mut *deser,
         259  +
                                response.headers(),
         260  +
                                response.status().into(),
         261  +
                                body,
         262  +
                            )
         263  +
                        }) {
         264  +
                        ::std::result::Result::Ok(val) => val,
         265  +
                        ::std::result::Result::Err(e) => {
         266  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         267  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         268  +
                            ))
         269  +
                        }
         270  +
                    };
         271  +
                    tmp.meta = generic;
         272  +
                    if tmp.message.is_none() {
         273  +
                        tmp.message = _error_message;
         274  +
                    }
         275  +
                    tmp
         276  +
                }),
         277  +
                "LimitExceededException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::LimitExceededError({
         278  +
                    let mut tmp = match protocol
         279  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         280  +
                        .and_then(|mut deser| {
         281  +
                            crate::types::error::LimitExceededError::deserialize_with_response(
         282  +
                                &mut *deser,
         283  +
                                response.headers(),
         284  +
                                response.status().into(),
         285  +
                                body,
         286  +
                            )
         287  +
                        }) {
         288  +
                        ::std::result::Result::Ok(val) => val,
         289  +
                        ::std::result::Result::Err(e) => {
         290  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         291  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         292  +
                            ))
         293  +
                        }
         294  +
                    };
         295  +
                    tmp.meta = generic;
         296  +
                    if tmp.message.is_none() {
         297  +
                        tmp.message = _error_message;
         298  +
                    }
         299  +
                    tmp
         300  +
                }),
         301  +
                "ReplicaNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ReplicaNotFoundError({
         302  +
                    let mut tmp = match protocol
         303  +
                        .deserialize_response(response, crate::types::error::ReplicaNotFoundError::SCHEMA, _cfg)
         304  +
                        .and_then(|mut deser| {
         305  +
                            crate::types::error::ReplicaNotFoundError::deserialize_with_response(
         306  +
                                &mut *deser,
         307  +
                                response.headers(),
         308  +
                                response.status().into(),
         309  +
                                body,
         310  +
                            )
         311  +
                        }) {
         312  +
                        ::std::result::Result::Ok(val) => val,
         313  +
                        ::std::result::Result::Err(e) => {
         314  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         315  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         316  +
                            ))
         317  +
                        }
         318  +
                    };
         319  +
                    tmp.meta = generic;
         320  +
                    if tmp.message.is_none() {
         321  +
                        tmp.message = _error_message;
         322  +
                    }
         323  +
                    tmp
         324  +
                }),
         325  +
                "ResourceInUseException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ResourceInUseError({
         326  +
                    let mut tmp = match protocol
         327  +
                        .deserialize_response(response, crate::types::error::ResourceInUseError::SCHEMA, _cfg)
         328  +
                        .and_then(|mut deser| {
         329  +
                            crate::types::error::ResourceInUseError::deserialize_with_response(
         330  +
                                &mut *deser,
         331  +
                                response.headers(),
         332  +
                                response.status().into(),
         333  +
                                body,
         334  +
                            )
         335  +
                        }) {
         336  +
                        ::std::result::Result::Ok(val) => val,
         337  +
                        ::std::result::Result::Err(e) => {
         338  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         339  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         340  +
                            ))
         341  +
                        }
         342  +
                    };
         343  +
                    tmp.meta = generic;
         344  +
                    if tmp.message.is_none() {
         345  +
                        tmp.message = _error_message;
         346  +
                    }
         347  +
                    tmp
         348  +
                }),
         349  +
                _ => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::generic(generic),
         350  +
            };
         351  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         352  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         353  +
            ))
  152    354   
        } else {
  153         -
            crate::protocol_serde::shape_update_global_table_settings::de_update_global_table_settings_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         355  +
            let protocol = _cfg
         356  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         357  +
                .expect("a SharedClientProtocol is required");
         358  +
            let mut deser = protocol
         359  +
                .deserialize_response(response, UpdateGlobalTableSettings::OUTPUT_SCHEMA, _cfg)
         360  +
                .map_err(|e| {
         361  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         362  +
                })?;
         363  +
            let body = response.body().bytes().expect("body loaded");
         364  +
            let output = crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput::deserialize_with_response(
         365  +
                &mut *deser,
         366  +
                response.headers(),
         367  +
                response.status().into(),
         368  +
                body,
         369  +
            )
         370  +
            .map_err(|e| {
         371  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         372  +
            })?;
         373  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         374  +
        }
  156    375   
    }
  157    376   
}
  158    377   
#[derive(Debug)]
  159    378   
struct UpdateGlobalTableSettingsRequestSerializer;
  160    379   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateGlobalTableSettingsRequestSerializer {
  161    380   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    381   
    fn serialize_input(
  163    382   
        &self,
  164    383   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    384   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    385   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    386   
        let input = input
  168    387   
            .downcast::<crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput>()
  169    388   
            .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::update_global_table_settings::UpdateGlobalTableSettingsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "DynamoDB_20120810.UpdateGlobalTableSettings",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  203         -
            crate::protocol_serde::shape_update_global_table_settings::ser_update_global_table_settings_input(&input)?,
  204         -
        );
  205         -
        if let Some(content_length) = body.content_length() {
  206         -
            let content_length = content_length.to_string();
  207         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  208         -
        }
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         389  +
        let protocol = _cfg
         390  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         391  +
            .expect("a SharedClientProtocol is required");
         392  +
        let mut request = protocol
         393  +
            .serialize_request(&input, UpdateGlobalTableSettings::INPUT_SCHEMA, "", _cfg)
         394  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         395  +
         396  +
        return ::std::result::Result::Ok(request);
  210    397   
    }
  211    398   
}
  212    399   
#[derive(Debug)]
  213    400   
struct UpdateGlobalTableSettingsEndpointParamsInterceptor;
  214    401   
  215    402   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateGlobalTableSettingsEndpointParamsInterceptor {
  216    403   
    fn name(&self) -> &'static str {
  217    404   
        "UpdateGlobalTableSettingsEndpointParamsInterceptor"
  218    405   
    }
  219    406   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_global_table_settings/_update_global_table_settings_input.rs

@@ -46,46 +159,159 @@
   66     66   
    "com.amazonaws.dynamodb.synthetic",
   67     67   
    "UpdateGlobalTableSettingsInput",
   68     68   
);
   69     69   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   70     70   
    ::aws_smithy_schema::ShapeId::from_static(
   71     71   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$GlobalTableName",
   72     72   
        "com.amazonaws.dynamodb.synthetic",
   73     73   
        "UpdateGlobalTableSettingsInput",
   74     74   
    ),
   75     75   
    ::aws_smithy_schema::ShapeType::String,
   76         -
    "global_table_name",
          76  +
    "GlobalTableName",
   77     77   
    0,
   78     78   
);
   79     79   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_BILLING_MODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   80     80   
    ::aws_smithy_schema::ShapeId::from_static(
   81     81   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$GlobalTableBillingMode",
   82     82   
        "com.amazonaws.dynamodb.synthetic",
   83     83   
        "UpdateGlobalTableSettingsInput",
   84     84   
    ),
   85     85   
    ::aws_smithy_schema::ShapeType::String,
   86         -
    "global_table_billing_mode",
          86  +
    "GlobalTableBillingMode",
   87     87   
    1,
   88     88   
);
   89     89   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_PROVISIONED_WRITE_CAPACITY_UNITS: ::aws_smithy_schema::Schema =
   90     90   
    ::aws_smithy_schema::Schema::new_member(
   91     91   
        ::aws_smithy_schema::ShapeId::from_static(
   92     92   
            "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$GlobalTableProvisionedWriteCapacityUnits",
   93     93   
            "com.amazonaws.dynamodb.synthetic",
   94     94   
            "UpdateGlobalTableSettingsInput",
   95     95   
        ),
   96     96   
        ::aws_smithy_schema::ShapeType::Long,
   97         -
        "global_table_provisioned_write_capacity_units",
          97  +
        "GlobalTableProvisionedWriteCapacityUnits",
   98     98   
        2,
   99     99   
    );
  100    100   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_PROVISIONED_WRITE_CAPACITY_AUTO_SCALING_SETTINGS_UPDATE: ::aws_smithy_schema::Schema =
  101    101   
    ::aws_smithy_schema::Schema::new_member(
  102    102   
        ::aws_smithy_schema::ShapeId::from_static(
  103    103   
            "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate",
  104    104   
            "com.amazonaws.dynamodb.synthetic",
  105    105   
            "UpdateGlobalTableSettingsInput",
  106    106   
        ),
  107    107   
        ::aws_smithy_schema::ShapeType::Structure,
  108         -
        "global_table_provisioned_write_capacity_auto_scaling_settings_update",
         108  +
        "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate",
  109    109   
        3,
  110    110   
    );
  111    111   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE: ::aws_smithy_schema::Schema =
  112    112   
    ::aws_smithy_schema::Schema::new_member(
  113    113   
        ::aws_smithy_schema::ShapeId::from_static(
  114    114   
            "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$GlobalTableGlobalSecondaryIndexSettingsUpdate",
  115    115   
            "com.amazonaws.dynamodb.synthetic",
  116    116   
            "UpdateGlobalTableSettingsInput",
  117    117   
        ),
  118    118   
        ::aws_smithy_schema::ShapeType::List,
  119         -
        "global_table_global_secondary_index_settings_update",
         119  +
        "GlobalTableGlobalSecondaryIndexSettingsUpdate",
  120    120   
        4,
  121    121   
    );
  122    122   
static UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_REPLICA_SETTINGS_UPDATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  123    123   
    ::aws_smithy_schema::ShapeId::from_static(
  124    124   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsInput$ReplicaSettingsUpdate",
  125    125   
        "com.amazonaws.dynamodb.synthetic",
  126    126   
        "UpdateGlobalTableSettingsInput",
  127    127   
    ),
  128    128   
    ::aws_smithy_schema::ShapeType::List,
  129         -
    "replica_settings_update",
         129  +
    "ReplicaSettingsUpdate",
  130    130   
    5,
  131    131   
);
  132    132   
static UPDATEGLOBALTABLESETTINGSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  133    133   
    UPDATEGLOBALTABLESETTINGSINPUT_SCHEMA_ID,
  134    134   
    ::aws_smithy_schema::ShapeType::Structure,
  135    135   
    &[
  136    136   
        &UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_NAME,
  137    137   
        &UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_BILLING_MODE,
  138    138   
        &UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_PROVISIONED_WRITE_CAPACITY_UNITS,
  139    139   
        &UPDATEGLOBALTABLESETTINGSINPUT_MEMBER_GLOBAL_TABLE_PROVISIONED_WRITE_CAPACITY_AUTO_SCALING_SETTINGS_UPDATE,
@@ -166,166 +287,293 @@
  186    186   
                    }
  187    187   
                    Ok(())
  188    188   
                },
  189    189   
            )?;
  190    190   
        }
  191    191   
        Ok(())
  192    192   
    }
  193    193   
}
  194    194   
impl UpdateGlobalTableSettingsInput {
  195    195   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  196         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  197         -
        deserializer: &mut D,
         196  +
    pub fn deserialize(
         197  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  198    198   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  199    199   
        #[allow(unused_variables, unused_mut)]
  200    200   
        let mut builder = Self::builder();
  201    201   
        #[allow(
  202    202   
            unused_variables,
  203    203   
            unreachable_code,
  204    204   
            clippy::single_match,
  205    205   
            clippy::match_single_binding,
  206    206   
            clippy::diverging_sub_expression
  207    207   
        )]
  208         -
        deserializer.read_struct(&UPDATEGLOBALTABLESETTINGSINPUT_SCHEMA, (), |_, member, deser| {
         208  +
        deserializer.read_struct(&UPDATEGLOBALTABLESETTINGSINPUT_SCHEMA, &mut |member, deser| {
  209    209   
            match member.member_index() {
  210    210   
                Some(0) => {
  211    211   
                    builder.global_table_name = Some(deser.read_string(member)?);
  212    212   
                }
  213    213   
                Some(1) => {
  214    214   
                    builder.global_table_billing_mode = Some(crate::types::BillingMode::from(deser.read_string(member)?.as_str()));
  215    215   
                }
  216    216   
                Some(2) => {
  217    217   
                    builder.global_table_provisioned_write_capacity_units = Some(deser.read_long(member)?);
  218    218   
                }
  219    219   
                Some(3) => {
  220    220   
                    builder.global_table_provisioned_write_capacity_auto_scaling_settings_update =
  221    221   
                        Some(crate::types::AutoScalingSettingsUpdate::deserialize(deser)?);
  222    222   
                }
  223    223   
                Some(4) => {
  224    224   
                    builder.global_table_global_secondary_index_settings_update = Some({
  225         -
                        let container = if let Some(cap) = deser.container_size() {
  226         -
                            Vec::with_capacity(cap)
  227         -
                        } else {
  228         -
                            Vec::new()
  229         -
                        };
  230         -
                        deser.read_list(member, container, |mut list, deser| {
  231         -
                            list.push(crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate::deserialize(deser)?);
  232         -
                            Ok(list)
  233         -
                        })?
         225  +
                        let mut container = Vec::new();
         226  +
                        deser.read_list(member, &mut |deser| {
         227  +
                            container.push(crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate::deserialize(deser)?);
         228  +
                            Ok(())
         229  +
                        })?;
         230  +
                        container
  234    231   
                    });
  235    232   
                }
  236    233   
                Some(5) => {
  237    234   
                    builder.replica_settings_update = Some({
  238         -
                        let container = if let Some(cap) = deser.container_size() {
  239         -
                            Vec::with_capacity(cap)
  240         -
                        } else {
  241         -
                            Vec::new()
  242         -
                        };
  243         -
                        deser.read_list(member, container, |mut list, deser| {
  244         -
                            list.push(crate::types::ReplicaSettingsUpdate::deserialize(deser)?);
  245         -
                            Ok(list)
  246         -
                        })?
         235  +
                        let mut container = Vec::new();
         236  +
                        deser.read_list(member, &mut |deser| {
         237  +
                            container.push(crate::types::ReplicaSettingsUpdate::deserialize(deser)?);
         238  +
                            Ok(())
         239  +
                        })?;
         240  +
                        container
  247    241   
                    });
  248    242   
                }
  249    243   
                _ => {}
  250    244   
            }
  251    245   
            Ok(())
  252    246   
        })?;
         247  +
        builder.global_table_name = builder.global_table_name.or(Some(String::new()));
  253    248   
        builder
  254    249   
            .build()
  255    250   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  256    251   
    }
  257    252   
}
         253  +
impl UpdateGlobalTableSettingsInput {
         254  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         255  +
    pub fn deserialize_with_response(
         256  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         257  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         258  +
        _status: u16,
         259  +
        _body: &[u8],
         260  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         261  +
        Self::deserialize(deserializer)
         262  +
    }
         263  +
}
  258    264   
impl UpdateGlobalTableSettingsInput {
  259    265   
    /// Creates a new builder-style object to manufacture [`UpdateGlobalTableSettingsInput`](crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput).
  260    266   
    pub fn builder() -> crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder {
  261    267   
        crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder::default()
  262    268   
    }
  263    269   
}
  264    270   
  265    271   
/// A builder for [`UpdateGlobalTableSettingsInput`](crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput).
  266    272   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  267    273   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_global_table_settings/_update_global_table_settings_output.rs

@@ -5,5 +151,159 @@
   25     25   
    "com.amazonaws.dynamodb.synthetic",
   26     26   
    "UpdateGlobalTableSettingsOutput",
   27     27   
);
   28     28   
static UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_GLOBAL_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   29     29   
    ::aws_smithy_schema::ShapeId::from_static(
   30     30   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsOutput$GlobalTableName",
   31     31   
        "com.amazonaws.dynamodb.synthetic",
   32     32   
        "UpdateGlobalTableSettingsOutput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::String,
   35         -
    "global_table_name",
          35  +
    "GlobalTableName",
   36     36   
    0,
   37     37   
);
   38     38   
static UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_REPLICA_SETTINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.dynamodb.synthetic#UpdateGlobalTableSettingsOutput$ReplicaSettings",
   41     41   
        "com.amazonaws.dynamodb.synthetic",
   42     42   
        "UpdateGlobalTableSettingsOutput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::List,
   45         -
    "replica_settings",
          45  +
    "ReplicaSettings",
   46     46   
    1,
   47     47   
);
   48     48   
static UPDATEGLOBALTABLESETTINGSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    UPDATEGLOBALTABLESETTINGSOUTPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_GLOBAL_TABLE_NAME,
   53     53   
        &UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_REPLICA_SETTINGS,
   54     54   
    ],
   55     55   
);
   56     56   
impl UpdateGlobalTableSettingsOutput {
   57     57   
    /// The schema for this shape.
   58     58   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEGLOBALTABLESETTINGSOUTPUT_SCHEMA;
   59     59   
}
   60     60   
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateGlobalTableSettingsOutput {
   61     61   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     62   
    fn serialize_members(
   63     63   
        &self,
   64     64   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     65   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     66   
        if let Some(ref val) = self.global_table_name {
   67     67   
            ser.write_string(&UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_GLOBAL_TABLE_NAME, val)?;
   68     68   
        }
   69     69   
        if let Some(ref val) = self.replica_settings {
   70     70   
            ser.write_list(
   71     71   
                &UPDATEGLOBALTABLESETTINGSOUTPUT_MEMBER_REPLICA_SETTINGS,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::ReplicaSettingsDescription::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        Ok(())
   81     81   
    }
   82     82   
}
   83     83   
impl UpdateGlobalTableSettingsOutput {
   84     84   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   85         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   86         -
        deserializer: &mut D,
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   87     87   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   88     88   
        #[allow(unused_variables, unused_mut)]
   89     89   
        let mut builder = Self::builder();
   90     90   
        #[allow(
   91     91   
            unused_variables,
   92     92   
            unreachable_code,
   93     93   
            clippy::single_match,
   94     94   
            clippy::match_single_binding,
   95     95   
            clippy::diverging_sub_expression
   96     96   
        )]
   97         -
        deserializer.read_struct(&UPDATEGLOBALTABLESETTINGSOUTPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&UPDATEGLOBALTABLESETTINGSOUTPUT_SCHEMA, &mut |member, deser| {
   98     98   
            match member.member_index() {
   99     99   
                Some(0) => {
  100    100   
                    builder.global_table_name = Some(deser.read_string(member)?);
  101    101   
                }
  102    102   
                Some(1) => {
  103    103   
                    builder.replica_settings = Some({
  104         -
                        let container = if let Some(cap) = deser.container_size() {
  105         -
                            Vec::with_capacity(cap)
  106         -
                        } else {
  107         -
                            Vec::new()
  108         -
                        };
  109         -
                        deser.read_list(member, container, |mut list, deser| {
  110         -
                            list.push(crate::types::ReplicaSettingsDescription::deserialize(deser)?);
  111         -
                            Ok(list)
  112         -
                        })?
         104  +
                        let mut container = Vec::new();
         105  +
                        deser.read_list(member, &mut |deser| {
         106  +
                            container.push(crate::types::ReplicaSettingsDescription::deserialize(deser)?);
         107  +
                            Ok(())
         108  +
                        })?;
         109  +
                        container
  113    110   
                    });
  114    111   
                }
  115    112   
                _ => {}
  116    113   
            }
  117    114   
            Ok(())
  118    115   
        })?;
  119    116   
        Ok(builder.build())
  120    117   
    }
  121    118   
}
         119  +
impl UpdateGlobalTableSettingsOutput {
         120  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         121  +
    pub fn deserialize_with_response(
         122  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         123  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         124  +
        _status: u16,
         125  +
        _body: &[u8],
         126  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         127  +
        Self::deserialize(deserializer)
         128  +
    }
         129  +
}
  122    130   
impl UpdateGlobalTableSettingsOutput {
  123    131   
    /// Creates a new builder-style object to manufacture [`UpdateGlobalTableSettingsOutput`](crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput).
  124    132   
    pub fn builder() -> crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder {
  125    133   
        crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder::default()
  126    134   
    }
  127    135   
}
  128    136   
  129    137   
/// A builder for [`UpdateGlobalTableSettingsOutput`](crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput).
  130    138   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  131    139   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_item.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 `UpdateItem`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct UpdateItem;
    6      6   
impl UpdateItem {
    7      7   
    /// Creates a new `UpdateItem`
    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::update_item::UpdateItemInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::update_item::UpdateItemOutput::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::update_item::UpdateItemInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::update_item::UpdateItemOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::update_item::UpdateItemError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +226,431 @@
  121    125   
                crate::operation::update_item::UpdateItemError,
  122    126   
            >::new());
  123    127   
  124    128   
        ::std::borrow::Cow::Owned(rcb)
  125    129   
    }
  126    130   
}
  127    131   
  128    132   
#[derive(Debug)]
  129    133   
struct UpdateItemResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateItemResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_update_item::de_update_item_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::update_item::UpdateItemError::unhandled(generic)),
         158  +
                    ))
         159  +
                }
         160  +
            };
         161  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let err = match error_code {
         166  +
                "ConditionalCheckFailedException" => crate::operation::update_item::UpdateItemError::ConditionalCheckFailedError({
         167  +
                    let mut tmp = match protocol
         168  +
                        .deserialize_response(response, crate::types::error::ConditionalCheckFailedError::SCHEMA, _cfg)
         169  +
                        .and_then(|mut deser| {
         170  +
                            crate::types::error::ConditionalCheckFailedError::deserialize_with_response(
         171  +
                                &mut *deser,
         172  +
                                response.headers(),
         173  +
                                response.status().into(),
         174  +
                                body,
         175  +
                            )
         176  +
                        }) {
         177  +
                        ::std::result::Result::Ok(val) => val,
         178  +
                        ::std::result::Result::Err(e) => {
         179  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         180  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         181  +
                            ))
         182  +
                        }
         183  +
                    };
         184  +
                    tmp.meta = generic;
         185  +
                    if tmp.message.is_none() {
         186  +
                        tmp.message = _error_message;
         187  +
                    }
         188  +
                    tmp
         189  +
                }),
         190  +
                "InternalServerError" => crate::operation::update_item::UpdateItemError::InternalServerError({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         195  +
                                &mut *deser,
         196  +
                                response.headers(),
         197  +
                                response.status().into(),
         198  +
                                body,
         199  +
                            )
         200  +
                        }) {
         201  +
                        ::std::result::Result::Ok(val) => val,
         202  +
                        ::std::result::Result::Err(e) => {
         203  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         204  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         205  +
                            ))
         206  +
                        }
         207  +
                    };
         208  +
                    tmp.meta = generic;
         209  +
                    if tmp.message.is_none() {
         210  +
                        tmp.message = _error_message;
         211  +
                    }
         212  +
                    tmp
         213  +
                }),
         214  +
                "InvalidEndpointException" => crate::operation::update_item::UpdateItemError::InvalidEndpointError({
         215  +
                    let mut tmp = match protocol
         216  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         217  +
                        .and_then(|mut deser| {
         218  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         219  +
                                &mut *deser,
         220  +
                                response.headers(),
         221  +
                                response.status().into(),
         222  +
                                body,
         223  +
                            )
         224  +
                        }) {
         225  +
                        ::std::result::Result::Ok(val) => val,
         226  +
                        ::std::result::Result::Err(e) => {
         227  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         228  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         229  +
                            ))
         230  +
                        }
         231  +
                    };
         232  +
                    tmp.meta = generic;
         233  +
                    if tmp.message.is_none() {
         234  +
                        tmp.message = _error_message;
         235  +
                    }
         236  +
                    tmp
         237  +
                }),
         238  +
                "ItemCollectionSizeLimitExceededException" => crate::operation::update_item::UpdateItemError::ItemCollectionSizeLimitExceededError({
         239  +
                    let mut tmp = match protocol
         240  +
                        .deserialize_response(response, crate::types::error::ItemCollectionSizeLimitExceededError::SCHEMA, _cfg)
         241  +
                        .and_then(|mut deser| {
         242  +
                            crate::types::error::ItemCollectionSizeLimitExceededError::deserialize_with_response(
         243  +
                                &mut *deser,
         244  +
                                response.headers(),
         245  +
                                response.status().into(),
         246  +
                                body,
         247  +
                            )
         248  +
                        }) {
         249  +
                        ::std::result::Result::Ok(val) => val,
         250  +
                        ::std::result::Result::Err(e) => {
         251  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         252  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         253  +
                            ))
         254  +
                        }
         255  +
                    };
         256  +
                    tmp.meta = generic;
         257  +
                    if tmp.message.is_none() {
         258  +
                        tmp.message = _error_message;
         259  +
                    }
         260  +
                    tmp
         261  +
                }),
         262  +
                "ProvisionedThroughputExceededException" => crate::operation::update_item::UpdateItemError::ProvisionedThroughputExceededError({
         263  +
                    let mut tmp = match protocol
         264  +
                        .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededError::SCHEMA, _cfg)
         265  +
                        .and_then(|mut deser| {
         266  +
                            crate::types::error::ProvisionedThroughputExceededError::deserialize_with_response(
         267  +
                                &mut *deser,
         268  +
                                response.headers(),
         269  +
                                response.status().into(),
         270  +
                                body,
         271  +
                            )
         272  +
                        }) {
         273  +
                        ::std::result::Result::Ok(val) => val,
         274  +
                        ::std::result::Result::Err(e) => {
         275  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         276  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         277  +
                            ))
         278  +
                        }
         279  +
                    };
         280  +
                    tmp.meta = generic;
         281  +
                    if tmp.message.is_none() {
         282  +
                        tmp.message = _error_message;
         283  +
                    }
         284  +
                    tmp
         285  +
                }),
         286  +
                "RequestLimitExceeded" => crate::operation::update_item::UpdateItemError::RequestLimitExceeded({
         287  +
                    let mut tmp = match protocol
         288  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         289  +
                        .and_then(|mut deser| {
         290  +
                            crate::types::error::RequestLimitExceeded::deserialize_with_response(
         291  +
                                &mut *deser,
         292  +
                                response.headers(),
         293  +
                                response.status().into(),
         294  +
                                body,
         295  +
                            )
         296  +
                        }) {
         297  +
                        ::std::result::Result::Ok(val) => val,
         298  +
                        ::std::result::Result::Err(e) => {
         299  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         300  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         301  +
                            ))
         302  +
                        }
         303  +
                    };
         304  +
                    tmp.meta = generic;
         305  +
                    if tmp.message.is_none() {
         306  +
                        tmp.message = _error_message;
         307  +
                    }
         308  +
                    tmp
         309  +
                }),
         310  +
                "ResourceNotFoundException" => crate::operation::update_item::UpdateItemError::ResourceNotFoundError({
         311  +
                    let mut tmp = match protocol
         312  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         313  +
                        .and_then(|mut deser| {
         314  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         315  +
                                &mut *deser,
         316  +
                                response.headers(),
         317  +
                                response.status().into(),
         318  +
                                body,
         319  +
                            )
         320  +
                        }) {
         321  +
                        ::std::result::Result::Ok(val) => val,
         322  +
                        ::std::result::Result::Err(e) => {
         323  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         324  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         325  +
                            ))
         326  +
                        }
         327  +
                    };
         328  +
                    tmp.meta = generic;
         329  +
                    if tmp.message.is_none() {
         330  +
                        tmp.message = _error_message;
         331  +
                    }
         332  +
                    tmp
         333  +
                }),
         334  +
                "TransactionConflictException" => crate::operation::update_item::UpdateItemError::TransactionConflictError({
         335  +
                    let mut tmp = match protocol
         336  +
                        .deserialize_response(response, crate::types::error::TransactionConflictError::SCHEMA, _cfg)
         337  +
                        .and_then(|mut deser| {
         338  +
                            crate::types::error::TransactionConflictError::deserialize_with_response(
         339  +
                                &mut *deser,
         340  +
                                response.headers(),
         341  +
                                response.status().into(),
         342  +
                                body,
         343  +
                            )
         344  +
                        }) {
         345  +
                        ::std::result::Result::Ok(val) => val,
         346  +
                        ::std::result::Result::Err(e) => {
         347  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         348  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         349  +
                            ))
         350  +
                        }
         351  +
                    };
         352  +
                    tmp.meta = generic;
         353  +
                    if tmp.message.is_none() {
         354  +
                        tmp.message = _error_message;
         355  +
                    }
         356  +
                    tmp
         357  +
                }),
         358  +
                _ => crate::operation::update_item::UpdateItemError::generic(generic),
         359  +
            };
         360  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         361  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         362  +
            ))
  143    363   
        } else {
  144         -
            crate::protocol_serde::shape_update_item::de_update_item_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         364  +
            let protocol = _cfg
         365  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         366  +
                .expect("a SharedClientProtocol is required");
         367  +
            let mut deser = protocol.deserialize_response(response, UpdateItem::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         368  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         369  +
            })?;
         370  +
            let body = response.body().bytes().expect("body loaded");
         371  +
            let output = crate::operation::update_item::UpdateItemOutput::deserialize_with_response(
         372  +
                &mut *deser,
         373  +
                response.headers(),
         374  +
                response.status().into(),
         375  +
                body,
         376  +
            )
         377  +
            .map_err(|e| {
         378  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         379  +
            })?;
         380  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         381  +
        }
  147    382   
    }
  148    383   
}
  149    384   
#[derive(Debug)]
  150    385   
struct UpdateItemRequestSerializer;
  151    386   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateItemRequestSerializer {
  152    387   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    388   
    fn serialize_input(
  154    389   
        &self,
  155    390   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    391   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    392   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    393   
        let input = input.downcast::<crate::operation::update_item::UpdateItemInput>().expect("correct type");
  159         -
        let _header_serialization_settings = _cfg
  160         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  161         -
            .cloned()
  162         -
            .unwrap_or_default();
  163         -
        let mut request_builder = {
  164         -
            #[allow(clippy::uninlined_format_args)]
  165         -
            fn uri_base(
  166         -
                _input: &crate::operation::update_item::UpdateItemInput,
  167         -
                output: &mut ::std::string::String,
  168         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  169         -
                use ::std::fmt::Write as _;
  170         -
                ::std::write!(output, "/").expect("formatting should succeed");
  171         -
                ::std::result::Result::Ok(())
  172         -
            }
  173         -
            #[allow(clippy::unnecessary_wraps)]
  174         -
            fn update_http_builder(
  175         -
                input: &crate::operation::update_item::UpdateItemInput,
  176         -
                builder: ::http_1x::request::Builder,
  177         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  178         -
                let mut uri = ::std::string::String::new();
  179         -
                uri_base(input, &mut uri)?;
  180         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  181         -
            }
  182         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  183         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  184         -
            builder = _header_serialization_settings.set_default_header(
  185         -
                builder,
  186         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  187         -
                "DynamoDB_20120810.UpdateItem",
  188         -
            );
  189         -
            builder
  190         -
        };
  191         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_item::ser_update_item_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())
         394  +
        let protocol = _cfg
         395  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         396  +
            .expect("a SharedClientProtocol is required");
         397  +
        let mut request = protocol
         398  +
            .serialize_request(&input, UpdateItem::INPUT_SCHEMA, "", _cfg)
         399  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         400  +
         401  +
        return ::std::result::Result::Ok(request);
  197    402   
    }
  198    403   
}
  199    404   
#[derive(Debug)]
  200    405   
struct UpdateItemEndpointParamsInterceptor;
  201    406   
  202    407   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateItemEndpointParamsInterceptor {
  203    408   
    fn name(&self) -> &'static str {
  204    409   
        "UpdateItemEndpointParamsInterceptor"
  205    410   
    }
  206    411   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_item/_update_item_input.rs

@@ -276,276 +486,486 @@
  296    296   
    "com.amazonaws.dynamodb.synthetic",
  297    297   
    "UpdateItemInput",
  298    298   
);
  299    299   
static UPDATEITEMINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  300    300   
    ::aws_smithy_schema::ShapeId::from_static(
  301    301   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$TableName",
  302    302   
        "com.amazonaws.dynamodb.synthetic",
  303    303   
        "UpdateItemInput",
  304    304   
    ),
  305    305   
    ::aws_smithy_schema::ShapeType::String,
  306         -
    "table_name",
         306  +
    "TableName",
  307    307   
    0,
  308    308   
);
  309    309   
static UPDATEITEMINPUT_MEMBER_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  310    310   
    ::aws_smithy_schema::ShapeId::from_static(
  311    311   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$Key",
  312    312   
        "com.amazonaws.dynamodb.synthetic",
  313    313   
        "UpdateItemInput",
  314    314   
    ),
  315    315   
    ::aws_smithy_schema::ShapeType::Map,
  316         -
    "key",
         316  +
    "Key",
  317    317   
    1,
  318    318   
);
  319    319   
static UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  320    320   
    ::aws_smithy_schema::ShapeId::from_static(
  321    321   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$AttributeUpdates",
  322    322   
        "com.amazonaws.dynamodb.synthetic",
  323    323   
        "UpdateItemInput",
  324    324   
    ),
  325    325   
    ::aws_smithy_schema::ShapeType::Map,
  326         -
    "attribute_updates",
         326  +
    "AttributeUpdates",
  327    327   
    2,
  328    328   
);
  329    329   
static UPDATEITEMINPUT_MEMBER_EXPECTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  330    330   
    ::aws_smithy_schema::ShapeId::from_static(
  331    331   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$Expected",
  332    332   
        "com.amazonaws.dynamodb.synthetic",
  333    333   
        "UpdateItemInput",
  334    334   
    ),
  335    335   
    ::aws_smithy_schema::ShapeType::Map,
  336         -
    "expected",
         336  +
    "Expected",
  337    337   
    3,
  338    338   
);
  339    339   
static UPDATEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  340    340   
    ::aws_smithy_schema::ShapeId::from_static(
  341    341   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ConditionalOperator",
  342    342   
        "com.amazonaws.dynamodb.synthetic",
  343    343   
        "UpdateItemInput",
  344    344   
    ),
  345    345   
    ::aws_smithy_schema::ShapeType::String,
  346         -
    "conditional_operator",
         346  +
    "ConditionalOperator",
  347    347   
    4,
  348    348   
);
  349    349   
static UPDATEITEMINPUT_MEMBER_RETURN_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  350    350   
    ::aws_smithy_schema::ShapeId::from_static(
  351    351   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnValues",
  352    352   
        "com.amazonaws.dynamodb.synthetic",
  353    353   
        "UpdateItemInput",
  354    354   
    ),
  355    355   
    ::aws_smithy_schema::ShapeType::String,
  356         -
    "return_values",
         356  +
    "ReturnValues",
  357    357   
    5,
  358    358   
);
  359    359   
static UPDATEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  360    360   
    ::aws_smithy_schema::ShapeId::from_static(
  361    361   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnConsumedCapacity",
  362    362   
        "com.amazonaws.dynamodb.synthetic",
  363    363   
        "UpdateItemInput",
  364    364   
    ),
  365    365   
    ::aws_smithy_schema::ShapeType::String,
  366         -
    "return_consumed_capacity",
         366  +
    "ReturnConsumedCapacity",
  367    367   
    6,
  368    368   
);
  369    369   
static UPDATEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  370    370   
    ::aws_smithy_schema::ShapeId::from_static(
  371    371   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnItemCollectionMetrics",
  372    372   
        "com.amazonaws.dynamodb.synthetic",
  373    373   
        "UpdateItemInput",
  374    374   
    ),
  375    375   
    ::aws_smithy_schema::ShapeType::String,
  376         -
    "return_item_collection_metrics",
         376  +
    "ReturnItemCollectionMetrics",
  377    377   
    7,
  378    378   
);
  379    379   
static UPDATEITEMINPUT_MEMBER_UPDATE_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  380    380   
    ::aws_smithy_schema::ShapeId::from_static(
  381    381   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$UpdateExpression",
  382    382   
        "com.amazonaws.dynamodb.synthetic",
  383    383   
        "UpdateItemInput",
  384    384   
    ),
  385    385   
    ::aws_smithy_schema::ShapeType::String,
  386         -
    "update_expression",
         386  +
    "UpdateExpression",
  387    387   
    8,
  388    388   
);
  389    389   
static UPDATEITEMINPUT_MEMBER_CONDITION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  390    390   
    ::aws_smithy_schema::ShapeId::from_static(
  391    391   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ConditionExpression",
  392    392   
        "com.amazonaws.dynamodb.synthetic",
  393    393   
        "UpdateItemInput",
  394    394   
    ),
  395    395   
    ::aws_smithy_schema::ShapeType::String,
  396         -
    "condition_expression",
         396  +
    "ConditionExpression",
  397    397   
    9,
  398    398   
);
  399    399   
static UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  400    400   
    ::aws_smithy_schema::ShapeId::from_static(
  401    401   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ExpressionAttributeNames",
  402    402   
        "com.amazonaws.dynamodb.synthetic",
  403    403   
        "UpdateItemInput",
  404    404   
    ),
  405    405   
    ::aws_smithy_schema::ShapeType::Map,
  406         -
    "expression_attribute_names",
         406  +
    "ExpressionAttributeNames",
  407    407   
    10,
  408    408   
);
  409    409   
static UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  410    410   
    ::aws_smithy_schema::ShapeId::from_static(
  411    411   
        "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ExpressionAttributeValues",
  412    412   
        "com.amazonaws.dynamodb.synthetic",
  413    413   
        "UpdateItemInput",
  414    414   
    ),
  415    415   
    ::aws_smithy_schema::ShapeType::Map,
  416         -
    "expression_attribute_values",
         416  +
    "ExpressionAttributeValues",
  417    417   
    11,
  418    418   
);
  419    419   
static UPDATEITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  420    420   
    UPDATEITEMINPUT_SCHEMA_ID,
  421    421   
    ::aws_smithy_schema::ShapeType::Structure,
  422    422   
    &[
  423    423   
        &UPDATEITEMINPUT_MEMBER_TABLE_NAME,
  424    424   
        &UPDATEITEMINPUT_MEMBER_KEY,
  425    425   
        &UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES,
  426    426   
        &UPDATEITEMINPUT_MEMBER_EXPECTED,
  427    427   
        &UPDATEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR,
  428    428   
        &UPDATEITEMINPUT_MEMBER_RETURN_VALUES,
  429    429   
        &UPDATEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY,
  430    430   
        &UPDATEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS,
  431    431   
        &UPDATEITEMINPUT_MEMBER_UPDATE_EXPRESSION,
  432    432   
        &UPDATEITEMINPUT_MEMBER_CONDITION_EXPRESSION,
  433    433   
        &UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES,
  434    434   
        &UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES,
  435    435   
    ],
  436    436   
);
  437    437   
impl UpdateItemInput {
  438    438   
    /// The schema for this shape.
  439    439   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEITEMINPUT_SCHEMA;
  440    440   
}
  441    441   
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateItemInput {
  442    442   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  443    443   
    fn serialize_members(
  444    444   
        &self,
  445    445   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  446    446   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  447    447   
        if let Some(ref val) = self.table_name {
  448    448   
            ser.write_string(&UPDATEITEMINPUT_MEMBER_TABLE_NAME, val)?;
  449    449   
        }
  450    450   
        if let Some(ref val) = self.key {
  451    451   
            ser.write_map(
  452    452   
                &UPDATEITEMINPUT_MEMBER_KEY,
  453    453   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  454    454   
                    for (key, value) in val {
  455    455   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  456         -
                        todo!("schema: unsupported map value type");
         456  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  457    457   
                    }
  458    458   
                    Ok(())
  459    459   
                },
  460    460   
            )?;
  461    461   
        }
  462    462   
        if let Some(ref val) = self.attribute_updates {
  463    463   
            ser.write_map(
  464    464   
                &UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES,
  465    465   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  466    466   
                    for (key, value) in val {
@@ -492,492 +672,663 @@
  512    512   
                    Ok(())
  513    513   
                },
  514    514   
            )?;
  515    515   
        }
  516    516   
        if let Some(ref val) = self.expression_attribute_values {
  517    517   
            ser.write_map(
  518    518   
                &UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES,
  519    519   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  520    520   
                    for (key, value) in val {
  521    521   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  522         -
                        todo!("schema: unsupported map value type");
         522  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  523    523   
                    }
  524    524   
                    Ok(())
  525    525   
                },
  526    526   
            )?;
  527    527   
        }
  528    528   
        Ok(())
  529    529   
    }
  530    530   
}
  531    531   
impl UpdateItemInput {
  532    532   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  533         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  534         -
        deserializer: &mut D,
         533  +
    pub fn deserialize(
         534  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  535    535   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  536    536   
        #[allow(unused_variables, unused_mut)]
  537    537   
        let mut builder = Self::builder();
  538    538   
        #[allow(
  539    539   
            unused_variables,
  540    540   
            unreachable_code,
  541    541   
            clippy::single_match,
  542    542   
            clippy::match_single_binding,
  543    543   
            clippy::diverging_sub_expression
  544    544   
        )]
  545         -
        deserializer.read_struct(&UPDATEITEMINPUT_SCHEMA, (), |_, member, deser| {
         545  +
        deserializer.read_struct(&UPDATEITEMINPUT_SCHEMA, &mut |member, deser| {
  546    546   
            match member.member_index() {
  547    547   
                Some(0) => {
  548    548   
                    builder.table_name = Some(deser.read_string(member)?);
  549    549   
                }
  550    550   
                Some(1) => {
  551    551   
                    builder.key = Some({
  552         -
                        let container = if let Some(cap) = deser.container_size() {
  553         -
                            std::collections::HashMap::with_capacity(cap)
  554         -
                        } else {
  555         -
                            std::collections::HashMap::new()
  556         -
                        };
  557         -
                        deser.read_map(member, container, |mut map, key, deser| {
  558         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  559         -
                            Ok(map)
  560         -
                        })?
         552  +
                        let mut container = std::collections::HashMap::new();
         553  +
                        deser.read_map(member, &mut |key, deser| {
         554  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         555  +
                            Ok(())
         556  +
                        })?;
         557  +
                        container
  561    558   
                    });
  562    559   
                }
  563    560   
                Some(2) => {
  564    561   
                    builder.attribute_updates = Some({
  565         -
                        let container = if let Some(cap) = deser.container_size() {
  566         -
                            std::collections::HashMap::with_capacity(cap)
  567         -
                        } else {
  568         -
                            std::collections::HashMap::new()
  569         -
                        };
  570         -
                        deser.read_map(member, container, |mut map, key, deser| {
  571         -
                            map.insert(key, crate::types::AttributeValueUpdate::deserialize(deser)?);
  572         -
                            Ok(map)
  573         -
                        })?
         562  +
                        let mut container = std::collections::HashMap::new();
         563  +
                        deser.read_map(member, &mut |key, deser| {
         564  +
                            container.insert(key, crate::types::AttributeValueUpdate::deserialize(deser)?);
         565  +
                            Ok(())
         566  +
                        })?;
         567  +
                        container
  574    568   
                    });
  575    569   
                }
  576    570   
                Some(3) => {
  577    571   
                    builder.expected = Some({
  578         -
                        let container = if let Some(cap) = deser.container_size() {
  579         -
                            std::collections::HashMap::with_capacity(cap)
  580         -
                        } else {
  581         -
                            std::collections::HashMap::new()
  582         -
                        };
  583         -
                        deser.read_map(member, container, |mut map, key, deser| {
  584         -
                            map.insert(key, crate::types::ExpectedAttributeValue::deserialize(deser)?);
  585         -
                            Ok(map)
  586         -
                        })?
         572  +
                        let mut container = std::collections::HashMap::new();
         573  +
                        deser.read_map(member, &mut |key, deser| {
         574  +
                            container.insert(key, crate::types::ExpectedAttributeValue::deserialize(deser)?);
         575  +
                            Ok(())
         576  +
                        })?;
         577  +
                        container
  587    578   
                    });
  588    579   
                }
  589    580   
                Some(4) => {
  590    581   
                    builder.conditional_operator = Some(crate::types::ConditionalOperator::from(deser.read_string(member)?.as_str()));
  591    582   
                }
  592    583   
                Some(5) => {
  593    584   
                    builder.return_values = Some(crate::types::ReturnValue::from(deser.read_string(member)?.as_str()));
  594    585   
                }
  595    586   
                Some(6) => {
  596    587   
                    builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
  597    588   
                }
  598    589   
                Some(7) => {
  599    590   
                    builder.return_item_collection_metrics =
  600    591   
                        Some(crate::types::ReturnItemCollectionMetrics::from(deser.read_string(member)?.as_str()));
  601    592   
                }
  602    593   
                Some(8) => {
  603    594   
                    builder.update_expression = Some(deser.read_string(member)?);
  604    595   
                }
  605    596   
                Some(9) => {
  606    597   
                    builder.condition_expression = Some(deser.read_string(member)?);
  607    598   
                }
  608    599   
                Some(10) => {
  609         -
                    builder.expression_attribute_names = Some({
  610         -
                        let container = if let Some(cap) = deser.container_size() {
  611         -
                            std::collections::HashMap::with_capacity(cap)
  612         -
                        } else {
  613         -
                            std::collections::HashMap::new()
  614         -
                        };
  615         -
                        deser.read_map(member, container, |mut map, key, deser| {
  616         -
                            map.insert(key, deser.read_string(member)?);
  617         -
                            Ok(map)
  618         -
                        })?
  619         -
                    });
         600  +
                    builder.expression_attribute_names = Some(deser.read_string_string_map(member)?);
  620    601   
                }
  621    602   
                Some(11) => {
  622    603   
                    builder.expression_attribute_values = Some({
  623         -
                        let container = if let Some(cap) = deser.container_size() {
  624         -
                            std::collections::HashMap::with_capacity(cap)
  625         -
                        } else {
  626         -
                            std::collections::HashMap::new()
  627         -
                        };
  628         -
                        deser.read_map(member, container, |mut map, key, deser| {
  629         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  630         -
                            Ok(map)
  631         -
                        })?
         604  +
                        let mut container = std::collections::HashMap::new();
         605  +
                        deser.read_map(member, &mut |key, deser| {
         606  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         607  +
                            Ok(())
         608  +
                        })?;
         609  +
                        container
  632    610   
                    });
  633    611   
                }
  634    612   
                _ => {}
  635    613   
            }
  636    614   
            Ok(())
  637    615   
        })?;
         616  +
        builder.table_name = builder.table_name.or(Some(String::new()));
         617  +
        builder.key = builder.key.or(Some(::std::collections::HashMap::new()));
  638    618   
        builder
  639    619   
            .build()
  640    620   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  641    621   
    }
  642    622   
}
         623  +
impl UpdateItemInput {
         624  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         625  +
    pub fn deserialize_with_response(
         626  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         627  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         628  +
        _status: u16,
         629  +
        _body: &[u8],
         630  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         631  +
        Self::deserialize(deserializer)
         632  +
    }
         633  +
}
  643    634   
impl UpdateItemInput {
  644    635   
    /// Creates a new builder-style object to manufacture [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
  645    636   
    pub fn builder() -> crate::operation::update_item::builders::UpdateItemInputBuilder {
  646    637   
        crate::operation::update_item::builders::UpdateItemInputBuilder::default()
  647    638   
    }
  648    639   
}
  649    640   
  650    641   
/// A builder for [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
  651    642   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  652    643   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_item/_update_item_output.rs

@@ -28,28 +192,200 @@
   48     48   
    "com.amazonaws.dynamodb.synthetic",
   49     49   
    "UpdateItemOutput",
   50     50   
);
   51     51   
static UPDATEITEMOUTPUT_MEMBER_ATTRIBUTES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   52     52   
    ::aws_smithy_schema::ShapeId::from_static(
   53     53   
        "com.amazonaws.dynamodb.synthetic#UpdateItemOutput$Attributes",
   54     54   
        "com.amazonaws.dynamodb.synthetic",
   55     55   
        "UpdateItemOutput",
   56     56   
    ),
   57     57   
    ::aws_smithy_schema::ShapeType::Map,
   58         -
    "attributes",
          58  +
    "Attributes",
   59     59   
    0,
   60     60   
);
   61     61   
static UPDATEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   62     62   
    ::aws_smithy_schema::ShapeId::from_static(
   63     63   
        "com.amazonaws.dynamodb.synthetic#UpdateItemOutput$ConsumedCapacity",
   64     64   
        "com.amazonaws.dynamodb.synthetic",
   65     65   
        "UpdateItemOutput",
   66     66   
    ),
   67     67   
    ::aws_smithy_schema::ShapeType::Structure,
   68         -
    "consumed_capacity",
          68  +
    "ConsumedCapacity",
   69     69   
    1,
   70     70   
);
   71     71   
static UPDATEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   72     72   
    ::aws_smithy_schema::ShapeId::from_static(
   73     73   
        "com.amazonaws.dynamodb.synthetic#UpdateItemOutput$ItemCollectionMetrics",
   74     74   
        "com.amazonaws.dynamodb.synthetic",
   75     75   
        "UpdateItemOutput",
   76     76   
    ),
   77     77   
    ::aws_smithy_schema::ShapeType::Structure,
   78         -
    "item_collection_metrics",
          78  +
    "ItemCollectionMetrics",
   79     79   
    2,
   80     80   
);
   81     81   
static UPDATEITEMOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   82     82   
    UPDATEITEMOUTPUT_SCHEMA_ID,
   83     83   
    ::aws_smithy_schema::ShapeType::Structure,
   84     84   
    &[
   85     85   
        &UPDATEITEMOUTPUT_MEMBER_ATTRIBUTES,
   86     86   
        &UPDATEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY,
   87     87   
        &UPDATEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS,
   88     88   
    ],
   89     89   
);
   90     90   
impl UpdateItemOutput {
   91     91   
    /// The schema for this shape.
   92     92   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEITEMOUTPUT_SCHEMA;
   93     93   
}
   94     94   
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateItemOutput {
   95     95   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   96     96   
    fn serialize_members(
   97     97   
        &self,
   98     98   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   99     99   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  100    100   
        if let Some(ref val) = self.attributes {
  101    101   
            ser.write_map(
  102    102   
                &UPDATEITEMOUTPUT_MEMBER_ATTRIBUTES,
  103    103   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  104    104   
                    for (key, value) in val {
  105    105   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  106         -
                        todo!("schema: unsupported map value type");
         106  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  107    107   
                    }
  108    108   
                    Ok(())
  109    109   
                },
  110    110   
            )?;
  111    111   
        }
  112    112   
        if let Some(ref val) = self.consumed_capacity {
  113    113   
            ser.write_struct(&UPDATEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY, val)?;
  114    114   
        }
  115    115   
        if let Some(ref val) = self.item_collection_metrics {
  116    116   
            ser.write_struct(&UPDATEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS, val)?;
  117    117   
        }
  118    118   
        Ok(())
  119    119   
    }
  120    120   
}
  121    121   
impl UpdateItemOutput {
  122    122   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  123         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  124         -
        deserializer: &mut D,
         123  +
    pub fn deserialize(
         124  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  125    125   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  126    126   
        #[allow(unused_variables, unused_mut)]
  127    127   
        let mut builder = Self::builder();
  128    128   
        #[allow(
  129    129   
            unused_variables,
  130    130   
            unreachable_code,
  131    131   
            clippy::single_match,
  132    132   
            clippy::match_single_binding,
  133    133   
            clippy::diverging_sub_expression
  134    134   
        )]
  135         -
        deserializer.read_struct(&UPDATEITEMOUTPUT_SCHEMA, (), |_, member, deser| {
         135  +
        deserializer.read_struct(&UPDATEITEMOUTPUT_SCHEMA, &mut |member, deser| {
  136    136   
            match member.member_index() {
  137    137   
                Some(0) => {
  138    138   
                    builder.attributes = Some({
  139         -
                        let container = if let Some(cap) = deser.container_size() {
  140         -
                            std::collections::HashMap::with_capacity(cap)
  141         -
                        } else {
  142         -
                            std::collections::HashMap::new()
  143         -
                        };
  144         -
                        deser.read_map(member, container, |mut map, key, deser| {
  145         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  146         -
                            Ok(map)
  147         -
                        })?
         139  +
                        let mut container = std::collections::HashMap::new();
         140  +
                        deser.read_map(member, &mut |key, deser| {
         141  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         142  +
                            Ok(())
         143  +
                        })?;
         144  +
                        container
  148    145   
                    });
  149    146   
                }
  150    147   
                Some(1) => {
  151    148   
                    builder.consumed_capacity = Some(crate::types::ConsumedCapacity::deserialize(deser)?);
  152    149   
                }
  153    150   
                Some(2) => {
  154    151   
                    builder.item_collection_metrics = Some(crate::types::ItemCollectionMetrics::deserialize(deser)?);
  155    152   
                }
  156    153   
                _ => {}
  157    154   
            }
  158    155   
            Ok(())
  159    156   
        })?;
  160    157   
        Ok(builder.build())
  161    158   
    }
  162    159   
}
         160  +
impl UpdateItemOutput {
         161  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         162  +
    pub fn deserialize_with_response(
         163  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         164  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         165  +
        _status: u16,
         166  +
        _body: &[u8],
         167  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         168  +
        Self::deserialize(deserializer)
         169  +
    }
         170  +
}
  163    171   
impl UpdateItemOutput {
  164    172   
    /// Creates a new builder-style object to manufacture [`UpdateItemOutput`](crate::operation::update_item::UpdateItemOutput).
  165    173   
    pub fn builder() -> crate::operation::update_item::builders::UpdateItemOutputBuilder {
  166    174   
        crate::operation::update_item::builders::UpdateItemOutputBuilder::default()
  167    175   
    }
  168    176   
}
  169    177   
  170    178   
/// A builder for [`UpdateItemOutput`](crate::operation::update_item::UpdateItemOutput).
  171    179   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  172    180   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/update_table.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 `UpdateTable`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct UpdateTable;
    6      6   
impl UpdateTable {
    7      7   
    /// Creates a new `UpdateTable`
    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::update_table::UpdateTableInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::update_table::UpdateTableOutput::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::update_table::UpdateTableInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::update_table::UpdateTableOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::update_table::UpdateTableError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,361 @@
  121    125   
                crate::operation::update_table::UpdateTableError,
  122    126   
            >::new());
  123    127   
  124    128   
        ::std::borrow::Cow::Owned(rcb)
  125    129   
    }
  126    130   
}
  127    131   
  128    132   
#[derive(Debug)]
  129    133   
struct UpdateTableResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateTableResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_update_table::de_update_table_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::update_table::UpdateTableError::unhandled(generic)),
         158  +
                    ))
         159  +
                }
         160  +
            };
         161  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let err = match error_code {
         166  +
                "InternalServerError" => crate::operation::update_table::UpdateTableError::InternalServerError({
         167  +
                    let mut tmp = match protocol
         168  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         169  +
                        .and_then(|mut deser| {
         170  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         171  +
                                &mut *deser,
         172  +
                                response.headers(),
         173  +
                                response.status().into(),
         174  +
                                body,
         175  +
                            )
         176  +
                        }) {
         177  +
                        ::std::result::Result::Ok(val) => val,
         178  +
                        ::std::result::Result::Err(e) => {
         179  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         180  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         181  +
                            ))
         182  +
                        }
         183  +
                    };
         184  +
                    tmp.meta = generic;
         185  +
                    if tmp.message.is_none() {
         186  +
                        tmp.message = _error_message;
         187  +
                    }
         188  +
                    tmp
         189  +
                }),
         190  +
                "InvalidEndpointException" => crate::operation::update_table::UpdateTableError::InvalidEndpointError({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         195  +
                                &mut *deser,
         196  +
                                response.headers(),
         197  +
                                response.status().into(),
         198  +
                                body,
         199  +
                            )
         200  +
                        }) {
         201  +
                        ::std::result::Result::Ok(val) => val,
         202  +
                        ::std::result::Result::Err(e) => {
         203  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         204  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         205  +
                            ))
         206  +
                        }
         207  +
                    };
         208  +
                    tmp.meta = generic;
         209  +
                    if tmp.message.is_none() {
         210  +
                        tmp.message = _error_message;
         211  +
                    }
         212  +
                    tmp
         213  +
                }),
         214  +
                "LimitExceededException" => crate::operation::update_table::UpdateTableError::LimitExceededError({
         215  +
                    let mut tmp = match protocol
         216  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         217  +
                        .and_then(|mut deser| {
         218  +
                            crate::types::error::LimitExceededError::deserialize_with_response(
         219  +
                                &mut *deser,
         220  +
                                response.headers(),
         221  +
                                response.status().into(),
         222  +
                                body,
         223  +
                            )
         224  +
                        }) {
         225  +
                        ::std::result::Result::Ok(val) => val,
         226  +
                        ::std::result::Result::Err(e) => {
         227  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         228  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         229  +
                            ))
         230  +
                        }
         231  +
                    };
         232  +
                    tmp.meta = generic;
         233  +
                    if tmp.message.is_none() {
         234  +
                        tmp.message = _error_message;
         235  +
                    }
         236  +
                    tmp
         237  +
                }),
         238  +
                "ResourceInUseException" => crate::operation::update_table::UpdateTableError::ResourceInUseError({
         239  +
                    let mut tmp = match protocol
         240  +
                        .deserialize_response(response, crate::types::error::ResourceInUseError::SCHEMA, _cfg)
         241  +
                        .and_then(|mut deser| {
         242  +
                            crate::types::error::ResourceInUseError::deserialize_with_response(
         243  +
                                &mut *deser,
         244  +
                                response.headers(),
         245  +
                                response.status().into(),
         246  +
                                body,
         247  +
                            )
         248  +
                        }) {
         249  +
                        ::std::result::Result::Ok(val) => val,
         250  +
                        ::std::result::Result::Err(e) => {
         251  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         252  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         253  +
                            ))
         254  +
                        }
         255  +
                    };
         256  +
                    tmp.meta = generic;
         257  +
                    if tmp.message.is_none() {
         258  +
                        tmp.message = _error_message;
         259  +
                    }
         260  +
                    tmp
         261  +
                }),
         262  +
                "ResourceNotFoundException" => crate::operation::update_table::UpdateTableError::ResourceNotFoundError({
         263  +
                    let mut tmp = match protocol
         264  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         265  +
                        .and_then(|mut deser| {
         266  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         267  +
                                &mut *deser,
         268  +
                                response.headers(),
         269  +
                                response.status().into(),
         270  +
                                body,
         271  +
                            )
         272  +
                        }) {
         273  +
                        ::std::result::Result::Ok(val) => val,
         274  +
                        ::std::result::Result::Err(e) => {
         275  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         276  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         277  +
                            ))
         278  +
                        }
         279  +
                    };
         280  +
                    tmp.meta = generic;
         281  +
                    if tmp.message.is_none() {
         282  +
                        tmp.message = _error_message;
         283  +
                    }
         284  +
                    tmp
         285  +
                }),
         286  +
                _ => crate::operation::update_table::UpdateTableError::generic(generic),
         287  +
            };
         288  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         289  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         290  +
            ))
  143    291   
        } else {
  144         -
            crate::protocol_serde::shape_update_table::de_update_table_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         292  +
            let protocol = _cfg
         293  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         294  +
                .expect("a SharedClientProtocol is required");
         295  +
            let mut deser = protocol.deserialize_response(response, UpdateTable::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         296  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         297  +
            })?;
         298  +
            let body = response.body().bytes().expect("body loaded");
         299  +
            let output = crate::operation::update_table::UpdateTableOutput::deserialize_with_response(
         300  +
                &mut *deser,
         301  +
                response.headers(),
         302  +
                response.status().into(),
         303  +
                body,
         304  +
            )
         305  +
            .map_err(|e| {
         306  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         307  +
            })?;
         308  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         309  +
        }
  147    310   
    }
  148    311   
}
  149    312   
#[derive(Debug)]
  150    313   
struct UpdateTableRequestSerializer;
  151    314   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateTableRequestSerializer {
  152    315   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    316   
    fn serialize_input(
  154    317   
        &self,
  155    318   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    319   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    320   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    321   
        let input = input
  159    322   
            .downcast::<crate::operation::update_table::UpdateTableInput>()
  160    323   
            .expect("correct type");
  161         -
        let _header_serialization_settings = _cfg
  162         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163         -
            .cloned()
  164         -
            .unwrap_or_default();
  165         -
        let mut request_builder = {
  166         -
            #[allow(clippy::uninlined_format_args)]
  167         -
            fn uri_base(
  168         -
                _input: &crate::operation::update_table::UpdateTableInput,
  169         -
                output: &mut ::std::string::String,
  170         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  171         -
                use ::std::fmt::Write as _;
  172         -
                ::std::write!(output, "/").expect("formatting should succeed");
  173         -
                ::std::result::Result::Ok(())
  174         -
            }
  175         -
            #[allow(clippy::unnecessary_wraps)]
  176         -
            fn update_http_builder(
  177         -
                input: &crate::operation::update_table::UpdateTableInput,
  178         -
                builder: ::http_1x::request::Builder,
  179         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  180         -
                let mut uri = ::std::string::String::new();
  181         -
                uri_base(input, &mut uri)?;
  182         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  183         -
            }
  184         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  185         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  186         -
            builder = _header_serialization_settings.set_default_header(
  187         -
                builder,
  188         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  189         -
                "DynamoDB_20120810.UpdateTable",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_table::ser_update_table_input(&input)?);
  194         -
        if let Some(content_length) = body.content_length() {
  195         -
            let content_length = content_length.to_string();
  196         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  197         -
        }
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         324  +
        let protocol = _cfg
         325  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         326  +
            .expect("a SharedClientProtocol is required");
         327  +
        let mut request = protocol
         328  +
            .serialize_request(&input, UpdateTable::INPUT_SCHEMA, "", _cfg)
         329  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         330  +
         331  +
        return ::std::result::Result::Ok(request);
  199    332   
    }
  200    333   
}
  201    334   
#[derive(Debug)]
  202    335   
struct UpdateTableEndpointParamsInterceptor;
  203    336   
  204    337   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateTableEndpointParamsInterceptor {
  205    338   
    fn name(&self) -> &'static str {
  206    339   
        "UpdateTableEndpointParamsInterceptor"
  207    340   
    }
  208    341