Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/get_item/_get_item_output.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_backups.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 `ListBackups`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListBackups;
    6      6   
impl ListBackups {
    7      7   
    /// Creates a new `ListBackups`
    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::list_backups::ListBackupsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_backups::ListBackupsOutput::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::list_backups::ListBackupsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_backups::ListBackupsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_backups::ListBackupsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,289 @@
  121    125   
                crate::operation::list_backups::ListBackupsError,
  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 ListBackupsResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListBackupsResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_list_backups::de_list_backups_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::list_backups::ListBackupsError::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::list_backups::ListBackupsError::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::list_backups::ListBackupsError::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  +
                _ => crate::operation::list_backups::ListBackupsError::generic(generic),
         215  +
            };
         216  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         217  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         218  +
            ))
  143    219   
        } else {
  144         -
            crate::protocol_serde::shape_list_backups::de_list_backups_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         220  +
            let protocol = _cfg
         221  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         222  +
                .expect("a SharedClientProtocol is required");
         223  +
            let mut deser = protocol.deserialize_response(response, ListBackups::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         224  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         225  +
            })?;
         226  +
            let body = response.body().bytes().expect("body loaded");
         227  +
            let output = crate::operation::list_backups::ListBackupsOutput::deserialize_with_response(
         228  +
                &mut *deser,
         229  +
                response.headers(),
         230  +
                response.status().into(),
         231  +
                body,
         232  +
            )
         233  +
            .map_err(|e| {
         234  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         235  +
            })?;
         236  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         237  +
        }
  147    238   
    }
  148    239   
}
  149    240   
#[derive(Debug)]
  150    241   
struct ListBackupsRequestSerializer;
  151    242   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListBackupsRequestSerializer {
  152    243   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    244   
    fn serialize_input(
  154    245   
        &self,
  155    246   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    247   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    248   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    249   
        let input = input
  159    250   
            .downcast::<crate::operation::list_backups::ListBackupsInput>()
  160    251   
            .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::list_backups::ListBackupsInput,
  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::list_backups::ListBackupsInput,
  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.ListBackups",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_backups::ser_list_backups_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())
         252  +
        let protocol = _cfg
         253  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         254  +
            .expect("a SharedClientProtocol is required");
         255  +
        let mut request = protocol
         256  +
            .serialize_request(&input, ListBackups::INPUT_SCHEMA, "", _cfg)
         257  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         258  +
         259  +
        return ::std::result::Result::Ok(request);
  199    260   
    }
  200    261   
}
  201    262   
#[derive(Debug)]
  202    263   
struct ListBackupsEndpointParamsInterceptor;
  203    264   
  204    265   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListBackupsEndpointParamsInterceptor {
  205    266   
    fn name(&self) -> &'static str {
  206    267   
        "ListBackupsEndpointParamsInterceptor"
  207    268   
    }
  208    269   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_backups/_list_backups_input.rs

@@ -45,45 +243,254 @@
   65     65   
    "com.amazonaws.dynamodb.synthetic",
   66     66   
    "ListBackupsInput",
   67     67   
);
   68     68   
static LISTBACKUPSINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   69     69   
    ::aws_smithy_schema::ShapeId::from_static(
   70     70   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$TableName",
   71     71   
        "com.amazonaws.dynamodb.synthetic",
   72     72   
        "ListBackupsInput",
   73     73   
    ),
   74     74   
    ::aws_smithy_schema::ShapeType::String,
   75         -
    "table_name",
          75  +
    "TableName",
   76     76   
    0,
   77     77   
);
   78     78   
static LISTBACKUPSINPUT_MEMBER_LIMIT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   79     79   
    ::aws_smithy_schema::ShapeId::from_static(
   80     80   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$Limit",
   81     81   
        "com.amazonaws.dynamodb.synthetic",
   82     82   
        "ListBackupsInput",
   83     83   
    ),
   84     84   
    ::aws_smithy_schema::ShapeType::Integer,
   85         -
    "limit",
          85  +
    "Limit",
   86     86   
    1,
   87     87   
);
   88     88   
static LISTBACKUPSINPUT_MEMBER_TIME_RANGE_LOWER_BOUND: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   89     89   
    ::aws_smithy_schema::ShapeId::from_static(
   90     90   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$TimeRangeLowerBound",
   91     91   
        "com.amazonaws.dynamodb.synthetic",
   92     92   
        "ListBackupsInput",
   93     93   
    ),
   94     94   
    ::aws_smithy_schema::ShapeType::Timestamp,
   95         -
    "time_range_lower_bound",
          95  +
    "TimeRangeLowerBound",
   96     96   
    2,
   97     97   
);
   98     98   
static LISTBACKUPSINPUT_MEMBER_TIME_RANGE_UPPER_BOUND: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99     99   
    ::aws_smithy_schema::ShapeId::from_static(
  100    100   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$TimeRangeUpperBound",
  101    101   
        "com.amazonaws.dynamodb.synthetic",
  102    102   
        "ListBackupsInput",
  103    103   
    ),
  104    104   
    ::aws_smithy_schema::ShapeType::Timestamp,
  105         -
    "time_range_upper_bound",
         105  +
    "TimeRangeUpperBound",
  106    106   
    3,
  107    107   
);
  108    108   
static LISTBACKUPSINPUT_MEMBER_EXCLUSIVE_START_BACKUP_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    109   
    ::aws_smithy_schema::ShapeId::from_static(
  110    110   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$ExclusiveStartBackupArn",
  111    111   
        "com.amazonaws.dynamodb.synthetic",
  112    112   
        "ListBackupsInput",
  113    113   
    ),
  114    114   
    ::aws_smithy_schema::ShapeType::String,
  115         -
    "exclusive_start_backup_arn",
         115  +
    "ExclusiveStartBackupArn",
  116    116   
    4,
  117    117   
);
  118    118   
static LISTBACKUPSINPUT_MEMBER_BACKUP_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  119    119   
    ::aws_smithy_schema::ShapeId::from_static(
  120    120   
        "com.amazonaws.dynamodb.synthetic#ListBackupsInput$BackupType",
  121    121   
        "com.amazonaws.dynamodb.synthetic",
  122    122   
        "ListBackupsInput",
  123    123   
    ),
  124    124   
    ::aws_smithy_schema::ShapeType::String,
  125         -
    "backup_type",
         125  +
    "BackupType",
  126    126   
    5,
  127    127   
);
  128    128   
static LISTBACKUPSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  129    129   
    LISTBACKUPSINPUT_SCHEMA_ID,
  130    130   
    ::aws_smithy_schema::ShapeType::Structure,
  131    131   
    &[
  132    132   
        &LISTBACKUPSINPUT_MEMBER_TABLE_NAME,
  133    133   
        &LISTBACKUPSINPUT_MEMBER_LIMIT,
  134    134   
        &LISTBACKUPSINPUT_MEMBER_TIME_RANGE_LOWER_BOUND,
  135    135   
        &LISTBACKUPSINPUT_MEMBER_TIME_RANGE_UPPER_BOUND,
  136    136   
        &LISTBACKUPSINPUT_MEMBER_EXCLUSIVE_START_BACKUP_ARN,
  137    137   
        &LISTBACKUPSINPUT_MEMBER_BACKUP_TYPE,
  138    138   
    ],
  139    139   
);
  140    140   
impl ListBackupsInput {
  141    141   
    /// The schema for this shape.
  142    142   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTBACKUPSINPUT_SCHEMA;
  143    143   
}
  144    144   
impl ::aws_smithy_schema::serde::SerializableStruct for ListBackupsInput {
  145    145   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  146    146   
    fn serialize_members(
  147    147   
        &self,
  148    148   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  149    149   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  150    150   
        if let Some(ref val) = self.table_name {
  151    151   
            ser.write_string(&LISTBACKUPSINPUT_MEMBER_TABLE_NAME, val)?;
  152    152   
        }
  153    153   
        if let Some(ref val) = self.limit {
  154    154   
            ser.write_integer(&LISTBACKUPSINPUT_MEMBER_LIMIT, *val)?;
  155    155   
        }
  156    156   
        if let Some(ref val) = self.time_range_lower_bound {
  157    157   
            ser.write_timestamp(&LISTBACKUPSINPUT_MEMBER_TIME_RANGE_LOWER_BOUND, val)?;
  158    158   
        }
  159    159   
        if let Some(ref val) = self.time_range_upper_bound {
  160    160   
            ser.write_timestamp(&LISTBACKUPSINPUT_MEMBER_TIME_RANGE_UPPER_BOUND, val)?;
  161    161   
        }
  162    162   
        if let Some(ref val) = self.exclusive_start_backup_arn {
  163    163   
            ser.write_string(&LISTBACKUPSINPUT_MEMBER_EXCLUSIVE_START_BACKUP_ARN, val)?;
  164    164   
        }
  165    165   
        if let Some(ref val) = self.backup_type {
  166    166   
            ser.write_string(&LISTBACKUPSINPUT_MEMBER_BACKUP_TYPE, val.as_str())?;
  167    167   
        }
  168    168   
        Ok(())
  169    169   
    }
  170    170   
}
  171    171   
impl ListBackupsInput {
  172    172   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  173         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  174         -
        deserializer: &mut D,
         173  +
    pub fn deserialize(
         174  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  175    175   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  176    176   
        #[allow(unused_variables, unused_mut)]
  177    177   
        let mut builder = Self::builder();
  178    178   
        #[allow(
  179    179   
            unused_variables,
  180    180   
            unreachable_code,
  181    181   
            clippy::single_match,
  182    182   
            clippy::match_single_binding,
  183    183   
            clippy::diverging_sub_expression
  184    184   
        )]
  185         -
        deserializer.read_struct(&LISTBACKUPSINPUT_SCHEMA, (), |_, member, deser| {
         185  +
        deserializer.read_struct(&LISTBACKUPSINPUT_SCHEMA, &mut |member, deser| {
  186    186   
            match member.member_index() {
  187    187   
                Some(0) => {
  188    188   
                    builder.table_name = Some(deser.read_string(member)?);
  189    189   
                }
  190    190   
                Some(1) => {
  191    191   
                    builder.limit = Some(deser.read_integer(member)?);
  192    192   
                }
  193    193   
                Some(2) => {
  194    194   
                    builder.time_range_lower_bound = Some(deser.read_timestamp(member)?);
  195    195   
                }
  196    196   
                Some(3) => {
  197    197   
                    builder.time_range_upper_bound = Some(deser.read_timestamp(member)?);
  198    198   
                }
  199    199   
                Some(4) => {
  200    200   
                    builder.exclusive_start_backup_arn = Some(deser.read_string(member)?);
  201    201   
                }
  202    202   
                Some(5) => {
  203    203   
                    builder.backup_type = Some(crate::types::BackupTypeFilter::from(deser.read_string(member)?.as_str()));
  204    204   
                }
  205    205   
                _ => {}
  206    206   
            }
  207    207   
            Ok(())
  208    208   
        })?;
  209    209   
        builder
  210    210   
            .build()
  211    211   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  212    212   
    }
  213    213   
}
         214  +
impl ListBackupsInput {
         215  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         216  +
    pub fn deserialize_with_response(
         217  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         218  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         219  +
        _status: u16,
         220  +
        _body: &[u8],
         221  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         222  +
        Self::deserialize(deserializer)
         223  +
    }
         224  +
}
  214    225   
impl ListBackupsInput {
  215    226   
    /// Creates a new builder-style object to manufacture [`ListBackupsInput`](crate::operation::list_backups::ListBackupsInput).
  216    227   
    pub fn builder() -> crate::operation::list_backups::builders::ListBackupsInputBuilder {
  217    228   
        crate::operation::list_backups::builders::ListBackupsInputBuilder::default()
  218    229   
    }
  219    230   
}
  220    231   
  221    232   
/// A builder for [`ListBackupsInput`](crate::operation::list_backups::ListBackupsInput).
  222    233   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  223    234   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_backups/_list_backups_output.rs

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

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

@@ -1,1 +40,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ListContributorInsights`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListContributorInsights;
    6      6   
impl ListContributorInsights {
    7      7   
    /// Creates a new `ListContributorInsights`
    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::list_contributor_insights::ListContributorInsightsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          15  +
        crate::operation::list_contributor_insights::ListContributorInsightsOutput::SCHEMA;
   11     16   
    pub(crate) async fn orchestrate(
   12     17   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     18   
        input: crate::operation::list_contributor_insights::ListContributorInsightsInput,
   14     19   
    ) -> ::std::result::Result<
   15     20   
        crate::operation::list_contributor_insights::ListContributorInsightsOutput,
   16     21   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     22   
            crate::operation::list_contributor_insights::ListContributorInsightsError,
   18     23   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     24   
        >,
   20     25   
    > {
@@ -104,109 +233,297 @@
  124    129   
                crate::operation::list_contributor_insights::ListContributorInsightsError,
  125    130   
            >::new());
  126    131   
  127    132   
        ::std::borrow::Cow::Owned(rcb)
  128    133   
    }
  129    134   
}
  130    135   
  131    136   
#[derive(Debug)]
  132    137   
struct ListContributorInsightsResponseDeserializer;
  133    138   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListContributorInsightsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         139  +
    fn deserialize_nonstreaming_with_config(
  135    140   
        &self,
  136    141   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         142  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    143   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    144   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    145   
        #[allow(unused_mut)]
  142    146   
        let mut force_error = false;
  143    147   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights_http_error(status, headers, body)
         148  +
        if !success && status != 200 || force_error {
         149  +
            let headers = response.headers();
         150  +
            let body = response.body().bytes().expect("body loaded");
         151  +
            #[allow(unused_mut)]
         152  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         153  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         154  +
            })?;
         155  +
         156  +
            let generic = generic_builder.build();
         157  +
            let error_code = match generic.code() {
         158  +
                ::std::option::Option::Some(code) => code,
         159  +
                ::std::option::Option::None => {
         160  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         161  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         162  +
                            crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled(generic),
         163  +
                        ),
         164  +
                    ))
         165  +
                }
         166  +
            };
         167  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let err = match error_code {
         172  +
                "InternalServerError" => crate::operation::list_contributor_insights::ListContributorInsightsError::InternalServerError({
         173  +
                    let mut tmp = match protocol
         174  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         175  +
                        .and_then(|mut deser| {
         176  +
                            crate::types::error::InternalServerError::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  +
                        }
         189  +
                    };
         190  +
                    tmp.meta = generic;
         191  +
                    if tmp.message.is_none() {
         192  +
                        tmp.message = _error_message;
         193  +
                    }
         194  +
                    tmp
         195  +
                }),
         196  +
                "ResourceNotFoundException" => crate::operation::list_contributor_insights::ListContributorInsightsError::ResourceNotFoundError({
         197  +
                    let mut tmp = match protocol
         198  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         199  +
                        .and_then(|mut deser| {
         200  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         201  +
                                &mut *deser,
         202  +
                                response.headers(),
         203  +
                                response.status().into(),
         204  +
                                body,
         205  +
                            )
         206  +
                        }) {
         207  +
                        ::std::result::Result::Ok(val) => val,
         208  +
                        ::std::result::Result::Err(e) => {
         209  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         210  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         211  +
                            ))
         212  +
                        }
         213  +
                    };
         214  +
                    tmp.meta = generic;
         215  +
                    if tmp.message.is_none() {
         216  +
                        tmp.message = _error_message;
         217  +
                    }
         218  +
                    tmp
         219  +
                }),
         220  +
                _ => crate::operation::list_contributor_insights::ListContributorInsightsError::generic(generic),
         221  +
            };
         222  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         223  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         224  +
            ))
  146    225   
        } else {
  147         -
            crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         226  +
            let protocol = _cfg
         227  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         228  +
                .expect("a SharedClientProtocol is required");
         229  +
            let mut deser = protocol
         230  +
                .deserialize_response(response, ListContributorInsights::OUTPUT_SCHEMA, _cfg)
         231  +
                .map_err(|e| {
         232  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         233  +
                })?;
         234  +
            let body = response.body().bytes().expect("body loaded");
         235  +
            let output = crate::operation::list_contributor_insights::ListContributorInsightsOutput::deserialize_with_response(
         236  +
                &mut *deser,
         237  +
                response.headers(),
         238  +
                response.status().into(),
         239  +
                body,
         240  +
            )
         241  +
            .map_err(|e| {
         242  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         243  +
            })?;
         244  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         245  +
        }
  150    246   
    }
  151    247   
}
  152    248   
#[derive(Debug)]
  153    249   
struct ListContributorInsightsRequestSerializer;
  154    250   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListContributorInsightsRequestSerializer {
  155    251   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    252   
    fn serialize_input(
  157    253   
        &self,
  158    254   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    255   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    256   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    257   
        let input = input
  162    258   
            .downcast::<crate::operation::list_contributor_insights::ListContributorInsightsInput>()
  163    259   
            .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::list_contributor_insights::ListContributorInsightsInput,
  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::list_contributor_insights::ListContributorInsightsInput,
  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.ListContributorInsights",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  197         -
            crate::protocol_serde::shape_list_contributor_insights::ser_list_contributor_insights_input(&input)?,
  198         -
        );
  199         -
        if let Some(content_length) = body.content_length() {
  200         -
            let content_length = content_length.to_string();
  201         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  202         -
        }
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         260  +
        let protocol = _cfg
         261  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         262  +
            .expect("a SharedClientProtocol is required");
         263  +
        let mut request = protocol
         264  +
            .serialize_request(&input, ListContributorInsights::INPUT_SCHEMA, "", _cfg)
         265  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         266  +
         267  +
        return ::std::result::Result::Ok(request);
  204    268   
    }
  205    269   
}
  206    270   
#[derive(Debug)]
  207    271   
struct ListContributorInsightsEndpointParamsInterceptor;
  208    272   
  209    273   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListContributorInsightsEndpointParamsInterceptor {
  210    274   
    fn name(&self) -> &'static str {
  211    275   
        "ListContributorInsightsEndpointParamsInterceptor"
  212    276   
    }
  213    277   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_contributor_insights/_list_contributor_insights_input.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_contributor_insights/_list_contributor_insights_output.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_exports.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 `ListExports`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListExports;
    6      6   
impl ListExports {
    7      7   
    /// Creates a new `ListExports`
    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::list_exports::ListExportsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_exports::ListExportsOutput::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::list_exports::ListExportsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_exports::ListExportsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_exports::ListExportsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,289 @@
  121    125   
                crate::operation::list_exports::ListExportsError,
  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 ListExportsResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListExportsResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_list_exports::de_list_exports_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::list_exports::ListExportsError::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::list_exports::ListExportsError::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  +
                "LimitExceededException" => crate::operation::list_exports::ListExportsError::LimitExceededError({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::LimitExceededError::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  +
                _ => crate::operation::list_exports::ListExportsError::generic(generic),
         215  +
            };
         216  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         217  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         218  +
            ))
  143    219   
        } else {
  144         -
            crate::protocol_serde::shape_list_exports::de_list_exports_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         220  +
            let protocol = _cfg
         221  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         222  +
                .expect("a SharedClientProtocol is required");
         223  +
            let mut deser = protocol.deserialize_response(response, ListExports::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         224  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         225  +
            })?;
         226  +
            let body = response.body().bytes().expect("body loaded");
         227  +
            let output = crate::operation::list_exports::ListExportsOutput::deserialize_with_response(
         228  +
                &mut *deser,
         229  +
                response.headers(),
         230  +
                response.status().into(),
         231  +
                body,
         232  +
            )
         233  +
            .map_err(|e| {
         234  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         235  +
            })?;
         236  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         237  +
        }
  147    238   
    }
  148    239   
}
  149    240   
#[derive(Debug)]
  150    241   
struct ListExportsRequestSerializer;
  151    242   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListExportsRequestSerializer {
  152    243   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    244   
    fn serialize_input(
  154    245   
        &self,
  155    246   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    247   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    248   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    249   
        let input = input
  159    250   
            .downcast::<crate::operation::list_exports::ListExportsInput>()
  160    251   
            .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::list_exports::ListExportsInput,
  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::list_exports::ListExportsInput,
  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.ListExports",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_exports::ser_list_exports_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())
         252  +
        let protocol = _cfg
         253  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         254  +
            .expect("a SharedClientProtocol is required");
         255  +
        let mut request = protocol
         256  +
            .serialize_request(&input, ListExports::INPUT_SCHEMA, "", _cfg)
         257  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         258  +
         259  +
        return ::std::result::Result::Ok(request);
  199    260   
    }
  200    261   
}
  201    262   
#[derive(Debug)]
  202    263   
struct ListExportsEndpointParamsInterceptor;
  203    264   
  204    265   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListExportsEndpointParamsInterceptor {
  205    266   
    fn name(&self) -> &'static str {
  206    267   
        "ListExportsEndpointParamsInterceptor"
  207    268   
    }
  208    269   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_exports/_list_exports_input.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_exports/_list_exports_output.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_global_tables.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 `ListGlobalTables`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListGlobalTables;
    6      6   
impl ListGlobalTables {
    7      7   
    /// Creates a new `ListGlobalTables`
    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::list_global_tables::ListGlobalTablesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_global_tables::ListGlobalTablesOutput::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::list_global_tables::ListGlobalTablesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_global_tables::ListGlobalTablesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_global_tables::ListGlobalTablesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +231,296 @@
  124    128   
                crate::operation::list_global_tables::ListGlobalTablesError,
  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 ListGlobalTablesResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListGlobalTablesResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_list_global_tables::de_list_global_tables_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            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(crate::operation::list_global_tables::ListGlobalTablesError::unhandled(
         161  +
                            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  +
                "InternalServerError" => crate::operation::list_global_tables::ListGlobalTablesError::InternalServerError({
         172  +
                    let mut tmp = match protocol
         173  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         174  +
                        .and_then(|mut deser| {
         175  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         176  +
                                &mut *deser,
         177  +
                                response.headers(),
         178  +
                                response.status().into(),
         179  +
                                body,
         180  +
                            )
         181  +
                        }) {
         182  +
                        ::std::result::Result::Ok(val) => val,
         183  +
                        ::std::result::Result::Err(e) => {
         184  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         185  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         186  +
                            ))
         187  +
                        }
         188  +
                    };
         189  +
                    tmp.meta = generic;
         190  +
                    if tmp.message.is_none() {
         191  +
                        tmp.message = _error_message;
         192  +
                    }
         193  +
                    tmp
         194  +
                }),
         195  +
                "InvalidEndpointException" => crate::operation::list_global_tables::ListGlobalTablesError::InvalidEndpointError({
         196  +
                    let mut tmp = match protocol
         197  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         198  +
                        .and_then(|mut deser| {
         199  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         200  +
                                &mut *deser,
         201  +
                                response.headers(),
         202  +
                                response.status().into(),
         203  +
                                body,
         204  +
                            )
         205  +
                        }) {
         206  +
                        ::std::result::Result::Ok(val) => val,
         207  +
                        ::std::result::Result::Err(e) => {
         208  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         209  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         210  +
                            ))
         211  +
                        }
         212  +
                    };
         213  +
                    tmp.meta = generic;
         214  +
                    if tmp.message.is_none() {
         215  +
                        tmp.message = _error_message;
         216  +
                    }
         217  +
                    tmp
         218  +
                }),
         219  +
                _ => crate::operation::list_global_tables::ListGlobalTablesError::generic(generic),
         220  +
            };
         221  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         222  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         223  +
            ))
  146    224   
        } else {
  147         -
            crate::protocol_serde::shape_list_global_tables::de_list_global_tables_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         225  +
            let protocol = _cfg
         226  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         227  +
                .expect("a SharedClientProtocol is required");
         228  +
            let mut deser = protocol
         229  +
                .deserialize_response(response, ListGlobalTables::OUTPUT_SCHEMA, _cfg)
         230  +
                .map_err(|e| {
         231  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         232  +
                })?;
         233  +
            let body = response.body().bytes().expect("body loaded");
         234  +
            let output = crate::operation::list_global_tables::ListGlobalTablesOutput::deserialize_with_response(
         235  +
                &mut *deser,
         236  +
                response.headers(),
         237  +
                response.status().into(),
         238  +
                body,
         239  +
            )
         240  +
            .map_err(|e| {
         241  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         242  +
            })?;
         243  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         244  +
        }
  150    245   
    }
  151    246   
}
  152    247   
#[derive(Debug)]
  153    248   
struct ListGlobalTablesRequestSerializer;
  154    249   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListGlobalTablesRequestSerializer {
  155    250   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    251   
    fn serialize_input(
  157    252   
        &self,
  158    253   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    254   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    255   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    256   
        let input = input
  162    257   
            .downcast::<crate::operation::list_global_tables::ListGlobalTablesInput>()
  163    258   
            .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::list_global_tables::ListGlobalTablesInput,
  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::list_global_tables::ListGlobalTablesInput,
  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.ListGlobalTables",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_global_tables::ser_list_global_tables_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())
         259  +
        let protocol = _cfg
         260  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         261  +
            .expect("a SharedClientProtocol is required");
         262  +
        let mut request = protocol
         263  +
            .serialize_request(&input, ListGlobalTables::INPUT_SCHEMA, "", _cfg)
         264  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         265  +
         266  +
        return ::std::result::Result::Ok(request);
  202    267   
    }
  203    268   
}
  204    269   
#[derive(Debug)]
  205    270   
struct ListGlobalTablesEndpointParamsInterceptor;
  206    271   
  207    272   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListGlobalTablesEndpointParamsInterceptor {
  208    273   
    fn name(&self) -> &'static str {
  209    274   
        "ListGlobalTablesEndpointParamsInterceptor"
  210    275   
    }
  211    276   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_global_tables/_list_global_tables_input.rs

@@ -11,11 +158,169 @@
   31     31   
    "com.amazonaws.dynamodb.synthetic",
   32     32   
    "ListGlobalTablesInput",
   33     33   
);
   34     34   
static LISTGLOBALTABLESINPUT_MEMBER_EXCLUSIVE_START_GLOBAL_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   35     35   
    ::aws_smithy_schema::ShapeId::from_static(
   36     36   
        "com.amazonaws.dynamodb.synthetic#ListGlobalTablesInput$ExclusiveStartGlobalTableName",
   37     37   
        "com.amazonaws.dynamodb.synthetic",
   38     38   
        "ListGlobalTablesInput",
   39     39   
    ),
   40     40   
    ::aws_smithy_schema::ShapeType::String,
   41         -
    "exclusive_start_global_table_name",
          41  +
    "ExclusiveStartGlobalTableName",
   42     42   
    0,
   43     43   
);
   44     44   
static LISTGLOBALTABLESINPUT_MEMBER_LIMIT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   45     45   
    ::aws_smithy_schema::ShapeId::from_static(
   46     46   
        "com.amazonaws.dynamodb.synthetic#ListGlobalTablesInput$Limit",
   47     47   
        "com.amazonaws.dynamodb.synthetic",
   48     48   
        "ListGlobalTablesInput",
   49     49   
    ),
   50     50   
    ::aws_smithy_schema::ShapeType::Integer,
   51         -
    "limit",
          51  +
    "Limit",
   52     52   
    1,
   53     53   
);
   54     54   
static LISTGLOBALTABLESINPUT_MEMBER_REGION_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "com.amazonaws.dynamodb.synthetic#ListGlobalTablesInput$RegionName",
   57     57   
        "com.amazonaws.dynamodb.synthetic",
   58     58   
        "ListGlobalTablesInput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::String,
   61         -
    "region_name",
          61  +
    "RegionName",
   62     62   
    2,
   63     63   
);
   64     64   
static LISTGLOBALTABLESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   65     65   
    LISTGLOBALTABLESINPUT_SCHEMA_ID,
   66     66   
    ::aws_smithy_schema::ShapeType::Structure,
   67     67   
    &[
   68     68   
        &LISTGLOBALTABLESINPUT_MEMBER_EXCLUSIVE_START_GLOBAL_TABLE_NAME,
   69     69   
        &LISTGLOBALTABLESINPUT_MEMBER_LIMIT,
   70     70   
        &LISTGLOBALTABLESINPUT_MEMBER_REGION_NAME,
   71     71   
    ],
   72     72   
);
   73     73   
impl ListGlobalTablesInput {
   74     74   
    /// The schema for this shape.
   75     75   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTGLOBALTABLESINPUT_SCHEMA;
   76     76   
}
   77     77   
impl ::aws_smithy_schema::serde::SerializableStruct for ListGlobalTablesInput {
   78     78   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   79     79   
    fn serialize_members(
   80     80   
        &self,
   81     81   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   82     82   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   83     83   
        if let Some(ref val) = self.exclusive_start_global_table_name {
   84     84   
            ser.write_string(&LISTGLOBALTABLESINPUT_MEMBER_EXCLUSIVE_START_GLOBAL_TABLE_NAME, val)?;
   85     85   
        }
   86     86   
        if let Some(ref val) = self.limit {
   87     87   
            ser.write_integer(&LISTGLOBALTABLESINPUT_MEMBER_LIMIT, *val)?;
   88     88   
        }
   89     89   
        if let Some(ref val) = self.region_name {
   90     90   
            ser.write_string(&LISTGLOBALTABLESINPUT_MEMBER_REGION_NAME, val)?;
   91     91   
        }
   92     92   
        Ok(())
   93     93   
    }
   94     94   
}
   95     95   
impl ListGlobalTablesInput {
   96     96   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   97         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   98         -
        deserializer: &mut D,
          97  +
    pub fn deserialize(
          98  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   99     99   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  100    100   
        #[allow(unused_variables, unused_mut)]
  101    101   
        let mut builder = Self::builder();
  102    102   
        #[allow(
  103    103   
            unused_variables,
  104    104   
            unreachable_code,
  105    105   
            clippy::single_match,
  106    106   
            clippy::match_single_binding,
  107    107   
            clippy::diverging_sub_expression
  108    108   
        )]
  109         -
        deserializer.read_struct(&LISTGLOBALTABLESINPUT_SCHEMA, (), |_, member, deser| {
         109  +
        deserializer.read_struct(&LISTGLOBALTABLESINPUT_SCHEMA, &mut |member, deser| {
  110    110   
            match member.member_index() {
  111    111   
                Some(0) => {
  112    112   
                    builder.exclusive_start_global_table_name = Some(deser.read_string(member)?);
  113    113   
                }
  114    114   
                Some(1) => {
  115    115   
                    builder.limit = Some(deser.read_integer(member)?);
  116    116   
                }
  117    117   
                Some(2) => {
  118    118   
                    builder.region_name = Some(deser.read_string(member)?);
  119    119   
                }
  120    120   
                _ => {}
  121    121   
            }
  122    122   
            Ok(())
  123    123   
        })?;
  124    124   
        builder
  125    125   
            .build()
  126    126   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  127    127   
    }
  128    128   
}
         129  +
impl ListGlobalTablesInput {
         130  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         131  +
    pub fn deserialize_with_response(
         132  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         133  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         134  +
        _status: u16,
         135  +
        _body: &[u8],
         136  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         137  +
        Self::deserialize(deserializer)
         138  +
    }
         139  +
}
  129    140   
impl ListGlobalTablesInput {
  130    141   
    /// Creates a new builder-style object to manufacture [`ListGlobalTablesInput`](crate::operation::list_global_tables::ListGlobalTablesInput).
  131    142   
    pub fn builder() -> crate::operation::list_global_tables::builders::ListGlobalTablesInputBuilder {
  132    143   
        crate::operation::list_global_tables::builders::ListGlobalTablesInputBuilder::default()
  133    144   
    }
  134    145   
}
  135    146   
  136    147   
/// A builder for [`ListGlobalTablesInput`](crate::operation::list_global_tables::ListGlobalTablesInput).
  137    148   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  138    149   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_global_tables/_list_global_tables_output.rs

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

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/list_tables.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 `ListTables`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListTables;
    6      6   
impl ListTables {
    7      7   
    /// Creates a new `ListTables`
    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::list_tables::ListTablesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_tables::ListTablesOutput::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::list_tables::ListTablesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_tables::ListTablesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_tables::ListTablesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +226,287 @@
  121    125   
                crate::operation::list_tables::ListTablesError,
  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 ListTablesResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListTablesResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_list_tables::de_list_tables_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::list_tables::ListTablesError::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::list_tables::ListTablesError::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::list_tables::ListTablesError::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  +
                _ => crate::operation::list_tables::ListTablesError::generic(generic),
         215  +
            };
         216  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         217  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         218  +
            ))
  143    219   
        } else {
  144         -
            crate::protocol_serde::shape_list_tables::de_list_tables_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         220  +
            let protocol = _cfg
         221  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         222  +
                .expect("a SharedClientProtocol is required");
         223  +
            let mut deser = protocol.deserialize_response(response, ListTables::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         224  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         225  +
            })?;
         226  +
            let body = response.body().bytes().expect("body loaded");
         227  +
            let output = crate::operation::list_tables::ListTablesOutput::deserialize_with_response(
         228  +
                &mut *deser,
         229  +
                response.headers(),
         230  +
                response.status().into(),
         231  +
                body,
         232  +
            )
         233  +
            .map_err(|e| {
         234  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         235  +
            })?;
         236  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         237  +
        }
  147    238   
    }
  148    239   
}
  149    240   
#[derive(Debug)]
  150    241   
struct ListTablesRequestSerializer;
  151    242   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListTablesRequestSerializer {
  152    243   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    244   
    fn serialize_input(
  154    245   
        &self,
  155    246   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    247   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    248   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    249   
        let input = input.downcast::<crate::operation::list_tables::ListTablesInput>().expect("correct type");
  159         -
        let _header_serialization_settings = _cfg
  160         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  161         -
            .cloned()
  162         -
            .unwrap_or_default();
  163         -
        let mut request_builder = {
  164         -
            #[allow(clippy::uninlined_format_args)]
  165         -
            fn uri_base(
  166         -
                _input: &crate::operation::list_tables::ListTablesInput,
  167         -
                output: &mut ::std::string::String,
  168         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  169         -
                use ::std::fmt::Write as _;
  170         -
                ::std::write!(output, "/").expect("formatting should succeed");
  171         -
                ::std::result::Result::Ok(())
  172         -
            }
  173         -
            #[allow(clippy::unnecessary_wraps)]
  174         -
            fn update_http_builder(
  175         -
                input: &crate::operation::list_tables::ListTablesInput,
  176         -
                builder: ::http_1x::request::Builder,
  177         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  178         -
                let mut uri = ::std::string::String::new();
  179         -
                uri_base(input, &mut uri)?;
  180         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  181         -
            }
  182         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  183         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  184         -
            builder = _header_serialization_settings.set_default_header(
  185         -
                builder,
  186         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  187         -
                "DynamoDB_20120810.ListTables",
  188         -
            );
  189         -
            builder
  190         -
        };
  191         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_tables::ser_list_tables_input(&input)?);
  192         -
        if let Some(content_length) = body.content_length() {
  193         -
            let content_length = content_length.to_string();
  194         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  195         -
        }
  196         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         250  +
        let protocol = _cfg
         251  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         252  +
            .expect("a SharedClientProtocol is required");
         253  +
        let mut request = protocol
         254  +
            .serialize_request(&input, ListTables::INPUT_SCHEMA, "", _cfg)
         255  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         256  +
         257  +
        return ::std::result::Result::Ok(request);
  197    258   
    }
  198    259   
}
  199    260   
#[derive(Debug)]
  200    261   
struct ListTablesEndpointParamsInterceptor;
  201    262   
  202    263   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListTablesEndpointParamsInterceptor {
  203    264   
    fn name(&self) -> &'static str {
  204    265   
        "ListTablesEndpointParamsInterceptor"
  205    266   
    }
  206    267