Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_path_default.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 `MalformedTimestampPathDefault`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampPathDefault;
    6      6   
impl MalformedTimestampPathDefault {
    7      7   
    /// Creates a new `MalformedTimestampPathDefault`
    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::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultOutput::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::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +239,241 @@
  130    136   
                crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultError,
  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 MalformedTimestampPathDefaultResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampPathDefaultResponseDeserializer {
  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_malformed_timestamp_path_default::de_malformed_timestamp_path_default_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::malformed_timestamp_path_default::MalformedTimestampPathDefaultError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_path_default::de_malformed_timestamp_path_default_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, MalformedTimestampPathDefault::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::malformed_timestamp_path_default::MalformedTimestampPathDefaultOutput::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 MalformedTimestampPathDefaultRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampPathDefaultRequestSerializer {
  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::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput>()
  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::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                let input_1 = &_input.timestamp;
  182         -
                let input_1 = input_1
  183         -
                    .as_ref()
  184         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  185         -
                let timestamp = ::aws_smithy_http::label::fmt_timestamp(input_1, ::aws_smithy_types::date_time::Format::DateTime)?;
  186         -
                if timestamp.is_empty() {
  187         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  188         -
                        "timestamp",
  189         -
                        "cannot be empty or unset",
  190         -
                    ));
  191         -
                }
  192         -
                ::std::write!(output, "/MalformedTimestampPathDefault/{timestamp}", timestamp = timestamp).expect("formatting should succeed");
  193         -
                ::std::result::Result::Ok(())
  194         -
            }
  195         -
            #[allow(clippy::unnecessary_wraps)]
  196         -
            fn update_http_builder(
  197         -
                input: &crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput,
  198         -
                builder: ::http_1x::request::Builder,
  199         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  200         -
                let mut uri = ::std::string::String::new();
  201         -
                uri_base(input, &mut uri)?;
  202         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  203         -
            }
  204         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  205         -
            builder
  206         -
        };
  207         -
        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, MalformedTimestampPathDefault::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  208    210   
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  210    212   
    }
  211    213   
}
  212    214   
#[derive(Debug)]
  213    215   
struct MalformedTimestampPathDefaultEndpointParamsInterceptor;
  214    216   
  215    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampPathDefaultEndpointParamsInterceptor {
  216    218   
    fn name(&self) -> &'static str {
  217    219   
        "MalformedTimestampPathDefaultEndpointParamsInterceptor"
  218    220   
    }
  219    221   

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

@@ -5,5 +109,126 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_label();
   31     31   
static MALFORMEDTIMESTAMPPATHDEFAULTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    MALFORMEDTIMESTAMPPATHDEFAULTINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&MALFORMEDTIMESTAMPPATHDEFAULTINPUT_MEMBER_TIMESTAMP],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          37  +
    "POST",
          38  +
    "/MalformedTimestampPathDefault/{timestamp}",
          39  +
    None,
          40  +
));
   36     41   
impl MalformedTimestampPathDefaultInput {
   37     42   
    /// The schema for this shape.
   38     43   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPPATHDEFAULTINPUT_SCHEMA;
   39     44   
}
   40     45   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampPathDefaultInput {
   41     46   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     47   
    fn serialize_members(
   43     48   
        &self,
   44     49   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     50   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     51   
        if let Some(ref val) = self.timestamp {
   47     52   
            ser.write_timestamp(&MALFORMEDTIMESTAMPPATHDEFAULTINPUT_MEMBER_TIMESTAMP, val)?;
   48     53   
        }
   49     54   
        Ok(())
   50     55   
    }
   51     56   
}
   52     57   
impl MalformedTimestampPathDefaultInput {
   53     58   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          59  +
    pub fn deserialize(
          60  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     61   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     62   
        #[allow(unused_variables, unused_mut)]
   58     63   
        let mut builder = Self::builder();
   59     64   
        #[allow(
   60     65   
            unused_variables,
   61     66   
            unreachable_code,
   62     67   
            clippy::single_match,
   63     68   
            clippy::match_single_binding,
   64     69   
            clippy::diverging_sub_expression
   65     70   
        )]
   66         -
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHDEFAULTINPUT_SCHEMA, (), |_, member, deser| {
          71  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHDEFAULTINPUT_SCHEMA, &mut |member, deser| {
   67     72   
            match member.member_index() {
   68     73   
                Some(0) => {
   69     74   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
   70     75   
                }
   71     76   
                _ => {}
   72     77   
            }
   73     78   
            Ok(())
   74     79   
        })?;
          80  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
   75     81   
        builder
   76     82   
            .build()
   77     83   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     84   
    }
   79     85   
}
          86  +
impl MalformedTimestampPathDefaultInput {
          87  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          88  +
    pub fn deserialize_with_response(
          89  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          90  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          91  +
        _status: u16,
          92  +
        _body: &[u8],
          93  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          94  +
        Self::deserialize(deserializer)
          95  +
    }
          96  +
}
   80     97   
impl MalformedTimestampPathDefaultInput {
   81     98   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathDefaultInput`](crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput).
   82     99   
    pub fn builder() -> crate::operation::malformed_timestamp_path_default::builders::MalformedTimestampPathDefaultInputBuilder {
   83    100   
        crate::operation::malformed_timestamp_path_default::builders::MalformedTimestampPathDefaultInputBuilder::default()
   84    101   
    }
   85    102   
}
   86    103   
   87    104   
/// A builder for [`MalformedTimestampPathDefaultInput`](crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultInput).
   88    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    106   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_path_default/_malformed_timestamp_path_default_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 MalformedTimestampPathDefaultOutput {
   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(&MALFORMEDTIMESTAMPPATHDEFAULTOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHDEFAULTOUTPUT_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 MalformedTimestampPathDefaultOutput {
          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 MalformedTimestampPathDefaultOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathDefaultOutput`](crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_path_default::builders::MalformedTimestampPathDefaultOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_path_default::builders::MalformedTimestampPathDefaultOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampPathDefaultOutput`](crate::operation::malformed_timestamp_path_default::MalformedTimestampPathDefaultOutput).
   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/malformed_timestamp_path_epoch.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 `MalformedTimestampPathEpoch`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampPathEpoch;
    6      6   
impl MalformedTimestampPathEpoch {
    7      7   
    /// Creates a new `MalformedTimestampPathEpoch`
    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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochOutput::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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +239,241 @@
  130    136   
                crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochError,
  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 MalformedTimestampPathEpochResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampPathEpochResponseDeserializer {
  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_malformed_timestamp_path_epoch::de_malformed_timestamp_path_epoch_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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_path_epoch::de_malformed_timestamp_path_epoch_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, MalformedTimestampPathEpoch::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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochOutput::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 MalformedTimestampPathEpochRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampPathEpochRequestSerializer {
  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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput>()
  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::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                let input_1 = &_input.timestamp;
  182         -
                let input_1 = input_1
  183         -
                    .as_ref()
  184         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  185         -
                let timestamp = ::aws_smithy_http::label::fmt_timestamp(input_1, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  186         -
                if timestamp.is_empty() {
  187         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  188         -
                        "timestamp",
  189         -
                        "cannot be empty or unset",
  190         -
                    ));
  191         -
                }
  192         -
                ::std::write!(output, "/MalformedTimestampPathEpoch/{timestamp}", timestamp = timestamp).expect("formatting should succeed");
  193         -
                ::std::result::Result::Ok(())
  194         -
            }
  195         -
            #[allow(clippy::unnecessary_wraps)]
  196         -
            fn update_http_builder(
  197         -
                input: &crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput,
  198         -
                builder: ::http_1x::request::Builder,
  199         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  200         -
                let mut uri = ::std::string::String::new();
  201         -
                uri_base(input, &mut uri)?;
  202         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  203         -
            }
  204         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  205         -
            builder
  206         -
        };
  207         -
        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, MalformedTimestampPathEpoch::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  208    210   
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  210    212   
    }
  211    213   
}
  212    214   
#[derive(Debug)]
  213    215   
struct MalformedTimestampPathEpochEndpointParamsInterceptor;
  214    216   
  215    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampPathEpochEndpointParamsInterceptor {
  216    218   
    fn name(&self) -> &'static str {
  217    219   
        "MalformedTimestampPathEpochEndpointParamsInterceptor"
  218    220   
    }
  219    221   

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

@@ -6,6 +110,127 @@
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds)
   31     31   
.with_http_label();
   32     32   
static MALFORMEDTIMESTAMPPATHEPOCHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    MALFORMEDTIMESTAMPPATHEPOCHINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&MALFORMEDTIMESTAMPPATHEPOCHINPUT_MEMBER_TIMESTAMP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          38  +
    "POST",
          39  +
    "/MalformedTimestampPathEpoch/{timestamp}",
          40  +
    None,
          41  +
));
   37     42   
impl MalformedTimestampPathEpochInput {
   38     43   
    /// The schema for this shape.
   39     44   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPPATHEPOCHINPUT_SCHEMA;
   40     45   
}
   41     46   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampPathEpochInput {
   42     47   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     48   
    fn serialize_members(
   44     49   
        &self,
   45     50   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     51   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     52   
        if let Some(ref val) = self.timestamp {
   48     53   
            ser.write_timestamp(&MALFORMEDTIMESTAMPPATHEPOCHINPUT_MEMBER_TIMESTAMP, val)?;
   49     54   
        }
   50     55   
        Ok(())
   51     56   
    }
   52     57   
}
   53     58   
impl MalformedTimestampPathEpochInput {
   54     59   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          60  +
    pub fn deserialize(
          61  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     62   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     63   
        #[allow(unused_variables, unused_mut)]
   59     64   
        let mut builder = Self::builder();
   60     65   
        #[allow(
   61     66   
            unused_variables,
   62     67   
            unreachable_code,
   63     68   
            clippy::single_match,
   64     69   
            clippy::match_single_binding,
   65     70   
            clippy::diverging_sub_expression
   66     71   
        )]
   67         -
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHEPOCHINPUT_SCHEMA, (), |_, member, deser| {
          72  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHEPOCHINPUT_SCHEMA, &mut |member, deser| {
   68     73   
            match member.member_index() {
   69     74   
                Some(0) => {
   70     75   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
   71     76   
                }
   72     77   
                _ => {}
   73     78   
            }
   74     79   
            Ok(())
   75     80   
        })?;
          81  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
   76     82   
        builder
   77     83   
            .build()
   78     84   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     85   
    }
   80     86   
}
          87  +
impl MalformedTimestampPathEpochInput {
          88  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          89  +
    pub fn deserialize_with_response(
          90  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          91  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          92  +
        _status: u16,
          93  +
        _body: &[u8],
          94  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          95  +
        Self::deserialize(deserializer)
          96  +
    }
          97  +
}
   81     98   
impl MalformedTimestampPathEpochInput {
   82     99   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathEpochInput`](crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput).
   83    100   
    pub fn builder() -> crate::operation::malformed_timestamp_path_epoch::builders::MalformedTimestampPathEpochInputBuilder {
   84    101   
        crate::operation::malformed_timestamp_path_epoch::builders::MalformedTimestampPathEpochInputBuilder::default()
   85    102   
    }
   86    103   
}
   87    104   
   88    105   
/// A builder for [`MalformedTimestampPathEpochInput`](crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochInput).
   89    106   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    107   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_path_epoch/_malformed_timestamp_path_epoch_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 MalformedTimestampPathEpochOutput {
   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(&MALFORMEDTIMESTAMPPATHEPOCHOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHEPOCHOUTPUT_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 MalformedTimestampPathEpochOutput {
          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 MalformedTimestampPathEpochOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathEpochOutput`](crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_path_epoch::builders::MalformedTimestampPathEpochOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_path_epoch::builders::MalformedTimestampPathEpochOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampPathEpochOutput`](crate::operation::malformed_timestamp_path_epoch::MalformedTimestampPathEpochOutput).
   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/malformed_timestamp_path_http_date.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 `MalformedTimestampPathHttpDate`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampPathHttpDate;
    6      6   
impl MalformedTimestampPathHttpDate {
    7      7   
    /// Creates a new `MalformedTimestampPathHttpDate`
    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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateOutput::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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +241,241 @@
  130    136   
                crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateError,
  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 MalformedTimestampPathHttpDateResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampPathHttpDateResponseDeserializer {
  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_malformed_timestamp_path_http_date::de_malformed_timestamp_path_http_date_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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_path_http_date::de_malformed_timestamp_path_http_date_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, MalformedTimestampPathHttpDate::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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateOutput::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 MalformedTimestampPathHttpDateRequestSerializer;
  162    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampPathHttpDateRequestSerializer {
  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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput>()
  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::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput,
  180         -
                output: &mut ::std::string::String,
  181         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182         -
                use ::std::fmt::Write as _;
  183         -
                let input_1 = &_input.timestamp;
  184         -
                let input_1 = input_1
  185         -
                    .as_ref()
  186         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  187         -
                let timestamp = ::aws_smithy_http::label::fmt_timestamp(input_1, ::aws_smithy_types::date_time::Format::HttpDate)?;
  188         -
                if timestamp.is_empty() {
  189         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  190         -
                        "timestamp",
  191         -
                        "cannot be empty or unset",
  192         -
                    ));
  193         -
                }
  194         -
                ::std::write!(output, "/MalformedTimestampPathHttpDate/{timestamp}", timestamp = timestamp).expect("formatting should succeed");
  195         -
                ::std::result::Result::Ok(())
  196         -
            }
  197         -
            #[allow(clippy::unnecessary_wraps)]
  198         -
            fn update_http_builder(
  199         -
                input: &crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput,
  200         -
                builder: ::http_1x::request::Builder,
  201         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  202         -
                let mut uri = ::std::string::String::new();
  203         -
                uri_base(input, &mut uri)?;
  204         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  205         -
            }
  206         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  207         -
            builder
  208         -
        };
  209         -
        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, MalformedTimestampPathHttpDate::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  210    210   
  211         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  212    212   
    }
  213    213   
}
  214    214   
#[derive(Debug)]
  215    215   
struct MalformedTimestampPathHttpDateEndpointParamsInterceptor;
  216    216   
  217    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampPathHttpDateEndpointParamsInterceptor {
  218    218   
    fn name(&self) -> &'static str {
  219    219   
        "MalformedTimestampPathHttpDateEndpointParamsInterceptor"
  220    220   
    }
  221    221   

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

@@ -6,6 +110,127 @@
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate)
   31     31   
.with_http_label();
   32     32   
static MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_MEMBER_TIMESTAMP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          38  +
    "POST",
          39  +
    "/MalformedTimestampPathHttpDate/{timestamp}",
          40  +
    None,
          41  +
));
   37     42   
impl MalformedTimestampPathHttpDateInput {
   38     43   
    /// The schema for this shape.
   39     44   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_SCHEMA;
   40     45   
}
   41     46   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampPathHttpDateInput {
   42     47   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     48   
    fn serialize_members(
   44     49   
        &self,
   45     50   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     51   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     52   
        if let Some(ref val) = self.timestamp {
   48     53   
            ser.write_timestamp(&MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_MEMBER_TIMESTAMP, val)?;
   49     54   
        }
   50     55   
        Ok(())
   51     56   
    }
   52     57   
}
   53     58   
impl MalformedTimestampPathHttpDateInput {
   54     59   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          60  +
    pub fn deserialize(
          61  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     62   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     63   
        #[allow(unused_variables, unused_mut)]
   59     64   
        let mut builder = Self::builder();
   60     65   
        #[allow(
   61     66   
            unused_variables,
   62     67   
            unreachable_code,
   63     68   
            clippy::single_match,
   64     69   
            clippy::match_single_binding,
   65     70   
            clippy::diverging_sub_expression
   66     71   
        )]
   67         -
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_SCHEMA, (), |_, member, deser| {
          72  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHHTTPDATEINPUT_SCHEMA, &mut |member, deser| {
   68     73   
            match member.member_index() {
   69     74   
                Some(0) => {
   70     75   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
   71     76   
                }
   72     77   
                _ => {}
   73     78   
            }
   74     79   
            Ok(())
   75     80   
        })?;
          81  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
   76     82   
        builder
   77     83   
            .build()
   78     84   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     85   
    }
   80     86   
}
          87  +
impl MalformedTimestampPathHttpDateInput {
          88  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          89  +
    pub fn deserialize_with_response(
          90  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          91  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          92  +
        _status: u16,
          93  +
        _body: &[u8],
          94  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          95  +
        Self::deserialize(deserializer)
          96  +
    }
          97  +
}
   81     98   
impl MalformedTimestampPathHttpDateInput {
   82     99   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathHttpDateInput`](crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput).
   83    100   
    pub fn builder() -> crate::operation::malformed_timestamp_path_http_date::builders::MalformedTimestampPathHttpDateInputBuilder {
   84    101   
        crate::operation::malformed_timestamp_path_http_date::builders::MalformedTimestampPathHttpDateInputBuilder::default()
   85    102   
    }
   86    103   
}
   87    104   
   88    105   
/// A builder for [`MalformedTimestampPathHttpDateInput`](crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateInput).
   89    106   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    107   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_path_http_date/_malformed_timestamp_path_http_date_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 MalformedTimestampPathHttpDateOutput {
   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(&MALFORMEDTIMESTAMPPATHHTTPDATEOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPPATHHTTPDATEOUTPUT_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 MalformedTimestampPathHttpDateOutput {
          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 MalformedTimestampPathHttpDateOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampPathHttpDateOutput`](crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_path_http_date::builders::MalformedTimestampPathHttpDateOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_path_http_date::builders::MalformedTimestampPathHttpDateOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampPathHttpDateOutput`](crate::operation::malformed_timestamp_path_http_date::MalformedTimestampPathHttpDateOutput).
   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/malformed_timestamp_query_default.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 `MalformedTimestampQueryDefault`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampQueryDefault;
    6      6   
impl MalformedTimestampQueryDefault {
    7      7   
    /// Creates a new `MalformedTimestampQueryDefault`
    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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultOutput::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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +244,241 @@
  130    136   
                crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultError,
  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 MalformedTimestampQueryDefaultResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampQueryDefaultResponseDeserializer {
  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_malformed_timestamp_query_default::de_malformed_timestamp_query_default_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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_query_default::de_malformed_timestamp_query_default_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, MalformedTimestampQueryDefault::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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultOutput::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 MalformedTimestampQueryDefaultRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampQueryDefaultRequestSerializer {
  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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput>()
  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::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput,
  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, "/MalformedTimestampQueryDefault").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput,
  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         -
                let inner_1 = &_input.timestamp;
  190         -
                let inner_1 = inner_1
  191         -
                    .as_ref()
  192         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  193         -
                query.push_kv(
  194         -
                    "timestamp",
  195         -
                    &::aws_smithy_http::query::fmt_timestamp(inner_1, ::aws_smithy_types::date_time::Format::DateTime)?,
  196         -
                );
  197         -
                ::std::result::Result::Ok(())
  198         -
            }
  199         -
            #[allow(clippy::unnecessary_wraps)]
  200         -
            fn update_http_builder(
  201         -
                input: &crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput,
  202         -
                builder: ::http_1x::request::Builder,
  203         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  204         -
                let mut uri = ::std::string::String::new();
  205         -
                uri_base(input, &mut uri)?;
  206         -
                uri_query(input, &mut uri)?;
  207         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  208         -
            }
  209         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  210         -
            builder
  211         -
        };
  212         -
        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, MalformedTimestampQueryDefault::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  213    210   
  214         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  215    212   
    }
  216    213   
}
  217    214   
#[derive(Debug)]
  218    215   
struct MalformedTimestampQueryDefaultEndpointParamsInterceptor;
  219    216   
  220    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampQueryDefaultEndpointParamsInterceptor {
  221    218   
    fn name(&self) -> &'static str {
  222    219   
        "MalformedTimestampQueryDefaultEndpointParamsInterceptor"
  223    220   
    }
  224    221   

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

@@ -5,5 +109,122 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_query("timestamp");
   31     31   
static MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_MEMBER_TIMESTAMP],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedTimestampQueryDefault", None));
   36     37   
impl MalformedTimestampQueryDefaultInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampQueryDefaultInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.timestamp {
   47     48   
            ser.write_timestamp(&MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_MEMBER_TIMESTAMP, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl MalformedTimestampQueryDefaultInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYDEFAULTINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
          76  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
   75     77   
        builder
   76     78   
            .build()
   77     79   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     80   
    }
   79     81   
}
          82  +
impl MalformedTimestampQueryDefaultInput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          84  +
    pub fn deserialize_with_response(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          87  +
        _status: u16,
          88  +
        _body: &[u8],
          89  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          90  +
        Self::deserialize(deserializer)
          91  +
    }
          92  +
}
   80     93   
impl MalformedTimestampQueryDefaultInput {
   81     94   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampQueryDefaultInput`](crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput).
   82     95   
    pub fn builder() -> crate::operation::malformed_timestamp_query_default::builders::MalformedTimestampQueryDefaultInputBuilder {
   83     96   
        crate::operation::malformed_timestamp_query_default::builders::MalformedTimestampQueryDefaultInputBuilder::default()
   84     97   
    }
   85     98   
}
   86     99   
   87    100   
/// A builder for [`MalformedTimestampQueryDefaultInput`](crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultInput).
   88    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    102   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_query_default/_malformed_timestamp_query_default_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 MalformedTimestampQueryDefaultOutput {
   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(&MALFORMEDTIMESTAMPQUERYDEFAULTOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYDEFAULTOUTPUT_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 MalformedTimestampQueryDefaultOutput {
          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 MalformedTimestampQueryDefaultOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampQueryDefaultOutput`](crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_query_default::builders::MalformedTimestampQueryDefaultOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_query_default::builders::MalformedTimestampQueryDefaultOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampQueryDefaultOutput`](crate::operation::malformed_timestamp_query_default::MalformedTimestampQueryDefaultOutput).
   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/malformed_timestamp_query_epoch.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 `MalformedTimestampQueryEpoch`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampQueryEpoch;
    6      6   
impl MalformedTimestampQueryEpoch {
    7      7   
    /// Creates a new `MalformedTimestampQueryEpoch`
    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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochOutput::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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +244,241 @@
  130    136   
                crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochError,
  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 MalformedTimestampQueryEpochResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampQueryEpochResponseDeserializer {
  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_malformed_timestamp_query_epoch::de_malformed_timestamp_query_epoch_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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_query_epoch::de_malformed_timestamp_query_epoch_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, MalformedTimestampQueryEpoch::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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochOutput::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 MalformedTimestampQueryEpochRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampQueryEpochRequestSerializer {
  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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput>()
  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::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput,
  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, "/MalformedTimestampQueryEpoch").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            fn uri_query(
  185         -
                _input: &crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput,
  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         -
                let inner_1 = &_input.timestamp;
  190         -
                let inner_1 = inner_1
  191         -
                    .as_ref()
  192         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  193         -
                query.push_kv(
  194         -
                    "timestamp",
  195         -
                    &::aws_smithy_http::query::fmt_timestamp(inner_1, ::aws_smithy_types::date_time::Format::EpochSeconds)?,
  196         -
                );
  197         -
                ::std::result::Result::Ok(())
  198         -
            }
  199         -
            #[allow(clippy::unnecessary_wraps)]
  200         -
            fn update_http_builder(
  201         -
                input: &crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput,
  202         -
                builder: ::http_1x::request::Builder,
  203         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  204         -
                let mut uri = ::std::string::String::new();
  205         -
                uri_base(input, &mut uri)?;
  206         -
                uri_query(input, &mut uri)?;
  207         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  208         -
            }
  209         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  210         -
            builder
  211         -
        };
  212         -
        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, MalformedTimestampQueryEpoch::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  213    210   
  214         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  215    212   
    }
  216    213   
}
  217    214   
#[derive(Debug)]
  218    215   
struct MalformedTimestampQueryEpochEndpointParamsInterceptor;
  219    216   
  220    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampQueryEpochEndpointParamsInterceptor {
  221    218   
    fn name(&self) -> &'static str {
  222    219   
        "MalformedTimestampQueryEpochEndpointParamsInterceptor"
  223    220   
    }
  224    221   

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

@@ -6,6 +110,123 @@
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds)
   31     31   
.with_http_query("timestamp");
   32     32   
static MALFORMEDTIMESTAMPQUERYEPOCHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    MALFORMEDTIMESTAMPQUERYEPOCHINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&MALFORMEDTIMESTAMPQUERYEPOCHINPUT_MEMBER_TIMESTAMP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedTimestampQueryEpoch", None));
   37     38   
impl MalformedTimestampQueryEpochInput {
   38     39   
    /// The schema for this shape.
   39     40   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPQUERYEPOCHINPUT_SCHEMA;
   40     41   
}
   41     42   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampQueryEpochInput {
   42     43   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     44   
    fn serialize_members(
   44     45   
        &self,
   45     46   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     47   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     48   
        if let Some(ref val) = self.timestamp {
   48     49   
            ser.write_timestamp(&MALFORMEDTIMESTAMPQUERYEPOCHINPUT_MEMBER_TIMESTAMP, val)?;
   49     50   
        }
   50     51   
        Ok(())
   51     52   
    }
   52     53   
}
   53     54   
impl MalformedTimestampQueryEpochInput {
   54     55   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          56  +
    pub fn deserialize(
          57  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     58   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     59   
        #[allow(unused_variables, unused_mut)]
   59     60   
        let mut builder = Self::builder();
   60     61   
        #[allow(
   61     62   
            unused_variables,
   62     63   
            unreachable_code,
   63     64   
            clippy::single_match,
   64     65   
            clippy::match_single_binding,
   65     66   
            clippy::diverging_sub_expression
   66     67   
        )]
   67         -
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYEPOCHINPUT_SCHEMA, (), |_, member, deser| {
          68  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYEPOCHINPUT_SCHEMA, &mut |member, deser| {
   68     69   
            match member.member_index() {
   69     70   
                Some(0) => {
   70     71   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
   71     72   
                }
   72     73   
                _ => {}
   73     74   
            }
   74     75   
            Ok(())
   75     76   
        })?;
          77  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
   76     78   
        builder
   77     79   
            .build()
   78     80   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79     81   
    }
   80     82   
}
          83  +
impl MalformedTimestampQueryEpochInput {
          84  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        _body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        Self::deserialize(deserializer)
          92  +
    }
          93  +
}
   81     94   
impl MalformedTimestampQueryEpochInput {
   82     95   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampQueryEpochInput`](crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput).
   83     96   
    pub fn builder() -> crate::operation::malformed_timestamp_query_epoch::builders::MalformedTimestampQueryEpochInputBuilder {
   84     97   
        crate::operation::malformed_timestamp_query_epoch::builders::MalformedTimestampQueryEpochInputBuilder::default()
   85     98   
    }
   86     99   
}
   87    100   
   88    101   
/// A builder for [`MalformedTimestampQueryEpochInput`](crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochInput).
   89    102   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90    103   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_query_epoch/_malformed_timestamp_query_epoch_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 MalformedTimestampQueryEpochOutput {
   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(&MALFORMEDTIMESTAMPQUERYEPOCHOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPQUERYEPOCHOUTPUT_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 MalformedTimestampQueryEpochOutput {
          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 MalformedTimestampQueryEpochOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampQueryEpochOutput`](crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_query_epoch::builders::MalformedTimestampQueryEpochOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_query_epoch::builders::MalformedTimestampQueryEpochOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampQueryEpochOutput`](crate::operation::malformed_timestamp_query_epoch::MalformedTimestampQueryEpochOutput).
   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/malformed_timestamp_query_http_date.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 `MalformedTimestampQueryHttpDate`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampQueryHttpDate;
    6      6   
impl MalformedTimestampQueryHttpDate {
    7      7   
    /// Creates a new `MalformedTimestampQueryHttpDate`
    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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateOutput::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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +246,241 @@
  130    136   
                crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateError,
  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 MalformedTimestampQueryHttpDateResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampQueryHttpDateResponseDeserializer {
  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_malformed_timestamp_query_http_date::de_malformed_timestamp_query_http_date_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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_query_http_date::de_malformed_timestamp_query_http_date_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, MalformedTimestampQueryHttpDate::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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateOutput::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 MalformedTimestampQueryHttpDateRequestSerializer;
  162    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampQueryHttpDateRequestSerializer {
  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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput>()
  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::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput,
  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, "/MalformedTimestampQueryHttpDate").expect("formatting should succeed");
  184         -
                ::std::result::Result::Ok(())
  185         -
            }
  186         -
            fn uri_query(
  187         -
                _input: &crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput,
  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         -
                let inner_1 = &_input.timestamp;
  192         -
                let inner_1 = inner_1
  193         -
                    .as_ref()
  194         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  195         -
                query.push_kv(
  196         -
                    "timestamp",
  197         -
                    &::aws_smithy_http::query::fmt_timestamp(inner_1, ::aws_smithy_types::date_time::Format::HttpDate)?,
  198         -
                );
  199         -
                ::std::result::Result::Ok(())
  200         -
            }
  201         -
            #[allow(clippy::unnecessary_wraps)]
  202         -
            fn update_http_builder(
  203         -
                input: &crate::operation::malformed_timestamp_query_http_date::MalformedTimestampQueryHttpDateInput,
  204         -
                builder: ::http_1x::request::Builder,
  205         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  206         -
                let mut uri = ::std::string::String::new();
  207         -
                uri_base(input, &mut uri)?;
  208         -
                uri_query(input, &mut uri)?;
  209         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  210         -
            }
  211         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  212         -
            builder
  213         -
        };
  214         -
        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, MalformedTimestampQueryHttpDate::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  215    210   
  216         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         211  +
        return ::std::result::Result::Ok(request);
  217    212   
    }
  218    213   
}
  219    214   
#[derive(Debug)]
  220    215   
struct MalformedTimestampQueryHttpDateEndpointParamsInterceptor;
  221    216   
  222    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampQueryHttpDateEndpointParamsInterceptor {
  223    218   
    fn name(&self) -> &'static str {
  224    219   
        "MalformedTimestampQueryHttpDateEndpointParamsInterceptor"
  225    220   
    }
  226    221