Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/serialization_settings.rs

@@ -1,0 +89,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/*
    3         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4         -
 * SPDX-License-Identifier: Apache-2.0
    5         -
 */
    6         -
    7         -
#![allow(dead_code)]
    8         -
    9         -
use aws_smithy_http::header::set_request_header_if_absent;
   10         -
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12         -
   13         -
/// Configuration for how default protocol headers are serialized
   14         -
#[derive(Clone, Debug, Default)]
   15         -
pub(crate) struct HeaderSerializationSettings {
   16         -
    omit_default_content_length: bool,
   17         -
    omit_default_content_type: bool,
   18         -
}
   19         -
   20         -
impl HeaderSerializationSettings {
   21         -
    /// Creates new [`HeaderSerializationSettings`]
   22         -
    pub(crate) fn new() -> Self {
   23         -
        Default::default()
   24         -
    }
   25         -
   26         -
    /// Omit the default `Content-Length` header during serialization
   27         -
    pub(crate) fn omit_default_content_length(self) -> Self {
   28         -
        Self {
   29         -
            omit_default_content_length: true,
   30         -
            ..self
   31         -
        }
   32         -
    }
   33         -
   34         -
    /// Omit the default `Content-Type` header during serialization
   35         -
    pub(crate) fn omit_default_content_type(self) -> Self {
   36         -
        Self {
   37         -
            omit_default_content_type: true,
   38         -
            ..self
   39         -
        }
   40         -
    }
   41         -
   42         -
    /// Returns true if the given default header name should be serialized
   43         -
    fn include_header(&self, header: &HeaderName) -> bool {
   44         -
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45         -
    }
   46         -
   47         -
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(
   49         -
        &self,
   50         -
        mut request: http_1x::request::Builder,
   51         -
        header_name: HeaderName,
   52         -
        value: &str,
   53         -
    ) -> http_1x::request::Builder {
   54         -
        if self.include_header(&header_name) {
   55         -
            request = set_request_header_if_absent(request, header_name, value);
   56         -
        }
   57         -
        request
   58         -
    }
   59         -
}
   60         -
   61         -
impl Storable for HeaderSerializationSettings {
   62         -
    type Storer = StoreReplace<Self>;
   63         -
}
   64         -
   65         -
#[cfg(test)]
   66         -
mod tests {
   67         -
    use super::*;
   68         -
   69         -
    #[test]
   70         -
    fn test_include_header() {
   71         -
        let settings = HeaderSerializationSettings::default();
   72         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   73         -
        assert!(settings.include_header(&CONTENT_TYPE));
   74         -
   75         -
        let settings = HeaderSerializationSettings::default().omit_default_content_length();
   76         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   77         -
        assert!(settings.include_header(&CONTENT_TYPE));
   78         -
   79         -
        let settings = HeaderSerializationSettings::default().omit_default_content_type();
   80         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   81         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   82         -
   83         -
        let settings = HeaderSerializationSettings::default()
   84         -
            .omit_default_content_type()
   85         -
            .omit_default_content_length();
   86         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   87         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   88         -
    }
   89         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_attempt_capturing_pokemon_event.rs

@@ -8,8 +0,94 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Event`](crate::types::AttemptCapturingPokemonEvent::Event).
   30     30   
    pub fn is_event(&self) -> bool {
   31     31   
        self.as_event().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
          39  +
    "com.aws.example#AttemptCapturingPokemonEvent",
          40  +
    "com.aws.example",
          41  +
    "AttemptCapturingPokemonEvent",
          42  +
);
          43  +
static ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_static(
          45  +
        "com.aws.example#AttemptCapturingPokemonEvent$event",
          46  +
        "com.aws.example",
          47  +
        "AttemptCapturingPokemonEvent",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::Structure,
          50  +
    "event",
          51  +
    0,
          52  +
);
          53  +
static ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          54  +
    ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA_ID,
          55  +
    ::aws_smithy_schema::ShapeType::Union,
          56  +
    &[&ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT],
          57  +
)
          58  +
.with_streaming();
          59  +
impl AttemptCapturingPokemonEvent {
          60  +
    /// The schema for this shape.
          61  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA;
          62  +
}
          63  +
impl ::aws_smithy_schema::serde::SerializableStruct for AttemptCapturingPokemonEvent {
          64  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          65  +
    fn serialize_members(
          66  +
        &self,
          67  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          68  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          69  +
        match self {
          70  +
            Self::Event(val) => {
          71  +
                ser.write_struct(&ATTEMPTCAPTURINGPOKEMONEVENT_MEMBER_EVENT, val)?;
          72  +
            }
          73  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          74  +
        }
          75  +
        Ok(())
          76  +
    }
          77  +
}
          78  +
impl AttemptCapturingPokemonEvent {
          79  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          80  +
    pub fn deserialize(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          83  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          84  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          85  +
        deserializer.read_struct(&ATTEMPTCAPTURINGPOKEMONEVENT_SCHEMA, &mut |member, deser| {
          86  +
            result = ::std::option::Option::Some(match member.member_index() {
          87  +
                Some(0) => Self::Event(crate::types::CapturingEvent::deserialize(deser)?),
          88  +
                _ => Self::Unknown,
          89  +
            });
          90  +
            Ok(())
          91  +
        })?;
          92  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          93  +
    }
          94  +
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_capture_event.rs

@@ -70,70 +162,173 @@
   90     90   
            ser.write_boolean(&CAPTUREEVENT_MEMBER_SHINY, *val)?;
   91     91   
        }
   92     92   
        if let Some(ref val) = self.pokedex_update {
   93     93   
            ser.write_blob(&CAPTUREEVENT_MEMBER_POKEDEX_UPDATE, val)?;
   94     94   
        }
   95     95   
        Ok(())
   96     96   
    }
   97     97   
}
   98     98   
impl CaptureEvent {
   99     99   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  100         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  101         -
        deserializer: &mut D,
         100  +
    pub fn deserialize(
         101  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  102    102   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  103    103   
        #[allow(unused_variables, unused_mut)]
  104    104   
        let mut builder = Self::builder();
  105    105   
        #[allow(
  106    106   
            unused_variables,
  107    107   
            unreachable_code,
  108    108   
            clippy::single_match,
  109    109   
            clippy::match_single_binding,
  110    110   
            clippy::diverging_sub_expression
  111    111   
        )]
  112         -
        deserializer.read_struct(&CAPTUREEVENT_SCHEMA, (), |_, member, deser| {
         112  +
        deserializer.read_struct(&CAPTUREEVENT_SCHEMA, &mut |member, deser| {
  113    113   
            match member.member_index() {
  114    114   
                Some(0) => {
  115    115   
                    builder.name = Some(deser.read_string(member)?);
  116    116   
                }
  117    117   
                Some(1) => {
  118    118   
                    builder.captured = Some(deser.read_boolean(member)?);
  119    119   
                }
  120    120   
                Some(2) => {
  121    121   
                    builder.shiny = Some(deser.read_boolean(member)?);
  122    122   
                }
  123    123   
                Some(3) => {
  124    124   
                    builder.pokedex_update = Some(deser.read_blob(member)?);
  125    125   
                }
  126    126   
                _ => {}
  127    127   
            }
  128    128   
            Ok(())
  129    129   
        })?;
  130    130   
        Ok(builder.build())
  131    131   
    }
  132    132   
}
         133  +
impl CaptureEvent {
         134  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         135  +
    pub fn deserialize_with_response(
         136  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         137  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         138  +
        _status: u16,
         139  +
        _body: &[u8],
         140  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         141  +
        Self::deserialize(deserializer)
         142  +
    }
         143  +
}
  133    144   
impl CaptureEvent {
  134    145   
    /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::types::CaptureEvent).
  135    146   
    pub fn builder() -> crate::types::builders::CaptureEventBuilder {
  136    147   
        crate::types::builders::CaptureEventBuilder::default()
  137    148   
    }
  138    149   
}
  139    150   
  140    151   
/// A builder for [`CaptureEvent`](crate::types::CaptureEvent).
  141    152   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  142    153   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_capture_pokemon_events.rs

@@ -8,8 +0,87 @@
   28     28   
    }
   29     29   
    /// Returns true if this is a [`Event`](crate::types::CapturePokemonEvents::Event).
   30     30   
    pub fn is_event(&self) -> bool {
   31     31   
        self.as_event().is_ok()
   32     32   
    }
   33     33   
    /// Returns true if the enum instance is the `Unknown` variant.
   34     34   
    pub fn is_unknown(&self) -> bool {
   35     35   
        matches!(self, Self::Unknown)
   36     36   
    }
   37     37   
}
          38  +
static CAPTUREPOKEMONEVENTS_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          39  +
    ::aws_smithy_schema::ShapeId::from_static("com.aws.example#CapturePokemonEvents", "com.aws.example", "CapturePokemonEvents");
          40  +
static CAPTUREPOKEMONEVENTS_MEMBER_EVENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_static("com.aws.example#CapturePokemonEvents$event", "com.aws.example", "CapturePokemonEvents"),
          42  +
    ::aws_smithy_schema::ShapeType::Structure,
          43  +
    "event",
          44  +
    0,
          45  +
);
          46  +
static CAPTUREPOKEMONEVENTS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          47  +
    CAPTUREPOKEMONEVENTS_SCHEMA_ID,
          48  +
    ::aws_smithy_schema::ShapeType::Union,
          49  +
    &[&CAPTUREPOKEMONEVENTS_MEMBER_EVENT],
          50  +
)
          51  +
.with_streaming();
          52  +
impl CapturePokemonEvents {
          53  +
    /// The schema for this shape.
          54  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CAPTUREPOKEMONEVENTS_SCHEMA;
          55  +
}
          56  +
impl ::aws_smithy_schema::serde::SerializableStruct for CapturePokemonEvents {
          57  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          58  +
    fn serialize_members(
          59  +
        &self,
          60  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          61  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          62  +
        match self {
          63  +
            Self::Event(val) => {
          64  +
                ser.write_struct(&CAPTUREPOKEMONEVENTS_MEMBER_EVENT, val)?;
          65  +
            }
          66  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          67  +
        }
          68  +
        Ok(())
          69  +
    }
          70  +
}
          71  +
impl CapturePokemonEvents {
          72  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          73  +
    pub fn deserialize(
          74  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          75  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          76  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          77  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          78  +
        deserializer.read_struct(&CAPTUREPOKEMONEVENTS_SCHEMA, &mut |member, deser| {
          79  +
            result = ::std::option::Option::Some(match member.member_index() {
          80  +
                Some(0) => Self::Event(crate::types::CaptureEvent::deserialize(deser)?),
          81  +
                _ => Self::Unknown,
          82  +
            });
          83  +
            Ok(())
          84  +
        })?;
          85  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          86  +
    }
          87  +
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_capturing_event.rs

@@ -17,17 +100,111 @@
   37     37   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   38     38   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   39     39   
        if let Some(ref val) = self.payload {
   40     40   
            ser.write_struct(&CAPTURINGEVENT_MEMBER_PAYLOAD, val)?;
   41     41   
        }
   42     42   
        Ok(())
   43     43   
    }
   44     44   
}
   45     45   
impl CapturingEvent {
   46     46   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   47         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   48         -
        deserializer: &mut D,
          47  +
    pub fn deserialize(
          48  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   49     49   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   50     50   
        #[allow(unused_variables, unused_mut)]
   51     51   
        let mut builder = Self::builder();
   52     52   
        #[allow(
   53     53   
            unused_variables,
   54     54   
            unreachable_code,
   55     55   
            clippy::single_match,
   56     56   
            clippy::match_single_binding,
   57     57   
            clippy::diverging_sub_expression
   58     58   
        )]
   59         -
        deserializer.read_struct(&CAPTURINGEVENT_SCHEMA, (), |_, member, deser| {
          59  +
        deserializer.read_struct(&CAPTURINGEVENT_SCHEMA, &mut |member, deser| {
   60     60   
            match member.member_index() {
   61     61   
                Some(0) => {
   62     62   
                    builder.payload = Some(crate::types::CapturingPayload::deserialize(deser)?);
   63     63   
                }
   64     64   
                _ => {}
   65     65   
            }
   66     66   
            Ok(())
   67     67   
        })?;
   68     68   
        Ok(builder.build())
   69     69   
    }
   70     70   
}
          71  +
impl CapturingEvent {
          72  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          73  +
    pub fn deserialize_with_response(
          74  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          75  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          76  +
        _status: u16,
          77  +
        _body: &[u8],
          78  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          79  +
        Self::deserialize(deserializer)
          80  +
    }
          81  +
}
   71     82   
impl CapturingEvent {
   72     83   
    /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::types::CapturingEvent).
   73     84   
    pub fn builder() -> crate::types::builders::CapturingEventBuilder {
   74     85   
        crate::types::builders::CapturingEventBuilder::default()
   75     86   
    }
   76     87   
}
   77     88   
   78     89   
/// A builder for [`CapturingEvent`](crate::types::CapturingEvent).
   79     90   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   80     91   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_capturing_payload.rs

@@ -31,31 +117,128 @@
   51     51   
            ser.write_string(&CAPTURINGPAYLOAD_MEMBER_NAME, val)?;
   52     52   
        }
   53     53   
        if let Some(ref val) = self.pokeball {
   54     54   
            ser.write_string(&CAPTURINGPAYLOAD_MEMBER_POKEBALL, val)?;
   55     55   
        }
   56     56   
        Ok(())
   57     57   
    }
   58     58   
}
   59     59   
impl CapturingPayload {
   60     60   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   61         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   62         -
        deserializer: &mut D,
          61  +
    pub fn deserialize(
          62  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   63     63   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   64     64   
        #[allow(unused_variables, unused_mut)]
   65     65   
        let mut builder = Self::builder();
   66     66   
        #[allow(
   67     67   
            unused_variables,
   68     68   
            unreachable_code,
   69     69   
            clippy::single_match,
   70     70   
            clippy::match_single_binding,
   71     71   
            clippy::diverging_sub_expression
   72     72   
        )]
   73         -
        deserializer.read_struct(&CAPTURINGPAYLOAD_SCHEMA, (), |_, member, deser| {
          73  +
        deserializer.read_struct(&CAPTURINGPAYLOAD_SCHEMA, &mut |member, deser| {
   74     74   
            match member.member_index() {
   75     75   
                Some(0) => {
   76     76   
                    builder.name = Some(deser.read_string(member)?);
   77     77   
                }
   78     78   
                Some(1) => {
   79     79   
                    builder.pokeball = Some(deser.read_string(member)?);
   80     80   
                }
   81     81   
                _ => {}
   82     82   
            }
   83     83   
            Ok(())
   84     84   
        })?;
   85     85   
        Ok(builder.build())
   86     86   
    }
   87     87   
}
          88  +
impl CapturingPayload {
          89  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          90  +
    pub fn deserialize_with_response(
          91  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          92  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          93  +
        _status: u16,
          94  +
        _body: &[u8],
          95  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          96  +
        Self::deserialize(deserializer)
          97  +
    }
          98  +
}
   88     99   
impl CapturingPayload {
   89    100   
    /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::types::CapturingPayload).
   90    101   
    pub fn builder() -> crate::types::builders::CapturingPayloadBuilder {
   91    102   
        crate::types::builders::CapturingPayloadBuilder::default()
   92    103   
    }
   93    104   
}
   94    105   
   95    106   
/// A builder for [`CapturingPayload`](crate::types::CapturingPayload).
   96    107   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   97    108   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_flavor_text.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/_validation_exception_field.rs

@@ -47,47 +135,148 @@
   67     67   
        }
   68     68   
        {
   69     69   
            let val = &self.message;
   70     70   
            ser.write_string(&VALIDATIONEXCEPTIONFIELD_MEMBER_MESSAGE, val)?;
   71     71   
        }
   72     72   
        Ok(())
   73     73   
    }
   74     74   
}
   75     75   
impl ValidationExceptionField {
   76     76   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          77  +
    pub fn deserialize(
          78  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     79   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     80   
        #[allow(unused_variables, unused_mut)]
   81     81   
        let mut builder = Self::builder();
   82     82   
        #[allow(
   83     83   
            unused_variables,
   84     84   
            unreachable_code,
   85     85   
            clippy::single_match,
   86     86   
            clippy::match_single_binding,
   87     87   
            clippy::diverging_sub_expression
   88     88   
        )]
   89         -
        deserializer.read_struct(&VALIDATIONEXCEPTIONFIELD_SCHEMA, (), |_, member, deser| {
          89  +
        deserializer.read_struct(&VALIDATIONEXCEPTIONFIELD_SCHEMA, &mut |member, deser| {
   90     90   
            match member.member_index() {
   91     91   
                Some(0) => {
   92     92   
                    builder.path = Some(deser.read_string(member)?);
   93     93   
                }
   94     94   
                Some(1) => {
   95     95   
                    builder.message = Some(deser.read_string(member)?);
   96     96   
                }
   97     97   
                _ => {}
   98     98   
            }
   99     99   
            Ok(())
  100    100   
        })?;
         101  +
        builder.path = builder.path.or(Some(String::new()));
         102  +
        builder.message = builder.message.or(Some(String::new()));
  101    103   
        builder
  102    104   
            .build()
  103    105   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    106   
    }
  105    107   
}
         108  +
impl ValidationExceptionField {
         109  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         110  +
    pub fn deserialize_with_response(
         111  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         112  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         113  +
        _status: u16,
         114  +
        _body: &[u8],
         115  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         116  +
        Self::deserialize(deserializer)
         117  +
    }
         118  +
}
  106    119   
impl ValidationExceptionField {
  107    120   
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
  108    121   
    pub fn builder() -> crate::types::builders::ValidationExceptionFieldBuilder {
  109    122   
        crate::types::builders::ValidationExceptionFieldBuilder::default()
  110    123   
    }
  111    124   
}
  112    125   
  113    126   
/// A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
  114    127   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    128   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_invalid_pokeball_error.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_master_ball_unsuccessful.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(&MASTERBALLUNSUCCESSFUL_MEMBER_MESSAGE, val)?;
   39     39   
        }
   40     40   
        Ok(())
   41     41   
    }
   42     42   
}
   43     43   
impl MasterBallUnsuccessful {
   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(&MASTERBALLUNSUCCESSFUL_SCHEMA, (), |_, member, deser| {
          57  +
        deserializer.read_struct(&MASTERBALLUNSUCCESSFUL_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 MasterBallUnsuccessful {
          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 MasterBallUnsuccessful {
   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 MasterBallUnsuccessful {
   76     87   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   77     88   
        ::std::write!(f, "MasterBallUnsuccessful")?;
   78     89   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_resource_not_found_exception.rs

@@ -19,19 +104,116 @@
   39     39   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   40     40   
        {
   41     41   
            let val = &self.message;
   42     42   
            ser.write_string(&RESOURCENOTFOUNDERROR_MEMBER_MESSAGE, val)?;
   43     43   
        }
   44     44   
        Ok(())
   45     45   
    }
   46     46   
}
   47     47   
impl ResourceNotFoundError {
   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(&RESOURCENOTFOUNDERROR_SCHEMA, (), |_, member, deser| {
          61  +
        deserializer.read_struct(&RESOURCENOTFOUNDERROR_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  +
        builder.message = builder.message.or(Some(String::new()));
   70     71   
        builder
   71     72   
            .build()
   72     73   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   73     74   
    }
   74     75   
}
          76  +
impl ResourceNotFoundError {
          77  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          78  +
    pub fn deserialize_with_response(
          79  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          80  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          81  +
        _status: u16,
          82  +
        _body: &[u8],
          83  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          84  +
        Self::deserialize(deserializer)
          85  +
    }
          86  +
}
   75     87   
impl ResourceNotFoundError {
   76     88   
    /// Returns the error message.
   77     89   
    pub fn message(&self) -> &str {
   78     90   
        &self.message
   79     91   
    }
   80     92   
}
   81     93   
impl ::std::fmt::Display for ResourceNotFoundError {
   82     94   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   83     95   
        ::std::write!(f, "ResourceNotFoundError [ResourceNotFoundException]")?;
   84     96   
        {

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_storage_access_not_authorized.rs

@@ -1,1 +102,113 @@
   13     13   
    "com.aws.example",
   14     14   
    "StorageAccessNotAuthorized",
   15     15   
);
   16     16   
static STORAGEACCESSNOTAUTHORIZED_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   17     17   
    ::aws_smithy_schema::ShapeId::from_static(
   18     18   
        "com.aws.example#StorageAccessNotAuthorized$Message",
   19     19   
        "com.aws.example",
   20     20   
        "StorageAccessNotAuthorized",
   21     21   
    ),
   22     22   
    ::aws_smithy_schema::ShapeType::String,
   23         -
    "message",
          23  +
    "Message",
   24     24   
    0,
   25     25   
);
   26     26   
static STORAGEACCESSNOTAUTHORIZED_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   27     27   
    STORAGEACCESSNOTAUTHORIZED_SCHEMA_ID,
   28     28   
    ::aws_smithy_schema::ShapeType::Structure,
   29     29   
    &[&STORAGEACCESSNOTAUTHORIZED_MEMBER_MESSAGE],
   30     30   
);
   31     31   
impl StorageAccessNotAuthorized {
   32     32   
    /// The schema for this shape.
   33     33   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STORAGEACCESSNOTAUTHORIZED_SCHEMA;
   34     34   
}
   35     35   
impl ::aws_smithy_schema::serde::SerializableStruct for StorageAccessNotAuthorized {
   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(&STORAGEACCESSNOTAUTHORIZED_MEMBER_MESSAGE, val)?;
   43     43   
        }
   44     44   
        Ok(())
   45     45   
    }
   46     46   
}
   47     47   
impl StorageAccessNotAuthorized {
   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(&STORAGEACCESSNOTAUTHORIZED_SCHEMA, (), |_, member, deser| {
          61  +
        deserializer.read_struct(&STORAGEACCESSNOTAUTHORIZED_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 StorageAccessNotAuthorized {
          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 StorageAccessNotAuthorized {
   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 StorageAccessNotAuthorized {
   80     91   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   81     92   
        ::std::write!(f, "StorageAccessNotAuthorized")?;
   82     93   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_throttling_error.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_unsupported_region_error.rs

@@ -8,8 +126,138 @@
   28     28   
    "region",
   29     29   
    0,
   30     30   
);
   31     31   
static UNSUPPORTEDREGIONERROR_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   32     32   
    ::aws_smithy_schema::ShapeId::from_static(
   33     33   
        "com.aws.example#UnsupportedRegionError$Message",
   34     34   
        "com.aws.example",
   35     35   
        "UnsupportedRegionError",
   36     36   
    ),
   37     37   
    ::aws_smithy_schema::ShapeType::String,
   38         -
    "message",
          38  +
    "Message",
   39     39   
    1,
   40     40   
);
   41     41   
static UNSUPPORTEDREGIONERROR_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   42     42   
    UNSUPPORTEDREGIONERROR_SCHEMA_ID,
   43     43   
    ::aws_smithy_schema::ShapeType::Structure,
   44     44   
    &[&UNSUPPORTEDREGIONERROR_MEMBER_REGION, &UNSUPPORTEDREGIONERROR_MEMBER_MESSAGE],
   45     45   
);
   46     46   
impl UnsupportedRegionError {
   47     47   
    /// The schema for this shape.
   48     48   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UNSUPPORTEDREGIONERROR_SCHEMA;
   49     49   
}
   50     50   
impl ::aws_smithy_schema::serde::SerializableStruct for UnsupportedRegionError {
   51     51   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   52     52   
    fn serialize_members(
   53     53   
        &self,
   54     54   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   55     55   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        {
   57     57   
            let val = &self.region;
   58     58   
            ser.write_string(&UNSUPPORTEDREGIONERROR_MEMBER_REGION, val)?;
   59     59   
        }
   60     60   
        if let Some(ref val) = self.message {
   61     61   
            ser.write_string(&UNSUPPORTEDREGIONERROR_MEMBER_MESSAGE, val)?;
   62     62   
        }
   63     63   
        Ok(())
   64     64   
    }
   65     65   
}
   66     66   
impl UnsupportedRegionError {
   67     67   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   68         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   69         -
        deserializer: &mut D,
          68  +
    pub fn deserialize(
          69  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   70     70   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   71     71   
        #[allow(unused_variables, unused_mut)]
   72     72   
        let mut builder = Self::builder();
   73     73   
        #[allow(
   74     74   
            unused_variables,
   75     75   
            unreachable_code,
   76     76   
            clippy::single_match,
   77     77   
            clippy::match_single_binding,
   78     78   
            clippy::diverging_sub_expression
   79     79   
        )]
   80         -
        deserializer.read_struct(&UNSUPPORTEDREGIONERROR_SCHEMA, (), |_, member, deser| {
          80  +
        deserializer.read_struct(&UNSUPPORTEDREGIONERROR_SCHEMA, &mut |member, deser| {
   81     81   
            match member.member_index() {
   82     82   
                Some(0) => {
   83     83   
                    builder.region = Some(deser.read_string(member)?);
   84     84   
                }
   85     85   
                Some(1) => {
   86     86   
                    builder.message = Some(deser.read_string(member)?);
   87     87   
                }
   88     88   
                _ => {}
   89     89   
            }
   90     90   
            Ok(())
   91     91   
        })?;
          92  +
        builder.region = builder.region.or(Some(String::new()));
   92     93   
        builder
   93     94   
            .build()
   94     95   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   95     96   
    }
   96     97   
}
          98  +
impl UnsupportedRegionError {
          99  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         100  +
    pub fn deserialize_with_response(
         101  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         102  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         103  +
        _status: u16,
         104  +
        _body: &[u8],
         105  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         106  +
        Self::deserialize(deserializer)
         107  +
    }
         108  +
}
   97    109   
impl UnsupportedRegionError {
   98    110   
    /// Returns the error message.
   99    111   
    pub fn message(&self) -> ::std::option::Option<&str> {
  100    112   
        self.message.as_deref()
  101    113   
    }
  102    114   
}
  103    115   
impl ::std::fmt::Display for UnsupportedRegionError {
  104    116   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  105    117   
        ::std::write!(f, "UnsupportedRegionError")?;
  106    118   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/types/error/_validation_exception.rs

@@ -6,6 +142,151 @@
   26     26   
    "message",
   27     27   
    0,
   28     28   
);
   29     29   
static VALIDATIONERROR_MEMBER_FIELD_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   30     30   
    ::aws_smithy_schema::ShapeId::from_static(
   31     31   
        "smithy.framework#ValidationException$fieldList",
   32     32   
        "smithy.framework",
   33     33   
        "ValidationException",
   34     34   
    ),
   35     35   
    ::aws_smithy_schema::ShapeType::List,
   36         -
    "field_list",
          36  +
    "fieldList",
   37     37   
    1,
   38     38   
);
   39     39   
static VALIDATIONERROR_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   40     40   
    VALIDATIONERROR_SCHEMA_ID,
   41     41   
    ::aws_smithy_schema::ShapeType::Structure,
   42     42   
    &[&VALIDATIONERROR_MEMBER_MESSAGE, &VALIDATIONERROR_MEMBER_FIELD_LIST],
   43     43   
);
   44     44   
impl ValidationError {
   45     45   
    /// The schema for this shape.
   46     46   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &VALIDATIONERROR_SCHEMA;
   47     47   
}
   48     48   
impl ::aws_smithy_schema::serde::SerializableStruct for ValidationError {
   49     49   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   50     50   
    fn serialize_members(
   51     51   
        &self,
   52     52   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   53     53   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   54     54   
        {
   55     55   
            let val = &self.message;
   56     56   
            ser.write_string(&VALIDATIONERROR_MEMBER_MESSAGE, val)?;
   57     57   
        }
   58     58   
        if let Some(ref val) = self.field_list {
   59     59   
            ser.write_list(
   60     60   
                &VALIDATIONERROR_MEMBER_FIELD_LIST,
   61     61   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   62     62   
                    for item in val {
   63     63   
                        ser.write_struct(crate::types::ValidationExceptionField::SCHEMA, item)?;
   64     64   
                    }
   65     65   
                    Ok(())
   66     66   
                },
   67     67   
            )?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl ValidationError {
   73     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   74         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   75         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   76     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   77     77   
        #[allow(unused_variables, unused_mut)]
   78     78   
        let mut builder = Self::builder();
   79     79   
        #[allow(
   80     80   
            unused_variables,
   81     81   
            unreachable_code,
   82     82   
            clippy::single_match,
   83     83   
            clippy::match_single_binding,
   84     84   
            clippy::diverging_sub_expression
   85     85   
        )]
   86         -
        deserializer.read_struct(&VALIDATIONERROR_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&VALIDATIONERROR_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.message = Some(deser.read_string(member)?);
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.field_list = Some({
   93         -
                        let container = if let Some(cap) = deser.container_size() {
   94         -
                            Vec::with_capacity(cap)
   95         -
                        } else {
   96         -
                            Vec::new()
   97         -
                        };
   98         -
                        deser.read_list(member, container, |mut list, deser| {
   99         -
                            list.push(crate::types::ValidationExceptionField::deserialize(deser)?);
  100         -
                            Ok(list)
  101         -
                        })?
          93  +
                        let mut container = Vec::new();
          94  +
                        deser.read_list(member, &mut |deser| {
          95  +
                            container.push(crate::types::ValidationExceptionField::deserialize(deser)?);
          96  +
                            Ok(())
          97  +
                        })?;
          98  +
                        container
  102     99   
                    });
  103    100   
                }
  104    101   
                _ => {}
  105    102   
            }
  106    103   
            Ok(())
  107    104   
        })?;
         105  +
        builder.message = builder.message.or(Some(String::new()));
  108    106   
        builder
  109    107   
            .build()
  110    108   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  111    109   
    }
  112    110   
}
         111  +
impl ValidationError {
         112  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         113  +
    pub fn deserialize_with_response(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         116  +
        _status: u16,
         117  +
        _body: &[u8],
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        Self::deserialize(deserializer)
         120  +
    }
         121  +
}
  113    122   
impl ValidationError {
  114    123   
    /// Returns the error message.
  115    124   
    pub fn message(&self) -> &str {
  116    125   
        &self.message
  117    126   
    }
  118    127   
}
  119    128   
impl ::std::fmt::Display for ValidationError {
  120    129   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  121    130   
        ::std::write!(f, "ValidationError [ValidationException]")?;
  122    131   
        {

tmp-codegen-diff/codegen-client-test/query-compat-test/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#awsJson1_0"
   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"