Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_operation/_endpoint_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation.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 `EndpointWithHostLabelHeaderOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EndpointWithHostLabelHeaderOperation;
    6      6   
impl EndpointWithHostLabelHeaderOperation {
    7      7   
    /// Creates a new `EndpointWithHostLabelHeaderOperation`
    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::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput::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::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct EndpointWithHostLabelHeaderOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointWithHostLabelHeaderOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_endpoint_with_host_label_header_operation::de_endpoint_with_host_label_header_operation_http_error(
  152    159   
                status, headers, body,

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation/_endpoint_with_host_label_header_operation_input.rs

@@ -1,1 +105,131 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "EndpointWithHostLabelHeaderOperationInput",
   19     19   
);
   20     20   
static ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#EndpointWithHostLabelHeaderOperationInput$accountId",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "EndpointWithHostLabelHeaderOperationInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "account_id",
          27  +
    "accountId",
   28     28   
    0,
   29     29   
)
   30     30   
.with_host_label()
   31     31   
.with_http_header("X-Amz-Account-Id");
   32     32   
static ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          38  +
    "POST",
          39  +
    "/EndpointWithHostLabelHeaderOperation",
          40  +
    None,
          41  +
));
   37     42   
impl EndpointWithHostLabelHeaderOperationInput {
   38     43   
    /// The schema for this shape.
   39     44   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA;
   40     45   
}
   41     46   
impl ::aws_smithy_schema::serde::SerializableStruct for EndpointWithHostLabelHeaderOperationInput {
   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.account_id {
   48     53   
            ser.write_string(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID, val)?;
   49     54   
        }
   50     55   
        Ok(())
   51     56   
    }
   52     57   
}
   53     58   
impl EndpointWithHostLabelHeaderOperationInput {
   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(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          72  +
        deserializer.read_struct(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA, &mut |member, deser| {
   68     73   
            match member.member_index() {
   69     74   
                Some(0) => {
   70     75   
                    builder.account_id = Some(deser.read_string(member)?);
   71     76   
                }
   72     77   
                _ => {}
   73     78   
            }
   74     79   
            Ok(())
   75     80   
        })?;
          81  +
        builder.account_id = builder.account_id.or(Some(String::new()));
          82  +
        builder
          83  +
            .build()
          84  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          85  +
    }
          86  +
}
          87  +
impl EndpointWithHostLabelHeaderOperationInput {
          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("X-Amz-Account-Id") {
         100  +
            builder.account_id = Some(val.to_string());
         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 EndpointWithHostLabelHeaderOperationInput {
   82    108   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelHeaderOperationInput`](crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationInput).
   83    109   
    pub fn builder() -> crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder {
   84    110   
        crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder::default()
   85    111   
    }

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation/_endpoint_with_host_label_header_operation_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 EndpointWithHostLabelHeaderOperationOutput {
   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(&ENDPOINTWITHHOSTLABELHEADEROPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&ENDPOINTWITHHOSTLABELHEADEROPERATIONOUTPUT_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 EndpointWithHostLabelHeaderOperationOutput {
          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 EndpointWithHostLabelHeaderOperationOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelHeaderOperationOutput`](crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput).
   54     65   
    pub fn builder() -> crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationOutputBuilder {
   55     66   
        crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`EndpointWithHostLabelHeaderOperationOutput`](crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput).
   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_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation.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 `EndpointWithHostLabelOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EndpointWithHostLabelOperation;
    6      6   
impl EndpointWithHostLabelOperation {
    7      7   
    /// Creates a new `EndpointWithHostLabelOperation`
    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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct EndpointWithHostLabelOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointWithHostLabelOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_error(status, headers, body)
  152    159   
        } else {

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_operation_input.rs

@@ -5,5 +109,122 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27     27   
    "label",
   28     28   
    0,
   29     29   
)
   30     30   
.with_host_label();
   31     31   
static ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&ENDPOINTWITHHOSTLABELOPERATIONINPUT_MEMBER_LABEL],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/EndpointWithHostLabelOperation", None));
   36     37   
impl EndpointWithHostLabelOperationInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for EndpointWithHostLabelOperationInput {
   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.label {
   47     48   
            ser.write_string(&ENDPOINTWITHHOSTLABELOPERATIONINPUT_MEMBER_LABEL, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl EndpointWithHostLabelOperationInput {
   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(&ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&ENDPOINTWITHHOSTLABELOPERATIONINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.label = Some(deser.read_string(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
          76  +
        builder.label = builder.label.or(Some(String::new()));
   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 EndpointWithHostLabelOperationInput {
          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 EndpointWithHostLabelOperationInput {
   81     94   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
   82     95   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
   83     96   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder::default()
   84     97   
    }
   85     98   
}
   86     99   
   87    100   
/// A builder for [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
   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_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_operation_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 EndpointWithHostLabelOperationOutput {
   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(&ENDPOINTWITHHOSTLABELOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&ENDPOINTWITHHOSTLABELOPERATIONOUTPUT_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 EndpointWithHostLabelOperationOutput {
          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 EndpointWithHostLabelOperationOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
   54     65   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder {
   55     66   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
   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_xml/rust-client-codegen/src/operation/flattened_xml_map.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `FlattenedXmlMap`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct FlattenedXmlMap;
    6      6   
impl FlattenedXmlMap {
    7      7   
    /// Creates a new `FlattenedXmlMap`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::flattened_xml_map::FlattenedXmlMapInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::flattened_xml_map::FlattenedXmlMapOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::flattened_xml_map::FlattenedXmlMapInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::flattened_xml_map::FlattenedXmlMapOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::flattened_xml_map::FlattenedXmlMapError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +166,171 @@
  124    128   
                crate::operation::flattened_xml_map::FlattenedXmlMapError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct FlattenedXmlMapResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139    144   
        let headers = response.headers();
  140    145   
        let body = response.body().bytes().expect("body loaded");
  141    146   
        #[allow(unused_mut)]
  142    147   
        let mut force_error = false;
  143    148   
  144    149   
        let parse_result = if !success && status != 200 || force_error {
  145    150   
            crate::protocol_serde::shape_flattened_xml_map::de_flattened_xml_map_http_error(status, headers, body)
  146    151   
        } else {
@@ -293,298 +353,362 @@
  313    318   
            .expect("the config must have a deserializer");
  314    319   
  315    320   
        let parsed = de.deserialize_streaming(&mut http_response);
  316    321   
        let parsed = parsed.unwrap_or_else(|| {
  317    322   
            let http_response = http_response.map(|body| {
  318    323   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  319    324   
                    body.bytes().unwrap(),
  320    325   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  321    326   
                )))
  322    327   
            });
  323         -
            de.deserialize_nonstreaming(&http_response)
         328  +
            // Build a config bag with the protocol for schema-based deserialization
         329  +
            #[allow(unused_mut)]
         330  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         331  +
         332  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  324    333   
        });
  325    334   
        let parsed = parsed
  326    335   
            .expect("should be successful response")
  327    336   
            .downcast::<crate::operation::flattened_xml_map::FlattenedXmlMapOutput>()
  328    337   
            .unwrap();
  329    338   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  330    339   
    }
  331    340   
}
  332    341   
  333    342   
/// Error type for the `FlattenedXmlMapError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map/_flattened_xml_map_input.rs

@@ -1,1 +128,137 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "FlattenedXmlMapInput",
   19     19   
);
   20     20   
static FLATTENEDXMLMAPINPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#FlattenedXmlMapInput$myMap",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "FlattenedXmlMapInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Map,
   27         -
    "my_map",
          27  +
    "myMap",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_flattened();
   31     31   
static FLATTENEDXMLMAPINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    FLATTENEDXMLMAPINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&FLATTENEDXMLMAPINPUT_MEMBER_MY_MAP],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/FlattenedXmlMap", None));
   36     37   
impl FlattenedXmlMapInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FLATTENEDXMLMAPINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for FlattenedXmlMapInput {
   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.my_map {
   47     48   
            ser.write_map(
   48     49   
                &FLATTENEDXMLMAPINPUT_MEMBER_MY_MAP,
   49     50   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   50     51   
                    for (key, value) in val {
   51     52   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   52     53   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value.as_str())?;
   53     54   
                    }
   54     55   
                    Ok(())
   55     56   
                },
   56     57   
            )?;
   57     58   
        }
   58     59   
        Ok(())
   59     60   
    }
   60     61   
}
   61     62   
impl FlattenedXmlMapInput {
   62     63   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   63         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   64         -
        deserializer: &mut D,
          64  +
    pub fn deserialize(
          65  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   65     66   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   66     67   
        #[allow(unused_variables, unused_mut)]
   67     68   
        let mut builder = Self::builder();
   68     69   
        #[allow(
   69     70   
            unused_variables,
   70     71   
            unreachable_code,
   71     72   
            clippy::single_match,
   72     73   
            clippy::match_single_binding,
   73     74   
            clippy::diverging_sub_expression
   74     75   
        )]
   75         -
        deserializer.read_struct(&FLATTENEDXMLMAPINPUT_SCHEMA, (), |_, member, deser| {
          76  +
        deserializer.read_struct(&FLATTENEDXMLMAPINPUT_SCHEMA, &mut |member, deser| {
   76     77   
            match member.member_index() {
   77     78   
                Some(0) => {
   78     79   
                    builder.my_map = Some({
   79         -
                        let container = if let Some(cap) = deser.container_size() {
   80         -
                            std::collections::HashMap::with_capacity(cap)
   81         -
                        } else {
   82         -
                            std::collections::HashMap::new()
   83         -
                        };
   84         -
                        deser.read_map(member, container, |mut map, key, deser| {
   85         -
                            map.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
   86         -
                            Ok(map)
   87         -
                        })?
          80  +
                        let mut container = std::collections::HashMap::new();
          81  +
                        deser.read_map(member, &mut |key, deser| {
          82  +
                            container.insert(key, crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
          83  +
                            Ok(())
          84  +
                        })?;
          85  +
                        container
   88     86   
                    });
   89     87   
                }
   90     88   
                _ => {}
   91     89   
            }
   92     90   
            Ok(())
   93     91   
        })?;
   94     92   
        builder
   95     93   
            .build()
   96     94   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   97     95   
    }
   98     96   
}
          97  +
impl FlattenedXmlMapInput {
          98  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          99  +
    pub fn deserialize_with_response(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         101  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         102  +
        _status: u16,
         103  +
        _body: &[u8],
         104  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         105  +
        Self::deserialize(deserializer)
         106  +
    }
         107  +
}
   99    108   
impl FlattenedXmlMapInput {
  100    109   
    /// Creates a new builder-style object to manufacture [`FlattenedXmlMapInput`](crate::operation::flattened_xml_map::FlattenedXmlMapInput).
  101    110   
    pub fn builder() -> crate::operation::flattened_xml_map::builders::FlattenedXmlMapInputBuilder {
  102    111   
        crate::operation::flattened_xml_map::builders::FlattenedXmlMapInputBuilder::default()
  103    112   
    }
  104    113   
}
  105    114   
  106    115   
/// A builder for [`FlattenedXmlMapInput`](crate::operation::flattened_xml_map::FlattenedXmlMapInput).
  107    116   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  108    117   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map/_flattened_xml_map_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name.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 `FlattenedXmlMapWithXmlName`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct FlattenedXmlMapWithXmlName;
    6      6   
impl FlattenedXmlMapWithXmlName {
    7      7   
    /// Creates a new `FlattenedXmlMapWithXmlName`
    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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput::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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct FlattenedXmlMapWithXmlNameResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapWithXmlNameResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name_http_error(status, headers, body)
  152    159   
        } else {
@@ -289,296 +349,360 @@
  309    316   
            .expect("the config must have a deserializer");
  310    317   
  311    318   
        let parsed = de.deserialize_streaming(&mut http_response);
  312    319   
        let parsed = parsed.unwrap_or_else(|| {
  313    320   
            let http_response = http_response.map(|body| {
  314    321   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  315    322   
                    body.bytes().unwrap(),
  316    323   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  317    324   
                )))
  318    325   
            });
  319         -
            de.deserialize_nonstreaming(&http_response)
         326  +
            // Build a config bag with the protocol for schema-based deserialization
         327  +
            #[allow(unused_mut)]
         328  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         329  +
         330  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  320    331   
        });
  321    332   
        let parsed = parsed
  322    333   
            .expect("should be successful response")
  323    334   
            .downcast::<crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput>()
  324    335   
            .unwrap();
  325    336   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  326    337   
    }
  327    338   
}
  328    339   
  329    340   
/// Error type for the `FlattenedXmlMapWithXmlNameError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name/_flattened_xml_map_with_xml_name_input.rs

@@ -1,1 +129,131 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "FlattenedXmlMapWithXmlNameInput",
   19     19   
);
   20     20   
static FLATTENEDXMLMAPWITHXMLNAMEINPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNameInput$myMap",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "FlattenedXmlMapWithXmlNameInput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Map,
   27         -
    "my_map",
          27  +
    "myMap",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_name("KVP")
   31     31   
.with_xml_flattened();
   32     32   
static FLATTENEDXMLMAPWITHXMLNAMEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    FLATTENEDXMLMAPWITHXMLNAMEINPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&FLATTENEDXMLMAPWITHXMLNAMEINPUT_MEMBER_MY_MAP],
   36         -
);
          36  +
)
          37  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/FlattenedXmlMapWithXmlName", None));
   37     38   
impl FlattenedXmlMapWithXmlNameInput {
   38     39   
    /// The schema for this shape.
   39     40   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FLATTENEDXMLMAPWITHXMLNAMEINPUT_SCHEMA;
   40     41   
}
   41     42   
impl ::aws_smithy_schema::serde::SerializableStruct for FlattenedXmlMapWithXmlNameInput {
   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.my_map {
   48     49   
            ser.write_map(
   49     50   
                &FLATTENEDXMLMAPWITHXMLNAMEINPUT_MEMBER_MY_MAP,
   50     51   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   51     52   
                    for (key, value) in val {
   52     53   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   53     54   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   54     55   
                    }
   55     56   
                    Ok(())
   56     57   
                },
   57     58   
            )?;
   58     59   
        }
   59     60   
        Ok(())
   60     61   
    }
   61     62   
}
   62     63   
impl FlattenedXmlMapWithXmlNameInput {
   63     64   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   64         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   65         -
        deserializer: &mut D,
          65  +
    pub fn deserialize(
          66  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   66     67   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   67     68   
        #[allow(unused_variables, unused_mut)]
   68     69   
        let mut builder = Self::builder();
   69     70   
        #[allow(
   70     71   
            unused_variables,
   71     72   
            unreachable_code,
   72     73   
            clippy::single_match,
   73     74   
            clippy::match_single_binding,
   74     75   
            clippy::diverging_sub_expression
   75     76   
        )]
   76         -
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMEINPUT_SCHEMA, (), |_, member, deser| {
          77  +
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMEINPUT_SCHEMA, &mut |member, deser| {
   77     78   
            match member.member_index() {
   78     79   
                Some(0) => {
   79         -
                    builder.my_map = Some({
   80         -
                        let container = if let Some(cap) = deser.container_size() {
   81         -
                            std::collections::HashMap::with_capacity(cap)
   82         -
                        } else {
   83         -
                            std::collections::HashMap::new()
   84         -
                        };
   85         -
                        deser.read_map(member, container, |mut map, key, deser| {
   86         -
                            map.insert(key, deser.read_string(member)?);
   87         -
                            Ok(map)
   88         -
                        })?
   89         -
                    });
          80  +
                    builder.my_map = Some(deser.read_string_string_map(member)?);
   90     81   
                }
   91     82   
                _ => {}
   92     83   
            }
   93     84   
            Ok(())
   94     85   
        })?;
   95     86   
        builder
   96     87   
            .build()
   97     88   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   98     89   
    }
   99     90   
}
          91  +
impl FlattenedXmlMapWithXmlNameInput {
          92  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          93  +
    pub fn deserialize_with_response(
          94  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          95  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          96  +
        _status: u16,
          97  +
        _body: &[u8],
          98  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          99  +
        Self::deserialize(deserializer)
         100  +
    }
         101  +
}
  100    102   
impl FlattenedXmlMapWithXmlNameInput {
  101    103   
    /// Creates a new builder-style object to manufacture [`FlattenedXmlMapWithXmlNameInput`](crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput).
  102    104   
    pub fn builder() -> crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameInputBuilder {
  103    105   
        crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameInputBuilder::default()
  104    106   
    }
  105    107   
}
  106    108   
  107    109   
/// A builder for [`FlattenedXmlMapWithXmlNameInput`](crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput).
  108    110   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  109    111   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name/_flattened_xml_map_with_xml_name_output.rs

@@ -1,1 +127,128 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "FlattenedXmlMapWithXmlNameOutput",
   19     19   
);
   20     20   
static FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNameOutput$myMap",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "FlattenedXmlMapWithXmlNameOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Map,
   27         -
    "my_map",
          27  +
    "myMap",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_name("KVP")
   31     31   
.with_xml_flattened();
   32     32   
static FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     33   
    FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_SCHEMA_ID,
   34     34   
    ::aws_smithy_schema::ShapeType::Structure,
   35     35   
    &[&FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_MEMBER_MY_MAP],
   36     36   
);
   37     37   
impl FlattenedXmlMapWithXmlNameOutput {
   38     38   
    /// The schema for this shape.
   39     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_SCHEMA;
   40     40   
}
   41     41   
impl ::aws_smithy_schema::serde::SerializableStruct for FlattenedXmlMapWithXmlNameOutput {
   42     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     43   
    fn serialize_members(
   44     44   
        &self,
   45     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     47   
        if let Some(ref val) = self.my_map {
   48     48   
            ser.write_map(
   49     49   
                &FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_MEMBER_MY_MAP,
   50     50   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   51     51   
                    for (key, value) in val {
   52     52   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   53     53   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   54     54   
                    }
   55     55   
                    Ok(())
   56     56   
                },
   57     57   
            )?;
   58     58   
        }
   59     59   
        Ok(())
   60     60   
    }
   61     61   
}
   62     62   
impl FlattenedXmlMapWithXmlNameOutput {
   63     63   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   64         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   65         -
        deserializer: &mut D,
          64  +
    pub fn deserialize(
          65  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   66     66   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   67     67   
        #[allow(unused_variables, unused_mut)]
   68     68   
        let mut builder = Self::builder();
   69     69   
        #[allow(
   70     70   
            unused_variables,
   71     71   
            unreachable_code,
   72     72   
            clippy::single_match,
   73     73   
            clippy::match_single_binding,
   74     74   
            clippy::diverging_sub_expression
   75     75   
        )]
   76         -
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_SCHEMA, (), |_, member, deser| {
          76  +
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMEOUTPUT_SCHEMA, &mut |member, deser| {
   77     77   
            match member.member_index() {
   78     78   
                Some(0) => {
   79         -
                    builder.my_map = Some({
   80         -
                        let container = if let Some(cap) = deser.container_size() {
   81         -
                            std::collections::HashMap::with_capacity(cap)
   82         -
                        } else {
   83         -
                            std::collections::HashMap::new()
   84         -
                        };
   85         -
                        deser.read_map(member, container, |mut map, key, deser| {
   86         -
                            map.insert(key, deser.read_string(member)?);
   87         -
                            Ok(map)
   88         -
                        })?
   89         -
                    });
          79  +
                    builder.my_map = Some(deser.read_string_string_map(member)?);
   90     80   
                }
   91     81   
                _ => {}
   92     82   
            }
   93     83   
            Ok(())
   94     84   
        })?;
   95     85   
        Ok(builder.build())
   96     86   
    }
   97     87   
}
          88  +
impl FlattenedXmlMapWithXmlNameOutput {
          89  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          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  +
        Self::deserialize(deserializer)
          97  +
    }
          98  +
}
   98     99   
impl FlattenedXmlMapWithXmlNameOutput {
   99    100   
    /// Creates a new builder-style object to manufacture [`FlattenedXmlMapWithXmlNameOutput`](crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput).
  100    101   
    pub fn builder() -> crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameOutputBuilder {
  101    102   
        crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameOutputBuilder::default()
  102    103   
    }
  103    104   
}
  104    105   
  105    106   
/// A builder for [`FlattenedXmlMapWithXmlNameOutput`](crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput).
  106    107   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  107    108   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace.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 `FlattenedXmlMapWithXmlNamespace`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct FlattenedXmlMapWithXmlNamespace;
    6      6   
impl FlattenedXmlMapWithXmlNamespace {
    7      7   
    /// Creates a new `FlattenedXmlMapWithXmlNamespace`
    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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput::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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +172,179 @@
  130    136   
                crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct FlattenedXmlMapWithXmlNamespaceResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapWithXmlNamespaceResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145    152   
        let headers = response.headers();
  146    153   
        let body = response.body().bytes().expect("body loaded");
  147    154   
        #[allow(unused_mut)]
  148    155   
        let mut force_error = false;
  149    156   
  150    157   
        let parse_result = if !success && status != 200 || force_error {
  151    158   
            crate::protocol_serde::shape_flattened_xml_map_with_xml_namespace::de_flattened_xml_map_with_xml_namespace_http_error(
  152    159   
                status, headers, body,
@@ -250,257 +310,321 @@
  270    277   
            .expect("the config must have a deserializer");
  271    278   
  272    279   
        let parsed = de.deserialize_streaming(&mut http_response);
  273    280   
        let parsed = parsed.unwrap_or_else(|| {
  274    281   
            let http_response = http_response.map(|body| {
  275    282   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  276    283   
                    body.bytes().unwrap(),
  277    284   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  278    285   
                )))
  279    286   
            });
  280         -
            de.deserialize_nonstreaming(&http_response)
         287  +
            // Build a config bag with the protocol for schema-based deserialization
         288  +
            #[allow(unused_mut)]
         289  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         290  +
         291  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  281    292   
        });
  282    293   
        let parsed = parsed
  283    294   
            .expect("should be successful response")
  284    295   
            .downcast::<crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput>()
  285    296   
            .unwrap();
  286    297   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  287    298   
    }
  288    299   
}
  289    300   
  290    301   
/// Error type for the `FlattenedXmlMapWithXmlNamespaceError` operation.

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace/_flattened_xml_map_with_xml_namespace_input.rs

@@ -1,1 +75,93 @@
    5      5   
pub struct FlattenedXmlMapWithXmlNamespaceInput {}
    6      6   
static FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNamespaceInput",
    8      8   
    "aws.protocoltests.restxml.synthetic",
    9      9   
    "FlattenedXmlMapWithXmlNamespaceInput",
   10     10   
);
   11     11   
static FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   12     12   
    FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA_ID,
   13     13   
    ::aws_smithy_schema::ShapeType::Structure,
   14     14   
    &[],
   15         -
);
          15  +
)
          16  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          17  +
    "POST",
          18  +
    "/FlattenedXmlMapWithXmlNamespace",
          19  +
    None,
          20  +
));
   16     21   
impl FlattenedXmlMapWithXmlNamespaceInput {
   17     22   
    /// The schema for this shape.
   18     23   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA;
   19     24   
}
   20     25   
impl ::aws_smithy_schema::serde::SerializableStruct for FlattenedXmlMapWithXmlNamespaceInput {
   21     26   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     27   
    fn serialize_members(
   23     28   
        &self,
   24     29   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     30   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     31   
        Ok(())
   27     32   
    }
   28     33   
}
   29     34   
impl FlattenedXmlMapWithXmlNamespaceInput {
   30     35   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          36  +
    pub fn deserialize(
          37  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     38   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     39   
        #[allow(unused_variables, unused_mut)]
   35     40   
        let mut builder = Self::builder();
   36     41   
        #[allow(
   37     42   
            unused_variables,
   38     43   
            unreachable_code,
   39     44   
            clippy::single_match,
   40     45   
            clippy::match_single_binding,
   41     46   
            clippy::diverging_sub_expression
   42     47   
        )]
   43         -
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA, (), |_, member, deser| {
          48  +
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMESPACEINPUT_SCHEMA, &mut |member, deser| {
   44     49   
            match member.member_index() {
   45     50   
                _ => {}
   46     51   
            }
   47     52   
            Ok(())
   48     53   
        })?;
   49     54   
        builder
   50     55   
            .build()
   51     56   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   52     57   
    }
   53     58   
}
          59  +
impl FlattenedXmlMapWithXmlNamespaceInput {
          60  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          61  +
    pub fn deserialize_with_response(
          62  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          63  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          64  +
        _status: u16,
          65  +
        _body: &[u8],
          66  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          67  +
        Self::builder()
          68  +
            .build()
          69  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          70  +
    }
          71  +
}
   54     72   
impl FlattenedXmlMapWithXmlNamespaceInput {
   55     73   
    /// Creates a new builder-style object to manufacture [`FlattenedXmlMapWithXmlNamespaceInput`](crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput).
   56     74   
    pub fn builder() -> crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceInputBuilder {
   57     75   
        crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceInputBuilder::default()
   58     76   
    }
   59     77   
}
   60     78   
   61     79   
/// A builder for [`FlattenedXmlMapWithXmlNamespaceInput`](crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput).
   62     80   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   63     81   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace/_flattened_xml_map_with_xml_namespace_output.rs

@@ -1,1 +128,129 @@
   17     17   
    "aws.protocoltests.restxml.synthetic",
   18     18   
    "FlattenedXmlMapWithXmlNamespaceOutput",
   19     19   
);
   20     20   
static FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_MEMBER_MY_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNamespaceOutput$myMap",
   23     23   
        "aws.protocoltests.restxml.synthetic",
   24     24   
        "FlattenedXmlMapWithXmlNamespaceOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::Map,
   27         -
    "my_map",
          27  +
    "myMap",
   28     28   
    0,
   29     29   
)
   30     30   
.with_xml_name("KVP")
   31     31   
.with_xml_flattened()
   32     32   
.with_xml_namespace();
   33     33   
static FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   34     34   
    FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_SCHEMA_ID,
   35     35   
    ::aws_smithy_schema::ShapeType::Structure,
   36     36   
    &[&FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_MEMBER_MY_MAP],
   37     37   
);
   38     38   
impl FlattenedXmlMapWithXmlNamespaceOutput {
   39     39   
    /// The schema for this shape.
   40     40   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_SCHEMA;
   41     41   
}
   42     42   
impl ::aws_smithy_schema::serde::SerializableStruct for FlattenedXmlMapWithXmlNamespaceOutput {
   43     43   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   44     44   
    fn serialize_members(
   45     45   
        &self,
   46     46   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   47     47   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   48     48   
        if let Some(ref val) = self.my_map {
   49     49   
            ser.write_map(
   50     50   
                &FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_MEMBER_MY_MAP,
   51     51   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   52     52   
                    for (key, value) in val {
   53     53   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   54     54   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
   55     55   
                    }
   56     56   
                    Ok(())
   57     57   
                },
   58     58   
            )?;
   59     59   
        }
   60     60   
        Ok(())
   61     61   
    }
   62     62   
}
   63     63   
impl FlattenedXmlMapWithXmlNamespaceOutput {
   64     64   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   65         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   66         -
        deserializer: &mut D,
          65  +
    pub fn deserialize(
          66  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   67     67   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   68     68   
        #[allow(unused_variables, unused_mut)]
   69     69   
        let mut builder = Self::builder();
   70     70   
        #[allow(
   71     71   
            unused_variables,
   72     72   
            unreachable_code,
   73     73   
            clippy::single_match,
   74     74   
            clippy::match_single_binding,
   75     75   
            clippy::diverging_sub_expression
   76     76   
        )]
   77         -
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_SCHEMA, (), |_, member, deser| {
          77  +
        deserializer.read_struct(&FLATTENEDXMLMAPWITHXMLNAMESPACEOUTPUT_SCHEMA, &mut |member, deser| {
   78     78   
            match member.member_index() {
   79     79   
                Some(0) => {
   80         -
                    builder.my_map = Some({
   81         -
                        let container = if let Some(cap) = deser.container_size() {
   82         -
                            std::collections::HashMap::with_capacity(cap)
   83         -
                        } else {
   84         -
                            std::collections::HashMap::new()
   85         -
                        };
   86         -
                        deser.read_map(member, container, |mut map, key, deser| {
   87         -
                            map.insert(key, deser.read_string(member)?);
   88         -
                            Ok(map)
   89         -
                        })?
   90         -
                    });
          80  +
                    builder.my_map = Some(deser.read_string_string_map(member)?);
   91     81   
                }
   92     82   
                _ => {}
   93     83   
            }
   94     84   
            Ok(())
   95     85   
        })?;
   96     86   
        Ok(builder.build())
   97     87   
    }
   98     88   
}
          89  +
impl FlattenedXmlMapWithXmlNamespaceOutput {
          90  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          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  +
        Self::deserialize(deserializer)
          98  +
    }
          99  +
}
   99    100   
impl FlattenedXmlMapWithXmlNamespaceOutput {
  100    101   
    /// Creates a new builder-style object to manufacture [`FlattenedXmlMapWithXmlNamespaceOutput`](crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput).
  101    102   
    pub fn builder() -> crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceOutputBuilder {
  102    103   
        crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceOutputBuilder::default()
  103    104   
    }
  104    105   
}
  105    106   
  106    107   
/// A builder for [`FlattenedXmlMapWithXmlNamespaceOutput`](crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput).
  107    108   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  108    109   
#[non_exhaustive]