Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c

Files changed:

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

@@ -78,78 +177,230 @@
   98     98   
                    }
   99     99   
                    Ok(())
  100    100   
                },
  101    101   
            )?;
  102    102   
        }
  103    103   
        Ok(())
  104    104   
    }
  105    105   
}
  106    106   
impl NullAndEmptyHeadersClientOutput {
  107    107   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  108         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  109         -
        deserializer: &mut D,
         108  +
    pub fn deserialize(
         109  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  110    110   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  111    111   
        #[allow(unused_variables, unused_mut)]
  112    112   
        let mut builder = Self::builder();
  113    113   
        #[allow(
  114    114   
            unused_variables,
  115    115   
            unreachable_code,
  116    116   
            clippy::single_match,
  117    117   
            clippy::match_single_binding,
  118    118   
            clippy::diverging_sub_expression
  119    119   
        )]
  120         -
        deserializer.read_struct(&NULLANDEMPTYHEADERSCLIENTOUTPUT_SCHEMA, (), |_, member, deser| {
         120  +
        deserializer.read_struct(&NULLANDEMPTYHEADERSCLIENTOUTPUT_SCHEMA, &mut |member, deser| {
  121    121   
            match member.member_index() {
  122    122   
                Some(0) => {
  123    123   
                    builder.a = Some(deser.read_string(member)?);
  124    124   
                }
  125    125   
                Some(1) => {
  126    126   
                    builder.b = Some(deser.read_string(member)?);
  127    127   
                }
  128    128   
                Some(2) => {
  129         -
                    builder.c = Some({
  130         -
                        let container = if let Some(cap) = deser.container_size() {
  131         -
                            Vec::with_capacity(cap)
  132         -
                        } else {
  133         -
                            Vec::new()
  134         -
                        };
  135         -
                        deser.read_list(member, container, |mut list, deser| {
  136         -
                            list.push(deser.read_string(member)?);
  137         -
                            Ok(list)
  138         -
                        })?
  139         -
                    });
         129  +
                    builder.c = Some(deser.read_string_list(member)?);
  140    130   
                }
  141    131   
                _ => {}
  142    132   
            }
  143    133   
            Ok(())
  144    134   
        })?;
  145    135   
        Ok(builder.build())
  146    136   
    }
  147    137   
}
         138  +
impl NullAndEmptyHeadersClientOutput {
         139  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         140  +
    /// Header-bound members are read directly from headers, avoiding runtime
         141  +
    /// member iteration overhead. Body members are read via the deserializer.
         142  +
    pub fn deserialize_with_response(
         143  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         144  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         145  +
        _status: u16,
         146  +
        _body: &[u8],
         147  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         148  +
        #[allow(unused_variables, unused_mut)]
         149  +
        let mut builder = Self::builder();
         150  +
        if let Some(val) = headers.get("X-A") {
         151  +
            builder.a = Some(val.to_string());
         152  +
        }
         153  +
        if let Some(val) = headers.get("X-B") {
         154  +
            builder.b = Some(val.to_string());
         155  +
        }
         156  +
        if let Some(val) = headers.get("X-C") {
         157  +
            builder.c = {
         158  +
                let mut items = Vec::new();
         159  +
                let mut chars = val.chars().peekable();
         160  +
                while chars.peek().is_some() {
         161  +
                    // Skip whitespace
         162  +
                    while chars.peek() == Some(&' ') {
         163  +
                        chars.next();
         164  +
                    }
         165  +
                    if chars.peek() == Some(&'"') {
         166  +
                        chars.next(); // skip opening quote
         167  +
                        let mut s = String::new();
         168  +
                        while let Some(&c) = chars.peek() {
         169  +
                            if c == '\\' {
         170  +
                                chars.next();
         171  +
                                if let Some(escaped) = chars.next() {
         172  +
                                    s.push(escaped);
         173  +
                                }
         174  +
                            } else if c == '"' {
         175  +
                                chars.next();
         176  +
                                break;
         177  +
                            } else {
         178  +
                                s.push(c);
         179  +
                                chars.next();
         180  +
                            }
         181  +
                        }
         182  +
                        items.push(s);
         183  +
                    } else {
         184  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         185  +
                        let trimmed = s.trim();
         186  +
                        if !trimmed.is_empty() {
         187  +
                            items.push(trimmed.to_string());
         188  +
                        }
         189  +
                    }
         190  +
                    // Skip comma separator
         191  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         192  +
                        chars.next();
         193  +
                    }
         194  +
                }
         195  +
                Some(items)
         196  +
            };
         197  +
        }
         198  +
        Ok(builder.build())
         199  +
    }
         200  +
}
  148    201   
impl NullAndEmptyHeadersClientOutput {
  149    202   
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
  150    203   
    pub fn builder() -> crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientOutputBuilder {
  151    204   
        crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientOutputBuilder::default()
  152    205   
    }
  153    206   
}
  154    207   
  155    208   
/// A builder for [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
  156    209   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  157    210   
#[non_exhaustive]

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

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

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

@@ -45,45 +179,235 @@
   65     65   
)
   66     66   
.with_http_header("X-C");
   67     67   
static NULLANDEMPTYHEADERSSERVERINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   68     68   
    NULLANDEMPTYHEADERSSERVERINPUT_SCHEMA_ID,
   69     69   
    ::aws_smithy_schema::ShapeType::Structure,
   70     70   
    &[
   71     71   
        &NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_A,
   72     72   
        &NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_B,
   73     73   
        &NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_C,
   74     74   
    ],
   75         -
);
          75  +
)
          76  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/NullAndEmptyHeadersServer", None));
   76     77   
impl NullAndEmptyHeadersServerInput {
   77     78   
    /// The schema for this shape.
   78     79   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &NULLANDEMPTYHEADERSSERVERINPUT_SCHEMA;
   79     80   
}
   80     81   
impl ::aws_smithy_schema::serde::SerializableStruct for NullAndEmptyHeadersServerInput {
   81     82   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   82     83   
    fn serialize_members(
   83     84   
        &self,
   84     85   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   85     86   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   86     87   
        if let Some(ref val) = self.a {
   87     88   
            ser.write_string(&NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_A, val)?;
   88     89   
        }
   89     90   
        if let Some(ref val) = self.b {
   90     91   
            ser.write_string(&NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_B, val)?;
   91     92   
        }
   92     93   
        if let Some(ref val) = self.c {
   93     94   
            ser.write_list(
   94     95   
                &NULLANDEMPTYHEADERSSERVERINPUT_MEMBER_C,
   95     96   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   96     97   
                    for item in val {
   97     98   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   98     99   
                    }
   99    100   
                    Ok(())
  100    101   
                },
  101    102   
            )?;
  102    103   
        }
  103    104   
        Ok(())
  104    105   
    }
  105    106   
}
  106    107   
impl NullAndEmptyHeadersServerInput {
  107    108   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  108         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  109         -
        deserializer: &mut D,
         109  +
    pub fn deserialize(
         110  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  110    111   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  111    112   
        #[allow(unused_variables, unused_mut)]
  112    113   
        let mut builder = Self::builder();
  113    114   
        #[allow(
  114    115   
            unused_variables,
  115    116   
            unreachable_code,
  116    117   
            clippy::single_match,
  117    118   
            clippy::match_single_binding,
  118    119   
            clippy::diverging_sub_expression
  119    120   
        )]
  120         -
        deserializer.read_struct(&NULLANDEMPTYHEADERSSERVERINPUT_SCHEMA, (), |_, member, deser| {
         121  +
        deserializer.read_struct(&NULLANDEMPTYHEADERSSERVERINPUT_SCHEMA, &mut |member, deser| {
  121    122   
            match member.member_index() {
  122    123   
                Some(0) => {
  123    124   
                    builder.a = Some(deser.read_string(member)?);
  124    125   
                }
  125    126   
                Some(1) => {
  126    127   
                    builder.b = Some(deser.read_string(member)?);
  127    128   
                }
  128    129   
                Some(2) => {
  129         -
                    builder.c = Some({
  130         -
                        let container = if let Some(cap) = deser.container_size() {
  131         -
                            Vec::with_capacity(cap)
  132         -
                        } else {
  133         -
                            Vec::new()
  134         -
                        };
  135         -
                        deser.read_list(member, container, |mut list, deser| {
  136         -
                            list.push(deser.read_string(member)?);
  137         -
                            Ok(list)
  138         -
                        })?
  139         -
                    });
         130  +
                    builder.c = Some(deser.read_string_list(member)?);
  140    131   
                }
  141    132   
                _ => {}
  142    133   
            }
  143    134   
            Ok(())
  144    135   
        })?;
  145    136   
        builder
  146    137   
            .build()
  147    138   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  148    139   
    }
  149    140   
}
         141  +
impl NullAndEmptyHeadersServerInput {
         142  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         143  +
    /// Header-bound members are read directly from headers, avoiding runtime
         144  +
    /// member iteration overhead. Body members are read via the deserializer.
         145  +
    pub fn deserialize_with_response(
         146  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         147  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         148  +
        _status: u16,
         149  +
        _body: &[u8],
         150  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         151  +
        #[allow(unused_variables, unused_mut)]
         152  +
        let mut builder = Self::builder();
         153  +
        if let Some(val) = headers.get("X-A") {
         154  +
            builder.a = Some(val.to_string());
         155  +
        }
         156  +
        if let Some(val) = headers.get("X-B") {
         157  +
            builder.b = Some(val.to_string());
         158  +
        }
         159  +
        if let Some(val) = headers.get("X-C") {
         160  +
            builder.c = {
         161  +
                let mut items = Vec::new();
         162  +
                let mut chars = val.chars().peekable();
         163  +
                while chars.peek().is_some() {
         164  +
                    // Skip whitespace
         165  +
                    while chars.peek() == Some(&' ') {
         166  +
                        chars.next();
         167  +
                    }
         168  +
                    if chars.peek() == Some(&'"') {
         169  +
                        chars.next(); // skip opening quote
         170  +
                        let mut s = String::new();
         171  +
                        while let Some(&c) = chars.peek() {
         172  +
                            if c == '\\' {
         173  +
                                chars.next();
         174  +
                                if let Some(escaped) = chars.next() {
         175  +
                                    s.push(escaped);
         176  +
                                }
         177  +
                            } else if c == '"' {
         178  +
                                chars.next();
         179  +
                                break;
         180  +
                            } else {
         181  +
                                s.push(c);
         182  +
                                chars.next();
         183  +
                            }
         184  +
                        }
         185  +
                        items.push(s);
         186  +
                    } else {
         187  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         188  +
                        let trimmed = s.trim();
         189  +
                        if !trimmed.is_empty() {
         190  +
                            items.push(trimmed.to_string());
         191  +
                        }
         192  +
                    }
         193  +
                    // Skip comma separator
         194  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         195  +
                        chars.next();
         196  +
                    }
         197  +
                }
         198  +
                Some(items)
         199  +
            };
         200  +
        }
         201  +
        builder
         202  +
            .build()
         203  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         204  +
    }
         205  +
}
  150    206   
impl NullAndEmptyHeadersServerInput {
  151    207   
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
  152    208   
    pub fn builder() -> crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder {
  153    209   
        crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder::default()
  154    210   
    }
  155    211   
}
  156    212   
  157    213   
/// A builder for [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
  158    214   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  159    215   
#[non_exhaustive]

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

@@ -78,78 +177,230 @@
   98     98   
                    }
   99     99   
                    Ok(())
  100    100   
                },
  101    101   
            )?;
  102    102   
        }
  103    103   
        Ok(())
  104    104   
    }
  105    105   
}
  106    106   
impl NullAndEmptyHeadersServerOutput {
  107    107   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  108         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  109         -
        deserializer: &mut D,
         108  +
    pub fn deserialize(
         109  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  110    110   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  111    111   
        #[allow(unused_variables, unused_mut)]
  112    112   
        let mut builder = Self::builder();
  113    113   
        #[allow(
  114    114   
            unused_variables,
  115    115   
            unreachable_code,
  116    116   
            clippy::single_match,
  117    117   
            clippy::match_single_binding,
  118    118   
            clippy::diverging_sub_expression
  119    119   
        )]
  120         -
        deserializer.read_struct(&NULLANDEMPTYHEADERSSERVEROUTPUT_SCHEMA, (), |_, member, deser| {
         120  +
        deserializer.read_struct(&NULLANDEMPTYHEADERSSERVEROUTPUT_SCHEMA, &mut |member, deser| {
  121    121   
            match member.member_index() {
  122    122   
                Some(0) => {
  123    123   
                    builder.a = Some(deser.read_string(member)?);
  124    124   
                }
  125    125   
                Some(1) => {
  126    126   
                    builder.b = Some(deser.read_string(member)?);
  127    127   
                }
  128    128   
                Some(2) => {
  129         -
                    builder.c = Some({
  130         -
                        let container = if let Some(cap) = deser.container_size() {
  131         -
                            Vec::with_capacity(cap)
  132         -
                        } else {
  133         -
                            Vec::new()
  134         -
                        };
  135         -
                        deser.read_list(member, container, |mut list, deser| {
  136         -
                            list.push(deser.read_string(member)?);
  137         -
                            Ok(list)
  138         -
                        })?
  139         -
                    });
         129  +
                    builder.c = Some(deser.read_string_list(member)?);
  140    130   
                }
  141    131   
                _ => {}
  142    132   
            }
  143    133   
            Ok(())
  144    134   
        })?;
  145    135   
        Ok(builder.build())
  146    136   
    }
  147    137   
}
         138  +
impl NullAndEmptyHeadersServerOutput {
         139  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         140  +
    /// Header-bound members are read directly from headers, avoiding runtime
         141  +
    /// member iteration overhead. Body members are read via the deserializer.
         142  +
    pub fn deserialize_with_response(
         143  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         144  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         145  +
        _status: u16,
         146  +
        _body: &[u8],
         147  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         148  +
        #[allow(unused_variables, unused_mut)]
         149  +
        let mut builder = Self::builder();
         150  +
        if let Some(val) = headers.get("X-A") {
         151  +
            builder.a = Some(val.to_string());
         152  +
        }
         153  +
        if let Some(val) = headers.get("X-B") {
         154  +
            builder.b = Some(val.to_string());
         155  +
        }
         156  +
        if let Some(val) = headers.get("X-C") {
         157  +
            builder.c = {
         158  +
                let mut items = Vec::new();
         159  +
                let mut chars = val.chars().peekable();
         160  +
                while chars.peek().is_some() {
         161  +
                    // Skip whitespace
         162  +
                    while chars.peek() == Some(&' ') {
         163  +
                        chars.next();
         164  +
                    }
         165  +
                    if chars.peek() == Some(&'"') {
         166  +
                        chars.next(); // skip opening quote
         167  +
                        let mut s = String::new();
         168  +
                        while let Some(&c) = chars.peek() {
         169  +
                            if c == '\\' {
         170  +
                                chars.next();
         171  +
                                if let Some(escaped) = chars.next() {
         172  +
                                    s.push(escaped);
         173  +
                                }
         174  +
                            } else if c == '"' {
         175  +
                                chars.next();
         176  +
                                break;
         177  +
                            } else {
         178  +
                                s.push(c);
         179  +
                                chars.next();
         180  +
                            }
         181  +
                        }
         182  +
                        items.push(s);
         183  +
                    } else {
         184  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         185  +
                        let trimmed = s.trim();
         186  +
                        if !trimmed.is_empty() {
         187  +
                            items.push(trimmed.to_string());
         188  +
                        }
         189  +
                    }
         190  +
                    // Skip comma separator
         191  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         192  +
                        chars.next();
         193  +
                    }
         194  +
                }
         195  +
                Some(items)
         196  +
            };
         197  +
        }
         198  +
        Ok(builder.build())
         199  +
    }
         200  +
}
  148    201   
impl NullAndEmptyHeadersServerOutput {
  149    202   
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
  150    203   
    pub fn builder() -> crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerOutputBuilder {
  151    204   
        crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerOutputBuilder::default()
  152    205   
    }
  153    206   
}
  154    207   
  155    208   
/// A builder for [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
  156    209   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  157    210   
#[non_exhaustive]

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

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

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

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

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

@@ -1,1 +68,79 @@
   21     21   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     22   
    fn serialize_members(
   23     23   
        &self,
   24     24   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     25   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     26   
        Ok(())
   27     27   
    }
   28     28   
}
   29     29   
impl OmitsNullSerializesEmptyStringOutput {
   30     30   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          31  +
    pub fn deserialize(
          32  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     33   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     34   
        #[allow(unused_variables, unused_mut)]
   35     35   
        let mut builder = Self::builder();
   36     36   
        #[allow(
   37     37   
            unused_variables,
   38     38   
            unreachable_code,
   39     39   
            clippy::single_match,
   40     40   
            clippy::match_single_binding,
   41     41   
            clippy::diverging_sub_expression
   42     42   
        )]
   43         -
        deserializer.read_struct(&OMITSNULLSERIALIZESEMPTYSTRINGOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&OMITSNULLSERIALIZESEMPTYSTRINGOUTPUT_SCHEMA, &mut |member, deser| {
   44     44   
            match member.member_index() {
   45     45   
                _ => {}
   46     46   
            }
   47     47   
            Ok(())
   48     48   
        })?;
   49     49   
        Ok(builder.build())
   50     50   
    }
   51     51   
}
          52  +
impl OmitsNullSerializesEmptyStringOutput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Ok(Self::builder().build())
          61  +
    }
          62  +
}
   52     63   
impl OmitsNullSerializesEmptyStringOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`OmitsNullSerializesEmptyStringOutput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput).
   54     65   
    pub fn builder() -> crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringOutputBuilder {
   55     66   
        crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`OmitsNullSerializesEmptyStringOutput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput).
   60     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   61     72   
#[non_exhaustive]

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

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `OmitsSerializingEmptyLists`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct OmitsSerializingEmptyLists;
    6      6   
impl OmitsSerializingEmptyLists {
    7      7   
    /// Creates a new `OmitsSerializingEmptyLists`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          13  +
        crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +288,241 @@
  130    136   
                crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct OmitsSerializingEmptyListsResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OmitsSerializingEmptyListsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, OmitsSerializingEmptyLists::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct OmitsSerializingEmptyListsRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OmitsSerializingEmptyListsRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput>()
  169    203   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/OmitsSerializingEmptyLists").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput,
  186         -
                mut output: &mut ::std::string::String,
  187         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  189         -
                if let ::std::option::Option::Some(inner_1) = &_input.query_string_list {
  190         -
                    {
  191         -
                        for inner_2 in inner_1 {
  192         -
                            query.push_kv("StringList", &::aws_smithy_http::query::fmt_string(inner_2));
  193         -
                        }
  194         -
                    }
  195         -
                }
  196         -
                if let ::std::option::Option::Some(inner_3) = &_input.query_integer_list {
  197         -
                    {
  198         -
                        for inner_4 in inner_3 {
  199         -
                            query.push_kv("IntegerList", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
  200         -
                        }
  201         -
                    }
  202         -
                }
  203         -
                if let ::std::option::Option::Some(inner_5) = &_input.query_double_list {
  204         -
                    {
  205         -
                        for inner_6 in inner_5 {
  206         -
                            query.push_kv("DoubleList", ::aws_smithy_types::primitive::Encoder::from(*inner_6).encode());
  207         -
                        }
  208         -
                    }
  209         -
                }
  210         -
                if let ::std::option::Option::Some(inner_7) = &_input.query_boolean_list {
  211         -
                    {
  212         -
                        for inner_8 in inner_7 {
  213         -
                            query.push_kv("BooleanList", ::aws_smithy_types::primitive::Encoder::from(*inner_8).encode());
  214         -
                        }
  215         -
                    }
  216         -
                }
  217         -
                if let ::std::option::Option::Some(inner_9) = &_input.query_timestamp_list {
  218         -
                    {
  219         -
                        for inner_10 in inner_9 {
  220         -
                            query.push_kv(
  221         -
                                "TimestampList",
  222         -
                                &::aws_smithy_http::query::fmt_timestamp(inner_10, ::aws_smithy_types::date_time::Format::DateTime)?,
  223         -
                            );
  224         -
                        }
  225         -
                    }
  226         -
                }
  227         -
                if let ::std::option::Option::Some(inner_11) = &_input.query_enum_list {
  228         -
                    {
  229         -
                        for inner_12 in inner_11 {
  230         -
                            query.push_kv("EnumList", &::aws_smithy_http::query::fmt_string(inner_12.as_str()));
  231         -
                        }
  232         -
                    }
  233         -
                }
  234         -
                if let ::std::option::Option::Some(inner_13) = &_input.query_integer_enum_list {
  235         -
                    {
  236         -
                        for inner_14 in inner_13 {
  237         -
                            query.push_kv("IntegerEnumList", ::aws_smithy_types::primitive::Encoder::from(*inner_14).encode());
  238         -
                        }
  239         -
                    }
  240         -
                }
  241         -
                ::std::result::Result::Ok(())
  242         -
            }
  243         -
            #[allow(clippy::unnecessary_wraps)]
  244         -
            fn update_http_builder(
  245         -
                input: &crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput,
  246         -
                builder: ::http_1x::request::Builder,
  247         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  248         -
                let mut uri = ::std::string::String::new();
  249         -
                uri_base(input, &mut uri)?;
  250         -
                uri_query(input, &mut uri)?;
  251         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  252         -
            }
  253         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  254         -
            builder
  255         -
        };
  256         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        let mut request = protocol
         208  +
            .serialize_request(&input, OmitsSerializingEmptyLists::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  257    210   
  258         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  259    212   
    }
  260    213   
}
  261    214   
#[derive(Debug)]
  262    215   
struct OmitsSerializingEmptyListsEndpointParamsInterceptor;
  263    216   
  264    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OmitsSerializingEmptyListsEndpointParamsInterceptor {
  265    218   
    fn name(&self) -> &'static str {
  266    219   
        "OmitsSerializingEmptyListsEndpointParamsInterceptor"
  267    220   
    }
  268    221   

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

@@ -47,47 +189,190 @@
   67     67   
    "aws.protocoltests.restjson.synthetic",
   68     68   
    "OmitsSerializingEmptyListsInput",
   69     69   
);
   70     70   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   71     71   
    ::aws_smithy_schema::ShapeId::from_static(
   72     72   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryStringList",
   73     73   
        "aws.protocoltests.restjson.synthetic",
   74     74   
        "OmitsSerializingEmptyListsInput",
   75     75   
    ),
   76     76   
    ::aws_smithy_schema::ShapeType::List,
   77         -
    "query_string_list",
          77  +
    "queryStringList",
   78     78   
    0,
   79     79   
)
   80     80   
.with_http_query("StringList");
   81     81   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   82     82   
    ::aws_smithy_schema::ShapeId::from_static(
   83     83   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryIntegerList",
   84     84   
        "aws.protocoltests.restjson.synthetic",
   85     85   
        "OmitsSerializingEmptyListsInput",
   86     86   
    ),
   87     87   
    ::aws_smithy_schema::ShapeType::List,
   88         -
    "query_integer_list",
          88  +
    "queryIntegerList",
   89     89   
    1,
   90     90   
)
   91     91   
.with_http_query("IntegerList");
   92     92   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_DOUBLE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   93     93   
    ::aws_smithy_schema::ShapeId::from_static(
   94     94   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryDoubleList",
   95     95   
        "aws.protocoltests.restjson.synthetic",
   96     96   
        "OmitsSerializingEmptyListsInput",
   97     97   
    ),
   98     98   
    ::aws_smithy_schema::ShapeType::List,
   99         -
    "query_double_list",
          99  +
    "queryDoubleList",
  100    100   
    2,
  101    101   
)
  102    102   
.with_http_query("DoubleList");
  103    103   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  104    104   
    ::aws_smithy_schema::ShapeId::from_static(
  105    105   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryBooleanList",
  106    106   
        "aws.protocoltests.restjson.synthetic",
  107    107   
        "OmitsSerializingEmptyListsInput",
  108    108   
    ),
  109    109   
    ::aws_smithy_schema::ShapeType::List,
  110         -
    "query_boolean_list",
         110  +
    "queryBooleanList",
  111    111   
    3,
  112    112   
)
  113    113   
.with_http_query("BooleanList");
  114    114   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  115    115   
    ::aws_smithy_schema::ShapeId::from_static(
  116    116   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryTimestampList",
  117    117   
        "aws.protocoltests.restjson.synthetic",
  118    118   
        "OmitsSerializingEmptyListsInput",
  119    119   
    ),
  120    120   
    ::aws_smithy_schema::ShapeType::List,
  121         -
    "query_timestamp_list",
         121  +
    "queryTimestampList",
  122    122   
    4,
  123    123   
)
  124    124   
.with_http_query("TimestampList");
  125    125   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  126    126   
    ::aws_smithy_schema::ShapeId::from_static(
  127    127   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryEnumList",
  128    128   
        "aws.protocoltests.restjson.synthetic",
  129    129   
        "OmitsSerializingEmptyListsInput",
  130    130   
    ),
  131    131   
    ::aws_smithy_schema::ShapeType::List,
  132         -
    "query_enum_list",
         132  +
    "queryEnumList",
  133    133   
    5,
  134    134   
)
  135    135   
.with_http_query("EnumList");
  136    136   
static OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_INTEGER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "aws.protocoltests.restjson.synthetic#OmitsSerializingEmptyListsInput$queryIntegerEnumList",
  139    139   
        "aws.protocoltests.restjson.synthetic",
  140    140   
        "OmitsSerializingEmptyListsInput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::List,
  143         -
    "query_integer_enum_list",
         143  +
    "queryIntegerEnumList",
  144    144   
    6,
  145    145   
)
  146    146   
.with_http_query("IntegerEnumList");
  147    147   
static OMITSSERIALIZINGEMPTYLISTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  148    148   
    OMITSSERIALIZINGEMPTYLISTSINPUT_SCHEMA_ID,
  149    149   
    ::aws_smithy_schema::ShapeType::Structure,
  150    150   
    &[
  151    151   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_STRING_LIST,
  152    152   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_INTEGER_LIST,
  153    153   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_DOUBLE_LIST,
  154    154   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_BOOLEAN_LIST,
  155    155   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_TIMESTAMP_LIST,
  156    156   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_ENUM_LIST,
  157    157   
        &OMITSSERIALIZINGEMPTYLISTSINPUT_MEMBER_QUERY_INTEGER_ENUM_LIST,
  158    158   
    ],
  159         -
);
         159  +
)
         160  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/OmitsSerializingEmptyLists", None));
  160    161   
impl OmitsSerializingEmptyListsInput {
  161    162   
    /// The schema for this shape.
  162    163   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &OMITSSERIALIZINGEMPTYLISTSINPUT_SCHEMA;
  163    164   
}
  164    165   
impl ::aws_smithy_schema::serde::SerializableStruct for OmitsSerializingEmptyListsInput {
  165    166   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  166    167   
    fn serialize_members(
  167    168   
        &self,
  168    169   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  169    170   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -222,223 +395,365 @@
  242    243   
                    }
  243    244   
                    Ok(())
  244    245   
                },
  245    246   
            )?;
  246    247   
        }
  247    248   
        Ok(())
  248    249   
    }
  249    250   
}
  250    251   
impl OmitsSerializingEmptyListsInput {
  251    252   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  252         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  253         -
        deserializer: &mut D,
         253  +
    pub fn deserialize(
         254  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  254    255   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  255    256   
        #[allow(unused_variables, unused_mut)]
  256    257   
        let mut builder = Self::builder();
  257    258   
        #[allow(
  258    259   
            unused_variables,
  259    260   
            unreachable_code,
  260    261   
            clippy::single_match,
  261    262   
            clippy::match_single_binding,
  262    263   
            clippy::diverging_sub_expression
  263    264   
        )]
  264         -
        deserializer.read_struct(&OMITSSERIALIZINGEMPTYLISTSINPUT_SCHEMA, (), |_, member, deser| {
         265  +
        deserializer.read_struct(&OMITSSERIALIZINGEMPTYLISTSINPUT_SCHEMA, &mut |member, deser| {
  265    266   
            match member.member_index() {
  266    267   
                Some(0) => {
  267         -
                    builder.query_string_list = Some({
  268         -
                        let container = if let Some(cap) = deser.container_size() {
  269         -
                            Vec::with_capacity(cap)
  270         -
                        } else {
  271         -
                            Vec::new()
  272         -
                        };
  273         -
                        deser.read_list(member, container, |mut list, deser| {
  274         -
                            list.push(deser.read_string(member)?);
  275         -
                            Ok(list)
  276         -
                        })?
  277         -
                    });
         268  +
                    builder.query_string_list = Some(deser.read_string_list(member)?);
  278    269   
                }
  279    270   
                Some(1) => {
  280         -
                    builder.query_integer_list = Some({
  281         -
                        let container = if let Some(cap) = deser.container_size() {
  282         -
                            Vec::with_capacity(cap)
  283         -
                        } else {
  284         -
                            Vec::new()
  285         -
                        };
  286         -
                        deser.read_list(member, container, |mut list, deser| {
  287         -
                            list.push(deser.read_integer(member)?);
  288         -
                            Ok(list)
  289         -
                        })?
  290         -
                    });
         271  +
                    builder.query_integer_list = Some(deser.read_integer_list(member)?);
  291    272   
                }
  292    273   
                Some(2) => {
  293    274   
                    builder.query_double_list = Some({
  294         -
                        let container = if let Some(cap) = deser.container_size() {
  295         -
                            Vec::with_capacity(cap)
  296         -
                        } else {
  297         -
                            Vec::new()
  298         -
                        };
  299         -
                        deser.read_list(member, container, |mut list, deser| {
  300         -
                            list.push(deser.read_double(member)?);
  301         -
                            Ok(list)
  302         -
                        })?
         275  +
                        let mut container = Vec::new();
         276  +
                        deser.read_list(member, &mut |deser| {
         277  +
                            container.push(deser.read_double(member)?);
         278  +
                            Ok(())
         279  +
                        })?;
         280  +
                        container
  303    281   
                    });
  304    282   
                }
  305    283   
                Some(3) => {
  306    284   
                    builder.query_boolean_list = Some({
  307         -
                        let container = if let Some(cap) = deser.container_size() {
  308         -
                            Vec::with_capacity(cap)
  309         -
                        } else {
  310         -
                            Vec::new()
  311         -
                        };
  312         -
                        deser.read_list(member, container, |mut list, deser| {
  313         -
                            list.push(deser.read_boolean(member)?);
  314         -
                            Ok(list)
  315         -
                        })?
         285  +
                        let mut container = Vec::new();
         286  +
                        deser.read_list(member, &mut |deser| {
         287  +
                            container.push(deser.read_boolean(member)?);
         288  +
                            Ok(())
         289  +
                        })?;
         290  +
                        container
  316    291   
                    });
  317    292   
                }
  318    293   
                Some(4) => {
  319    294   
                    builder.query_timestamp_list = Some({
  320         -
                        let container = if let Some(cap) = deser.container_size() {
  321         -
                            Vec::with_capacity(cap)
  322         -
                        } else {
  323         -
                            Vec::new()
  324         -
                        };
  325         -
                        deser.read_list(member, container, |mut list, deser| {
  326         -
                            list.push(deser.read_timestamp(member)?);
  327         -
                            Ok(list)
  328         -
                        })?
         295  +
                        let mut container = Vec::new();
         296  +
                        deser.read_list(member, &mut |deser| {
         297  +
                            container.push(deser.read_timestamp(member)?);
         298  +
                            Ok(())
         299  +
                        })?;
         300  +
                        container
  329    301   
                    });
  330    302   
                }
  331    303   
                Some(5) => {
  332    304   
                    builder.query_enum_list = Some({
  333         -
                        let container = if let Some(cap) = deser.container_size() {
  334         -
                            Vec::with_capacity(cap)
  335         -
                        } else {
  336         -
                            Vec::new()
  337         -
                        };
  338         -
                        deser.read_list(member, container, |mut list, deser| {
  339         -
                            list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
  340         -
                            Ok(list)
  341         -
                        })?
         305  +
                        let mut container = Vec::new();
         306  +
                        deser.read_list(member, &mut |deser| {
         307  +
                            container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
         308  +
                            Ok(())
         309  +
                        })?;
         310  +
                        container
  342    311   
                    });
  343    312   
                }
  344    313   
                Some(6) => {
  345         -
                    builder.query_integer_enum_list = Some({
  346         -
                        let container = if let Some(cap) = deser.container_size() {
  347         -
                            Vec::with_capacity(cap)
  348         -
                        } else {
  349         -
                            Vec::new()
  350         -
                        };
  351         -
                        deser.read_list(member, container, |mut list, deser| {
  352         -
                            list.push(deser.read_integer(member)?);
  353         -
                            Ok(list)
  354         -
                        })?
  355         -
                    });
         314  +
                    builder.query_integer_enum_list = Some(deser.read_integer_list(member)?);
  356    315   
                }
  357    316   
                _ => {}
  358    317   
            }
  359    318   
            Ok(())
  360    319   
        })?;
  361    320   
        builder
  362    321   
            .build()
  363    322   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  364    323   
    }
  365    324   
}
         325  +
impl OmitsSerializingEmptyListsInput {
         326  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         327  +
    pub fn deserialize_with_response(
         328  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         329  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         330  +
        _status: u16,
         331  +
        _body: &[u8],
         332  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         333  +
        Self::deserialize(deserializer)
         334  +
    }
         335  +
}
  366    336   
impl OmitsSerializingEmptyListsInput {
  367    337   
    /// Creates a new builder-style object to manufacture [`OmitsSerializingEmptyListsInput`](crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput).
  368    338   
    pub fn builder() -> crate::operation::omits_serializing_empty_lists::builders::OmitsSerializingEmptyListsInputBuilder {
  369    339   
        crate::operation::omits_serializing_empty_lists::builders::OmitsSerializingEmptyListsInputBuilder::default()
  370    340   
    }
  371    341   
}
  372    342   
  373    343   
/// A builder for [`OmitsSerializingEmptyListsInput`](crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsInput).
  374    344   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  375    345   
#[non_exhaustive]

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

@@ -1,1 +65,76 @@
   18     18   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     19   
    fn serialize_members(
   20     20   
        &self,
   21     21   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     22   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     23   
        Ok(())
   24     24   
    }
   25     25   
}
   26     26   
impl OmitsSerializingEmptyListsOutput {
   27     27   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          28  +
    pub fn deserialize(
          29  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     30   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     31   
        #[allow(unused_variables, unused_mut)]
   32     32   
        let mut builder = Self::builder();
   33     33   
        #[allow(
   34     34   
            unused_variables,
   35     35   
            unreachable_code,
   36     36   
            clippy::single_match,
   37     37   
            clippy::match_single_binding,
   38     38   
            clippy::diverging_sub_expression
   39     39   
        )]
   40         -
        deserializer.read_struct(&OMITSSERIALIZINGEMPTYLISTSOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&OMITSSERIALIZINGEMPTYLISTSOUTPUT_SCHEMA, &mut |member, deser| {
   41     41   
            match member.member_index() {
   42     42   
                _ => {}
   43     43   
            }
   44     44   
            Ok(())
   45     45   
        })?;
   46     46   
        Ok(builder.build())
   47     47   
    }
   48     48   
}
          49  +
impl OmitsSerializingEmptyListsOutput {
          50  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          51  +
    pub fn deserialize_with_response(
          52  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          53  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          54  +
        _status: u16,
          55  +
        _body: &[u8],
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        Ok(Self::builder().build())
          58  +
    }
          59  +
}
   49     60   
impl OmitsSerializingEmptyListsOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`OmitsSerializingEmptyListsOutput`](crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsOutput).
   51     62   
    pub fn builder() -> crate::operation::omits_serializing_empty_lists::builders::OmitsSerializingEmptyListsOutputBuilder {
   52     63   
        crate::operation::omits_serializing_empty_lists::builders::OmitsSerializingEmptyListsOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`OmitsSerializingEmptyListsOutput`](crate::operation::omits_serializing_empty_lists::OmitsSerializingEmptyListsOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/operation_with_defaults.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 `OperationWithDefaults`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct OperationWithDefaults;
    6      6   
impl OperationWithDefaults {
    7      7   
    /// Creates a new `OperationWithDefaults`
    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::operation_with_defaults::OperationWithDefaultsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::operation_with_defaults::OperationWithDefaultsOutput::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::operation_with_defaults::OperationWithDefaultsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::operation_with_defaults::OperationWithDefaultsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +234,239 @@
  130    134   
                crate::operation::operation_with_defaults::OperationWithDefaultsError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct OperationWithDefaultsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OperationWithDefaultsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::operation_with_defaults::OperationWithDefaultsError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, OperationWithDefaults::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::operation_with_defaults::OperationWithDefaultsOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct OperationWithDefaultsRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OperationWithDefaultsRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/OperationWithDefaults").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_input(
  198         -
            &input,
  199         -
        )?);
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203         -
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, OperationWithDefaults::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  205    210   
    }
  206    211   
}
  207    212   
#[derive(Debug)]
  208    213   
struct OperationWithDefaultsEndpointParamsInterceptor;
  209    214   
  210    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithDefaultsEndpointParamsInterceptor {
  211    216   
    fn name(&self) -> &'static str {
  212    217   
        "OperationWithDefaultsEndpointParamsInterceptor"
  213    218   
    }
  214    219   
@@ -521,526 +581,596 @@
  541    546   
            .expect("the config must have a deserializer");
  542    547   
  543    548   
        let parsed = de.deserialize_streaming(&mut http_response);
  544    549   
        let parsed = parsed.unwrap_or_else(|| {
  545    550   
            let http_response = http_response.map(|body| {
  546    551   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  547    552   
                    body.bytes().unwrap(),
  548    553   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  549    554   
                )))
  550    555   
            });
  551         -
            de.deserialize_nonstreaming(&http_response)
         556  +
            // Build a config bag with the protocol for schema-based deserialization
         557  +
            #[allow(unused_mut)]
         558  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         559  +
            {
         560  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         561  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         562  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         563  +
                ));
         564  +
                test_cfg.push_shared_layer(layer.freeze());
         565  +
            }
         566  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  552    567   
        });
  553    568   
        let parsed = parsed
  554    569   
            .expect("should be successful response")
  555    570   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsOutput>()
  556    571   
            .unwrap();
  557    572   
        ::pretty_assertions::assert_eq!(
  558    573   
            parsed.default_string,
  559    574   
            expected_output.default_string,
  560    575   
            "Unexpected value for `default_string`"
  561    576   
        );
@@ -713,728 +773,798 @@
  733    748   
            .expect("the config must have a deserializer");
  734    749   
  735    750   
        let parsed = de.deserialize_streaming(&mut http_response);
  736    751   
        let parsed = parsed.unwrap_or_else(|| {
  737    752   
            let http_response = http_response.map(|body| {
  738    753   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  739    754   
                    body.bytes().unwrap(),
  740    755   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  741    756   
                )))
  742    757   
            });
  743         -
            de.deserialize_nonstreaming(&http_response)
         758  +
            // Build a config bag with the protocol for schema-based deserialization
         759  +
            #[allow(unused_mut)]
         760  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         761  +
            {
         762  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         763  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         764  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         765  +
                ));
         766  +
                test_cfg.push_shared_layer(layer.freeze());
         767  +
            }
         768  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  744    769   
        });
  745    770   
        let parsed = parsed
  746    771   
            .expect("should be successful response")
  747    772   
            .downcast::<crate::operation::operation_with_defaults::OperationWithDefaultsOutput>()
  748    773   
            .unwrap();
  749    774   
        ::pretty_assertions::assert_eq!(
  750    775   
            parsed.default_string,
  751    776   
            expected_output.default_string,
  752    777   
            "Unexpected value for `default_string`"
  753    778   
        );

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

@@ -25,25 +179,191 @@
   45     45   
    "defaults",
   46     46   
    0,
   47     47   
);
   48     48   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   49     49   
    ::aws_smithy_schema::ShapeId::from_static(
   50     50   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsInput$clientOptionalDefaults",
   51     51   
        "aws.protocoltests.restjson.synthetic",
   52     52   
        "OperationWithDefaultsInput",
   53     53   
    ),
   54     54   
    ::aws_smithy_schema::ShapeType::Structure,
   55         -
    "client_optional_defaults",
          55  +
    "clientOptionalDefaults",
   56     56   
    1,
   57     57   
);
   58     58   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   59     59   
    ::aws_smithy_schema::ShapeId::from_static(
   60     60   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsInput$topLevelDefault",
   61     61   
        "aws.protocoltests.restjson.synthetic",
   62     62   
        "OperationWithDefaultsInput",
   63     63   
    ),
   64     64   
    ::aws_smithy_schema::ShapeType::String,
   65         -
    "top_level_default",
          65  +
    "topLevelDefault",
   66     66   
    2,
   67     67   
);
   68     68   
static OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   69     69   
    ::aws_smithy_schema::ShapeId::from_static(
   70     70   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsInput$otherTopLevelDefault",
   71     71   
        "aws.protocoltests.restjson.synthetic",
   72     72   
        "OperationWithDefaultsInput",
   73     73   
    ),
   74     74   
    ::aws_smithy_schema::ShapeType::Integer,
   75         -
    "other_top_level_default",
          75  +
    "otherTopLevelDefault",
   76     76   
    3,
   77     77   
);
   78     78   
static OPERATIONWITHDEFAULTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   79     79   
    OPERATIONWITHDEFAULTSINPUT_SCHEMA_ID,
   80     80   
    ::aws_smithy_schema::ShapeType::Structure,
   81     81   
    &[
   82     82   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_DEFAULTS,
   83     83   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS,
   84     84   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT,
   85     85   
        &OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT,
   86     86   
    ],
   87         -
);
          87  +
)
          88  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/OperationWithDefaults", None));
   88     89   
impl OperationWithDefaultsInput {
   89     90   
    /// The schema for this shape.
   90     91   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &OPERATIONWITHDEFAULTSINPUT_SCHEMA;
   91     92   
}
   92     93   
impl ::aws_smithy_schema::serde::SerializableStruct for OperationWithDefaultsInput {
   93     94   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   94     95   
    fn serialize_members(
   95     96   
        &self,
   96     97   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   97     98   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   98     99   
        if let Some(ref val) = self.defaults {
   99    100   
            ser.write_struct(&OPERATIONWITHDEFAULTSINPUT_MEMBER_DEFAULTS, val)?;
  100    101   
        }
  101    102   
        if let Some(ref val) = self.client_optional_defaults {
  102    103   
            ser.write_struct(&OPERATIONWITHDEFAULTSINPUT_MEMBER_CLIENT_OPTIONAL_DEFAULTS, val)?;
  103    104   
        }
  104    105   
        if let Some(ref val) = self.top_level_default {
  105    106   
            ser.write_string(&OPERATIONWITHDEFAULTSINPUT_MEMBER_TOP_LEVEL_DEFAULT, val)?;
  106    107   
        }
  107    108   
        if let Some(ref val) = self.other_top_level_default {
  108    109   
            ser.write_integer(&OPERATIONWITHDEFAULTSINPUT_MEMBER_OTHER_TOP_LEVEL_DEFAULT, *val)?;
  109    110   
        }
  110    111   
        Ok(())
  111    112   
    }
  112    113   
}
  113    114   
impl OperationWithDefaultsInput {
  114    115   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  115         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  116         -
        deserializer: &mut D,
         116  +
    pub fn deserialize(
         117  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  117    118   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  118    119   
        #[allow(unused_variables, unused_mut)]
  119    120   
        let mut builder = Self::builder();
  120    121   
        #[allow(
  121    122   
            unused_variables,
  122    123   
            unreachable_code,
  123    124   
            clippy::single_match,
  124    125   
            clippy::match_single_binding,
  125    126   
            clippy::diverging_sub_expression
  126    127   
        )]
  127         -
        deserializer.read_struct(&OPERATIONWITHDEFAULTSINPUT_SCHEMA, (), |_, member, deser| {
         128  +
        deserializer.read_struct(&OPERATIONWITHDEFAULTSINPUT_SCHEMA, &mut |member, deser| {
  128    129   
            match member.member_index() {
  129    130   
                Some(0) => {
  130    131   
                    builder.defaults = Some(crate::types::Defaults::deserialize(deser)?);
  131    132   
                }
  132    133   
                Some(1) => {
  133    134   
                    builder.client_optional_defaults = Some(crate::types::ClientOptionalDefaults::deserialize(deser)?);
  134    135   
                }
  135    136   
                Some(2) => {
  136    137   
                    builder.top_level_default = Some(deser.read_string(member)?);
  137    138   
                }
  138    139   
                Some(3) => {
  139    140   
                    builder.other_top_level_default = Some(deser.read_integer(member)?);
  140    141   
                }
  141    142   
                _ => {}
  142    143   
            }
  143    144   
            Ok(())
  144    145   
        })?;
  145    146   
        builder
  146    147   
            .build()
  147    148   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  148    149   
    }
  149    150   
}
         151  +
impl OperationWithDefaultsInput {
         152  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         153  +
    pub fn deserialize_with_response(
         154  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         155  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         156  +
        _status: u16,
         157  +
        _body: &[u8],
         158  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         159  +
        Self::deserialize(deserializer)
         160  +
    }
         161  +
}
  150    162   
impl OperationWithDefaultsInput {
  151    163   
    /// Creates a new builder-style object to manufacture [`OperationWithDefaultsInput`](crate::operation::operation_with_defaults::OperationWithDefaultsInput).
  152    164   
    pub fn builder() -> crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder {
  153    165   
        crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder::default()
  154    166   
    }
  155    167   
}
  156    168   
  157    169   
/// A builder for [`OperationWithDefaultsInput`](crate::operation::operation_with_defaults::OperationWithDefaultsInput).
  158    170   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  159    171   
#[non_exhaustive]

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

@@ -162,162 +492,492 @@
  182    182   
    "aws.protocoltests.restjson.synthetic",
  183    183   
    "OperationWithDefaultsOutput",
  184    184   
);
  185    185   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  186    186   
    ::aws_smithy_schema::ShapeId::from_static(
  187    187   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultString",
  188    188   
        "aws.protocoltests.restjson.synthetic",
  189    189   
        "OperationWithDefaultsOutput",
  190    190   
    ),
  191    191   
    ::aws_smithy_schema::ShapeType::String,
  192         -
    "default_string",
         192  +
    "defaultString",
  193    193   
    0,
  194    194   
);
  195    195   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  196    196   
    ::aws_smithy_schema::ShapeId::from_static(
  197    197   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultBoolean",
  198    198   
        "aws.protocoltests.restjson.synthetic",
  199    199   
        "OperationWithDefaultsOutput",
  200    200   
    ),
  201    201   
    ::aws_smithy_schema::ShapeType::Boolean,
  202         -
    "default_boolean",
         202  +
    "defaultBoolean",
  203    203   
    1,
  204    204   
);
  205    205   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  206    206   
    ::aws_smithy_schema::ShapeId::from_static(
  207    207   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultList",
  208    208   
        "aws.protocoltests.restjson.synthetic",
  209    209   
        "OperationWithDefaultsOutput",
  210    210   
    ),
  211    211   
    ::aws_smithy_schema::ShapeType::List,
  212         -
    "default_list",
         212  +
    "defaultList",
  213    213   
    2,
  214    214   
);
  215    215   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  216    216   
    ::aws_smithy_schema::ShapeId::from_static(
  217    217   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultDocumentMap",
  218    218   
        "aws.protocoltests.restjson.synthetic",
  219    219   
        "OperationWithDefaultsOutput",
  220    220   
    ),
  221    221   
    ::aws_smithy_schema::ShapeType::Document,
  222         -
    "default_document_map",
         222  +
    "defaultDocumentMap",
  223    223   
    3,
  224    224   
);
  225    225   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  226    226   
    ::aws_smithy_schema::ShapeId::from_static(
  227    227   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultDocumentString",
  228    228   
        "aws.protocoltests.restjson.synthetic",
  229    229   
        "OperationWithDefaultsOutput",
  230    230   
    ),
  231    231   
    ::aws_smithy_schema::ShapeType::Document,
  232         -
    "default_document_string",
         232  +
    "defaultDocumentString",
  233    233   
    4,
  234    234   
);
  235    235   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  236    236   
    ::aws_smithy_schema::ShapeId::from_static(
  237    237   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultDocumentBoolean",
  238    238   
        "aws.protocoltests.restjson.synthetic",
  239    239   
        "OperationWithDefaultsOutput",
  240    240   
    ),
  241    241   
    ::aws_smithy_schema::ShapeType::Document,
  242         -
    "default_document_boolean",
         242  +
    "defaultDocumentBoolean",
  243    243   
    5,
  244    244   
);
  245    245   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  246    246   
    ::aws_smithy_schema::ShapeId::from_static(
  247    247   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultDocumentList",
  248    248   
        "aws.protocoltests.restjson.synthetic",
  249    249   
        "OperationWithDefaultsOutput",
  250    250   
    ),
  251    251   
    ::aws_smithy_schema::ShapeType::Document,
  252         -
    "default_document_list",
         252  +
    "defaultDocumentList",
  253    253   
    6,
  254    254   
);
  255    255   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_NULL_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  256    256   
    ::aws_smithy_schema::ShapeId::from_static(
  257    257   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultNullDocument",
  258    258   
        "aws.protocoltests.restjson.synthetic",
  259    259   
        "OperationWithDefaultsOutput",
  260    260   
    ),
  261    261   
    ::aws_smithy_schema::ShapeType::Document,
  262         -
    "default_null_document",
         262  +
    "defaultNullDocument",
  263    263   
    7,
  264    264   
);
  265    265   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  266    266   
    ::aws_smithy_schema::ShapeId::from_static(
  267    267   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultTimestamp",
  268    268   
        "aws.protocoltests.restjson.synthetic",
  269    269   
        "OperationWithDefaultsOutput",
  270    270   
    ),
  271    271   
    ::aws_smithy_schema::ShapeType::Timestamp,
  272         -
    "default_timestamp",
         272  +
    "defaultTimestamp",
  273    273   
    8,
  274    274   
);
  275    275   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  276    276   
    ::aws_smithy_schema::ShapeId::from_static(
  277    277   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultBlob",
  278    278   
        "aws.protocoltests.restjson.synthetic",
  279    279   
        "OperationWithDefaultsOutput",
  280    280   
    ),
  281    281   
    ::aws_smithy_schema::ShapeType::Blob,
  282         -
    "default_blob",
         282  +
    "defaultBlob",
  283    283   
    9,
  284    284   
);
  285    285   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  286    286   
    ::aws_smithy_schema::ShapeId::from_static(
  287    287   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultByte",
  288    288   
        "aws.protocoltests.restjson.synthetic",
  289    289   
        "OperationWithDefaultsOutput",
  290    290   
    ),
  291    291   
    ::aws_smithy_schema::ShapeType::Byte,
  292         -
    "default_byte",
         292  +
    "defaultByte",
  293    293   
    10,
  294    294   
);
  295    295   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  296    296   
    ::aws_smithy_schema::ShapeId::from_static(
  297    297   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultShort",
  298    298   
        "aws.protocoltests.restjson.synthetic",
  299    299   
        "OperationWithDefaultsOutput",
  300    300   
    ),
  301    301   
    ::aws_smithy_schema::ShapeType::Short,
  302         -
    "default_short",
         302  +
    "defaultShort",
  303    303   
    11,
  304    304   
);
  305    305   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  306    306   
    ::aws_smithy_schema::ShapeId::from_static(
  307    307   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultInteger",
  308    308   
        "aws.protocoltests.restjson.synthetic",
  309    309   
        "OperationWithDefaultsOutput",
  310    310   
    ),
  311    311   
    ::aws_smithy_schema::ShapeType::Integer,
  312         -
    "default_integer",
         312  +
    "defaultInteger",
  313    313   
    12,
  314    314   
);
  315    315   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  316    316   
    ::aws_smithy_schema::ShapeId::from_static(
  317    317   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultLong",
  318    318   
        "aws.protocoltests.restjson.synthetic",
  319    319   
        "OperationWithDefaultsOutput",
  320    320   
    ),
  321    321   
    ::aws_smithy_schema::ShapeType::Long,
  322         -
    "default_long",
         322  +
    "defaultLong",
  323    323   
    13,
  324    324   
);
  325    325   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  326    326   
    ::aws_smithy_schema::ShapeId::from_static(
  327    327   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultFloat",
  328    328   
        "aws.protocoltests.restjson.synthetic",
  329    329   
        "OperationWithDefaultsOutput",
  330    330   
    ),
  331    331   
    ::aws_smithy_schema::ShapeType::Float,
  332         -
    "default_float",
         332  +
    "defaultFloat",
  333    333   
    14,
  334    334   
);
  335    335   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  336    336   
    ::aws_smithy_schema::ShapeId::from_static(
  337    337   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultDouble",
  338    338   
        "aws.protocoltests.restjson.synthetic",
  339    339   
        "OperationWithDefaultsOutput",
  340    340   
    ),
  341    341   
    ::aws_smithy_schema::ShapeType::Double,
  342         -
    "default_double",
         342  +
    "defaultDouble",
  343    343   
    15,
  344    344   
);
  345    345   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  346    346   
    ::aws_smithy_schema::ShapeId::from_static(
  347    347   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultMap",
  348    348   
        "aws.protocoltests.restjson.synthetic",
  349    349   
        "OperationWithDefaultsOutput",
  350    350   
    ),
  351    351   
    ::aws_smithy_schema::ShapeType::Map,
  352         -
    "default_map",
         352  +
    "defaultMap",
  353    353   
    16,
  354    354   
);
  355    355   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  356    356   
    ::aws_smithy_schema::ShapeId::from_static(
  357    357   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultEnum",
  358    358   
        "aws.protocoltests.restjson.synthetic",
  359    359   
        "OperationWithDefaultsOutput",
  360    360   
    ),
  361    361   
    ::aws_smithy_schema::ShapeType::String,
  362         -
    "default_enum",
         362  +
    "defaultEnum",
  363    363   
    17,
  364    364   
);
  365    365   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_INT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  366    366   
    ::aws_smithy_schema::ShapeId::from_static(
  367    367   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$defaultIntEnum",
  368    368   
        "aws.protocoltests.restjson.synthetic",
  369    369   
        "OperationWithDefaultsOutput",
  370    370   
    ),
  371    371   
    ::aws_smithy_schema::ShapeType::Integer,
  372         -
    "default_int_enum",
         372  +
    "defaultIntEnum",
  373    373   
    18,
  374    374   
);
  375    375   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_EMPTY_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  376    376   
    ::aws_smithy_schema::ShapeId::from_static(
  377    377   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$emptyString",
  378    378   
        "aws.protocoltests.restjson.synthetic",
  379    379   
        "OperationWithDefaultsOutput",
  380    380   
    ),
  381    381   
    ::aws_smithy_schema::ShapeType::String,
  382         -
    "empty_string",
         382  +
    "emptyString",
  383    383   
    19,
  384    384   
);
  385    385   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_FALSE_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  386    386   
    ::aws_smithy_schema::ShapeId::from_static(
  387    387   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$falseBoolean",
  388    388   
        "aws.protocoltests.restjson.synthetic",
  389    389   
        "OperationWithDefaultsOutput",
  390    390   
    ),
  391    391   
    ::aws_smithy_schema::ShapeType::Boolean,
  392         -
    "false_boolean",
         392  +
    "falseBoolean",
  393    393   
    20,
  394    394   
);
  395    395   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_EMPTY_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  396    396   
    ::aws_smithy_schema::ShapeId::from_static(
  397    397   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$emptyBlob",
  398    398   
        "aws.protocoltests.restjson.synthetic",
  399    399   
        "OperationWithDefaultsOutput",
  400    400   
    ),
  401    401   
    ::aws_smithy_schema::ShapeType::Blob,
  402         -
    "empty_blob",
         402  +
    "emptyBlob",
  403    403   
    21,
  404    404   
);
  405    405   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  406    406   
    ::aws_smithy_schema::ShapeId::from_static(
  407    407   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroByte",
  408    408   
        "aws.protocoltests.restjson.synthetic",
  409    409   
        "OperationWithDefaultsOutput",
  410    410   
    ),
  411    411   
    ::aws_smithy_schema::ShapeType::Byte,
  412         -
    "zero_byte",
         412  +
    "zeroByte",
  413    413   
    22,
  414    414   
);
  415    415   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  416    416   
    ::aws_smithy_schema::ShapeId::from_static(
  417    417   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroShort",
  418    418   
        "aws.protocoltests.restjson.synthetic",
  419    419   
        "OperationWithDefaultsOutput",
  420    420   
    ),
  421    421   
    ::aws_smithy_schema::ShapeType::Short,
  422         -
    "zero_short",
         422  +
    "zeroShort",
  423    423   
    23,
  424    424   
);
  425    425   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  426    426   
    ::aws_smithy_schema::ShapeId::from_static(
  427    427   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroInteger",
  428    428   
        "aws.protocoltests.restjson.synthetic",
  429    429   
        "OperationWithDefaultsOutput",
  430    430   
    ),
  431    431   
    ::aws_smithy_schema::ShapeType::Integer,
  432         -
    "zero_integer",
         432  +
    "zeroInteger",
  433    433   
    24,
  434    434   
);
  435    435   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  436    436   
    ::aws_smithy_schema::ShapeId::from_static(
  437    437   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroLong",
  438    438   
        "aws.protocoltests.restjson.synthetic",
  439    439   
        "OperationWithDefaultsOutput",
  440    440   
    ),
  441    441   
    ::aws_smithy_schema::ShapeType::Long,
  442         -
    "zero_long",
         442  +
    "zeroLong",
  443    443   
    25,
  444    444   
);
  445    445   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  446    446   
    ::aws_smithy_schema::ShapeId::from_static(
  447    447   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroFloat",
  448    448   
        "aws.protocoltests.restjson.synthetic",
  449    449   
        "OperationWithDefaultsOutput",
  450    450   
    ),
  451    451   
    ::aws_smithy_schema::ShapeType::Float,
  452         -
    "zero_float",
         452  +
    "zeroFloat",
  453    453   
    26,
  454    454   
);
  455    455   
static OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  456    456   
    ::aws_smithy_schema::ShapeId::from_static(
  457    457   
        "aws.protocoltests.restjson.synthetic#OperationWithDefaultsOutput$zeroDouble",
  458    458   
        "aws.protocoltests.restjson.synthetic",
  459    459   
        "OperationWithDefaultsOutput",
  460    460   
    ),
  461    461   
    ::aws_smithy_schema::ShapeType::Double,
  462         -
    "zero_double",
         462  +
    "zeroDouble",
  463    463   
    27,
  464    464   
);
  465    465   
static OPERATIONWITHDEFAULTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  466    466   
    OPERATIONWITHDEFAULTSOUTPUT_SCHEMA_ID,
  467    467   
    ::aws_smithy_schema::ShapeType::Structure,
  468    468   
    &[
  469    469   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_STRING,
  470    470   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_BOOLEAN,
  471    471   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_LIST,
  472    472   
        &OPERATIONWITHDEFAULTSOUTPUT_MEMBER_DEFAULT_DOCUMENT_MAP,
@@ -614,614 +798,789 @@
  634    634   
        }
  635    635   
        {
  636    636   
            let val = &self.zero_double;
  637    637   
            ser.write_double(&OPERATIONWITHDEFAULTSOUTPUT_MEMBER_ZERO_DOUBLE, *val)?;
  638    638   
        }
  639    639   
        Ok(())
  640    640   
    }
  641    641   
}
  642    642   
impl OperationWithDefaultsOutput {
  643    643   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  644         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  645         -
        deserializer: &mut D,
         644  +
    pub fn deserialize(
         645  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  646    646   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  647    647   
        #[allow(unused_variables, unused_mut)]
  648    648   
        let mut builder = Self::builder();
  649    649   
        #[allow(
  650    650   
            unused_variables,
  651    651   
            unreachable_code,
  652    652   
            clippy::single_match,
  653    653   
            clippy::match_single_binding,
  654    654   
            clippy::diverging_sub_expression
  655    655   
        )]
  656         -
        deserializer.read_struct(&OPERATIONWITHDEFAULTSOUTPUT_SCHEMA, (), |_, member, deser| {
         656  +
        deserializer.read_struct(&OPERATIONWITHDEFAULTSOUTPUT_SCHEMA, &mut |member, deser| {
  657    657   
            match member.member_index() {
  658    658   
                Some(0) => {
  659    659   
                    builder.default_string = Some(deser.read_string(member)?);
  660    660   
                }
  661    661   
                Some(1) => {
  662    662   
                    builder.default_boolean = Some(deser.read_boolean(member)?);
  663    663   
                }
  664    664   
                Some(2) => {
  665         -
                    builder.default_list = Some({
  666         -
                        let container = if let Some(cap) = deser.container_size() {
  667         -
                            Vec::with_capacity(cap)
  668         -
                        } else {
  669         -
                            Vec::new()
  670         -
                        };
  671         -
                        deser.read_list(member, container, |mut list, deser| {
  672         -
                            list.push(deser.read_string(member)?);
  673         -
                            Ok(list)
  674         -
                        })?
  675         -
                    });
         665  +
                    builder.default_list = Some(deser.read_string_list(member)?);
  676    666   
                }
  677    667   
                Some(3) => {
  678    668   
                    builder.default_document_map = Some(deser.read_document(member)?);
  679    669   
                }
  680    670   
                Some(4) => {
  681    671   
                    builder.default_document_string = Some(deser.read_document(member)?);
  682    672   
                }
  683    673   
                Some(5) => {
  684    674   
                    builder.default_document_boolean = Some(deser.read_document(member)?);
  685    675   
                }
  686    676   
                Some(6) => {
  687    677   
                    builder.default_document_list = Some(deser.read_document(member)?);
  688    678   
                }
  689    679   
                Some(7) => {
  690    680   
                    builder.default_null_document = Some(deser.read_document(member)?);
  691    681   
                }
  692    682   
                Some(8) => {
  693    683   
                    builder.default_timestamp = Some(deser.read_timestamp(member)?);
  694    684   
                }
  695    685   
                Some(9) => {
  696    686   
                    builder.default_blob = Some(deser.read_blob(member)?);
  697    687   
                }
  698    688   
                Some(10) => {
  699    689   
                    builder.default_byte = Some(deser.read_byte(member)?);
  700    690   
                }
  701    691   
                Some(11) => {
  702    692   
                    builder.default_short = Some(deser.read_short(member)?);
  703    693   
                }
  704    694   
                Some(12) => {
  705    695   
                    builder.default_integer = Some(deser.read_integer(member)?);
  706    696   
                }
  707    697   
                Some(13) => {
  708    698   
                    builder.default_long = Some(deser.read_long(member)?);
  709    699   
                }
  710    700   
                Some(14) => {
  711    701   
                    builder.default_float = Some(deser.read_float(member)?);
  712    702   
                }
  713    703   
                Some(15) => {
  714    704   
                    builder.default_double = Some(deser.read_double(member)?);
  715    705   
                }
  716    706   
                Some(16) => {
  717         -
                    builder.default_map = Some({
  718         -
                        let container = if let Some(cap) = deser.container_size() {
  719         -
                            std::collections::HashMap::with_capacity(cap)
  720         -
                        } else {
  721         -
                            std::collections::HashMap::new()
  722         -
                        };
  723         -
                        deser.read_map(member, container, |mut map, key, deser| {
  724         -
                            map.insert(key, deser.read_string(member)?);
  725         -
                            Ok(map)
  726         -
                        })?
  727         -
                    });
         707  +
                    builder.default_map = Some(deser.read_string_string_map(member)?);
  728    708   
                }
  729    709   
                Some(17) => {
  730    710   
                    builder.default_enum = Some(crate::types::TestEnum::from(deser.read_string(member)?.as_str()));
  731    711   
                }
  732    712   
                Some(18) => {
  733    713   
                    builder.default_int_enum = Some(deser.read_integer(member)?);
  734    714   
                }
  735    715   
                Some(19) => {
  736    716   
                    builder.empty_string = Some(deser.read_string(member)?);
  737    717   
                }
  738    718   
                Some(20) => {
  739    719   
                    builder.false_boolean = Some(deser.read_boolean(member)?);
  740    720   
                }
  741    721   
                Some(21) => {
  742    722   
                    builder.empty_blob = Some(deser.read_blob(member)?);
  743    723   
                }
  744    724   
                Some(22) => {
  745    725   
                    builder.zero_byte = Some(deser.read_byte(member)?);
  746    726   
                }
  747    727   
                Some(23) => {
  748    728   
                    builder.zero_short = Some(deser.read_short(member)?);
  749    729   
                }
  750    730   
                Some(24) => {
  751    731   
                    builder.zero_integer = Some(deser.read_integer(member)?);
  752    732   
                }
  753    733   
                Some(25) => {
  754    734   
                    builder.zero_long = Some(deser.read_long(member)?);
  755    735   
                }
  756    736   
                Some(26) => {
  757    737   
                    builder.zero_float = Some(deser.read_float(member)?);
  758    738   
                }
  759    739   
                Some(27) => {
  760    740   
                    builder.zero_double = Some(deser.read_double(member)?);
  761    741   
                }
  762    742   
                _ => {}
  763    743   
            }
  764    744   
            Ok(())
  765    745   
        })?;
  766    746   
        Ok(builder.build())
  767    747   
    }
  768    748   
}
         749  +
impl OperationWithDefaultsOutput {
         750  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         751  +
    pub fn deserialize_with_response(
         752  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         753  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         754  +
        _status: u16,
         755  +
        _body: &[u8],
         756  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         757  +
        Self::deserialize(deserializer)
         758  +
    }
         759  +
}
  769    760   
impl OperationWithDefaultsOutput {
  770    761   
    /// Creates a new builder-style object to manufacture [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
  771    762   
    pub fn builder() -> crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder {
  772    763   
        crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder::default()
  773    764   
    }
  774    765   
}
  775    766   
  776    767   
/// A builder for [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
  777    768   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  778    769   
#[non_exhaustive]