Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_body_date_time/_malformed_timestamp_body_date_time_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 MalformedTimestampBodyDateTimeOutput {
   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(&MALFORMEDTIMESTAMPBODYDATETIMEOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPBODYDATETIMEOUTPUT_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 MalformedTimestampBodyDateTimeOutput {
          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 MalformedTimestampBodyDateTimeOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampBodyDateTimeOutput`](crate::operation::malformed_timestamp_body_date_time::MalformedTimestampBodyDateTimeOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_body_date_time::builders::MalformedTimestampBodyDateTimeOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_body_date_time::builders::MalformedTimestampBodyDateTimeOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampBodyDateTimeOutput`](crate::operation::malformed_timestamp_body_date_time::MalformedTimestampBodyDateTimeOutput).
   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_body_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 `MalformedTimestampBodyDefault`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampBodyDefault;
    6      6   
impl MalformedTimestampBodyDefault {
    7      7   
    /// Creates a new `MalformedTimestampBodyDefault`
    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_body_default::MalformedTimestampBodyDefaultInput::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_body_default::MalformedTimestampBodyDefaultOutput::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_body_default::MalformedTimestampBodyDefaultInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +234,241 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct MalformedTimestampBodyDefaultResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampBodyDefaultResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  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());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_error(status, headers, body)
         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_body_default::MalformedTimestampBodyDefaultError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_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, MalformedTimestampBodyDefault::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_body_default::MalformedTimestampBodyDefaultOutput::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 MalformedTimestampBodyDefaultRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampBodyDefaultRequestSerializer {
  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_body_default::MalformedTimestampBodyDefaultInput>()
  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_body_default::MalformedTimestampBodyDefaultInput,
  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, "/MalformedTimestampBodyDefault").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  195         -
            builder
  196         -
        };
  197         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  198         -
            crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_input(&input)?,
  199         -
        );
  200         -
        if let Some(content_length) = body.content_length() {
  201         -
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203         -
        }
  204         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         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, MalformedTimestampBodyDefault::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
         211  +
        return ::std::result::Result::Ok(request);
  205    212   
    }
  206    213   
}
  207    214   
#[derive(Debug)]
  208    215   
struct MalformedTimestampBodyDefaultEndpointParamsInterceptor;
  209    216   
  210    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampBodyDefaultEndpointParamsInterceptor {
  211    218   
    fn name(&self) -> &'static str {
  212    219   
        "MalformedTimestampBodyDefaultEndpointParamsInterceptor"
  213    220   
    }
  214    221   

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_body_default/_malformed_timestamp_body_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 MalformedTimestampBodyDefaultOutput {
   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(&MALFORMEDTIMESTAMPBODYDEFAULTOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPBODYDEFAULTOUTPUT_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 MalformedTimestampBodyDefaultOutput {
          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 MalformedTimestampBodyDefaultOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampBodyDefaultOutput`](crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_body_default::builders::MalformedTimestampBodyDefaultOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_body_default::builders::MalformedTimestampBodyDefaultOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampBodyDefaultOutput`](crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput).
   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_body_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 `MalformedTimestampBodyHttpDate`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampBodyHttpDate;
    6      6   
impl MalformedTimestampBodyHttpDate {
    7      7   
    /// Creates a new `MalformedTimestampBodyHttpDate`
    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_body_http_date::MalformedTimestampBodyHttpDateInput::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_body_http_date::MalformedTimestampBodyHttpDateOutput::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_body_http_date::MalformedTimestampBodyHttpDateInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +236,241 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct MalformedTimestampBodyHttpDateResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampBodyHttpDateResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  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());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::de_malformed_timestamp_body_http_date_http_error(status, headers, body)
         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_body_http_date::MalformedTimestampBodyHttpDateError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::de_malformed_timestamp_body_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, MalformedTimestampBodyHttpDate::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_body_http_date::MalformedTimestampBodyHttpDateOutput::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 MalformedTimestampBodyHttpDateRequestSerializer;
  162    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampBodyHttpDateRequestSerializer {
  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_body_http_date::MalformedTimestampBodyHttpDateInput>()
  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_body_http_date::MalformedTimestampBodyHttpDateInput,
  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, "/MalformedTimestampBodyHttpDate").expect("formatting should succeed");
  184         -
                ::std::result::Result::Ok(())
  185         -
            }
  186         -
            #[allow(clippy::unnecessary_wraps)]
  187         -
            fn update_http_builder(
  188         -
                input: &crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateInput,
  189         -
                builder: ::http_1x::request::Builder,
  190         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191         -
                let mut uri = ::std::string::String::new();
  192         -
                uri_base(input, &mut uri)?;
  193         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  194         -
            }
  195         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  196         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  197         -
            builder
  198         -
        };
  199         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  200         -
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::ser_malformed_timestamp_body_http_date_input(&input)?,
  201         -
        );
  202         -
        if let Some(content_length) = body.content_length() {
  203         -
            let content_length = content_length.to_string();
  204         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  205         -
        }
  206         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         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, MalformedTimestampBodyHttpDate::INPUT_SCHEMA, "", _cfg)
         209  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         210  +
         211  +
        return ::std::result::Result::Ok(request);
  207    212   
    }
  208    213   
}
  209    214   
#[derive(Debug)]
  210    215   
struct MalformedTimestampBodyHttpDateEndpointParamsInterceptor;
  211    216   
  212    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampBodyHttpDateEndpointParamsInterceptor {
  213    218   
    fn name(&self) -> &'static str {
  214    219   
        "MalformedTimestampBodyHttpDateEndpointParamsInterceptor"
  215    220   
    }
  216    221   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_body_http_date/_malformed_timestamp_body_http_date_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_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
   31     31   
static MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_MEMBER_TIMESTAMP],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedTimestampBodyHttpDate", None));
   36     37   
impl MalformedTimestampBodyHttpDateInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampBodyHttpDateInput {
   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(&MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_MEMBER_TIMESTAMP, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl MalformedTimestampBodyHttpDateInput {
   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(&MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPBODYHTTPDATEINPUT_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 MalformedTimestampBodyHttpDateInput {
          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 MalformedTimestampBodyHttpDateInput {
   81     94   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampBodyHttpDateInput`](crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateInput).
   82     95   
    pub fn builder() -> crate::operation::malformed_timestamp_body_http_date::builders::MalformedTimestampBodyHttpDateInputBuilder {
   83     96   
        crate::operation::malformed_timestamp_body_http_date::builders::MalformedTimestampBodyHttpDateInputBuilder::default()
   84     97   
    }
   85     98   
}
   86     99   
   87    100   
/// A builder for [`MalformedTimestampBodyHttpDateInput`](crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateInput).
   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_body_http_date/_malformed_timestamp_body_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 MalformedTimestampBodyHttpDateOutput {
   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(&MALFORMEDTIMESTAMPBODYHTTPDATEOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPBODYHTTPDATEOUTPUT_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 MalformedTimestampBodyHttpDateOutput {
          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 MalformedTimestampBodyHttpDateOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampBodyHttpDateOutput`](crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_body_http_date::builders::MalformedTimestampBodyHttpDateOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_body_http_date::builders::MalformedTimestampBodyHttpDateOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampBodyHttpDateOutput`](crate::operation::malformed_timestamp_body_http_date::MalformedTimestampBodyHttpDateOutput).
   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_header_date_time.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 `MalformedTimestampHeaderDateTime`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampHeaderDateTime;
    6      6   
impl MalformedTimestampHeaderDateTime {
    7      7   
    /// Creates a new `MalformedTimestampHeaderDateTime`
    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_header_date_time::MalformedTimestampHeaderDateTimeInput::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_header_date_time::MalformedTimestampHeaderDateTimeOutput::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_header_date_time::MalformedTimestampHeaderDateTimeInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +235,274 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct MalformedTimestampHeaderDateTimeResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampHeaderDateTimeResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  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());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_timestamp_header_date_time::de_malformed_timestamp_header_date_time_http_error(
  152         -
                status, headers, body,
  153         -
            )
         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_header_date_time::MalformedTimestampHeaderDateTimeError::generic(generic),
         167  +
                ),
         168  +
            ))
  154    169   
        } else {
  155         -
            crate::protocol_serde::shape_malformed_timestamp_header_date_time::de_malformed_timestamp_header_date_time_http_response(
  156         -
                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, MalformedTimestampHeaderDateTime::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_header_date_time::MalformedTimestampHeaderDateTimeOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  157    184   
            )
  158         -
        };
  159         -
        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  +
        }
  160    190   
    }
  161    191   
}
  162    192   
#[derive(Debug)]
  163    193   
struct MalformedTimestampHeaderDateTimeRequestSerializer;
  164    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampHeaderDateTimeRequestSerializer {
  165    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    196   
    fn serialize_input(
  167    197   
        &self,
  168    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    201   
        let input = input
  172    202   
            .downcast::<crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeInput>()
  173    203   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                ::std::write!(output, "/MalformedTimestampHeaderDateTime").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, MalformedTimestampHeaderDateTime::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/MalformedTimestampHeaderDateTime".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.timestamp {
         215  +
                    request.headers_mut().insert(
         216  +
                        "timestamp",
         217  +
                        val.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
         218  +
                    );
         219  +
                }
         220  +
                if !query_params.is_empty() {
         221  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         222  +
                    let pairs: Vec<String> = query_params
         223  +
                        .iter()
         224  +
                        .map(|(k, v)| {
         225  +
                            format!(
         226  +
                                "{}={}",
         227  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         228  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         229  +
                            )
         230  +
                        })
         231  +
                        .collect();
         232  +
                    uri.push_str(&pairs.join("&"));
         233  +
                }
         234  +
                request.set_uri(uri.as_str()).expect("valid URI");
  187    235   
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                let builder = crate::protocol_serde::shape_malformed_timestamp_header_date_time::ser_malformed_timestamp_header_date_time_headers(
  196         -
                    input, builder,
  197         -
                )?;
  198         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  199         -
            }
  200         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  201         -
            builder
  202         -
        };
  203         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  204    236   
  205         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         237  +
            return ::std::result::Result::Ok(request);
         238  +
        } else {
         239  +
            let mut request = protocol
         240  +
                .serialize_request(&input, MalformedTimestampHeaderDateTime::INPUT_SCHEMA, "", _cfg)
         241  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         242  +
         243  +
            return ::std::result::Result::Ok(request);
         244  +
        }
  206    245   
    }
  207    246   
}
  208    247   
#[derive(Debug)]
  209    248   
struct MalformedTimestampHeaderDateTimeEndpointParamsInterceptor;
  210    249   
  211    250   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampHeaderDateTimeEndpointParamsInterceptor {
  212    251   
    fn name(&self) -> &'static str {
  213    252   
        "MalformedTimestampHeaderDateTimeEndpointParamsInterceptor"
  214    253   
    }
  215    254   

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

@@ -6,6 +105,131 @@
   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::DateTime)
   31     31   
.with_http_header("timestamp");
   32     32   
static MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_MEMBER_TIMESTAMP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          38  +
    "POST",
          39  +
    "/MalformedTimestampHeaderDateTime",
          40  +
    None,
          41  +
));
   37     42   
impl MalformedTimestampHeaderDateTimeInput {
   38     43   
    /// The schema for this shape.
   39     44   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_SCHEMA;
   40     45   
}
   41     46   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampHeaderDateTimeInput {
   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(&MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_MEMBER_TIMESTAMP, val)?;
   49     54   
        }
   50     55   
        Ok(())
   51     56   
    }
   52     57   
}
   53     58   
impl MalformedTimestampHeaderDateTimeInput {
   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(&MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_SCHEMA, (), |_, member, deser| {
          72  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADERDATETIMEINPUT_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)));
          82  +
        builder
          83  +
            .build()
          84  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          85  +
    }
          86  +
}
          87  +
impl MalformedTimestampHeaderDateTimeInput {
          88  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          89  +
    /// Header-bound members are read directly from headers, avoiding runtime
          90  +
    /// member iteration overhead. Body members are read via the deserializer.
          91  +
    pub fn deserialize_with_response(
          92  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          93  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          94  +
        _status: u16,
          95  +
        _body: &[u8],
          96  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          97  +
        #[allow(unused_variables, unused_mut)]
          98  +
        let mut builder = Self::builder();
          99  +
        if let Some(val) = headers.get("timestamp") {
         100  +
            builder.timestamp = ::aws_smithy_types::DateTime::from_str(val, ::aws_smithy_types::date_time::Format::DateTime).ok();
         101  +
        }
   76    102   
        builder
   77    103   
            .build()
   78    104   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79    105   
    }
   80    106   
}
   81    107   
impl MalformedTimestampHeaderDateTimeInput {
   82    108   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderDateTimeInput`](crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeInput).
   83    109   
    pub fn builder() -> crate::operation::malformed_timestamp_header_date_time::builders::MalformedTimestampHeaderDateTimeInputBuilder {
   84    110   
        crate::operation::malformed_timestamp_header_date_time::builders::MalformedTimestampHeaderDateTimeInputBuilder::default()
   85    111   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_header_date_time/_malformed_timestamp_header_date_time_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 MalformedTimestampHeaderDateTimeOutput {
   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(&MALFORMEDTIMESTAMPHEADERDATETIMEOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADERDATETIMEOUTPUT_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 MalformedTimestampHeaderDateTimeOutput {
          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 MalformedTimestampHeaderDateTimeOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderDateTimeOutput`](crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_header_date_time::builders::MalformedTimestampHeaderDateTimeOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_header_date_time::builders::MalformedTimestampHeaderDateTimeOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampHeaderDateTimeOutput`](crate::operation::malformed_timestamp_header_date_time::MalformedTimestampHeaderDateTimeOutput).
   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_header_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 `MalformedTimestampHeaderDefault`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampHeaderDefault;
    6      6   
impl MalformedTimestampHeaderDefault {
    7      7   
    /// Creates a new `MalformedTimestampHeaderDefault`
    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_header_default::MalformedTimestampHeaderDefaultInput::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_header_default::MalformedTimestampHeaderDefaultOutput::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_header_default::MalformedTimestampHeaderDefaultInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +232,274 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct MalformedTimestampHeaderDefaultResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampHeaderDefaultResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  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());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_timestamp_header_default::de_malformed_timestamp_header_default_http_error(status, headers, body)
         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_header_default::MalformedTimestampHeaderDefaultError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_header_default::de_malformed_timestamp_header_default_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, MalformedTimestampHeaderDefault::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_header_default::MalformedTimestampHeaderDefaultOutput::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 MalformedTimestampHeaderDefaultRequestSerializer;
  162    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampHeaderDefaultRequestSerializer {
  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_header_default::MalformedTimestampHeaderDefaultInput>()
  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_header_default::MalformedTimestampHeaderDefaultInput,
  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, "/MalformedTimestampHeaderDefault").expect("formatting should succeed");
  184         -
                ::std::result::Result::Ok(())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, MalformedTimestampHeaderDefault::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/MalformedTimestampHeaderDefault".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.timestamp {
         215  +
                    request.headers_mut().insert(
         216  +
                        "timestamp",
         217  +
                        val.fmt(::aws_smithy_types::date_time::Format::HttpDate).expect("valid timestamp"),
         218  +
                    );
         219  +
                }
         220  +
                if !query_params.is_empty() {
         221  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         222  +
                    let pairs: Vec<String> = query_params
         223  +
                        .iter()
         224  +
                        .map(|(k, v)| {
         225  +
                            format!(
         226  +
                                "{}={}",
         227  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         228  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         229  +
                            )
         230  +
                        })
         231  +
                        .collect();
         232  +
                    uri.push_str(&pairs.join("&"));
         233  +
                }
         234  +
                request.set_uri(uri.as_str()).expect("valid URI");
  185    235   
            }
  186         -
            #[allow(clippy::unnecessary_wraps)]
  187         -
            fn update_http_builder(
  188         -
                input: &crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultInput,
  189         -
                builder: ::http_1x::request::Builder,
  190         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191         -
                let mut uri = ::std::string::String::new();
  192         -
                uri_base(input, &mut uri)?;
  193         -
                let builder =
  194         -
                    crate::protocol_serde::shape_malformed_timestamp_header_default::ser_malformed_timestamp_header_default_headers(input, builder)?;
  195         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  196         -
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder
  199         -
        };
  200         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  201    236   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         237  +
            return ::std::result::Result::Ok(request);
         238  +
        } else {
         239  +
            let mut request = protocol
         240  +
                .serialize_request(&input, MalformedTimestampHeaderDefault::INPUT_SCHEMA, "", _cfg)
         241  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         242  +
         243  +
            return ::std::result::Result::Ok(request);
         244  +
        }
  203    245   
    }
  204    246   
}
  205    247   
#[derive(Debug)]
  206    248   
struct MalformedTimestampHeaderDefaultEndpointParamsInterceptor;
  207    249   
  208    250   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampHeaderDefaultEndpointParamsInterceptor {
  209    251   
    fn name(&self) -> &'static str {
  210    252   
        "MalformedTimestampHeaderDefaultEndpointParamsInterceptor"
  211    253   
    }
  212    254   

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

@@ -5,5 +104,130 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Timestamp,
   27     27   
    "timestamp",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_header("timestamp");
   31     31   
static MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_MEMBER_TIMESTAMP],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          37  +
    "POST",
          38  +
    "/MalformedTimestampHeaderDefault",
          39  +
    None,
          40  +
));
   36     41   
impl MalformedTimestampHeaderDefaultInput {
   37     42   
    /// The schema for this shape.
   38     43   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_SCHEMA;
   39     44   
}
   40     45   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampHeaderDefaultInput {
   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(&MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_MEMBER_TIMESTAMP, val)?;
   48     53   
        }
   49     54   
        Ok(())
   50     55   
    }
   51     56   
}
   52     57   
impl MalformedTimestampHeaderDefaultInput {
   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(&MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_SCHEMA, (), |_, member, deser| {
          71  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADERDEFAULTINPUT_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)));
          81  +
        builder
          82  +
            .build()
          83  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          84  +
    }
          85  +
}
          86  +
impl MalformedTimestampHeaderDefaultInput {
          87  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          88  +
    /// Header-bound members are read directly from headers, avoiding runtime
          89  +
    /// member iteration overhead. Body members are read via the deserializer.
          90  +
    pub fn deserialize_with_response(
          91  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          92  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          93  +
        _status: u16,
          94  +
        _body: &[u8],
          95  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          96  +
        #[allow(unused_variables, unused_mut)]
          97  +
        let mut builder = Self::builder();
          98  +
        if let Some(val) = headers.get("timestamp") {
          99  +
            builder.timestamp = ::aws_smithy_types::DateTime::from_str(val, ::aws_smithy_types::date_time::Format::HttpDate).ok();
         100  +
        }
   75    101   
        builder
   76    102   
            .build()
   77    103   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78    104   
    }
   79    105   
}
   80    106   
impl MalformedTimestampHeaderDefaultInput {
   81    107   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderDefaultInput`](crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultInput).
   82    108   
    pub fn builder() -> crate::operation::malformed_timestamp_header_default::builders::MalformedTimestampHeaderDefaultInputBuilder {
   83    109   
        crate::operation::malformed_timestamp_header_default::builders::MalformedTimestampHeaderDefaultInputBuilder::default()
   84    110   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_header_default/_malformed_timestamp_header_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 MalformedTimestampHeaderDefaultOutput {
   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(&MALFORMEDTIMESTAMPHEADERDEFAULTOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADERDEFAULTOUTPUT_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 MalformedTimestampHeaderDefaultOutput {
          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 MalformedTimestampHeaderDefaultOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderDefaultOutput`](crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_header_default::builders::MalformedTimestampHeaderDefaultOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_header_default::builders::MalformedTimestampHeaderDefaultOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampHeaderDefaultOutput`](crate::operation::malformed_timestamp_header_default::MalformedTimestampHeaderDefaultOutput).
   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_header_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 `MalformedTimestampHeaderEpoch`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct MalformedTimestampHeaderEpoch;
    6      6   
impl MalformedTimestampHeaderEpoch {
    7      7   
    /// Creates a new `MalformedTimestampHeaderEpoch`
    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_header_epoch::MalformedTimestampHeaderEpochInput::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_header_epoch::MalformedTimestampHeaderEpochOutput::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_header_epoch::MalformedTimestampHeaderEpochInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -113,119 +230,274 @@
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct MalformedTimestampHeaderEpochResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampHeaderEpochResponseDeserializer {
  140    146   
    fn deserialize_nonstreaming(
  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());
         152  +
        #[allow(unused_mut)]
         153  +
        let mut force_error = false;
         154  +
         155  +
        if !success && status != 200 || force_error {
  145    156   
            let headers = response.headers();
  146    157   
            let body = response.body().bytes().expect("body loaded");
  147    158   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         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  +
            })?;
  149    162   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_malformed_timestamp_header_epoch::de_malformed_timestamp_header_epoch_http_error(status, headers, body)
         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_header_epoch::MalformedTimestampHeaderEpochError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_malformed_timestamp_header_epoch::de_malformed_timestamp_header_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, MalformedTimestampHeaderEpoch::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_header_epoch::MalformedTimestampHeaderEpochOutput::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 MalformedTimestampHeaderEpochRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampHeaderEpochRequestSerializer {
  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_header_epoch::MalformedTimestampHeaderEpochInput>()
  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_header_epoch::MalformedTimestampHeaderEpochInput,
  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, "/MalformedTimestampHeaderEpoch").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, MalformedTimestampHeaderEpoch::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/MalformedTimestampHeaderEpoch".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.timestamp {
         215  +
                    request.headers_mut().insert(
         216  +
                        "timestamp",
         217  +
                        val.fmt(::aws_smithy_types::date_time::Format::EpochSeconds).expect("valid timestamp"),
         218  +
                    );
         219  +
                }
         220  +
                if !query_params.is_empty() {
         221  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         222  +
                    let pairs: Vec<String> = query_params
         223  +
                        .iter()
         224  +
                        .map(|(k, v)| {
         225  +
                            format!(
         226  +
                                "{}={}",
         227  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         228  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         229  +
                            )
         230  +
                        })
         231  +
                        .collect();
         232  +
                    uri.push_str(&pairs.join("&"));
         233  +
                }
         234  +
                request.set_uri(uri.as_str()).expect("valid URI");
  183    235   
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                let builder =
  192         -
                    crate::protocol_serde::shape_malformed_timestamp_header_epoch::ser_malformed_timestamp_header_epoch_headers(input, builder)?;
  193         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  194         -
            }
  195         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  196         -
            builder
  197         -
        };
  198         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  199    236   
  200         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         237  +
            return ::std::result::Result::Ok(request);
         238  +
        } else {
         239  +
            let mut request = protocol
         240  +
                .serialize_request(&input, MalformedTimestampHeaderEpoch::INPUT_SCHEMA, "", _cfg)
         241  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         242  +
         243  +
            return ::std::result::Result::Ok(request);
         244  +
        }
  201    245   
    }
  202    246   
}
  203    247   
#[derive(Debug)]
  204    248   
struct MalformedTimestampHeaderEpochEndpointParamsInterceptor;
  205    249   
  206    250   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampHeaderEpochEndpointParamsInterceptor {
  207    251   
    fn name(&self) -> &'static str {
  208    252   
        "MalformedTimestampHeaderEpochEndpointParamsInterceptor"
  209    253   
    }
  210    254   

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

@@ -6,6 +105,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_header("timestamp");
   32     32   
static MALFORMEDTIMESTAMPHEADEREPOCHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    MALFORMEDTIMESTAMPHEADEREPOCHINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&MALFORMEDTIMESTAMPHEADEREPOCHINPUT_MEMBER_TIMESTAMP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/MalformedTimestampHeaderEpoch", None));
   37     38   
impl MalformedTimestampHeaderEpochInput {
   38     39   
    /// The schema for this shape.
   39     40   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MALFORMEDTIMESTAMPHEADEREPOCHINPUT_SCHEMA;
   40     41   
}
   41     42   
impl ::aws_smithy_schema::serde::SerializableStruct for MalformedTimestampHeaderEpochInput {
   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(&MALFORMEDTIMESTAMPHEADEREPOCHINPUT_MEMBER_TIMESTAMP, val)?;
   49     50   
        }
   50     51   
        Ok(())
   51     52   
    }
   52     53   
}
   53     54   
impl MalformedTimestampHeaderEpochInput {
   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(&MALFORMEDTIMESTAMPHEADEREPOCHINPUT_SCHEMA, (), |_, member, deser| {
          68  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADEREPOCHINPUT_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)));
          78  +
        builder
          79  +
            .build()
          80  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          81  +
    }
          82  +
}
          83  +
impl MalformedTimestampHeaderEpochInput {
          84  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          85  +
    /// Header-bound members are read directly from headers, avoiding runtime
          86  +
    /// member iteration overhead. Body members are read via the deserializer.
          87  +
    pub fn deserialize_with_response(
          88  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          89  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          90  +
        _status: u16,
          91  +
        _body: &[u8],
          92  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          93  +
        #[allow(unused_variables, unused_mut)]
          94  +
        let mut builder = Self::builder();
          95  +
        if let Some(val) = headers.get("timestamp") {
          96  +
            builder.timestamp = val.parse::<f64>().ok().map(::aws_smithy_types::DateTime::from_secs_f64);
          97  +
        }
   76     98   
        builder
   77     99   
            .build()
   78    100   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   79    101   
    }
   80    102   
}
   81    103   
impl MalformedTimestampHeaderEpochInput {
   82    104   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderEpochInput`](crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochInput).
   83    105   
    pub fn builder() -> crate::operation::malformed_timestamp_header_epoch::builders::MalformedTimestampHeaderEpochInputBuilder {
   84    106   
        crate::operation::malformed_timestamp_header_epoch::builders::MalformedTimestampHeaderEpochInputBuilder::default()
   85    107   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_header_epoch/_malformed_timestamp_header_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 MalformedTimestampHeaderEpochOutput {
   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(&MALFORMEDTIMESTAMPHEADEREPOCHOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&MALFORMEDTIMESTAMPHEADEREPOCHOUTPUT_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 MalformedTimestampHeaderEpochOutput {
          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 MalformedTimestampHeaderEpochOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`MalformedTimestampHeaderEpochOutput`](crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochOutput).
   54     65   
    pub fn builder() -> crate::operation::malformed_timestamp_header_epoch::builders::MalformedTimestampHeaderEpochOutputBuilder {
   55     66   
        crate::operation::malformed_timestamp_header_epoch::builders::MalformedTimestampHeaderEpochOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`MalformedTimestampHeaderEpochOutput`](crate::operation::malformed_timestamp_header_epoch::MalformedTimestampHeaderEpochOutput).
   60     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   61     72   
#[non_exhaustive]