Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/batch_write_item/_batch_write_item_input.rs

@@ -60,60 +227,252 @@
   80     80   
    "com.amazonaws.dynamodb.synthetic",
   81     81   
    "BatchWriteItemInput",
   82     82   
);
   83     83   
static BATCHWRITEITEMINPUT_MEMBER_REQUEST_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static(
   85     85   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemInput$RequestItems",
   86     86   
        "com.amazonaws.dynamodb.synthetic",
   87     87   
        "BatchWriteItemInput",
   88     88   
    ),
   89     89   
    ::aws_smithy_schema::ShapeType::Map,
   90         -
    "request_items",
          90  +
    "RequestItems",
   91     91   
    0,
   92     92   
);
   93     93   
static BATCHWRITEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   94     94   
    ::aws_smithy_schema::ShapeId::from_static(
   95     95   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemInput$ReturnConsumedCapacity",
   96     96   
        "com.amazonaws.dynamodb.synthetic",
   97     97   
        "BatchWriteItemInput",
   98     98   
    ),
   99     99   
    ::aws_smithy_schema::ShapeType::String,
  100         -
    "return_consumed_capacity",
         100  +
    "ReturnConsumedCapacity",
  101    101   
    1,
  102    102   
);
  103    103   
static BATCHWRITEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  104    104   
    ::aws_smithy_schema::ShapeId::from_static(
  105    105   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemInput$ReturnItemCollectionMetrics",
  106    106   
        "com.amazonaws.dynamodb.synthetic",
  107    107   
        "BatchWriteItemInput",
  108    108   
    ),
  109    109   
    ::aws_smithy_schema::ShapeType::String,
  110         -
    "return_item_collection_metrics",
         110  +
    "ReturnItemCollectionMetrics",
  111    111   
    2,
  112    112   
);
  113    113   
static BATCHWRITEITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  114    114   
    BATCHWRITEITEMINPUT_SCHEMA_ID,
  115    115   
    ::aws_smithy_schema::ShapeType::Structure,
  116    116   
    &[
  117    117   
        &BATCHWRITEITEMINPUT_MEMBER_REQUEST_ITEMS,
  118    118   
        &BATCHWRITEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY,
  119    119   
        &BATCHWRITEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS,
  120    120   
    ],
  121    121   
);
  122    122   
impl BatchWriteItemInput {
  123    123   
    /// The schema for this shape.
  124    124   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &BATCHWRITEITEMINPUT_SCHEMA;
  125    125   
}
  126    126   
impl ::aws_smithy_schema::serde::SerializableStruct for BatchWriteItemInput {
  127    127   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  128    128   
    fn serialize_members(
  129    129   
        &self,
  130    130   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  131    131   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  132    132   
        if let Some(ref val) = self.request_items {
  133    133   
            ser.write_map(
  134    134   
                &BATCHWRITEITEMINPUT_MEMBER_REQUEST_ITEMS,
  135    135   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  136    136   
                    for (key, value) in val {
  137    137   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  138         -
                        todo!("schema: unsupported map value type");
         138  +
         139  +
                        ser.write_list(
         140  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         141  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         142  +
                                for item in value {
         143  +
                                    ser.write_struct(crate::types::WriteRequest::SCHEMA, item)?;
         144  +
                                }
         145  +
                                Ok(())
         146  +
                            },
         147  +
                        )?;
  139    148   
                    }
  140    149   
                    Ok(())
  141    150   
                },
  142    151   
            )?;
  143    152   
        }
  144    153   
        if let Some(ref val) = self.return_consumed_capacity {
  145    154   
            ser.write_string(&BATCHWRITEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
  146    155   
        }
  147    156   
        if let Some(ref val) = self.return_item_collection_metrics {
  148    157   
            ser.write_string(&BATCHWRITEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS, val.as_str())?;
  149    158   
        }
  150    159   
        Ok(())
  151    160   
    }
  152    161   
}
  153    162   
impl BatchWriteItemInput {
  154    163   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  155         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  156         -
        deserializer: &mut D,
         164  +
    pub fn deserialize(
         165  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  157    166   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  158    167   
        #[allow(unused_variables, unused_mut)]
  159    168   
        let mut builder = Self::builder();
  160    169   
        #[allow(
  161    170   
            unused_variables,
  162    171   
            unreachable_code,
  163    172   
            clippy::single_match,
  164    173   
            clippy::match_single_binding,
  165    174   
            clippy::diverging_sub_expression
  166    175   
        )]
  167         -
        deserializer.read_struct(&BATCHWRITEITEMINPUT_SCHEMA, (), |_, member, deser| {
         176  +
        deserializer.read_struct(&BATCHWRITEITEMINPUT_SCHEMA, &mut |member, deser| {
  168    177   
            match member.member_index() {
  169    178   
                Some(0) => {
  170    179   
                    builder.request_items = Some({
  171         -
                        let container = if let Some(cap) = deser.container_size() {
  172         -
                            std::collections::HashMap::with_capacity(cap)
  173         -
                        } else {
  174         -
                            std::collections::HashMap::new()
  175         -
                        };
  176         -
                        deser.read_map(member, container, |mut map, key, deser| {
  177         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  178         -
                            Ok(map)
  179         -
                        })?
         180  +
                        let mut container = std::collections::HashMap::new();
         181  +
                        deser.read_map(member, &mut |key, deser| {
         182  +
                            container.insert(key, {
         183  +
                                let mut list = Vec::new();
         184  +
                                deser.read_list(member, &mut |deser| {
         185  +
                                    list.push(crate::types::WriteRequest::deserialize(deser)?);
         186  +
                                    Ok(())
         187  +
                                })?;
         188  +
                                list
         189  +
                            });
         190  +
                            Ok(())
         191  +
                        })?;
         192  +
                        container
  180    193   
                    });
  181    194   
                }
  182    195   
                Some(1) => {
  183    196   
                    builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
  184    197   
                }
  185    198   
                Some(2) => {
  186    199   
                    builder.return_item_collection_metrics =
  187    200   
                        Some(crate::types::ReturnItemCollectionMetrics::from(deser.read_string(member)?.as_str()));
  188    201   
                }
  189    202   
                _ => {}
  190    203   
            }
  191    204   
            Ok(())
  192    205   
        })?;
         206  +
        builder.request_items = builder.request_items.or(Some(::std::collections::HashMap::new()));
  193    207   
        builder
  194    208   
            .build()
  195    209   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  196    210   
    }
  197    211   
}
         212  +
impl BatchWriteItemInput {
         213  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         214  +
    pub fn deserialize_with_response(
         215  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         216  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         217  +
        _status: u16,
         218  +
        _body: &[u8],
         219  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         220  +
        Self::deserialize(deserializer)
         221  +
    }
         222  +
}
  198    223   
impl BatchWriteItemInput {
  199    224   
    /// Creates a new builder-style object to manufacture [`BatchWriteItemInput`](crate::operation::batch_write_item::BatchWriteItemInput).
  200    225   
    pub fn builder() -> crate::operation::batch_write_item::builders::BatchWriteItemInputBuilder {
  201    226   
        crate::operation::batch_write_item::builders::BatchWriteItemInputBuilder::default()
  202    227   
    }
  203    228   
}
  204    229   
  205    230   
/// A builder for [`BatchWriteItemInput`](crate::operation::batch_write_item::BatchWriteItemInput).
  206    231   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  207    232   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/batch_write_item/_batch_write_item_output.rs

@@ -81,81 +282,316 @@
  101    101   
    "com.amazonaws.dynamodb.synthetic",
  102    102   
    "BatchWriteItemOutput",
  103    103   
);
  104    104   
static BATCHWRITEITEMOUTPUT_MEMBER_UNPROCESSED_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  105    105   
    ::aws_smithy_schema::ShapeId::from_static(
  106    106   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemOutput$UnprocessedItems",
  107    107   
        "com.amazonaws.dynamodb.synthetic",
  108    108   
        "BatchWriteItemOutput",
  109    109   
    ),
  110    110   
    ::aws_smithy_schema::ShapeType::Map,
  111         -
    "unprocessed_items",
         111  +
    "UnprocessedItems",
  112    112   
    0,
  113    113   
);
  114    114   
static BATCHWRITEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  115    115   
    ::aws_smithy_schema::ShapeId::from_static(
  116    116   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemOutput$ItemCollectionMetrics",
  117    117   
        "com.amazonaws.dynamodb.synthetic",
  118    118   
        "BatchWriteItemOutput",
  119    119   
    ),
  120    120   
    ::aws_smithy_schema::ShapeType::Map,
  121         -
    "item_collection_metrics",
         121  +
    "ItemCollectionMetrics",
  122    122   
    1,
  123    123   
);
  124    124   
static BATCHWRITEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  125    125   
    ::aws_smithy_schema::ShapeId::from_static(
  126    126   
        "com.amazonaws.dynamodb.synthetic#BatchWriteItemOutput$ConsumedCapacity",
  127    127   
        "com.amazonaws.dynamodb.synthetic",
  128    128   
        "BatchWriteItemOutput",
  129    129   
    ),
  130    130   
    ::aws_smithy_schema::ShapeType::List,
  131         -
    "consumed_capacity",
         131  +
    "ConsumedCapacity",
  132    132   
    2,
  133    133   
);
  134    134   
static BATCHWRITEITEMOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  135    135   
    BATCHWRITEITEMOUTPUT_SCHEMA_ID,
  136    136   
    ::aws_smithy_schema::ShapeType::Structure,
  137    137   
    &[
  138    138   
        &BATCHWRITEITEMOUTPUT_MEMBER_UNPROCESSED_ITEMS,
  139    139   
        &BATCHWRITEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS,
  140    140   
        &BATCHWRITEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY,
  141    141   
    ],
  142    142   
);
  143    143   
impl BatchWriteItemOutput {
  144    144   
    /// The schema for this shape.
  145    145   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &BATCHWRITEITEMOUTPUT_SCHEMA;
  146    146   
}
  147    147   
impl ::aws_smithy_schema::serde::SerializableStruct for BatchWriteItemOutput {
  148    148   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  149    149   
    fn serialize_members(
  150    150   
        &self,
  151    151   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  152    152   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  153    153   
        if let Some(ref val) = self.unprocessed_items {
  154    154   
            ser.write_map(
  155    155   
                &BATCHWRITEITEMOUTPUT_MEMBER_UNPROCESSED_ITEMS,
  156    156   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  157    157   
                    for (key, value) in val {
  158    158   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  159         -
                        todo!("schema: unsupported map value type");
         159  +
         160  +
                        ser.write_list(
         161  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         162  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         163  +
                                for item in value {
         164  +
                                    ser.write_struct(crate::types::WriteRequest::SCHEMA, item)?;
         165  +
                                }
         166  +
                                Ok(())
         167  +
                            },
         168  +
                        )?;
  160    169   
                    }
  161    170   
                    Ok(())
  162    171   
                },
  163    172   
            )?;
  164    173   
        }
  165    174   
        if let Some(ref val) = self.item_collection_metrics {
  166    175   
            ser.write_map(
  167    176   
                &BATCHWRITEITEMOUTPUT_MEMBER_ITEM_COLLECTION_METRICS,
  168    177   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  169    178   
                    for (key, value) in val {
  170    179   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  171         -
                        todo!("schema: unsupported map value type");
         180  +
         181  +
                        ser.write_list(
         182  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         183  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         184  +
                                for item in value {
         185  +
                                    ser.write_struct(crate::types::ItemCollectionMetrics::SCHEMA, item)?;
         186  +
                                }
         187  +
                                Ok(())
         188  +
                            },
         189  +
                        )?;
  172    190   
                    }
  173    191   
                    Ok(())
  174    192   
                },
  175    193   
            )?;
  176    194   
        }
  177    195   
        if let Some(ref val) = self.consumed_capacity {
  178    196   
            ser.write_list(
  179    197   
                &BATCHWRITEITEMOUTPUT_MEMBER_CONSUMED_CAPACITY,
  180    198   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  181    199   
                    for item in val {
  182    200   
                        ser.write_struct(crate::types::ConsumedCapacity::SCHEMA, item)?;
  183    201   
                    }
  184    202   
                    Ok(())
  185    203   
                },
  186    204   
            )?;
  187    205   
        }
  188    206   
        Ok(())
  189    207   
    }
  190    208   
}
  191    209   
impl BatchWriteItemOutput {
  192    210   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  193         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  194         -
        deserializer: &mut D,
         211  +
    pub fn deserialize(
         212  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  195    213   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  196    214   
        #[allow(unused_variables, unused_mut)]
  197    215   
        let mut builder = Self::builder();
  198    216   
        #[allow(
  199    217   
            unused_variables,
  200    218   
            unreachable_code,
  201    219   
            clippy::single_match,
  202    220   
            clippy::match_single_binding,
  203    221   
            clippy::diverging_sub_expression
  204    222   
        )]
  205         -
        deserializer.read_struct(&BATCHWRITEITEMOUTPUT_SCHEMA, (), |_, member, deser| {
         223  +
        deserializer.read_struct(&BATCHWRITEITEMOUTPUT_SCHEMA, &mut |member, deser| {
  206    224   
            match member.member_index() {
  207    225   
                Some(0) => {
  208    226   
                    builder.unprocessed_items = Some({
  209         -
                        let container = if let Some(cap) = deser.container_size() {
  210         -
                            std::collections::HashMap::with_capacity(cap)
  211         -
                        } else {
  212         -
                            std::collections::HashMap::new()
  213         -
                        };
  214         -
                        deser.read_map(member, container, |mut map, key, deser| {
  215         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  216         -
                            Ok(map)
  217         -
                        })?
         227  +
                        let mut container = std::collections::HashMap::new();
         228  +
                        deser.read_map(member, &mut |key, deser| {
         229  +
                            container.insert(key, {
         230  +
                                let mut list = Vec::new();
         231  +
                                deser.read_list(member, &mut |deser| {
         232  +
                                    list.push(crate::types::WriteRequest::deserialize(deser)?);
         233  +
                                    Ok(())
         234  +
                                })?;
         235  +
                                list
         236  +
                            });
         237  +
                            Ok(())
         238  +
                        })?;
         239  +
                        container
  218    240   
                    });
  219    241   
                }
  220    242   
                Some(1) => {
  221    243   
                    builder.item_collection_metrics = Some({
  222         -
                        let container = if let Some(cap) = deser.container_size() {
  223         -
                            std::collections::HashMap::with_capacity(cap)
  224         -
                        } else {
  225         -
                            std::collections::HashMap::new()
  226         -
                        };
  227         -
                        deser.read_map(member, container, |mut map, key, deser| {
  228         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  229         -
                            Ok(map)
  230         -
                        })?
         244  +
                        let mut container = std::collections::HashMap::new();
         245  +
                        deser.read_map(member, &mut |key, deser| {
         246  +
                            container.insert(key, {
         247  +
                                let mut list = Vec::new();
         248  +
                                deser.read_list(member, &mut |deser| {
         249  +
                                    list.push(crate::types::ItemCollectionMetrics::deserialize(deser)?);
         250  +
                                    Ok(())
         251  +
                                })?;
         252  +
                                list
         253  +
                            });
         254  +
                            Ok(())
         255  +
                        })?;
         256  +
                        container
  231    257   
                    });
  232    258   
                }
  233    259   
                Some(2) => {
  234    260   
                    builder.consumed_capacity = Some({
  235         -
                        let container = if let Some(cap) = deser.container_size() {
  236         -
                            Vec::with_capacity(cap)
  237         -
                        } else {
  238         -
                            Vec::new()
  239         -
                        };
  240         -
                        deser.read_list(member, container, |mut list, deser| {
  241         -
                            list.push(crate::types::ConsumedCapacity::deserialize(deser)?);
  242         -
                            Ok(list)
  243         -
                        })?
         261  +
                        let mut container = Vec::new();
         262  +
                        deser.read_list(member, &mut |deser| {
         263  +
                            container.push(crate::types::ConsumedCapacity::deserialize(deser)?);
         264  +
                            Ok(())
         265  +
                        })?;
         266  +
                        container
  244    267   
                    });
  245    268   
                }
  246    269   
                _ => {}
  247    270   
            }
  248    271   
            Ok(())
  249    272   
        })?;
  250    273   
        Ok(builder.build())
  251    274   
    }
  252    275   
}
         276  +
impl BatchWriteItemOutput {
         277  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         278  +
    pub fn deserialize_with_response(
         279  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         280  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         281  +
        _status: u16,
         282  +
        _body: &[u8],
         283  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         284  +
        Self::deserialize(deserializer)
         285  +
    }
         286  +
}
  253    287   
impl BatchWriteItemOutput {
  254    288   
    /// Creates a new builder-style object to manufacture [`BatchWriteItemOutput`](crate::operation::batch_write_item::BatchWriteItemOutput).
  255    289   
    pub fn builder() -> crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder {
  256    290   
        crate::operation::batch_write_item::builders::BatchWriteItemOutputBuilder::default()
  257    291   
    }
  258    292   
}
  259    293   
  260    294   
/// A builder for [`BatchWriteItemOutput`](crate::operation::batch_write_item::BatchWriteItemOutput).
  261    295   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  262    296   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/create_backup.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 `CreateBackup`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CreateBackup;
    6      6   
impl CreateBackup {
    7      7   
    /// Creates a new `CreateBackup`
    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::create_backup::CreateBackupInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_backup::CreateBackupOutput::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::create_backup::CreateBackupInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::create_backup::CreateBackupOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::create_backup::CreateBackupError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,409 @@
  121    125   
                crate::operation::create_backup::CreateBackupError,
  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 CreateBackupResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateBackupResponseDeserializer {
  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());
         141  +
        #[allow(unused_mut)]
         142  +
        let mut force_error = false;
         143  +
         144  +
        if !success && status != 200 || force_error {
  136    145   
            let headers = response.headers();
  137    146   
            let body = response.body().bytes().expect("body loaded");
  138    147   
            #[allow(unused_mut)]
  139         -
        let mut force_error = false;
         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  +
            })?;
  140    151   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_create_backup::de_create_backup_http_error(status, headers, body)
  143         -
        } else {
  144         -
            crate::protocol_serde::shape_create_backup::de_create_backup_http_response(status, headers, body)
         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::create_backup::CreateBackupError::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  +
                "BackupInUseException" => crate::operation::create_backup::CreateBackupError::BackupInUseError({
         167  +
                    let mut tmp = match protocol
         168  +
                        .deserialize_response(response, crate::types::error::BackupInUseError::SCHEMA, _cfg)
         169  +
                        .and_then(|mut deser| {
         170  +
                            crate::types::error::BackupInUseError::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  +
                "ContinuousBackupsUnavailableException" => crate::operation::create_backup::CreateBackupError::ContinuousBackupsUnavailableError({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::ContinuousBackupsUnavailableError::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::ContinuousBackupsUnavailableError::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  +
                "InternalServerError" => crate::operation::create_backup::CreateBackupError::InternalServerError({
         215  +
                    let mut tmp = match protocol
         216  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         217  +
                        .and_then(|mut deser| {
         218  +
                            crate::types::error::InternalServerError::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  +
                "InvalidEndpointException" => crate::operation::create_backup::CreateBackupError::InvalidEndpointError({
         239  +
                    let mut tmp = match protocol
         240  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         241  +
                        .and_then(|mut deser| {
         242  +
                            crate::types::error::InvalidEndpointError::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  +
                "LimitExceededException" => crate::operation::create_backup::CreateBackupError::LimitExceededError({
         263  +
                    let mut tmp = match protocol
         264  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         265  +
                        .and_then(|mut deser| {
         266  +
                            crate::types::error::LimitExceededError::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  +
                        }
  145    279   
                    };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         280  +
                    tmp.meta = generic;
         281  +
                    if tmp.message.is_none() {
         282  +
                        tmp.message = _error_message;
         283  +
                    }
         284  +
                    tmp
         285  +
                }),
         286  +
                "TableInUseException" => crate::operation::create_backup::CreateBackupError::TableInUseError({
         287  +
                    let mut tmp = match protocol
         288  +
                        .deserialize_response(response, crate::types::error::TableInUseError::SCHEMA, _cfg)
         289  +
                        .and_then(|mut deser| {
         290  +
                            crate::types::error::TableInUseError::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  +
                "TableNotFoundException" => crate::operation::create_backup::CreateBackupError::TableNotFoundError({
         311  +
                    let mut tmp = match protocol
         312  +
                        .deserialize_response(response, crate::types::error::TableNotFoundError::SCHEMA, _cfg)
         313  +
                        .and_then(|mut deser| {
         314  +
                            crate::types::error::TableNotFoundError::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  +
                _ => crate::operation::create_backup::CreateBackupError::generic(generic),
         335  +
            };
         336  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         337  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         338  +
            ))
         339  +
        } else {
         340  +
            let protocol = _cfg
         341  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         342  +
                .expect("a SharedClientProtocol is required");
         343  +
            let mut deser = protocol.deserialize_response(response, CreateBackup::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         344  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         345  +
            })?;
         346  +
            let body = response.body().bytes().expect("body loaded");
         347  +
            let output = crate::operation::create_backup::CreateBackupOutput::deserialize_with_response(
         348  +
                &mut *deser,
         349  +
                response.headers(),
         350  +
                response.status().into(),
         351  +
                body,
         352  +
            )
         353  +
            .map_err(|e| {
         354  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         355  +
            })?;
         356  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         357  +
        }
  147    358   
    }
  148    359   
}
  149    360   
#[derive(Debug)]
  150    361   
struct CreateBackupRequestSerializer;
  151    362   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateBackupRequestSerializer {
  152    363   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    364   
    fn serialize_input(
  154    365   
        &self,
  155    366   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    367   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    368   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    369   
        let input = input
  159    370   
            .downcast::<crate::operation::create_backup::CreateBackupInput>()
  160    371   
            .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::create_backup::CreateBackupInput,
  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::create_backup::CreateBackupInput,
  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.CreateBackup",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_backup::ser_create_backup_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())
         372  +
        let protocol = _cfg
         373  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         374  +
            .expect("a SharedClientProtocol is required");
         375  +
        let mut request = protocol
         376  +
            .serialize_request(&input, CreateBackup::INPUT_SCHEMA, "", _cfg)
         377  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         378  +
         379  +
        return ::std::result::Result::Ok(request);
  199    380   
    }
  200    381   
}
  201    382   
#[derive(Debug)]
  202    383   
struct CreateBackupEndpointParamsInterceptor;
  203    384   
  204    385   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateBackupEndpointParamsInterceptor {
  205    386   
    fn name(&self) -> &'static str {
  206    387   
        "CreateBackupEndpointParamsInterceptor"
  207    388   
    }
  208    389   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/create_backup/_create_backup_input.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/create_backup/_create_backup_output.rs

@@ -1,1 +106,117 @@
   17     17   
    "com.amazonaws.dynamodb.synthetic",
   18     18   
    "CreateBackupOutput",
   19     19   
);
   20     20   
static CREATEBACKUPOUTPUT_MEMBER_BACKUP_DETAILS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "com.amazonaws.dynamodb.synthetic#CreateBackupOutput$BackupDetails",
   23     23   
        "com.amazonaws.dynamodb.synthetic",
   24     24   
        "CreateBackupOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27         -
    "backup_details",
          27  +
    "BackupDetails",
   28     28   
    0,
   29     29   
);
   30     30   
static CREATEBACKUPOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    CREATEBACKUPOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&CREATEBACKUPOUTPUT_MEMBER_BACKUP_DETAILS],
   34     34   
);
   35     35   
impl CreateBackupOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEBACKUPOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for CreateBackupOutput {
   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.backup_details {
   46     46   
            ser.write_struct(&CREATEBACKUPOUTPUT_MEMBER_BACKUP_DETAILS, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl CreateBackupOutput {
   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(&CREATEBACKUPOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&CREATEBACKUPOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.backup_details = Some(crate::types::BackupDetails::deserialize(deser)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl CreateBackupOutput {
          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 CreateBackupOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`CreateBackupOutput`](crate::operation::create_backup::CreateBackupOutput).
   79     90   
    pub fn builder() -> crate::operation::create_backup::builders::CreateBackupOutputBuilder {
   80     91   
        crate::operation::create_backup::builders::CreateBackupOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`CreateBackupOutput`](crate::operation::create_backup::CreateBackupOutput).
   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/create_global_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 `CreateGlobalTable`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CreateGlobalTable;
    6      6   
impl CreateGlobalTable {
    7      7   
    /// Creates a new `CreateGlobalTable`
    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::create_global_table::CreateGlobalTableInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_global_table::CreateGlobalTableOutput::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::create_global_table::CreateGlobalTableInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::create_global_table::CreateGlobalTableOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::create_global_table::CreateGlobalTableError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +231,370 @@
  124    128   
                crate::operation::create_global_table::CreateGlobalTableError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct CreateGlobalTableResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateGlobalTableResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_create_global_table::de_create_global_table_http_error(status, headers, body)
  146         -
        } else {
  147         -
            crate::protocol_serde::shape_create_global_table::de_create_global_table_http_response(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            let error_code = match generic.code() {
         157  +
                ::std::option::Option::Some(code) => code,
         158  +
                ::std::option::Option::None => {
         159  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         160  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         161  +
                            crate::operation::create_global_table::CreateGlobalTableError::unhandled(generic),
         162  +
                        ),
         163  +
                    ))
         164  +
                }
         165  +
            };
         166  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         167  +
            let protocol = _cfg
         168  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         169  +
                .expect("a SharedClientProtocol is required");
         170  +
            let err = match error_code {
         171  +
                "GlobalTableAlreadyExistsException" => {
         172  +
                    crate::operation::create_global_table::CreateGlobalTableError::GlobalTableAlreadyExistsError({
         173  +
                        let mut tmp = match protocol
         174  +
                            .deserialize_response(response, crate::types::error::GlobalTableAlreadyExistsError::SCHEMA, _cfg)
         175  +
                            .and_then(|mut deser| {
         176  +
                                crate::types::error::GlobalTableAlreadyExistsError::deserialize_with_response(
         177  +
                                    &mut *deser,
         178  +
                                    response.headers(),
         179  +
                                    response.status().into(),
         180  +
                                    body,
         181  +
                                )
         182  +
                            }) {
         183  +
                            ::std::result::Result::Ok(val) => val,
         184  +
                            ::std::result::Result::Err(e) => {
         185  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         186  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         187  +
                                ))
         188  +
                            }
  148    189   
                        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         190  +
                        tmp.meta = generic;
         191  +
                        if tmp.message.is_none() {
         192  +
                            tmp.message = _error_message;
         193  +
                        }
         194  +
                        tmp
         195  +
                    })
         196  +
                }
         197  +
                "InternalServerError" => crate::operation::create_global_table::CreateGlobalTableError::InternalServerError({
         198  +
                    let mut tmp = match protocol
         199  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         200  +
                        .and_then(|mut deser| {
         201  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         202  +
                                &mut *deser,
         203  +
                                response.headers(),
         204  +
                                response.status().into(),
         205  +
                                body,
         206  +
                            )
         207  +
                        }) {
         208  +
                        ::std::result::Result::Ok(val) => val,
         209  +
                        ::std::result::Result::Err(e) => {
         210  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         211  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         212  +
                            ))
         213  +
                        }
         214  +
                    };
         215  +
                    tmp.meta = generic;
         216  +
                    if tmp.message.is_none() {
         217  +
                        tmp.message = _error_message;
         218  +
                    }
         219  +
                    tmp
         220  +
                }),
         221  +
                "InvalidEndpointException" => crate::operation::create_global_table::CreateGlobalTableError::InvalidEndpointError({
         222  +
                    let mut tmp = match protocol
         223  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         224  +
                        .and_then(|mut deser| {
         225  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         226  +
                                &mut *deser,
         227  +
                                response.headers(),
         228  +
                                response.status().into(),
         229  +
                                body,
         230  +
                            )
         231  +
                        }) {
         232  +
                        ::std::result::Result::Ok(val) => val,
         233  +
                        ::std::result::Result::Err(e) => {
         234  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         235  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         236  +
                            ))
         237  +
                        }
         238  +
                    };
         239  +
                    tmp.meta = generic;
         240  +
                    if tmp.message.is_none() {
         241  +
                        tmp.message = _error_message;
         242  +
                    }
         243  +
                    tmp
         244  +
                }),
         245  +
                "LimitExceededException" => crate::operation::create_global_table::CreateGlobalTableError::LimitExceededError({
         246  +
                    let mut tmp = match protocol
         247  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         248  +
                        .and_then(|mut deser| {
         249  +
                            crate::types::error::LimitExceededError::deserialize_with_response(
         250  +
                                &mut *deser,
         251  +
                                response.headers(),
         252  +
                                response.status().into(),
         253  +
                                body,
         254  +
                            )
         255  +
                        }) {
         256  +
                        ::std::result::Result::Ok(val) => val,
         257  +
                        ::std::result::Result::Err(e) => {
         258  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         259  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         260  +
                            ))
         261  +
                        }
         262  +
                    };
         263  +
                    tmp.meta = generic;
         264  +
                    if tmp.message.is_none() {
         265  +
                        tmp.message = _error_message;
         266  +
                    }
         267  +
                    tmp
         268  +
                }),
         269  +
                "TableNotFoundException" => crate::operation::create_global_table::CreateGlobalTableError::TableNotFoundError({
         270  +
                    let mut tmp = match protocol
         271  +
                        .deserialize_response(response, crate::types::error::TableNotFoundError::SCHEMA, _cfg)
         272  +
                        .and_then(|mut deser| {
         273  +
                            crate::types::error::TableNotFoundError::deserialize_with_response(
         274  +
                                &mut *deser,
         275  +
                                response.headers(),
         276  +
                                response.status().into(),
         277  +
                                body,
         278  +
                            )
         279  +
                        }) {
         280  +
                        ::std::result::Result::Ok(val) => val,
         281  +
                        ::std::result::Result::Err(e) => {
         282  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         283  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         284  +
                            ))
         285  +
                        }
         286  +
                    };
         287  +
                    tmp.meta = generic;
         288  +
                    if tmp.message.is_none() {
         289  +
                        tmp.message = _error_message;
         290  +
                    }
         291  +
                    tmp
         292  +
                }),
         293  +
                _ => crate::operation::create_global_table::CreateGlobalTableError::generic(generic),
         294  +
            };
         295  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         296  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         297  +
            ))
         298  +
        } else {
         299  +
            let protocol = _cfg
         300  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         301  +
                .expect("a SharedClientProtocol is required");
         302  +
            let mut deser = protocol
         303  +
                .deserialize_response(response, CreateGlobalTable::OUTPUT_SCHEMA, _cfg)
         304  +
                .map_err(|e| {
         305  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         306  +
                })?;
         307  +
            let body = response.body().bytes().expect("body loaded");
         308  +
            let output = crate::operation::create_global_table::CreateGlobalTableOutput::deserialize_with_response(
         309  +
                &mut *deser,
         310  +
                response.headers(),
         311  +
                response.status().into(),
         312  +
                body,
         313  +
            )
         314  +
            .map_err(|e| {
         315  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         316  +
            })?;
         317  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         318  +
        }
  150    319   
    }
  151    320   
}
  152    321   
#[derive(Debug)]
  153    322   
struct CreateGlobalTableRequestSerializer;
  154    323   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateGlobalTableRequestSerializer {
  155    324   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    325   
    fn serialize_input(
  157    326   
        &self,
  158    327   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    328   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    329   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    330   
        let input = input
  162    331   
            .downcast::<crate::operation::create_global_table::CreateGlobalTableInput>()
  163    332   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::create_global_table::CreateGlobalTableInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::create_global_table::CreateGlobalTableInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "DynamoDB_20120810.CreateGlobalTable",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_global_table::ser_create_global_table_input(&input)?);
  197         -
        if let Some(content_length) = body.content_length() {
  198         -
            let content_length = content_length.to_string();
  199         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  200         -
        }
  201         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         333  +
        let protocol = _cfg
         334  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         335  +
            .expect("a SharedClientProtocol is required");
         336  +
        let mut request = protocol
         337  +
            .serialize_request(&input, CreateGlobalTable::INPUT_SCHEMA, "", _cfg)
         338  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         339  +
         340  +
        return ::std::result::Result::Ok(request);
  202    341   
    }
  203    342   
}
  204    343   
#[derive(Debug)]
  205    344   
struct CreateGlobalTableEndpointParamsInterceptor;
  206    345   
  207    346   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateGlobalTableEndpointParamsInterceptor {
  208    347   
    fn name(&self) -> &'static str {
  209    348   
        "CreateGlobalTableEndpointParamsInterceptor"
  210    349   
    }
  211    350   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/create_global_table/_create_global_table_input.rs

@@ -5,5 +153,163 @@
   25     25   
    "com.amazonaws.dynamodb.synthetic",
   26     26   
    "CreateGlobalTableInput",
   27     27   
);
   28     28   
static CREATEGLOBALTABLEINPUT_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#CreateGlobalTableInput$GlobalTableName",
   31     31   
        "com.amazonaws.dynamodb.synthetic",
   32     32   
        "CreateGlobalTableInput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::String,
   35         -
    "global_table_name",
          35  +
    "GlobalTableName",
   36     36   
    0,
   37     37   
);
   38     38   
static CREATEGLOBALTABLEINPUT_MEMBER_REPLICATION_GROUP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.dynamodb.synthetic#CreateGlobalTableInput$ReplicationGroup",
   41     41   
        "com.amazonaws.dynamodb.synthetic",
   42     42   
        "CreateGlobalTableInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::List,
   45         -
    "replication_group",
          45  +
    "ReplicationGroup",
   46     46   
    1,
   47     47   
);
   48     48   
static CREATEGLOBALTABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    CREATEGLOBALTABLEINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &CREATEGLOBALTABLEINPUT_MEMBER_GLOBAL_TABLE_NAME,
   53     53   
        &CREATEGLOBALTABLEINPUT_MEMBER_REPLICATION_GROUP,
   54     54   
    ],
   55     55   
);
   56     56   
impl CreateGlobalTableInput {
   57     57   
    /// The schema for this shape.
   58     58   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEGLOBALTABLEINPUT_SCHEMA;
   59     59   
}
   60     60   
impl ::aws_smithy_schema::serde::SerializableStruct for CreateGlobalTableInput {
   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(&CREATEGLOBALTABLEINPUT_MEMBER_GLOBAL_TABLE_NAME, val)?;
   68     68   
        }
   69     69   
        if let Some(ref val) = self.replication_group {
   70     70   
            ser.write_list(
   71     71   
                &CREATEGLOBALTABLEINPUT_MEMBER_REPLICATION_GROUP,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::Replica::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        Ok(())
   81     81   
    }
   82     82   
}
   83     83   
impl CreateGlobalTableInput {
   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(&CREATEGLOBALTABLEINPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&CREATEGLOBALTABLEINPUT_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.replication_group = 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::Replica::deserialize(deser)?);
  111         -
                            Ok(list)
  112         -
                        })?
         104  +
                        let mut container = Vec::new();
         105  +
                        deser.read_list(member, &mut |deser| {
         106  +
                            container.push(crate::types::Replica::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.replication_group = builder.replication_group.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 CreateGlobalTableInput {
         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 CreateGlobalTableInput {
  125    135   
    /// Creates a new builder-style object to manufacture [`CreateGlobalTableInput`](crate::operation::create_global_table::CreateGlobalTableInput).
  126    136   
    pub fn builder() -> crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder {
  127    137   
        crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder::default()
  128    138   
    }
  129    139   
}
  130    140   
  131    141   
/// A builder for [`CreateGlobalTableInput`](crate::operation::create_global_table::CreateGlobalTableInput).
  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/create_global_table/_create_global_table_output.rs

@@ -1,1 +106,117 @@
   17     17   
    "com.amazonaws.dynamodb.synthetic",
   18     18   
    "CreateGlobalTableOutput",
   19     19   
);
   20     20   
static CREATEGLOBALTABLEOUTPUT_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#CreateGlobalTableOutput$GlobalTableDescription",
   23     23   
        "com.amazonaws.dynamodb.synthetic",
   24     24   
        "CreateGlobalTableOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Structure,
   27         -
    "global_table_description",
          27  +
    "GlobalTableDescription",
   28     28   
    0,
   29     29   
);
   30     30   
static CREATEGLOBALTABLEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    CREATEGLOBALTABLEOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&CREATEGLOBALTABLEOUTPUT_MEMBER_GLOBAL_TABLE_DESCRIPTION],
   34     34   
);
   35     35   
impl CreateGlobalTableOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEGLOBALTABLEOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for CreateGlobalTableOutput {
   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(&CREATEGLOBALTABLEOUTPUT_MEMBER_GLOBAL_TABLE_DESCRIPTION, val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl CreateGlobalTableOutput {
   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(&CREATEGLOBALTABLEOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&CREATEGLOBALTABLEOUTPUT_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 CreateGlobalTableOutput {
          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 CreateGlobalTableOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`CreateGlobalTableOutput`](crate::operation::create_global_table::CreateGlobalTableOutput).
   79     90   
    pub fn builder() -> crate::operation::create_global_table::builders::CreateGlobalTableOutputBuilder {
   80     91   
        crate::operation::create_global_table::builders::CreateGlobalTableOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`CreateGlobalTableOutput`](crate::operation::create_global_table::CreateGlobalTableOutput).
   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/create_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 `CreateTable`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CreateTable;
    6      6   
impl CreateTable {
    7      7   
    /// Creates a new `CreateTable`
    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::create_table::CreateTableInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_table::CreateTableOutput::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::create_table::CreateTableInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::create_table::CreateTableOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::create_table::CreateTableError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,337 @@
  121    125   
                crate::operation::create_table::CreateTableError,
  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 CreateTableResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateTableResponseDeserializer {
  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());
         141  +
        #[allow(unused_mut)]
         142  +
        let mut force_error = false;
         143  +
         144  +
        if !success && status != 200 || force_error {
  136    145   
            let headers = response.headers();
  137    146   
            let body = response.body().bytes().expect("body loaded");
  138    147   
            #[allow(unused_mut)]
  139         -
        let mut force_error = false;
         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  +
            })?;
  140    151   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_create_table::de_create_table_http_error(status, headers, body)
  143         -
        } else {
  144         -
            crate::protocol_serde::shape_create_table::de_create_table_http_response(status, headers, body)
         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::create_table::CreateTableError::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::create_table::CreateTableError::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::create_table::CreateTableError::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::create_table::CreateTableError::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::create_table::CreateTableError::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  +
                        }
  145    255   
                    };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         256  +
                    tmp.meta = generic;
         257  +
                    if tmp.message.is_none() {
         258  +
                        tmp.message = _error_message;
         259  +
                    }
         260  +
                    tmp
         261  +
                }),
         262  +
                _ => crate::operation::create_table::CreateTableError::generic(generic),
         263  +
            };
         264  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         265  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         266  +
            ))
         267  +
        } else {
         268  +
            let protocol = _cfg
         269  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         270  +
                .expect("a SharedClientProtocol is required");
         271  +
            let mut deser = protocol.deserialize_response(response, CreateTable::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         272  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         273  +
            })?;
         274  +
            let body = response.body().bytes().expect("body loaded");
         275  +
            let output = crate::operation::create_table::CreateTableOutput::deserialize_with_response(
         276  +
                &mut *deser,
         277  +
                response.headers(),
         278  +
                response.status().into(),
         279  +
                body,
         280  +
            )
         281  +
            .map_err(|e| {
         282  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         283  +
            })?;
         284  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         285  +
        }
  147    286   
    }
  148    287   
}
  149    288   
#[derive(Debug)]
  150    289   
struct CreateTableRequestSerializer;
  151    290   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateTableRequestSerializer {
  152    291   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    292   
    fn serialize_input(
  154    293   
        &self,
  155    294   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    295   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    296   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    297   
        let input = input
  159    298   
            .downcast::<crate::operation::create_table::CreateTableInput>()
  160    299   
            .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::create_table::CreateTableInput,
  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::create_table::CreateTableInput,
  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.CreateTable",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_table::ser_create_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())
         300  +
        let protocol = _cfg
         301  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         302  +
            .expect("a SharedClientProtocol is required");
         303  +
        let mut request = protocol
         304  +
            .serialize_request(&input, CreateTable::INPUT_SCHEMA, "", _cfg)
         305  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         306  +
         307  +
        return ::std::result::Result::Ok(request);
  199    308   
    }
  200    309   
}
  201    310   
#[derive(Debug)]
  202    311   
struct CreateTableEndpointParamsInterceptor;
  203    312   
  204    313   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTableEndpointParamsInterceptor {
  205    314   
    fn name(&self) -> &'static str {
  206    315   
        "CreateTableEndpointParamsInterceptor"
  207    316   
    }
  208    317   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/create_table/_create_table_input.rs

@@ -246,246 +396,396 @@
  266    266   
    "com.amazonaws.dynamodb.synthetic",
  267    267   
    "CreateTableInput",
  268    268   
);
  269    269   
static CREATETABLEINPUT_MEMBER_ATTRIBUTE_DEFINITIONS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  270    270   
    ::aws_smithy_schema::ShapeId::from_static(
  271    271   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$AttributeDefinitions",
  272    272   
        "com.amazonaws.dynamodb.synthetic",
  273    273   
        "CreateTableInput",
  274    274   
    ),
  275    275   
    ::aws_smithy_schema::ShapeType::List,
  276         -
    "attribute_definitions",
         276  +
    "AttributeDefinitions",
  277    277   
    0,
  278    278   
);
  279    279   
static CREATETABLEINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  280    280   
    ::aws_smithy_schema::ShapeId::from_static(
  281    281   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$TableName",
  282    282   
        "com.amazonaws.dynamodb.synthetic",
  283    283   
        "CreateTableInput",
  284    284   
    ),
  285    285   
    ::aws_smithy_schema::ShapeType::String,
  286         -
    "table_name",
         286  +
    "TableName",
  287    287   
    1,
  288    288   
);
  289    289   
static CREATETABLEINPUT_MEMBER_KEY_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  290    290   
    ::aws_smithy_schema::ShapeId::from_static(
  291    291   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$KeySchema",
  292    292   
        "com.amazonaws.dynamodb.synthetic",
  293    293   
        "CreateTableInput",
  294    294   
    ),
  295    295   
    ::aws_smithy_schema::ShapeType::List,
  296         -
    "key_schema",
         296  +
    "KeySchema",
  297    297   
    2,
  298    298   
);
  299    299   
static CREATETABLEINPUT_MEMBER_LOCAL_SECONDARY_INDEXES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  300    300   
    ::aws_smithy_schema::ShapeId::from_static(
  301    301   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$LocalSecondaryIndexes",
  302    302   
        "com.amazonaws.dynamodb.synthetic",
  303    303   
        "CreateTableInput",
  304    304   
    ),
  305    305   
    ::aws_smithy_schema::ShapeType::List,
  306         -
    "local_secondary_indexes",
         306  +
    "LocalSecondaryIndexes",
  307    307   
    3,
  308    308   
);
  309    309   
static CREATETABLEINPUT_MEMBER_GLOBAL_SECONDARY_INDEXES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  310    310   
    ::aws_smithy_schema::ShapeId::from_static(
  311    311   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$GlobalSecondaryIndexes",
  312    312   
        "com.amazonaws.dynamodb.synthetic",
  313    313   
        "CreateTableInput",
  314    314   
    ),
  315    315   
    ::aws_smithy_schema::ShapeType::List,
  316         -
    "global_secondary_indexes",
         316  +
    "GlobalSecondaryIndexes",
  317    317   
    4,
  318    318   
);
  319    319   
static CREATETABLEINPUT_MEMBER_BILLING_MODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  320    320   
    ::aws_smithy_schema::ShapeId::from_static(
  321    321   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$BillingMode",
  322    322   
        "com.amazonaws.dynamodb.synthetic",
  323    323   
        "CreateTableInput",
  324    324   
    ),
  325    325   
    ::aws_smithy_schema::ShapeType::String,
  326         -
    "billing_mode",
         326  +
    "BillingMode",
  327    327   
    5,
  328    328   
);
  329    329   
static CREATETABLEINPUT_MEMBER_PROVISIONED_THROUGHPUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  330    330   
    ::aws_smithy_schema::ShapeId::from_static(
  331    331   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$ProvisionedThroughput",
  332    332   
        "com.amazonaws.dynamodb.synthetic",
  333    333   
        "CreateTableInput",
  334    334   
    ),
  335    335   
    ::aws_smithy_schema::ShapeType::Structure,
  336         -
    "provisioned_throughput",
         336  +
    "ProvisionedThroughput",
  337    337   
    6,
  338    338   
);
  339    339   
static CREATETABLEINPUT_MEMBER_STREAM_SPECIFICATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  340    340   
    ::aws_smithy_schema::ShapeId::from_static(
  341    341   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$StreamSpecification",
  342    342   
        "com.amazonaws.dynamodb.synthetic",
  343    343   
        "CreateTableInput",
  344    344   
    ),
  345    345   
    ::aws_smithy_schema::ShapeType::Structure,
  346         -
    "stream_specification",
         346  +
    "StreamSpecification",
  347    347   
    7,
  348    348   
);
  349    349   
static CREATETABLEINPUT_MEMBER_SSE_SPECIFICATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  350    350   
    ::aws_smithy_schema::ShapeId::from_static(
  351    351   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$SSESpecification",
  352    352   
        "com.amazonaws.dynamodb.synthetic",
  353    353   
        "CreateTableInput",
  354    354   
    ),
  355    355   
    ::aws_smithy_schema::ShapeType::Structure,
  356         -
    "sse_specification",
         356  +
    "SSESpecification",
  357    357   
    8,
  358    358   
);
  359    359   
static CREATETABLEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  360    360   
    ::aws_smithy_schema::ShapeId::from_static(
  361    361   
        "com.amazonaws.dynamodb.synthetic#CreateTableInput$Tags",
  362    362   
        "com.amazonaws.dynamodb.synthetic",
  363    363   
        "CreateTableInput",
  364    364   
    ),
  365    365   
    ::aws_smithy_schema::ShapeType::List,
  366         -
    "tags",
         366  +
    "Tags",
  367    367   
    9,
  368    368   
);
  369    369   
static CREATETABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  370    370   
    CREATETABLEINPUT_SCHEMA_ID,
  371    371   
    ::aws_smithy_schema::ShapeType::Structure,
  372    372   
    &[
  373    373   
        &CREATETABLEINPUT_MEMBER_ATTRIBUTE_DEFINITIONS,
  374    374   
        &CREATETABLEINPUT_MEMBER_TABLE_NAME,
  375    375   
        &CREATETABLEINPUT_MEMBER_KEY_SCHEMA,
  376    376   
        &CREATETABLEINPUT_MEMBER_LOCAL_SECONDARY_INDEXES,
@@ -440,440 +602,601 @@
  460    460   
                    }
  461    461   
                    Ok(())
  462    462   
                },
  463    463   
            )?;
  464    464   
        }
  465    465   
        Ok(())
  466    466   
    }
  467    467   
}
  468    468   
impl CreateTableInput {
  469    469   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  470         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  471         -
        deserializer: &mut D,
         470  +
    pub fn deserialize(
         471  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  472    472   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  473    473   
        #[allow(unused_variables, unused_mut)]
  474    474   
        let mut builder = Self::builder();
  475    475   
        #[allow(
  476    476   
            unused_variables,
  477    477   
            unreachable_code,
  478    478   
            clippy::single_match,
  479    479   
            clippy::match_single_binding,
  480    480   
            clippy::diverging_sub_expression
  481    481   
        )]
  482         -
        deserializer.read_struct(&CREATETABLEINPUT_SCHEMA, (), |_, member, deser| {
         482  +
        deserializer.read_struct(&CREATETABLEINPUT_SCHEMA, &mut |member, deser| {
  483    483   
            match member.member_index() {
  484    484   
                Some(0) => {
  485    485   
                    builder.attribute_definitions = Some({
  486         -
                        let container = if let Some(cap) = deser.container_size() {
  487         -
                            Vec::with_capacity(cap)
  488         -
                        } else {
  489         -
                            Vec::new()
  490         -
                        };
  491         -
                        deser.read_list(member, container, |mut list, deser| {
  492         -
                            list.push(crate::types::AttributeDefinition::deserialize(deser)?);
  493         -
                            Ok(list)
  494         -
                        })?
         486  +
                        let mut container = Vec::new();
         487  +
                        deser.read_list(member, &mut |deser| {
         488  +
                            container.push(crate::types::AttributeDefinition::deserialize(deser)?);
         489  +
                            Ok(())
         490  +
                        })?;
         491  +
                        container
  495    492   
                    });
  496    493   
                }
  497    494   
                Some(1) => {
  498    495   
                    builder.table_name = Some(deser.read_string(member)?);
  499    496   
                }
  500    497   
                Some(2) => {
  501    498   
                    builder.key_schema = Some({
  502         -
                        let container = if let Some(cap) = deser.container_size() {
  503         -
                            Vec::with_capacity(cap)
  504         -
                        } else {
  505         -
                            Vec::new()
  506         -
                        };
  507         -
                        deser.read_list(member, container, |mut list, deser| {
  508         -
                            list.push(crate::types::KeySchemaElement::deserialize(deser)?);
  509         -
                            Ok(list)
  510         -
                        })?
         499  +
                        let mut container = Vec::new();
         500  +
                        deser.read_list(member, &mut |deser| {
         501  +
                            container.push(crate::types::KeySchemaElement::deserialize(deser)?);
         502  +
                            Ok(())
         503  +
                        })?;
         504  +
                        container
  511    505   
                    });
  512    506   
                }
  513    507   
                Some(3) => {
  514    508   
                    builder.local_secondary_indexes = Some({
  515         -
                        let container = if let Some(cap) = deser.container_size() {
  516         -
                            Vec::with_capacity(cap)
  517         -
                        } else {
  518         -
                            Vec::new()
  519         -
                        };
  520         -
                        deser.read_list(member, container, |mut list, deser| {
  521         -
                            list.push(crate::types::LocalSecondaryIndex::deserialize(deser)?);
  522         -
                            Ok(list)
  523         -
                        })?
         509  +
                        let mut container = Vec::new();
         510  +
                        deser.read_list(member, &mut |deser| {
         511  +
                            container.push(crate::types::LocalSecondaryIndex::deserialize(deser)?);
         512  +
                            Ok(())
         513  +
                        })?;
         514  +
                        container
  524    515   
                    });
  525    516   
                }
  526    517   
                Some(4) => {
  527    518   
                    builder.global_secondary_indexes = Some({
  528         -
                        let container = if let Some(cap) = deser.container_size() {
  529         -
                            Vec::with_capacity(cap)
  530         -
                        } else {
  531         -
                            Vec::new()
  532         -
                        };
  533         -
                        deser.read_list(member, container, |mut list, deser| {
  534         -
                            list.push(crate::types::GlobalSecondaryIndex::deserialize(deser)?);
  535         -
                            Ok(list)
  536         -
                        })?
         519  +
                        let mut container = Vec::new();
         520  +
                        deser.read_list(member, &mut |deser| {
         521  +
                            container.push(crate::types::GlobalSecondaryIndex::deserialize(deser)?);
         522  +
                            Ok(())
         523  +
                        })?;
         524  +
                        container
  537    525   
                    });
  538    526   
                }
  539    527   
                Some(5) => {
  540    528   
                    builder.billing_mode = Some(crate::types::BillingMode::from(deser.read_string(member)?.as_str()));
  541    529   
                }
  542    530   
                Some(6) => {
  543    531   
                    builder.provisioned_throughput = Some(crate::types::ProvisionedThroughput::deserialize(deser)?);
  544    532   
                }
  545    533   
                Some(7) => {
  546    534   
                    builder.stream_specification = Some(crate::types::StreamSpecification::deserialize(deser)?);
  547    535   
                }
  548    536   
                Some(8) => {
  549    537   
                    builder.sse_specification = Some(crate::types::SseSpecification::deserialize(deser)?);
  550    538   
                }
  551    539   
                Some(9) => {
  552    540   
                    builder.tags = Some({
  553         -
                        let container = if let Some(cap) = deser.container_size() {
  554         -
                            Vec::with_capacity(cap)
  555         -
                        } else {
  556         -
                            Vec::new()
  557         -
                        };
  558         -
                        deser.read_list(member, container, |mut list, deser| {
  559         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  560         -
                            Ok(list)
  561         -
                        })?
         541  +
                        let mut container = Vec::new();
         542  +
                        deser.read_list(member, &mut |deser| {
         543  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         544  +
                            Ok(())
         545  +
                        })?;
         546  +
                        container
  562    547   
                    });
  563    548   
                }
  564    549   
                _ => {}
  565    550   
            }
  566    551   
            Ok(())
  567    552   
        })?;
         553  +
        builder.attribute_definitions = builder.attribute_definitions.or(Some(Vec::new()));
         554  +
        builder.table_name = builder.table_name.or(Some(String::new()));
         555  +
        builder.key_schema = builder.key_schema.or(Some(Vec::new()));
  568    556   
        builder
  569    557   
            .build()
  570    558   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  571    559   
    }
  572    560   
}
         561  +
impl CreateTableInput {
         562  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         563  +
    pub fn deserialize_with_response(
         564  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         565  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         566  +
        _status: u16,
         567  +
        _body: &[u8],
         568  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         569  +
        Self::deserialize(deserializer)
         570  +
    }
         571  +
}
  573    572   
impl CreateTableInput {
  574    573   
    /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
  575    574   
    pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
  576    575   
        crate::operation::create_table::builders::CreateTableInputBuilder::default()
  577    576   
    }
  578    577   
}
  579    578   
  580    579   
/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
  581    580   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  582    581   
#[non_exhaustive]