Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/big_numbers/rust-client-codegen/src/protocol_serde/shape_process_nested_big_numbers_input.rs

@@ -1,0 +45,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_process_nested_big_numbers_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::process_nested_big_numbers::ProcessNestedBigNumbersInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.dec_map {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("decMap").start_object();
    9         -
        for (key_3, value_4) in var_1 {
   10         -
            {
   11         -
                object_2.key(key_3.as_str()).write_raw_value(value_4.as_ref());
   12         -
            }
   13         -
        }
   14         -
        object_2.finish();
   15         -
    }
   16         -
    if let Some(var_5) = &input.int_map {
   17         -
        #[allow(unused_mut)]
   18         -
        let mut object_6 = object.key("intMap").start_object();
   19         -
        for (key_7, value_8) in var_5 {
   20         -
            {
   21         -
                object_6.key(key_7.as_str()).write_raw_value(value_8.as_ref());
   22         -
            }
   23         -
        }
   24         -
        object_6.finish();
   25         -
    }
   26         -
    if let Some(var_9) = &input.numbers {
   27         -
        let mut array_10 = object.key("numbers").start_array();
   28         -
        for item_11 in var_9 {
   29         -
            {
   30         -
                array_10.value().write_raw_value(item_11.as_ref());
   31         -
            }
   32         -
        }
   33         -
        array_10.finish();
   34         -
    }
   35         -
    if let Some(var_12) = &input.ratios {
   36         -
        let mut array_13 = object.key("ratios").start_array();
   37         -
        for item_14 in var_12 {
   38         -
            {
   39         -
                array_13.value().write_raw_value(item_14.as_ref());
   40         -
            }
   41         -
        }
   42         -
        array_13.finish();
   43         -
    }
   44         -
    Ok(())
   45         -
}

tmp-codegen-diff/codegen-client-test/big_numbers/rust-client-codegen/src/protocol_serde/shape_string_to_big_decimal_map.rs

@@ -1,0 +49,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_string_to_big_decimal_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::BigDecimal>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_as_string_or_null(tokens.next(), _value)?
   22         -
                            .map(<::aws_smithy_types::BigDecimal as ::std::str::FromStr>::from_str)
   23         -
                            .transpose()
   24         -
                            .map_err(|e| ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("invalid BigDecimal: {e}")))?;
   25         -
                        match value {
   26         -
                            Some(value) => {
   27         -
                                map.insert(key, value);
   28         -
                            }
   29         -
                            None => {
   30         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
                                    "dense map cannot contain null values",
   32         -
                                ))
   33         -
                            }
   34         -
                        }
   35         -
                    }
   36         -
                    other => {
   37         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38         -
                            "expected object key or end object, found: {other:?}"
   39         -
                        )))
   40         -
                    }
   41         -
                }
   42         -
            }
   43         -
            Ok(Some(map))
   44         -
        }
   45         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
            "expected start object or null",
   47         -
        )),
   48         -
    }
   49         -
}

tmp-codegen-diff/codegen-client-test/big_numbers/rust-client-codegen/src/protocol_serde/shape_string_to_big_integer_map.rs

@@ -1,0 +49,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_string_to_big_integer_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::BigInteger>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_as_string_or_null(tokens.next(), _value)?
   22         -
                            .map(<::aws_smithy_types::BigInteger as ::std::str::FromStr>::from_str)
   23         -
                            .transpose()
   24         -
                            .map_err(|e| ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("invalid BigInteger: {e}")))?;
   25         -
                        match value {
   26         -
                            Some(value) => {
   27         -
                                map.insert(key, value);
   28         -
                            }
   29         -
                            None => {
   30         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
                                    "dense map cannot contain null values",
   32         -
                                ))
   33         -
                            }
   34         -
                        }
   35         -
                    }
   36         -
                    other => {
   37         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38         -
                            "expected object key or end object, found: {other:?}"
   39         -
                        )))
   40         -
                    }
   41         -
                }
   42         -
            }
   43         -
            Ok(Some(map))
   44         -
        }
   45         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
            "expected start object or null",
   47         -
        )),
   48         -
    }
   49         -
}

tmp-codegen-diff/codegen-client-test/big_numbers/rust-client-codegen/src/serialization_settings.rs

@@ -1,0 +89,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/*
    3         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4         -
 * SPDX-License-Identifier: Apache-2.0
    5         -
 */
    6         -
    7         -
#![allow(dead_code)]
    8         -
    9         -
use aws_smithy_http::header::set_request_header_if_absent;
   10         -
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12         -
   13         -
/// Configuration for how default protocol headers are serialized
   14         -
#[derive(Clone, Debug, Default)]
   15         -
pub(crate) struct HeaderSerializationSettings {
   16         -
    omit_default_content_length: bool,
   17         -
    omit_default_content_type: bool,
   18         -
}
   19         -
   20         -
impl HeaderSerializationSettings {
   21         -
    /// Creates new [`HeaderSerializationSettings`]
   22         -
    pub(crate) fn new() -> Self {
   23         -
        Default::default()
   24         -
    }
   25         -
   26         -
    /// Omit the default `Content-Length` header during serialization
   27         -
    pub(crate) fn omit_default_content_length(self) -> Self {
   28         -
        Self {
   29         -
            omit_default_content_length: true,
   30         -
            ..self
   31         -
        }
   32         -
    }
   33         -
   34         -
    /// Omit the default `Content-Type` header during serialization
   35         -
    pub(crate) fn omit_default_content_type(self) -> Self {
   36         -
        Self {
   37         -
            omit_default_content_type: true,
   38         -
            ..self
   39         -
        }
   40         -
    }
   41         -
   42         -
    /// Returns true if the given default header name should be serialized
   43         -
    fn include_header(&self, header: &HeaderName) -> bool {
   44         -
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45         -
    }
   46         -
   47         -
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(
   49         -
        &self,
   50         -
        mut request: http_1x::request::Builder,
   51         -
        header_name: HeaderName,
   52         -
        value: &str,
   53         -
    ) -> http_1x::request::Builder {
   54         -
        if self.include_header(&header_name) {
   55         -
            request = set_request_header_if_absent(request, header_name, value);
   56         -
        }
   57         -
        request
   58         -
    }
   59         -
}
   60         -
   61         -
impl Storable for HeaderSerializationSettings {
   62         -
    type Storer = StoreReplace<Self>;
   63         -
}
   64         -
   65         -
#[cfg(test)]
   66         -
mod tests {
   67         -
    use super::*;
   68         -
   69         -
    #[test]
   70         -
    fn test_include_header() {
   71         -
        let settings = HeaderSerializationSettings::default();
   72         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   73         -
        assert!(settings.include_header(&CONTENT_TYPE));
   74         -
   75         -
        let settings = HeaderSerializationSettings::default().omit_default_content_length();
   76         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   77         -
        assert!(settings.include_header(&CONTENT_TYPE));
   78         -
   79         -
        let settings = HeaderSerializationSettings::default().omit_default_content_type();
   80         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   81         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   82         -
   83         -
        let settings = HeaderSerializationSettings::default()
   84         -
            .omit_default_content_type()
   85         -
            .omit_default_content_length();
   86         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   87         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   88         -
    }
   89         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/Cargo.toml

@@ -1,1 +45,43 @@
    4      4   
version = "0.0.1"
    5      5   
authors = ["protocoltest@example.com"]
    6      6   
description = "test"
    7      7   
edition = "2021"
    8      8   
    9      9   
[package.metadata.smithy]
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#awsJson1_0"
   12     12   
[dependencies.aws-smithy-async]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-async"
   14         -
[dependencies.aws-smithy-http]
   15         -
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   16     14   
[dependencies.aws-smithy-json]
   17     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   18     16   
[dependencies.aws-smithy-runtime]
   19     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   20     18   
features = ["client"]
   21     19   
[dependencies.aws-smithy-runtime-api]
   22     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   23     21   
features = ["client", "http-1x"]
   24     22   
[dependencies.aws-smithy-schema]
   25     23   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-schema"

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

@@ -10,10 +69,73 @@
   30     30   
            config: self.cloneable.clone(),
   31     31   
            runtime_components: self.runtime_components.clone(),
   32     32   
            runtime_plugins: self.runtime_plugins.clone(),
   33     33   
            behavior_version: self.behavior_version,
   34     34   
        }
   35     35   
    }
   36     36   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     37   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     38   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     39   
    }
          40  +
    /// Returns the client protocol used for serialization and deserialization.
          41  +
    pub fn protocol(&self) -> ::std::option::Option<&::aws_smithy_schema::protocol::SharedClientProtocol> {
          42  +
        self.config.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
          43  +
    }
   40     44   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     45   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     46   
        self.runtime_components.http_client()
   43     47   
    }
   44     48   
    /// Return the auth schemes configured on this service config
   45     49   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     50   
        self.runtime_components.auth_schemes()
   47     51   
    }
   48     52   
   49     53   
    /// Return the auth scheme resolver configured on this service config
@@ -105,109 +201,224 @@
  125    129   
    ///
  126    130   
    pub fn new() -> Self {
  127    131   
        Self::default()
  128    132   
    }
  129    133   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  130    134   
    /// but not those in runtime components.
  131    135   
    #[allow(unused)]
  132    136   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  133    137   
        let mut builder = Self::new();
  134    138   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         139  +
        if let ::std::option::Option::Some(protocol) = config_bag.load::<::aws_smithy_schema::protocol::SharedClientProtocol>().cloned() {
         140  +
            builder.set_protocol(::std::option::Option::Some(protocol));
         141  +
        }
  135    142   
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  136    143   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  137    144   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  138    145   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  139    146   
        builder
  140    147   
    }
  141    148   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  142    149   
    /// to configure protection for stalled streams.
  143    150   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  144    151   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  145    152   
        self
  146    153   
    }
  147    154   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  148    155   
    /// to configure protection for stalled streams.
  149    156   
    pub fn set_stalled_stream_protection(
  150    157   
        &mut self,
  151    158   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  152    159   
    ) -> &mut Self {
  153    160   
        self.config.store_or_unset(stalled_stream_protection_config);
  154    161   
        self
  155    162   
    }
  156    163   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  157    164   
    pub fn idempotency_token_provider(
  158    165   
        mut self,
  159    166   
        idempotency_token_provider: impl ::std::convert::Into<crate::idempotency_token::IdempotencyTokenProvider>,
  160    167   
    ) -> Self {
  161    168   
        self.set_idempotency_token_provider(::std::option::Option::Some(idempotency_token_provider.into()));
  162    169   
        self
  163    170   
    }
  164    171   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  165    172   
    pub fn set_idempotency_token_provider(
  166    173   
        &mut self,
  167    174   
        idempotency_token_provider: ::std::option::Option<crate::idempotency_token::IdempotencyTokenProvider>,
  168    175   
    ) -> &mut Self {
  169    176   
        self.config.store_or_unset(idempotency_token_provider);
  170    177   
        self
  171    178   
    }
         179  +
    /// Sets the client protocol to use for serialization and deserialization.
         180  +
    ///
         181  +
    /// This overrides the default protocol determined by the service model,
         182  +
    /// enabling runtime protocol selection.
         183  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         184  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         185  +
            protocol,
         186  +
        )));
         187  +
        self
         188  +
    }
         189  +
         190  +
    /// Sets the client protocol to use for serialization and deserialization.
         191  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         192  +
        self.config.store_or_unset(protocol);
         193  +
        self
         194  +
    }
  172    195   
    /// Sets the HTTP client to use when making requests.
  173    196   
    ///
  174    197   
    /// # Examples
  175    198   
    /// ```no_run
  176    199   
    /// # #[cfg(test)]
  177    200   
    /// # mod tests {
  178    201   
    /// # #[test]
  179    202   
    /// # fn example() {
  180    203   
    /// use std::time::Duration;
  181    204   
    /// use dynamo::config::Config;
@@ -1132,1155 +1191,1219 @@
 1152   1175   
pub(crate) struct ServiceRuntimePlugin {
 1153   1176   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1154   1177   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1155   1178   
}
 1156   1179   
 1157   1180   
impl ServiceRuntimePlugin {
 1158   1181   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1159   1182   
        let config = {
 1160   1183   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DynamoDB_20120810");
 1161   1184   
            cfg.store_put(crate::idempotency_token::default_provider());
        1185  +
            if _service_config.protocol().is_none() {
        1186  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1187  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0("DynamoDB_20120810"),
        1188  +
                ));
        1189  +
            }
 1162   1190   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1163   1191   
            ::std::option::Option::Some(cfg.freeze())
 1164   1192   
        };
 1165   1193   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1166   1194   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1167   1195   
            use crate::config::auth::ResolveAuthScheme;
 1168   1196   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1169   1197   
        }));
 1170   1198   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1171   1199   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());

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

@@ -133,133 +176,172 @@
  153    153   
  154    154   
mod idempotency_token;
  155    155   
  156    156   
/// All operations that this crate can perform.
  157    157   
pub mod operation;
  158    158   
  159    159   
pub(crate) mod protocol_serde;
  160    160   
  161    161   
mod sdk_feature_tracker;
  162    162   
  163         -
mod serialization_settings;
         163  +
mod json_errors;
  164    164   
  165    165   
mod lens;
  166    166   
  167         -
mod serde_util;
  168         -
  169    167   
/// Supporting types for waiters.
  170    168   
///
  171    169   
/// Note: to use waiters, import the [`Waiters`](crate::client::Waiters) trait, which adds methods prefixed with `wait_until` to the client.
  172    170   
pub mod waiters;
  173    171   
  174         -
mod json_errors;
  175         -
  176    172   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/batch_execute_statement.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 `BatchExecuteStatement`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct BatchExecuteStatement;
    6      6   
impl BatchExecuteStatement {
    7      7   
    /// Creates a new `BatchExecuteStatement`
    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::batch_execute_statement::BatchExecuteStatementInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::batch_execute_statement::BatchExecuteStatementOutput::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::batch_execute_statement::BatchExecuteStatementInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::batch_execute_statement::BatchExecuteStatementOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::batch_execute_statement::BatchExecuteStatementError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +233,296 @@
  124    128   
                crate::operation::batch_execute_statement::BatchExecuteStatementError,
  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 BatchExecuteStatementResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for BatchExecuteStatementResponseDeserializer {
  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_batch_execute_statement::de_batch_execute_statement_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(
         161  +
                            crate::operation::batch_execute_statement::BatchExecuteStatementError::unhandled(generic),
         162  +
                        ),
         163  +
                    ))
         164  +
                }
         165  +
            };
         166  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         167  +
            let protocol = _cfg
         168  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         169  +
                .expect("a SharedClientProtocol is required");
         170  +
            let err = match error_code {
         171  +
                "InternalServerError" => crate::operation::batch_execute_statement::BatchExecuteStatementError::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  +
                "RequestLimitExceeded" => crate::operation::batch_execute_statement::BatchExecuteStatementError::RequestLimitExceeded({
         196  +
                    let mut tmp = match protocol
         197  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         198  +
                        .and_then(|mut deser| {
         199  +
                            crate::types::error::RequestLimitExceeded::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::batch_execute_statement::BatchExecuteStatementError::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_batch_execute_statement::de_batch_execute_statement_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, BatchExecuteStatement::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::batch_execute_statement::BatchExecuteStatementOutput::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 BatchExecuteStatementRequestSerializer;
  154    249   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for BatchExecuteStatementRequestSerializer {
  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::batch_execute_statement::BatchExecuteStatementInput>()
  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::batch_execute_statement::BatchExecuteStatementInput,
  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::batch_execute_statement::BatchExecuteStatementInput,
  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.BatchExecuteStatement",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_batch_execute_statement::ser_batch_execute_statement_input(
  197         -
            &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())
         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, BatchExecuteStatement::INPUT_SCHEMA, "", _cfg)
         264  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         265  +
         266  +
        return ::std::result::Result::Ok(request);
  204    267   
    }
  205    268   
}
  206    269   
#[derive(Debug)]
  207    270   
struct BatchExecuteStatementEndpointParamsInterceptor;
  208    271   
  209    272   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BatchExecuteStatementEndpointParamsInterceptor {
  210    273   
    fn name(&self) -> &'static str {
  211    274   
        "BatchExecuteStatementEndpointParamsInterceptor"
  212    275   
    }
  213    276   

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

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

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

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

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `BatchGetItem`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct BatchGetItem;
    6      6   
impl BatchGetItem {
    7      7   
    /// Creates a new `BatchGetItem`
    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::batch_get_item::BatchGetItemInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::batch_get_item::BatchGetItemOutput::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::batch_get_item::BatchGetItemInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::batch_get_item::BatchGetItemOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::batch_get_item::BatchGetItemError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,363 @@
  121    125   
                crate::operation::batch_get_item::BatchGetItemError,
  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 BatchGetItemResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for BatchGetItemResponseDeserializer {
  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_batch_get_item::de_batch_get_item_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::batch_get_item::BatchGetItemError::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::batch_get_item::BatchGetItemError::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::batch_get_item::BatchGetItemError::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  +
                "ProvisionedThroughputExceededException" => {
         215  +
                    crate::operation::batch_get_item::BatchGetItemError::ProvisionedThroughputExceededError({
         216  +
                        let mut tmp = match protocol
         217  +
                            .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededError::SCHEMA, _cfg)
         218  +
                            .and_then(|mut deser| {
         219  +
                                crate::types::error::ProvisionedThroughputExceededError::deserialize_with_response(
         220  +
                                    &mut *deser,
         221  +
                                    response.headers(),
         222  +
                                    response.status().into(),
         223  +
                                    body,
         224  +
                                )
         225  +
                            }) {
         226  +
                            ::std::result::Result::Ok(val) => val,
         227  +
                            ::std::result::Result::Err(e) => {
         228  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         229  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         230  +
                                ))
         231  +
                            }
         232  +
                        };
         233  +
                        tmp.meta = generic;
         234  +
                        if tmp.message.is_none() {
         235  +
                            tmp.message = _error_message;
         236  +
                        }
         237  +
                        tmp
         238  +
                    })
         239  +
                }
         240  +
                "RequestLimitExceeded" => crate::operation::batch_get_item::BatchGetItemError::RequestLimitExceeded({
         241  +
                    let mut tmp = match protocol
         242  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         243  +
                        .and_then(|mut deser| {
         244  +
                            crate::types::error::RequestLimitExceeded::deserialize_with_response(
         245  +
                                &mut *deser,
         246  +
                                response.headers(),
         247  +
                                response.status().into(),
         248  +
                                body,
         249  +
                            )
         250  +
                        }) {
         251  +
                        ::std::result::Result::Ok(val) => val,
         252  +
                        ::std::result::Result::Err(e) => {
         253  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         254  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         255  +
                            ))
         256  +
                        }
         257  +
                    };
         258  +
                    tmp.meta = generic;
         259  +
                    if tmp.message.is_none() {
         260  +
                        tmp.message = _error_message;
         261  +
                    }
         262  +
                    tmp
         263  +
                }),
         264  +
                "ResourceNotFoundException" => crate::operation::batch_get_item::BatchGetItemError::ResourceNotFoundError({
         265  +
                    let mut tmp = match protocol
         266  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         267  +
                        .and_then(|mut deser| {
         268  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         269  +
                                &mut *deser,
         270  +
                                response.headers(),
         271  +
                                response.status().into(),
         272  +
                                body,
         273  +
                            )
         274  +
                        }) {
         275  +
                        ::std::result::Result::Ok(val) => val,
         276  +
                        ::std::result::Result::Err(e) => {
         277  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         278  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         279  +
                            ))
         280  +
                        }
         281  +
                    };
         282  +
                    tmp.meta = generic;
         283  +
                    if tmp.message.is_none() {
         284  +
                        tmp.message = _error_message;
         285  +
                    }
         286  +
                    tmp
         287  +
                }),
         288  +
                _ => crate::operation::batch_get_item::BatchGetItemError::generic(generic),
         289  +
            };
         290  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         291  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         292  +
            ))
  143    293   
        } else {
  144         -
            crate::protocol_serde::shape_batch_get_item::de_batch_get_item_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         294  +
            let protocol = _cfg
         295  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         296  +
                .expect("a SharedClientProtocol is required");
         297  +
            let mut deser = protocol.deserialize_response(response, BatchGetItem::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         298  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         299  +
            })?;
         300  +
            let body = response.body().bytes().expect("body loaded");
         301  +
            let output = crate::operation::batch_get_item::BatchGetItemOutput::deserialize_with_response(
         302  +
                &mut *deser,
         303  +
                response.headers(),
         304  +
                response.status().into(),
         305  +
                body,
         306  +
            )
         307  +
            .map_err(|e| {
         308  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         309  +
            })?;
         310  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         311  +
        }
  147    312   
    }
  148    313   
}
  149    314   
#[derive(Debug)]
  150    315   
struct BatchGetItemRequestSerializer;
  151    316   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for BatchGetItemRequestSerializer {
  152    317   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    318   
    fn serialize_input(
  154    319   
        &self,
  155    320   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    321   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    322   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    323   
        let input = input
  159    324   
            .downcast::<crate::operation::batch_get_item::BatchGetItemInput>()
  160    325   
            .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::batch_get_item::BatchGetItemInput,
  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::batch_get_item::BatchGetItemInput,
  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.BatchGetItem",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_batch_get_item::ser_batch_get_item_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())
         326  +
        let protocol = _cfg
         327  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         328  +
            .expect("a SharedClientProtocol is required");
         329  +
        let mut request = protocol
         330  +
            .serialize_request(&input, BatchGetItem::INPUT_SCHEMA, "", _cfg)
         331  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         332  +
         333  +
        return ::std::result::Result::Ok(request);
  199    334   
    }
  200    335   
}
  201    336   
#[derive(Debug)]
  202    337   
struct BatchGetItemEndpointParamsInterceptor;
  203    338   
  204    339   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BatchGetItemEndpointParamsInterceptor {
  205    340   
    fn name(&self) -> &'static str {
  206    341   
        "BatchGetItemEndpointParamsInterceptor"
  207    342   
    }
  208    343   

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

@@ -104,104 +253,262 @@
  124    124   
    "com.amazonaws.dynamodb.synthetic",
  125    125   
    "BatchGetItemInput",
  126    126   
);
  127    127   
static BATCHGETITEMINPUT_MEMBER_REQUEST_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  128    128   
    ::aws_smithy_schema::ShapeId::from_static(
  129    129   
        "com.amazonaws.dynamodb.synthetic#BatchGetItemInput$RequestItems",
  130    130   
        "com.amazonaws.dynamodb.synthetic",
  131    131   
        "BatchGetItemInput",
  132    132   
    ),
  133    133   
    ::aws_smithy_schema::ShapeType::Map,
  134         -
    "request_items",
         134  +
    "RequestItems",
  135    135   
    0,
  136    136   
);
  137    137   
static BATCHGETITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  138    138   
    ::aws_smithy_schema::ShapeId::from_static(
  139    139   
        "com.amazonaws.dynamodb.synthetic#BatchGetItemInput$ReturnConsumedCapacity",
  140    140   
        "com.amazonaws.dynamodb.synthetic",
  141    141   
        "BatchGetItemInput",
  142    142   
    ),
  143    143   
    ::aws_smithy_schema::ShapeType::String,
  144         -
    "return_consumed_capacity",
         144  +
    "ReturnConsumedCapacity",
  145    145   
    1,
  146    146   
);
  147    147   
static BATCHGETITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  148    148   
    BATCHGETITEMINPUT_SCHEMA_ID,
  149    149   
    ::aws_smithy_schema::ShapeType::Structure,
  150    150   
    &[
  151    151   
        &BATCHGETITEMINPUT_MEMBER_REQUEST_ITEMS,
  152    152   
        &BATCHGETITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY,
  153    153   
    ],
  154    154   
);
  155    155   
impl BatchGetItemInput {
  156    156   
    /// The schema for this shape.
  157    157   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &BATCHGETITEMINPUT_SCHEMA;
  158    158   
}
  159    159   
impl ::aws_smithy_schema::serde::SerializableStruct for BatchGetItemInput {
  160    160   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  161    161   
    fn serialize_members(
  162    162   
        &self,
  163    163   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  164    164   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  165    165   
        if let Some(ref val) = self.request_items {
  166    166   
            ser.write_map(
  167    167   
                &BATCHGETITEMINPUT_MEMBER_REQUEST_ITEMS,
  168    168   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  169    169   
                    for (key, value) in val {
  170    170   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  171    171   
                        ser.write_struct(crate::types::KeysAndAttributes::SCHEMA, value)?;
  172    172   
                    }
  173    173   
                    Ok(())
  174    174   
                },
  175    175   
            )?;
  176    176   
        }
  177    177   
        if let Some(ref val) = self.return_consumed_capacity {
  178    178   
            ser.write_string(&BATCHGETITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
  179    179   
        }
  180    180   
        Ok(())
  181    181   
    }
  182    182   
}
  183    183   
impl BatchGetItemInput {
  184    184   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  185         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  186         -
        deserializer: &mut D,
         185  +
    pub fn deserialize(
         186  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  187    187   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  188    188   
        #[allow(unused_variables, unused_mut)]
  189    189   
        let mut builder = Self::builder();
  190    190   
        #[allow(
  191    191   
            unused_variables,
  192    192   
            unreachable_code,
  193    193   
            clippy::single_match,
  194    194   
            clippy::match_single_binding,
  195    195   
            clippy::diverging_sub_expression
  196    196   
        )]
  197         -
        deserializer.read_struct(&BATCHGETITEMINPUT_SCHEMA, (), |_, member, deser| {
         197  +
        deserializer.read_struct(&BATCHGETITEMINPUT_SCHEMA, &mut |member, deser| {
  198    198   
            match member.member_index() {
  199    199   
                Some(0) => {
  200    200   
                    builder.request_items = Some({
  201         -
                        let container = if let Some(cap) = deser.container_size() {
  202         -
                            std::collections::HashMap::with_capacity(cap)
  203         -
                        } else {
  204         -
                            std::collections::HashMap::new()
  205         -
                        };
  206         -
                        deser.read_map(member, container, |mut map, key, deser| {
  207         -
                            map.insert(key, crate::types::KeysAndAttributes::deserialize(deser)?);
  208         -
                            Ok(map)
  209         -
                        })?
         201  +
                        let mut container = std::collections::HashMap::new();
         202  +
                        deser.read_map(member, &mut |key, deser| {
         203  +
                            container.insert(key, crate::types::KeysAndAttributes::deserialize(deser)?);
         204  +
                            Ok(())
         205  +
                        })?;
         206  +
                        container
  210    207   
                    });
  211    208   
                }
  212    209   
                Some(1) => {
  213    210   
                    builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
  214    211   
                }
  215    212   
                _ => {}
  216    213   
            }
  217    214   
            Ok(())
  218    215   
        })?;
         216  +
        builder.request_items = builder.request_items.or(Some(::std::collections::HashMap::new()));
  219    217   
        builder
  220    218   
            .build()
  221    219   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  222    220   
    }
  223    221   
}
         222  +
impl BatchGetItemInput {
         223  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         224  +
    pub fn deserialize_with_response(
         225  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         226  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         227  +
        _status: u16,
         228  +
        _body: &[u8],
         229  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         230  +
        Self::deserialize(deserializer)
         231  +
    }
         232  +
}
  224    233   
impl BatchGetItemInput {
  225    234   
    /// Creates a new builder-style object to manufacture [`BatchGetItemInput`](crate::operation::batch_get_item::BatchGetItemInput).
  226    235   
    pub fn builder() -> crate::operation::batch_get_item::builders::BatchGetItemInputBuilder {
  227    236   
        crate::operation::batch_get_item::builders::BatchGetItemInputBuilder::default()
  228    237   
    }
  229    238   
}
  230    239   
  231    240   
/// A builder for [`BatchGetItemInput`](crate::operation::batch_get_item::BatchGetItemInput).
  232    241   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  233    242   
#[non_exhaustive]

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

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

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `BatchWriteItem`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct BatchWriteItem;
    6      6   
impl BatchWriteItem {
    7      7   
    /// Creates a new `BatchWriteItem`
    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::batch_write_item::BatchWriteItemInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::batch_write_item::BatchWriteItemOutput::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::batch_write_item::BatchWriteItemInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::batch_write_item::BatchWriteItemOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::batch_write_item::BatchWriteItemError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +231,396 @@
  124    128   
                crate::operation::batch_write_item::BatchWriteItemError,
  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 BatchWriteItemResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for BatchWriteItemResponseDeserializer {
  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_batch_write_item::de_batch_write_item_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::batch_write_item::BatchWriteItemError::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::batch_write_item::BatchWriteItemError::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::batch_write_item::BatchWriteItemError::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  +
                "ItemCollectionSizeLimitExceededException" => {
         220  +
                    crate::operation::batch_write_item::BatchWriteItemError::ItemCollectionSizeLimitExceededError({
         221  +
                        let mut tmp = match protocol
         222  +
                            .deserialize_response(response, crate::types::error::ItemCollectionSizeLimitExceededError::SCHEMA, _cfg)
         223  +
                            .and_then(|mut deser| {
         224  +
                                crate::types::error::ItemCollectionSizeLimitExceededError::deserialize_with_response(
         225  +
                                    &mut *deser,
         226  +
                                    response.headers(),
         227  +
                                    response.status().into(),
         228  +
                                    body,
         229  +
                                )
         230  +
                            }) {
         231  +
                            ::std::result::Result::Ok(val) => val,
         232  +
                            ::std::result::Result::Err(e) => {
         233  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         234  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         235  +
                                ))
         236  +
                            }
         237  +
                        };
         238  +
                        tmp.meta = generic;
         239  +
                        if tmp.message.is_none() {
         240  +
                            tmp.message = _error_message;
         241  +
                        }
         242  +
                        tmp
         243  +
                    })
         244  +
                }
         245  +
                "ProvisionedThroughputExceededException" => {
         246  +
                    crate::operation::batch_write_item::BatchWriteItemError::ProvisionedThroughputExceededError({
         247  +
                        let mut tmp = match protocol
         248  +
                            .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededError::SCHEMA, _cfg)
         249  +
                            .and_then(|mut deser| {
         250  +
                                crate::types::error::ProvisionedThroughputExceededError::deserialize_with_response(
         251  +
                                    &mut *deser,
         252  +
                                    response.headers(),
         253  +
                                    response.status().into(),
         254  +
                                    body,
         255  +
                                )
         256  +
                            }) {
         257  +
                            ::std::result::Result::Ok(val) => val,
         258  +
                            ::std::result::Result::Err(e) => {
         259  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         260  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         261  +
                                ))
         262  +
                            }
         263  +
                        };
         264  +
                        tmp.meta = generic;
         265  +
                        if tmp.message.is_none() {
         266  +
                            tmp.message = _error_message;
         267  +
                        }
         268  +
                        tmp
         269  +
                    })
         270  +
                }
         271  +
                "RequestLimitExceeded" => crate::operation::batch_write_item::BatchWriteItemError::RequestLimitExceeded({
         272  +
                    let mut tmp = match protocol
         273  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         274  +
                        .and_then(|mut deser| {
         275  +
                            crate::types::error::RequestLimitExceeded::deserialize_with_response(
         276  +
                                &mut *deser,
         277  +
                                response.headers(),
         278  +
                                response.status().into(),
         279  +
                                body,
         280  +
                            )
         281  +
                        }) {
         282  +
                        ::std::result::Result::Ok(val) => val,
         283  +
                        ::std::result::Result::Err(e) => {
         284  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         285  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         286  +
                            ))
         287  +
                        }
         288  +
                    };
         289  +
                    tmp.meta = generic;
         290  +
                    if tmp.message.is_none() {
         291  +
                        tmp.message = _error_message;
         292  +
                    }
         293  +
                    tmp
         294  +
                }),
         295  +
                "ResourceNotFoundException" => crate::operation::batch_write_item::BatchWriteItemError::ResourceNotFoundError({
         296  +
                    let mut tmp = match protocol
         297  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         298  +
                        .and_then(|mut deser| {
         299  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         300  +
                                &mut *deser,
         301  +
                                response.headers(),
         302  +
                                response.status().into(),
         303  +
                                body,
         304  +
                            )
         305  +
                        }) {
         306  +
                        ::std::result::Result::Ok(val) => val,
         307  +
                        ::std::result::Result::Err(e) => {
         308  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         309  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         310  +
                            ))
         311  +
                        }
         312  +
                    };
         313  +
                    tmp.meta = generic;
         314  +
                    if tmp.message.is_none() {
         315  +
                        tmp.message = _error_message;
         316  +
                    }
         317  +
                    tmp
         318  +
                }),
         319  +
                _ => crate::operation::batch_write_item::BatchWriteItemError::generic(generic),
         320  +
            };
         321  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         322  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         323  +
            ))
  146    324   
        } else {
  147         -
            crate::protocol_serde::shape_batch_write_item::de_batch_write_item_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         325  +
            let protocol = _cfg
         326  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         327  +
                .expect("a SharedClientProtocol is required");
         328  +
            let mut deser = protocol
         329  +
                .deserialize_response(response, BatchWriteItem::OUTPUT_SCHEMA, _cfg)
         330  +
                .map_err(|e| {
         331  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         332  +
                })?;
         333  +
            let body = response.body().bytes().expect("body loaded");
         334  +
            let output = crate::operation::batch_write_item::BatchWriteItemOutput::deserialize_with_response(
         335  +
                &mut *deser,
         336  +
                response.headers(),
         337  +
                response.status().into(),
         338  +
                body,
         339  +
            )
         340  +
            .map_err(|e| {
         341  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         342  +
            })?;
         343  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         344  +
        }
  150    345   
    }
  151    346   
}
  152    347   
#[derive(Debug)]
  153    348   
struct BatchWriteItemRequestSerializer;
  154    349   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for BatchWriteItemRequestSerializer {
  155    350   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    351   
    fn serialize_input(
  157    352   
        &self,
  158    353   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    354   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    355   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    356   
        let input = input
  162    357   
            .downcast::<crate::operation::batch_write_item::BatchWriteItemInput>()
  163    358   
            .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::batch_write_item::BatchWriteItemInput,
  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::batch_write_item::BatchWriteItemInput,
  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.BatchWriteItem",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_batch_write_item::ser_batch_write_item_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())
         359  +
        let protocol = _cfg
         360  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         361  +
            .expect("a SharedClientProtocol is required");
         362  +
        let mut request = protocol
         363  +
            .serialize_request(&input, BatchWriteItem::INPUT_SCHEMA, "", _cfg)
         364  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         365  +
         366  +
        return ::std::result::Result::Ok(request);
  202    367   
    }
  203    368   
}
  204    369   
#[derive(Debug)]
  205    370   
struct BatchWriteItemEndpointParamsInterceptor;
  206    371   
  207    372   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BatchWriteItemEndpointParamsInterceptor {
  208    373   
    fn name(&self) -> &'static str {
  209    374   
        "BatchWriteItemEndpointParamsInterceptor"
  210    375   
    }
  211    376