Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/_union_payload_event.rs

@@ -17,17 +110,118 @@
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UNIONPAYLOADEVENT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for UnionPayloadEvent {
   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.payload {
   47         -
            ser.write_null(&UNIONPAYLOADEVENT_MEMBER_PAYLOAD)?;
          47  +
            ser.write_struct(&UNIONPAYLOADEVENT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl UnionPayloadEvent {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&UNIONPAYLOADEVENT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&UNIONPAYLOADEVENT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69         -
                    builder.payload = Some({
   70         -
                        let _ = member;
   71         -
                        todo!("deserialize aggregate")
   72         -
                    });
          69  +
                    builder.payload = Some(crate::types::PayloadUnion::deserialize(deser)?);
   73     70   
                }
   74     71   
                _ => {}
   75     72   
            }
   76     73   
            Ok(())
   77     74   
        })?;
   78     75   
        Ok(builder.build())
   79     76   
    }
   80     77   
}
          78  +
impl UnionPayloadEvent {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   81     89   
impl UnionPayloadEvent {
   82     90   
    /// Creates a new builder-style object to manufacture [`UnionPayloadEvent`](crate::types::UnionPayloadEvent).
   83     91   
    pub fn builder() -> crate::types::builders::UnionPayloadEventBuilder {
   84     92   
        crate::types::builders::UnionPayloadEventBuilder::default()
   85     93   
    }
   86     94   
}
   87     95   
   88     96   
/// A builder for [`UnionPayloadEvent`](crate::types::UnionPayloadEvent).
   89     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   90     98   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/_union_with_json_name.rs

@@ -37,37 +0,156 @@
   57     57   
    }
   58     58   
    /// Returns true if this is a [`Foo`](crate::types::UnionWithJsonName::Foo).
   59     59   
    pub fn is_foo(&self) -> bool {
   60     60   
        self.as_foo().is_ok()
   61     61   
    }
   62     62   
    /// Returns true if the enum instance is the `Unknown` variant.
   63     63   
    pub fn is_unknown(&self) -> bool {
   64     64   
        matches!(self, Self::Unknown)
   65     65   
    }
   66     66   
}
          67  +
static UNIONWITHJSONNAME_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
          68  +
    "aws.protocoltests.restjson#UnionWithJsonName",
          69  +
    "aws.protocoltests.restjson",
          70  +
    "UnionWithJsonName",
          71  +
);
          72  +
static UNIONWITHJSONNAME_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          73  +
    ::aws_smithy_schema::ShapeId::from_static(
          74  +
        "aws.protocoltests.restjson#UnionWithJsonName$foo",
          75  +
        "aws.protocoltests.restjson",
          76  +
        "UnionWithJsonName",
          77  +
    ),
          78  +
    ::aws_smithy_schema::ShapeType::String,
          79  +
    "foo",
          80  +
    0,
          81  +
)
          82  +
.with_json_name("FOO");
          83  +
static UNIONWITHJSONNAME_MEMBER_BAR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          84  +
    ::aws_smithy_schema::ShapeId::from_static(
          85  +
        "aws.protocoltests.restjson#UnionWithJsonName$bar",
          86  +
        "aws.protocoltests.restjson",
          87  +
        "UnionWithJsonName",
          88  +
    ),
          89  +
    ::aws_smithy_schema::ShapeType::String,
          90  +
    "bar",
          91  +
    1,
          92  +
);
          93  +
static UNIONWITHJSONNAME_MEMBER_BAZ: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          94  +
    ::aws_smithy_schema::ShapeId::from_static(
          95  +
        "aws.protocoltests.restjson#UnionWithJsonName$baz",
          96  +
        "aws.protocoltests.restjson",
          97  +
        "UnionWithJsonName",
          98  +
    ),
          99  +
    ::aws_smithy_schema::ShapeType::String,
         100  +
    "baz",
         101  +
    2,
         102  +
)
         103  +
.with_json_name("_baz");
         104  +
static UNIONWITHJSONNAME_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
         105  +
    UNIONWITHJSONNAME_SCHEMA_ID,
         106  +
    ::aws_smithy_schema::ShapeType::Union,
         107  +
    &[
         108  +
        &UNIONWITHJSONNAME_MEMBER_FOO,
         109  +
        &UNIONWITHJSONNAME_MEMBER_BAR,
         110  +
        &UNIONWITHJSONNAME_MEMBER_BAZ,
         111  +
    ],
         112  +
);
         113  +
impl UnionWithJsonName {
         114  +
    /// The schema for this shape.
         115  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UNIONWITHJSONNAME_SCHEMA;
         116  +
}
         117  +
impl ::aws_smithy_schema::serde::SerializableStruct for UnionWithJsonName {
         118  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         119  +
    fn serialize_members(
         120  +
        &self,
         121  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         122  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         123  +
        match self {
         124  +
            Self::Foo(val) => {
         125  +
                ser.write_string(&UNIONWITHJSONNAME_MEMBER_FOO, val)?;
         126  +
            }
         127  +
            Self::Bar(val) => {
         128  +
                ser.write_string(&UNIONWITHJSONNAME_MEMBER_BAR, val)?;
         129  +
            }
         130  +
            Self::Baz(val) => {
         131  +
                ser.write_string(&UNIONWITHJSONNAME_MEMBER_BAZ, val)?;
         132  +
            }
         133  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
         134  +
        }
         135  +
        Ok(())
         136  +
    }
         137  +
}
         138  +
impl UnionWithJsonName {
         139  +
    /// Deserializes this union from a [`ShapeDeserializer`].
         140  +
    pub fn deserialize(
         141  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         142  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         143  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
         144  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
         145  +
        deserializer.read_struct(&UNIONWITHJSONNAME_SCHEMA, &mut |member, deser| {
         146  +
            result = ::std::option::Option::Some(match member.member_index() {
         147  +
                Some(0) => Self::Foo(deser.read_string(member)?),
         148  +
                Some(1) => Self::Bar(deser.read_string(member)?),
         149  +
                Some(2) => Self::Baz(deser.read_string(member)?),
         150  +
                _ => Self::Unknown,
         151  +
            });
         152  +
            Ok(())
         153  +
        })?;
         154  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         155  +
    }
         156  +
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/_unit.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/error/_complex_error.rs

@@ -10,10 +173,214 @@
   30     30   
}
   31     31   
static COMPLEXERROR_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   32     32   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#ComplexError", "aws.protocoltests.restjson", "ComplexError");
   33     33   
static COMPLEXERROR_MEMBER_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   34     34   
    ::aws_smithy_schema::ShapeId::from_static(
   35     35   
        "aws.protocoltests.restjson#ComplexError$Header",
   36     36   
        "aws.protocoltests.restjson",
   37     37   
        "ComplexError",
   38     38   
    ),
   39     39   
    ::aws_smithy_schema::ShapeType::String,
   40         -
    "header",
          40  +
    "Header",
   41     41   
    0,
   42     42   
)
   43     43   
.with_http_header("X-Header");
   44     44   
static COMPLEXERROR_MEMBER_TOP_LEVEL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   45     45   
    ::aws_smithy_schema::ShapeId::from_static(
   46     46   
        "aws.protocoltests.restjson#ComplexError$TopLevel",
   47     47   
        "aws.protocoltests.restjson",
   48     48   
        "ComplexError",
   49     49   
    ),
   50     50   
    ::aws_smithy_schema::ShapeType::String,
   51         -
    "top_level",
          51  +
    "TopLevel",
   52     52   
    1,
   53     53   
);
   54     54   
static COMPLEXERROR_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "aws.protocoltests.restjson#ComplexError$Nested",
   57     57   
        "aws.protocoltests.restjson",
   58     58   
        "ComplexError",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::Structure,
   61         -
    "nested",
          61  +
    "Nested",
   62     62   
    2,
   63     63   
);
   64     64   
static COMPLEXERROR_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   65     65   
    ::aws_smithy_schema::ShapeId::from_static(
   66     66   
        "aws.protocoltests.restjson#ComplexError$Message",
   67     67   
        "aws.protocoltests.restjson",
   68     68   
        "ComplexError",
   69     69   
    ),
   70     70   
    ::aws_smithy_schema::ShapeType::String,
   71         -
    "message",
          71  +
    "Message",
   72     72   
    3,
   73     73   
);
   74     74   
static COMPLEXERROR_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   75     75   
    COMPLEXERROR_SCHEMA_ID,
   76     76   
    ::aws_smithy_schema::ShapeType::Structure,
   77     77   
    &[
   78     78   
        &COMPLEXERROR_MEMBER_HEADER,
   79     79   
        &COMPLEXERROR_MEMBER_TOP_LEVEL,
   80     80   
        &COMPLEXERROR_MEMBER_NESTED,
   81     81   
        &COMPLEXERROR_MEMBER_MESSAGE,
   82     82   
    ],
   83     83   
);
   84     84   
impl ComplexError {
   85     85   
    /// The schema for this shape.
   86     86   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXERROR_SCHEMA;
   87     87   
}
   88     88   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexError {
   89     89   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   90     90   
    fn serialize_members(
   91     91   
        &self,
   92     92   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   93     93   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   94     94   
        if let Some(ref val) = self.header {
   95     95   
            ser.write_string(&COMPLEXERROR_MEMBER_HEADER, val)?;
   96     96   
        }
   97     97   
        if let Some(ref val) = self.top_level {
   98     98   
            ser.write_string(&COMPLEXERROR_MEMBER_TOP_LEVEL, val)?;
   99     99   
        }
  100    100   
        if let Some(ref val) = self.nested {
  101    101   
            ser.write_struct(&COMPLEXERROR_MEMBER_NESTED, val)?;
  102    102   
        }
  103    103   
        if let Some(ref val) = self.message {
  104    104   
            ser.write_string(&COMPLEXERROR_MEMBER_MESSAGE, val)?;
  105    105   
        }
  106    106   
        Ok(())
  107    107   
    }
  108    108   
}
  109    109   
impl ComplexError {
  110    110   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  111         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  112         -
        deserializer: &mut D,
         111  +
    pub fn deserialize(
         112  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  113    113   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  114    114   
        #[allow(unused_variables, unused_mut)]
  115    115   
        let mut builder = Self::builder();
  116    116   
        #[allow(
  117    117   
            unused_variables,
  118    118   
            unreachable_code,
  119    119   
            clippy::single_match,
  120    120   
            clippy::match_single_binding,
  121    121   
            clippy::diverging_sub_expression
  122    122   
        )]
  123         -
        deserializer.read_struct(&COMPLEXERROR_SCHEMA, (), |_, member, deser| {
         123  +
        deserializer.read_struct(&COMPLEXERROR_SCHEMA, &mut |member, deser| {
  124    124   
            match member.member_index() {
  125    125   
                Some(0) => {
  126    126   
                    builder.header = Some(deser.read_string(member)?);
  127    127   
                }
  128    128   
                Some(1) => {
  129    129   
                    builder.top_level = Some(deser.read_string(member)?);
  130    130   
                }
  131    131   
                Some(2) => {
  132    132   
                    builder.nested = Some(crate::types::ComplexNestedErrorData::deserialize(deser)?);
  133    133   
                }
  134    134   
                Some(3) => {
  135    135   
                    builder.message = Some(deser.read_string(member)?);
  136    136   
                }
  137    137   
                _ => {}
  138    138   
            }
  139    139   
            Ok(())
  140    140   
        })?;
  141    141   
        Ok(builder.build())
  142    142   
    }
  143    143   
}
         144  +
impl ComplexError {
         145  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         146  +
    /// Header-bound members are read directly from headers, avoiding runtime
         147  +
    /// member iteration overhead. Body members are read via the deserializer.
         148  +
    pub fn deserialize_with_response(
         149  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         150  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         151  +
        _status: u16,
         152  +
        _body: &[u8],
         153  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         154  +
        #[allow(unused_variables, unused_mut)]
         155  +
        let mut builder = Self::builder();
         156  +
        if let Some(val) = headers.get("X-Header") {
         157  +
            builder.header = Some(val.to_string());
         158  +
        }
         159  +
        #[allow(
         160  +
            unused_variables,
         161  +
            unreachable_code,
         162  +
            clippy::single_match,
         163  +
            clippy::match_single_binding,
         164  +
            clippy::diverging_sub_expression
         165  +
        )]
         166  +
        deserializer.read_struct(&COMPLEXERROR_SCHEMA, &mut |member, deser| {
         167  +
            match member.member_index() {
         168  +
                Some(0) => { /* read from headers above */ }
         169  +
                Some(1) => {
         170  +
                    builder.top_level = Some(deser.read_string(member)?);
         171  +
                }
         172  +
                Some(2) => {
         173  +
                    builder.nested = Some(crate::types::ComplexNestedErrorData::deserialize(deser)?);
         174  +
                }
         175  +
                Some(3) => {
         176  +
                    builder.message = Some(deser.read_string(member)?);
         177  +
                }
         178  +
                _ => {}
         179  +
            }
         180  +
            Ok(())
         181  +
        })?;
         182  +
        Ok(builder.build())
         183  +
    }
         184  +
}
  144    185   
impl ComplexError {
  145    186   
    /// Returns the error message.
  146    187   
    pub fn message(&self) -> ::std::option::Option<&str> {
  147    188   
        self.message.as_deref()
  148    189   
    }
  149    190   
}
  150    191   
impl ::std::fmt::Display for ComplexError {
  151    192   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  152    193   
        ::std::write!(f, "ComplexError")?;
  153    194   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/error/_error_event.rs

@@ -15,15 +98,109 @@
   35     35   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   36     36   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   37     37   
        if let Some(ref val) = self.message {
   38     38   
            ser.write_string(&ERROREVENT_MEMBER_MESSAGE, val)?;
   39     39   
        }
   40     40   
        Ok(())
   41     41   
    }
   42     42   
}
   43     43   
impl ErrorEvent {
   44     44   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   45         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   46         -
        deserializer: &mut D,
          45  +
    pub fn deserialize(
          46  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   47     47   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   48     48   
        #[allow(unused_variables, unused_mut)]
   49     49   
        let mut builder = Self::builder();
   50     50   
        #[allow(
   51     51   
            unused_variables,
   52     52   
            unreachable_code,
   53     53   
            clippy::single_match,
   54     54   
            clippy::match_single_binding,
   55     55   
            clippy::diverging_sub_expression
   56     56   
        )]
   57         -
        deserializer.read_struct(&ERROREVENT_SCHEMA, (), |_, member, deser| {
          57  +
        deserializer.read_struct(&ERROREVENT_SCHEMA, &mut |member, deser| {
   58     58   
            match member.member_index() {
   59     59   
                Some(0) => {
   60     60   
                    builder.message = Some(deser.read_string(member)?);
   61     61   
                }
   62     62   
                _ => {}
   63     63   
            }
   64     64   
            Ok(())
   65     65   
        })?;
   66     66   
        Ok(builder.build())
   67     67   
    }
   68     68   
}
          69  +
impl ErrorEvent {
          70  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          71  +
    pub fn deserialize_with_response(
          72  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          73  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          74  +
        _status: u16,
          75  +
        _body: &[u8],
          76  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          77  +
        Self::deserialize(deserializer)
          78  +
    }
          79  +
}
   69     80   
impl ErrorEvent {
   70     81   
    /// Returns the error message.
   71     82   
    pub fn message(&self) -> ::std::option::Option<&str> {
   72     83   
        self.message.as_deref()
   73     84   
    }
   74     85   
}
   75     86   
impl ::std::fmt::Display for ErrorEvent {
   76     87   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   77     88   
        ::std::write!(f, "ErrorEvent")?;
   78     89   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/error/_foo_error.rs

@@ -1,1 +92,103 @@
    6      6   
pub struct FooError {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
static FOOERROR_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   12     12   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#FooError", "aws.protocoltests.restjson", "FooError");
   13     13   
static FOOERROR_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   14     14   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.restjson#FooError$Message", "aws.protocoltests.restjson", "FooError"),
   15     15   
    ::aws_smithy_schema::ShapeType::String,
   16         -
    "message",
          16  +
    "Message",
   17     17   
    0,
   18     18   
);
   19     19   
static FOOERROR_SCHEMA: ::aws_smithy_schema::Schema =
   20     20   
    ::aws_smithy_schema::Schema::new_struct(FOOERROR_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[&FOOERROR_MEMBER_MESSAGE]);
   21     21   
impl FooError {
   22     22   
    /// The schema for this shape.
   23     23   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &FOOERROR_SCHEMA;
   24     24   
}
   25     25   
impl ::aws_smithy_schema::serde::SerializableStruct for FooError {
   26     26   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   27     27   
    fn serialize_members(
   28     28   
        &self,
   29     29   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   30     30   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   31     31   
        if let Some(ref val) = self.message {
   32     32   
            ser.write_string(&FOOERROR_MEMBER_MESSAGE, val)?;
   33     33   
        }
   34     34   
        Ok(())
   35     35   
    }
   36     36   
}
   37     37   
impl FooError {
   38     38   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   39         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   40         -
        deserializer: &mut D,
          39  +
    pub fn deserialize(
          40  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   41     41   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   42     42   
        #[allow(unused_variables, unused_mut)]
   43     43   
        let mut builder = Self::builder();
   44     44   
        #[allow(
   45     45   
            unused_variables,
   46     46   
            unreachable_code,
   47     47   
            clippy::single_match,
   48     48   
            clippy::match_single_binding,
   49     49   
            clippy::diverging_sub_expression
   50     50   
        )]
   51         -
        deserializer.read_struct(&FOOERROR_SCHEMA, (), |_, member, deser| {
          51  +
        deserializer.read_struct(&FOOERROR_SCHEMA, &mut |member, deser| {
   52     52   
            match member.member_index() {
   53     53   
                Some(0) => {
   54     54   
                    builder.message = Some(deser.read_string(member)?);
   55     55   
                }
   56     56   
                _ => {}
   57     57   
            }
   58     58   
            Ok(())
   59     59   
        })?;
   60     60   
        Ok(builder.build())
   61     61   
    }
   62     62   
}
          63  +
impl FooError {
          64  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          65  +
    pub fn deserialize_with_response(
          66  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          67  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          68  +
        _status: u16,
          69  +
        _body: &[u8],
          70  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          71  +
        Self::deserialize(deserializer)
          72  +
    }
          73  +
}
   63     74   
impl FooError {
   64     75   
    /// Returns the error message.
   65     76   
    pub fn message(&self) -> ::std::option::Option<&str> {
   66     77   
        self.message.as_deref()
   67     78   
    }
   68     79   
}
   69     80   
impl ::std::fmt::Display for FooError {
   70     81   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   71     82   
        ::std::write!(f, "FooError")?;
   72     83   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/error/_invalid_greeting.rs

@@ -1,1 +102,113 @@
   13     13   
    "aws.protocoltests.restjson",
   14     14   
    "InvalidGreeting",
   15     15   
);
   16     16   
static INVALIDGREETING_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   17     17   
    ::aws_smithy_schema::ShapeId::from_static(
   18     18   
        "aws.protocoltests.restjson#InvalidGreeting$Message",
   19     19   
        "aws.protocoltests.restjson",
   20     20   
        "InvalidGreeting",
   21     21   
    ),
   22     22   
    ::aws_smithy_schema::ShapeType::String,
   23         -
    "message",
          23  +
    "Message",
   24     24   
    0,
   25     25   
);
   26     26   
static INVALIDGREETING_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   27     27   
    INVALIDGREETING_SCHEMA_ID,
   28     28   
    ::aws_smithy_schema::ShapeType::Structure,
   29     29   
    &[&INVALIDGREETING_MEMBER_MESSAGE],
   30     30   
);
   31     31   
impl InvalidGreeting {
   32     32   
    /// The schema for this shape.
   33     33   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INVALIDGREETING_SCHEMA;
   34     34   
}
   35     35   
impl ::aws_smithy_schema::serde::SerializableStruct for InvalidGreeting {
   36     36   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   37     37   
    fn serialize_members(
   38     38   
        &self,
   39     39   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   40     40   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   41     41   
        if let Some(ref val) = self.message {
   42     42   
            ser.write_string(&INVALIDGREETING_MEMBER_MESSAGE, val)?;
   43     43   
        }
   44     44   
        Ok(())
   45     45   
    }
   46     46   
}
   47     47   
impl InvalidGreeting {
   48     48   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   49         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   50         -
        deserializer: &mut D,
          49  +
    pub fn deserialize(
          50  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   51     51   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   52     52   
        #[allow(unused_variables, unused_mut)]
   53     53   
        let mut builder = Self::builder();
   54     54   
        #[allow(
   55     55   
            unused_variables,
   56     56   
            unreachable_code,
   57     57   
            clippy::single_match,
   58     58   
            clippy::match_single_binding,
   59     59   
            clippy::diverging_sub_expression
   60     60   
        )]
   61         -
        deserializer.read_struct(&INVALIDGREETING_SCHEMA, (), |_, member, deser| {
          61  +
        deserializer.read_struct(&INVALIDGREETING_SCHEMA, &mut |member, deser| {
   62     62   
            match member.member_index() {
   63     63   
                Some(0) => {
   64     64   
                    builder.message = Some(deser.read_string(member)?);
   65     65   
                }
   66     66   
                _ => {}
   67     67   
            }
   68     68   
            Ok(())
   69     69   
        })?;
   70     70   
        Ok(builder.build())
   71     71   
    }
   72     72   
}
          73  +
impl InvalidGreeting {
          74  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          75  +
    pub fn deserialize_with_response(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          77  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          78  +
        _status: u16,
          79  +
        _body: &[u8],
          80  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          81  +
        Self::deserialize(deserializer)
          82  +
    }
          83  +
}
   73     84   
impl InvalidGreeting {
   74     85   
    /// Returns the error message.
   75     86   
    pub fn message(&self) -> ::std::option::Option<&str> {
   76     87   
        self.message.as_deref()
   77     88   
    }
   78     89   
}
   79     90   
impl ::std::fmt::Display for InvalidGreeting {
   80     91   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   81     92   
        ::std::write!(f, "InvalidGreeting")?;
   82     93   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/types/error/_service_unavailable_error.rs

@@ -18,18 +101,112 @@
   38     38   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   39     39   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   40     40   
        if let Some(ref val) = self.message {
   41     41   
            ser.write_string(&SERVICEUNAVAILABLEERROR_MEMBER_MESSAGE, val)?;
   42     42   
        }
   43     43   
        Ok(())
   44     44   
    }
   45     45   
}
   46     46   
impl ServiceUnavailableError {
   47     47   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   48         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   49         -
        deserializer: &mut D,
          48  +
    pub fn deserialize(
          49  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   50     50   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   51     51   
        #[allow(unused_variables, unused_mut)]
   52     52   
        let mut builder = Self::builder();
   53     53   
        #[allow(
   54     54   
            unused_variables,
   55     55   
            unreachable_code,
   56     56   
            clippy::single_match,
   57     57   
            clippy::match_single_binding,
   58     58   
            clippy::diverging_sub_expression
   59     59   
        )]
   60         -
        deserializer.read_struct(&SERVICEUNAVAILABLEERROR_SCHEMA, (), |_, member, deser| {
          60  +
        deserializer.read_struct(&SERVICEUNAVAILABLEERROR_SCHEMA, &mut |member, deser| {
   61     61   
            match member.member_index() {
   62     62   
                Some(0) => {
   63     63   
                    builder.message = Some(deser.read_string(member)?);
   64     64   
                }
   65     65   
                _ => {}
   66     66   
            }
   67     67   
            Ok(())
   68     68   
        })?;
   69     69   
        Ok(builder.build())
   70     70   
    }
   71     71   
}
          72  +
impl ServiceUnavailableError {
          73  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          74  +
    pub fn deserialize_with_response(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          76  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          77  +
        _status: u16,
          78  +
        _body: &[u8],
          79  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          80  +
        Self::deserialize(deserializer)
          81  +
    }
          82  +
}
   72     83   
impl ServiceUnavailableError {
   73     84   
    /// Returns the error message.
   74     85   
    pub fn message(&self) -> ::std::option::Option<&str> {
   75     86   
        self.message.as_deref()
   76     87   
    }
   77     88   
}
   78     89   
impl ::std::fmt::Display for ServiceUnavailableError {
   79     90   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   80     91   
        ::std::write!(f, "ServiceUnavailableError")?;
   81     92   
        if let ::std::option::Option::Some(inner_1) = &self.message {

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

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

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

@@ -10,10 +69,73 @@
   30     30   
            config: self.cloneable.clone(),
   31     31   
            runtime_components: self.runtime_components.clone(),
   32     32   
            runtime_plugins: self.runtime_plugins.clone(),
   33     33   
            behavior_version: self.behavior_version,
   34     34   
        }
   35     35   
    }
   36     36   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     37   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     38   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     39   
    }
          40  +
    /// Returns the client protocol used for serialization and deserialization.
          41  +
    pub fn protocol(&self) -> ::std::option::Option<&::aws_smithy_schema::protocol::SharedClientProtocol> {
          42  +
        self.config.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
          43  +
    }
   40     44   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     45   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     46   
        self.runtime_components.http_client()
   43     47   
    }
   44     48   
    /// Return the auth schemes configured on this service config
   45     49   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     50   
        self.runtime_components.auth_schemes()
   47     51   
    }
   48     52   
   49     53   
    /// Return the auth scheme resolver configured on this service config
@@ -105,109 +185,208 @@
  125    129   
    ///
  126    130   
    pub fn new() -> Self {
  127    131   
        Self::default()
  128    132   
    }
  129    133   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  130    134   
    /// but not those in runtime components.
  131    135   
    #[allow(unused)]
  132    136   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  133    137   
        let mut builder = Self::new();
  134    138   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         139  +
        if let ::std::option::Option::Some(protocol) = config_bag.load::<::aws_smithy_schema::protocol::SharedClientProtocol>().cloned() {
         140  +
            builder.set_protocol(::std::option::Option::Some(protocol));
         141  +
        }
  135    142   
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  136    143   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  137    144   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  138    145   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  139    146   
        builder
  140    147   
    }
  141    148   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  142    149   
    /// to configure protection for stalled streams.
  143    150   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  144    151   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  145    152   
        self
  146    153   
    }
  147    154   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  148    155   
    /// to configure protection for stalled streams.
  149    156   
    pub fn set_stalled_stream_protection(
  150    157   
        &mut self,
  151    158   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  152    159   
    ) -> &mut Self {
  153    160   
        self.config.store_or_unset(stalled_stream_protection_config);
  154    161   
        self
  155    162   
    }
         163  +
    /// Sets the client protocol to use for serialization and deserialization.
         164  +
    ///
         165  +
    /// This overrides the default protocol determined by the service model,
         166  +
    /// enabling runtime protocol selection.
         167  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         168  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         169  +
            protocol,
         170  +
        )));
         171  +
        self
         172  +
    }
         173  +
         174  +
    /// Sets the client protocol to use for serialization and deserialization.
         175  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         176  +
        self.config.store_or_unset(protocol);
         177  +
        self
         178  +
    }
  156    179   
    /// Sets the HTTP client to use when making requests.
  157    180   
    ///
  158    181   
    /// # Examples
  159    182   
    /// ```no_run
  160    183   
    /// # #[cfg(test)]
  161    184   
    /// # mod tests {
  162    185   
    /// # #[test]
  163    186   
    /// # fn example() {
  164    187   
    /// use std::time::Duration;
  165    188   
    /// use rest_json_extras::config::Config;
@@ -1116,1139 +1175,1203 @@
 1136   1159   
#[derive(::std::fmt::Debug)]
 1137   1160   
pub(crate) struct ServiceRuntimePlugin {
 1138   1161   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1139   1162   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1140   1163   
}
 1141   1164   
 1142   1165   
impl ServiceRuntimePlugin {
 1143   1166   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1144   1167   
        let config = {
 1145   1168   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RestJsonExtras");
        1169  +
            if _service_config.protocol().is_none() {
        1170  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1171  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1172  +
                ));
        1173  +
            }
 1146   1174   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1147   1175   
            ::std::option::Option::Some(cfg.freeze())
 1148   1176   
        };
 1149   1177   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1150   1178   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1151   1179   
            use crate::config::auth::ResolveAuthScheme;
 1152   1180   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1153   1181   
        }));
 1154   1182   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1155   1183   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());

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

@@ -97,97 +133,129 @@
  117    117   
/// Data structures used by operation inputs/outputs.
  118    118   
pub mod types;
  119    119   
  120    120   
/// All operations that this crate can perform.
  121    121   
pub mod operation;
  122    122   
  123    123   
pub(crate) mod protocol_serde;
  124    124   
  125    125   
mod sdk_feature_tracker;
  126    126   
  127         -
mod serialization_settings;
  128         -
  129         -
mod serde_util;
  130         -
  131    127   
mod json_errors;
  132    128   
  133    129   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_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 `CaseInsensitiveErrorOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CaseInsensitiveErrorOperation;
    6      6   
impl CaseInsensitiveErrorOperation {
    7      7   
    /// Creates a new `CaseInsensitiveErrorOperation`
    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::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput::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::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +228,306 @@
  130    136   
                crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
  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 CaseInsensitiveErrorOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CaseInsensitiveErrorOperationResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            let error_code = match generic.code() {
         165  +
                ::std::option::Option::Some(code) => code,
         166  +
                ::std::option::Option::None => {
         167  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         168  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         169  +
                            crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled(generic),
         170  +
                        ),
         171  +
                    ))
         172  +
                }
         173  +
            };
         174  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         175  +
            let protocol = _cfg
         176  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         177  +
                .expect("a SharedClientProtocol is required");
         178  +
            let err = match error_code {
         179  +
                "CaseInsensitiveError" => {
         180  +
                    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::CaseInsensitiveError({
         181  +
                        let mut tmp = match protocol
         182  +
                            .deserialize_response(response, crate::types::error::CaseInsensitiveError::SCHEMA, _cfg)
         183  +
                            .and_then(|mut deser| {
         184  +
                                crate::types::error::CaseInsensitiveError::deserialize_with_response(
         185  +
                                    &mut *deser,
         186  +
                                    response.headers(),
         187  +
                                    response.status().into(),
         188  +
                                    body,
         189  +
                                )
         190  +
                            }) {
         191  +
                            ::std::result::Result::Ok(val) => val,
         192  +
                            ::std::result::Result::Err(e) => {
         193  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         194  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         195  +
                                ))
         196  +
                            }
         197  +
                        };
         198  +
                        tmp.meta = generic;
         199  +
                        if tmp.message.is_none() {
         200  +
                            tmp.message = _error_message;
         201  +
                        }
         202  +
                        tmp
         203  +
                    })
         204  +
                }
         205  +
                "ExtraError" => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError({
         206  +
                    let mut tmp = match protocol
         207  +
                        .deserialize_response(response, crate::types::error::ExtraError::SCHEMA, _cfg)
         208  +
                        .and_then(|mut deser| {
         209  +
                            crate::types::error::ExtraError::deserialize_with_response(
         210  +
                                &mut *deser,
         211  +
                                response.headers(),
         212  +
                                response.status().into(),
         213  +
                                body,
         214  +
                            )
         215  +
                        }) {
         216  +
                        ::std::result::Result::Ok(val) => val,
         217  +
                        ::std::result::Result::Err(e) => {
         218  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         219  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         220  +
                            ))
         221  +
                        }
         222  +
                    };
         223  +
                    tmp.meta = generic;
         224  +
                    if tmp.message.is_none() {
         225  +
                        tmp.message = _error_message;
         226  +
                    }
         227  +
                    tmp
         228  +
                }),
         229  +
                _ => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::generic(generic),
         230  +
            };
         231  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         232  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         233  +
            ))
  152    234   
        } else {
  153         -
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         235  +
            let protocol = _cfg
         236  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         237  +
                .expect("a SharedClientProtocol is required");
         238  +
            let mut deser = protocol
         239  +
                .deserialize_response(response, CaseInsensitiveErrorOperation::OUTPUT_SCHEMA, _cfg)
         240  +
                .map_err(|e| {
         241  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         242  +
                })?;
         243  +
            let body = response.body().bytes().expect("body loaded");
         244  +
            let output = crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput::deserialize_with_response(
         245  +
                &mut *deser,
         246  +
                response.headers(),
         247  +
                response.status().into(),
         248  +
                body,
         249  +
            )
         250  +
            .map_err(|e| {
         251  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         252  +
            })?;
         253  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         254  +
        }
  156    255   
    }
  157    256   
}
  158    257   
#[derive(Debug)]
  159    258   
struct CaseInsensitiveErrorOperationRequestSerializer;
  160    259   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CaseInsensitiveErrorOperationRequestSerializer {
  161    260   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    261   
    fn serialize_input(
  163    262   
        &self,
  164    263   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    264   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    265   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    266   
        let input = input
  168    267   
            .downcast::<crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput>()
  169    268   
            .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::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  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, "/error-sensitive").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  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
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         269  +
        let protocol = _cfg
         270  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         271  +
            .expect("a SharedClientProtocol is required");
         272  +
        let mut request = protocol
         273  +
            .serialize_request(&input, CaseInsensitiveErrorOperation::INPUT_SCHEMA, "", _cfg)
         274  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    275   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         276  +
        return ::std::result::Result::Ok(request);
  199    277   
    }
  200    278   
}
  201    279   
#[derive(Debug)]
  202    280   
struct CaseInsensitiveErrorOperationEndpointParamsInterceptor;
  203    281   
  204    282   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CaseInsensitiveErrorOperationEndpointParamsInterceptor {
  205    283   
    fn name(&self) -> &'static str {
  206    284   
        "CaseInsensitiveErrorOperationEndpointParamsInterceptor"
  207    285   
    }
  208    286   
@@ -243,321 +346,444 @@
  263    341   
            .expect("the config must have a deserializer");
  264    342   
  265    343   
        let parsed = de.deserialize_streaming(&mut http_response);
  266    344   
        let parsed = parsed.unwrap_or_else(|| {
  267    345   
            let http_response = http_response.map(|body| {
  268    346   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  269    347   
                    body.bytes().unwrap(),
  270    348   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  271    349   
                )))
  272    350   
            });
  273         -
            de.deserialize_nonstreaming(&http_response)
         351  +
            // Build a config bag with the protocol for schema-based deserialization
         352  +
            #[allow(unused_mut)]
         353  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         354  +
            {
         355  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         356  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         357  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         358  +
                ));
         359  +
                test_cfg.push_shared_layer(layer.freeze());
         360  +
            }
         361  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  274    362   
        });
  275    363   
        let parsed = parsed.expect_err("should be error response");
  276    364   
        let parsed: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError =
  277    365   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  278    366   
        if let crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::CaseInsensitiveError(parsed) = parsed {
  279    367   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  280    368   
        } else {
  281    369   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  282    370   
        }
  283    371   
    }
  284    372   
  285    373   
    /// Upper case error modeled lower case
  286    374   
    /// Test ID: ServiceLevelErrorClient
  287    375   
    #[::tokio::test]
  288    376   
    #[::tracing_test::traced_test]
  289    377   
    async fn service_level_error_client_response() {
  290    378   
        let expected_output = crate::types::error::ExtraError::builder().build();
  291    379   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  292    380   
            ::http_1x::response::Builder::new()
  293    381   
                .header("X-Amzn-Errortype", "ExtraError")
  294    382   
                .status(500)
  295    383   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  296    384   
                .unwrap(),
  297    385   
        )
  298    386   
        .unwrap();
  299    387   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  300    388   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  301    389   
  302    390   
        let op = crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperation::new();
  303    391   
        let config = op.config().expect("the operation has config");
  304    392   
        let de = config
  305    393   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  306    394   
            .expect("the config must have a deserializer");
  307    395   
  308    396   
        let parsed = de.deserialize_streaming(&mut http_response);
  309    397   
        let parsed = parsed.unwrap_or_else(|| {
  310    398   
            let http_response = http_response.map(|body| {
  311    399   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  312    400   
                    body.bytes().unwrap(),
  313    401   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  314    402   
                )))
  315    403   
            });
  316         -
            de.deserialize_nonstreaming(&http_response)
         404  +
            // Build a config bag with the protocol for schema-based deserialization
         405  +
            #[allow(unused_mut)]
         406  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         407  +
            {
         408  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         409  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         410  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         411  +
                ));
         412  +
                test_cfg.push_shared_layer(layer.freeze());
         413  +
            }
         414  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  317    415   
        });
  318    416   
        let parsed = parsed.expect_err("should be error response");
  319    417   
        let parsed: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError =
  320    418   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  321    419   
        if let crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError(parsed) = parsed {
  322    420   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  323    421   
        } else {
  324    422   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  325    423   
        }
  326    424   
    }

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation/_case_insensitive_error_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation/_case_insensitive_error_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 CaseInsensitiveErrorOperationOutput {
   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(&CASEINSENSITIVEERROROPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&CASEINSENSITIVEERROROPERATIONOUTPUT_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 CaseInsensitiveErrorOperationOutput {
          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 CaseInsensitiveErrorOperationOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
   54     65   
    pub fn builder() -> crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder {
   55     66   
        crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder::default()
   56     67   
    }
   57     68   
}
   58     69   
   59     70   
/// A builder for [`CaseInsensitiveErrorOperationOutput`](crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput).
   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_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op.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 `EmptyStructWithContentOnWireOp`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct EmptyStructWithContentOnWireOp;
    6      6   
impl EmptyStructWithContentOnWireOp {
    7      7   
    /// Creates a new `EmptyStructWithContentOnWireOp`
    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::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput::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::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +232,280 @@
  130    136   
                crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
  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 EmptyStructWithContentOnWireOpResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyStructWithContentOnWireOpResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_error(
  152         -
                status, headers, body,
  153         -
            )
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            let error_code = match generic.code() {
         165  +
                ::std::option::Option::Some(code) => code,
         166  +
                ::std::option::Option::None => {
         167  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         168  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         169  +
                            crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled(generic),
         170  +
                        ),
         171  +
                    ))
         172  +
                }
         173  +
            };
         174  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         175  +
            let protocol = _cfg
         176  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         177  +
                .expect("a SharedClientProtocol is required");
         178  +
            let err = match error_code {
         179  +
                "ExtraError" => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError({
         180  +
                    let mut tmp = match protocol
         181  +
                        .deserialize_response(response, crate::types::error::ExtraError::SCHEMA, _cfg)
         182  +
                        .and_then(|mut deser| {
         183  +
                            crate::types::error::ExtraError::deserialize_with_response(
         184  +
                                &mut *deser,
         185  +
                                response.headers(),
         186  +
                                response.status().into(),
         187  +
                                body,
         188  +
                            )
         189  +
                        }) {
         190  +
                        ::std::result::Result::Ok(val) => val,
         191  +
                        ::std::result::Result::Err(e) => {
         192  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         193  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         194  +
                            ))
         195  +
                        }
         196  +
                    };
         197  +
                    tmp.meta = generic;
         198  +
                    if tmp.message.is_none() {
         199  +
                        tmp.message = _error_message;
         200  +
                    }
         201  +
                    tmp
         202  +
                }),
         203  +
                _ => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::generic(generic),
         204  +
            };
         205  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         206  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         207  +
            ))
  154    208   
        } else {
  155         -
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_response(
  156         -
                status, headers, body,
         209  +
            let protocol = _cfg
         210  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         211  +
                .expect("a SharedClientProtocol is required");
         212  +
            let mut deser = protocol
         213  +
                .deserialize_response(response, EmptyStructWithContentOnWireOp::OUTPUT_SCHEMA, _cfg)
         214  +
                .map_err(|e| {
         215  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         216  +
                })?;
         217  +
            let body = response.body().bytes().expect("body loaded");
         218  +
            let output = crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput::deserialize_with_response(
         219  +
                &mut *deser,
         220  +
                response.headers(),
         221  +
                response.status().into(),
         222  +
                body,
  157    223   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         224  +
            .map_err(|e| {
         225  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         226  +
            })?;
         227  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         228  +
        }
  160    229   
    }
  161    230   
}
  162    231   
#[derive(Debug)]
  163    232   
struct EmptyStructWithContentOnWireOpRequestSerializer;
  164    233   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyStructWithContentOnWireOpRequestSerializer {
  165    234   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    235   
    fn serialize_input(
  167    236   
        &self,
  168    237   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    238   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    239   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    240   
        let input = input
  172    241   
            .downcast::<crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput>()
  173    242   
            .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::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  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, "/empty-struct-with-content-on-wire-op").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  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         -
                ::std::result::Result::Ok(builder.method("GET").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("");
         243  +
        let protocol = _cfg
         244  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         245  +
            .expect("a SharedClientProtocol is required");
         246  +
        let mut request = protocol
         247  +
            .serialize_request(&input, EmptyStructWithContentOnWireOp::INPUT_SCHEMA, "", _cfg)
         248  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  201    249   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         250  +
        return ::std::result::Result::Ok(request);
  203    251   
    }
  204    252   
}
  205    253   
#[derive(Debug)]
  206    254   
struct EmptyStructWithContentOnWireOpEndpointParamsInterceptor;
  207    255   
  208    256   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyStructWithContentOnWireOpEndpointParamsInterceptor {
  209    257   
    fn name(&self) -> &'static str {
  210    258   
        "EmptyStructWithContentOnWireOpEndpointParamsInterceptor"
  211    259   
    }
  212    260   
@@ -245,293 +345,413 @@
  265    313   
            .expect("the config must have a deserializer");
  266    314   
  267    315   
        let parsed = de.deserialize_streaming(&mut http_response);
  268    316   
        let parsed = parsed.unwrap_or_else(|| {
  269    317   
            let http_response = http_response.map(|body| {
  270    318   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  271    319   
                    body.bytes().unwrap(),
  272    320   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  273    321   
                )))
  274    322   
            });
  275         -
            de.deserialize_nonstreaming(&http_response)
         323  +
            // Build a config bag with the protocol for schema-based deserialization
         324  +
            #[allow(unused_mut)]
         325  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         326  +
            {
         327  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         328  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         329  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         330  +
                ));
         331  +
                test_cfg.push_shared_layer(layer.freeze());
         332  +
            }
         333  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  276    334   
        });
  277    335   
        let parsed = parsed
  278    336   
            .expect("should be successful response")
  279    337   
            .downcast::<crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput>()
  280    338   
            .unwrap();
  281    339   
        ::pretty_assertions::assert_eq!(parsed.empty, expected_output.empty, "Unexpected value for `empty`");
  282    340   
    }
  283    341   
  284    342   
    /// Upper case error modeled lower case
  285    343   
    /// Test ID: ServiceLevelErrorClient
  286    344   
    #[::tokio::test]
  287    345   
    #[::tracing_test::traced_test]
  288    346   
    async fn service_level_error_client_response() {
  289    347   
        let expected_output = crate::types::error::ExtraError::builder().build();
  290    348   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  291    349   
            ::http_1x::response::Builder::new()
  292    350   
                .header("X-Amzn-Errortype", "ExtraError")
  293    351   
                .status(500)
  294    352   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  295    353   
                .unwrap(),
  296    354   
        )
  297    355   
        .unwrap();
  298    356   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  299    357   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  300    358   
  301    359   
        let op = crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOp::new();
  302    360   
        let config = op.config().expect("the operation has config");
  303    361   
        let de = config
  304    362   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  305    363   
            .expect("the config must have a deserializer");
  306    364   
  307    365   
        let parsed = de.deserialize_streaming(&mut http_response);
  308    366   
        let parsed = parsed.unwrap_or_else(|| {
  309    367   
            let http_response = http_response.map(|body| {
  310    368   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  311    369   
                    body.bytes().unwrap(),
  312    370   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  313    371   
                )))
  314    372   
            });
  315         -
            de.deserialize_nonstreaming(&http_response)
         373  +
            // Build a config bag with the protocol for schema-based deserialization
         374  +
            #[allow(unused_mut)]
         375  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         376  +
            {
         377  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         378  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         379  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         380  +
                ));
         381  +
                test_cfg.push_shared_layer(layer.freeze());
         382  +
            }
         383  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  316    384   
        });
  317    385   
        let parsed = parsed.expect_err("should be error response");
  318    386   
        let parsed: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError =
  319    387   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  320    388   
        if let crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError(parsed) = parsed {
  321    389   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  322    390   
        } else {
  323    391   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  324    392   
        }
  325    393   
    }

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op/_empty_struct_with_content_on_wire_op_input.rs

@@ -1,1 +75,93 @@
    5      5   
pub struct EmptyStructWithContentOnWireOpInput {}
    6      6   
static EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "aws.protocoltests.restjson.synthetic#EmptyStructWithContentOnWireOpInput",
    8      8   
    "aws.protocoltests.restjson.synthetic",
    9      9   
    "EmptyStructWithContentOnWireOpInput",
   10     10   
);
   11     11   
static EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   12     12   
    EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_SCHEMA_ID,
   13     13   
    ::aws_smithy_schema::ShapeType::Structure,
   14     14   
    &[],
   15         -
);
          15  +
)
          16  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          17  +
    "GET",
          18  +
    "/empty-struct-with-content-on-wire-op",
          19  +
    None,
          20  +
));
   16     21   
impl EmptyStructWithContentOnWireOpInput {
   17     22   
    /// The schema for this shape.
   18     23   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_SCHEMA;
   19     24   
}
   20     25   
impl ::aws_smithy_schema::serde::SerializableStruct for EmptyStructWithContentOnWireOpInput {
   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 EmptyStructWithContentOnWireOpInput {
   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(&EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_SCHEMA, (), |_, member, deser| {
          48  +
        deserializer.read_struct(&EMPTYSTRUCTWITHCONTENTONWIREOPINPUT_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 EmptyStructWithContentOnWireOpInput {
          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 EmptyStructWithContentOnWireOpInput {
   55     73   
    /// Creates a new builder-style object to manufacture [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
   56     74   
    pub fn builder() -> crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder {
   57     75   
        crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpInputBuilder::default()
   58     76   
    }
   59     77   
}
   60     78   
   61     79   
/// A builder for [`EmptyStructWithContentOnWireOpInput`](crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput).
   62     80   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   63     81   
#[non_exhaustive]