Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_empty_struct.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_greeting_struct.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_kitchen_sink.rs

@@ -158,158 +410,410 @@
  178    178   
    #[allow(missing_docs)] // documentation missing in model
  179    179   
    pub fn unix_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
  180    180   
        self.unix_timestamp.as_ref()
  181    181   
    }
  182    182   
}
  183    183   
static KITCHENSINK_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
  184    184   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink", "aws.protocoltests.json", "KitchenSink");
  185    185   
static KITCHENSINK_MEMBER_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  186    186   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Blob", "aws.protocoltests.json", "KitchenSink"),
  187    187   
    ::aws_smithy_schema::ShapeType::Blob,
  188         -
    "blob",
         188  +
    "Blob",
  189    189   
    0,
  190    190   
);
  191    191   
static KITCHENSINK_MEMBER_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  192    192   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Boolean", "aws.protocoltests.json", "KitchenSink"),
  193    193   
    ::aws_smithy_schema::ShapeType::Boolean,
  194         -
    "boolean",
         194  +
    "Boolean",
  195    195   
    1,
  196    196   
);
  197    197   
static KITCHENSINK_MEMBER_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  198    198   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Double", "aws.protocoltests.json", "KitchenSink"),
  199    199   
    ::aws_smithy_schema::ShapeType::Double,
  200         -
    "double",
         200  +
    "Double",
  201    201   
    2,
  202    202   
);
  203    203   
static KITCHENSINK_MEMBER_EMPTY_STRUCT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  204    204   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$EmptyStruct", "aws.protocoltests.json", "KitchenSink"),
  205    205   
    ::aws_smithy_schema::ShapeType::Structure,
  206         -
    "empty_struct",
         206  +
    "EmptyStruct",
  207    207   
    3,
  208    208   
);
  209    209   
static KITCHENSINK_MEMBER_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  210    210   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Float", "aws.protocoltests.json", "KitchenSink"),
  211    211   
    ::aws_smithy_schema::ShapeType::Float,
  212         -
    "float",
         212  +
    "Float",
  213    213   
    4,
  214    214   
);
  215    215   
static KITCHENSINK_MEMBER_HTTPDATE_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  216    216   
    ::aws_smithy_schema::ShapeId::from_static(
  217    217   
        "aws.protocoltests.json#KitchenSink$HttpdateTimestamp",
  218    218   
        "aws.protocoltests.json",
  219    219   
        "KitchenSink",
  220    220   
    ),
  221    221   
    ::aws_smithy_schema::ShapeType::Timestamp,
  222         -
    "httpdate_timestamp",
         222  +
    "HttpdateTimestamp",
  223    223   
    5,
  224    224   
)
  225    225   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  226    226   
static KITCHENSINK_MEMBER_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  227    227   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Integer", "aws.protocoltests.json", "KitchenSink"),
  228    228   
    ::aws_smithy_schema::ShapeType::Integer,
  229         -
    "integer",
         229  +
    "Integer",
  230    230   
    6,
  231    231   
);
  232    232   
static KITCHENSINK_MEMBER_ISO8601_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  233    233   
    ::aws_smithy_schema::ShapeId::from_static(
  234    234   
        "aws.protocoltests.json#KitchenSink$Iso8601Timestamp",
  235    235   
        "aws.protocoltests.json",
  236    236   
        "KitchenSink",
  237    237   
    ),
  238    238   
    ::aws_smithy_schema::ShapeType::Timestamp,
  239         -
    "iso8601_timestamp",
         239  +
    "Iso8601Timestamp",
  240    240   
    7,
  241    241   
)
  242    242   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
  243    243   
static KITCHENSINK_MEMBER_JSON_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  244    244   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$JsonValue", "aws.protocoltests.json", "KitchenSink"),
  245    245   
    ::aws_smithy_schema::ShapeType::String,
  246         -
    "json_value",
         246  +
    "JsonValue",
  247    247   
    8,
  248    248   
);
  249    249   
static KITCHENSINK_MEMBER_LIST_OF_LISTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  250    250   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$ListOfLists", "aws.protocoltests.json", "KitchenSink"),
  251    251   
    ::aws_smithy_schema::ShapeType::List,
  252         -
    "list_of_lists",
         252  +
    "ListOfLists",
  253    253   
    9,
  254    254   
);
  255    255   
static KITCHENSINK_MEMBER_LIST_OF_MAPS_OF_STRINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  256    256   
    ::aws_smithy_schema::ShapeId::from_static(
  257    257   
        "aws.protocoltests.json#KitchenSink$ListOfMapsOfStrings",
  258    258   
        "aws.protocoltests.json",
  259    259   
        "KitchenSink",
  260    260   
    ),
  261    261   
    ::aws_smithy_schema::ShapeType::List,
  262         -
    "list_of_maps_of_strings",
         262  +
    "ListOfMapsOfStrings",
  263    263   
    10,
  264    264   
);
  265    265   
static KITCHENSINK_MEMBER_LIST_OF_STRINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  266    266   
    ::aws_smithy_schema::ShapeId::from_static(
  267    267   
        "aws.protocoltests.json#KitchenSink$ListOfStrings",
  268    268   
        "aws.protocoltests.json",
  269    269   
        "KitchenSink",
  270    270   
    ),
  271    271   
    ::aws_smithy_schema::ShapeType::List,
  272         -
    "list_of_strings",
         272  +
    "ListOfStrings",
  273    273   
    11,
  274    274   
);
  275    275   
static KITCHENSINK_MEMBER_LIST_OF_STRUCTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  276    276   
    ::aws_smithy_schema::ShapeId::from_static(
  277    277   
        "aws.protocoltests.json#KitchenSink$ListOfStructs",
  278    278   
        "aws.protocoltests.json",
  279    279   
        "KitchenSink",
  280    280   
    ),
  281    281   
    ::aws_smithy_schema::ShapeType::List,
  282         -
    "list_of_structs",
         282  +
    "ListOfStructs",
  283    283   
    12,
  284    284   
);
  285    285   
static KITCHENSINK_MEMBER_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  286    286   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Long", "aws.protocoltests.json", "KitchenSink"),
  287    287   
    ::aws_smithy_schema::ShapeType::Long,
  288         -
    "long",
         288  +
    "Long",
  289    289   
    13,
  290    290   
);
  291    291   
static KITCHENSINK_MEMBER_MAP_OF_LISTS_OF_STRINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  292    292   
    ::aws_smithy_schema::ShapeId::from_static(
  293    293   
        "aws.protocoltests.json#KitchenSink$MapOfListsOfStrings",
  294    294   
        "aws.protocoltests.json",
  295    295   
        "KitchenSink",
  296    296   
    ),
  297    297   
    ::aws_smithy_schema::ShapeType::Map,
  298         -
    "map_of_lists_of_strings",
         298  +
    "MapOfListsOfStrings",
  299    299   
    14,
  300    300   
);
  301    301   
static KITCHENSINK_MEMBER_MAP_OF_MAPS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  302    302   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$MapOfMaps", "aws.protocoltests.json", "KitchenSink"),
  303    303   
    ::aws_smithy_schema::ShapeType::Map,
  304         -
    "map_of_maps",
         304  +
    "MapOfMaps",
  305    305   
    15,
  306    306   
);
  307    307   
static KITCHENSINK_MEMBER_MAP_OF_STRINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  308    308   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$MapOfStrings", "aws.protocoltests.json", "KitchenSink"),
  309    309   
    ::aws_smithy_schema::ShapeType::Map,
  310         -
    "map_of_strings",
         310  +
    "MapOfStrings",
  311    311   
    16,
  312    312   
);
  313    313   
static KITCHENSINK_MEMBER_MAP_OF_STRUCTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  314    314   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$MapOfStructs", "aws.protocoltests.json", "KitchenSink"),
  315    315   
    ::aws_smithy_schema::ShapeType::Map,
  316         -
    "map_of_structs",
         316  +
    "MapOfStructs",
  317    317   
    17,
  318    318   
);
  319    319   
static KITCHENSINK_MEMBER_RECURSIVE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  320    320   
    ::aws_smithy_schema::ShapeId::from_static(
  321    321   
        "aws.protocoltests.json#KitchenSink$RecursiveList",
  322    322   
        "aws.protocoltests.json",
  323    323   
        "KitchenSink",
  324    324   
    ),
  325    325   
    ::aws_smithy_schema::ShapeType::List,
  326         -
    "recursive_list",
         326  +
    "RecursiveList",
  327    327   
    18,
  328    328   
);
  329    329   
static KITCHENSINK_MEMBER_RECURSIVE_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  330    330   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$RecursiveMap", "aws.protocoltests.json", "KitchenSink"),
  331    331   
    ::aws_smithy_schema::ShapeType::Map,
  332         -
    "recursive_map",
         332  +
    "RecursiveMap",
  333    333   
    19,
  334    334   
);
  335    335   
static KITCHENSINK_MEMBER_RECURSIVE_STRUCT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  336    336   
    ::aws_smithy_schema::ShapeId::from_static(
  337    337   
        "aws.protocoltests.json#KitchenSink$RecursiveStruct",
  338    338   
        "aws.protocoltests.json",
  339    339   
        "KitchenSink",
  340    340   
    ),
  341    341   
    ::aws_smithy_schema::ShapeType::Structure,
  342         -
    "recursive_struct",
         342  +
    "RecursiveStruct",
  343    343   
    20,
  344    344   
);
  345    345   
static KITCHENSINK_MEMBER_SIMPLE_STRUCT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  346    346   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$SimpleStruct", "aws.protocoltests.json", "KitchenSink"),
  347    347   
    ::aws_smithy_schema::ShapeType::Structure,
  348         -
    "simple_struct",
         348  +
    "SimpleStruct",
  349    349   
    21,
  350    350   
);
  351    351   
static KITCHENSINK_MEMBER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  352    352   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$String", "aws.protocoltests.json", "KitchenSink"),
  353    353   
    ::aws_smithy_schema::ShapeType::String,
  354         -
    "string",
         354  +
    "String",
  355    355   
    22,
  356    356   
);
  357    357   
static KITCHENSINK_MEMBER_STRUCT_WITH_JSON_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  358    358   
    ::aws_smithy_schema::ShapeId::from_static(
  359    359   
        "aws.protocoltests.json#KitchenSink$StructWithJsonName",
  360    360   
        "aws.protocoltests.json",
  361    361   
        "KitchenSink",
  362    362   
    ),
  363    363   
    ::aws_smithy_schema::ShapeType::Structure,
  364         -
    "struct_with_json_name",
         364  +
    "StructWithJsonName",
  365    365   
    23,
  366    366   
);
  367    367   
static KITCHENSINK_MEMBER_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  368    368   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#KitchenSink$Timestamp", "aws.protocoltests.json", "KitchenSink"),
  369    369   
    ::aws_smithy_schema::ShapeType::Timestamp,
  370         -
    "timestamp",
         370  +
    "Timestamp",
  371    371   
    24,
  372    372   
);
  373    373   
static KITCHENSINK_MEMBER_UNIX_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  374    374   
    ::aws_smithy_schema::ShapeId::from_static(
  375    375   
        "aws.protocoltests.json#KitchenSink$UnixTimestamp",
  376    376   
        "aws.protocoltests.json",
  377    377   
        "KitchenSink",
  378    378   
    ),
  379    379   
    ::aws_smithy_schema::ShapeType::Timestamp,
  380         -
    "unix_timestamp",
         380  +
    "UnixTimestamp",
  381    381   
    25,
  382    382   
)
  383    383   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  384    384   
static KITCHENSINK_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  385    385   
    KITCHENSINK_SCHEMA_ID,
  386    386   
    ::aws_smithy_schema::ShapeType::Structure,
  387    387   
    &[
  388    388   
        &KITCHENSINK_MEMBER_BLOB,
  389    389   
        &KITCHENSINK_MEMBER_BOOLEAN,
  390    390   
        &KITCHENSINK_MEMBER_DOUBLE,
@@ -428,428 +548,584 @@
  448    448   
            ser.write_timestamp(&KITCHENSINK_MEMBER_ISO8601_TIMESTAMP, val)?;
  449    449   
        }
  450    450   
        if let Some(ref val) = self.json_value {
  451    451   
            ser.write_string(&KITCHENSINK_MEMBER_JSON_VALUE, val)?;
  452    452   
        }
  453    453   
        if let Some(ref val) = self.list_of_lists {
  454    454   
            ser.write_list(
  455    455   
                &KITCHENSINK_MEMBER_LIST_OF_LISTS,
  456    456   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  457    457   
                    for item in val {
  458         -
                        todo!("schema: unsupported list element type");
         458  +
                        ser.write_list(
         459  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         460  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         461  +
                                for item in item {
         462  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         463  +
                                }
         464  +
                                Ok(())
         465  +
                            },
         466  +
                        )?;
  459    467   
                    }
  460    468   
                    Ok(())
  461    469   
                },
  462    470   
            )?;
  463    471   
        }
  464    472   
        if let Some(ref val) = self.list_of_maps_of_strings {
  465    473   
            ser.write_list(
  466    474   
                &KITCHENSINK_MEMBER_LIST_OF_MAPS_OF_STRINGS,
  467    475   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  468    476   
                    for item in val {
  469         -
                        todo!("schema: unsupported list element type");
         477  +
                        ser.write_map(
         478  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         479  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         480  +
                                for (key, value) in item {
         481  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         482  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
         483  +
                                }
         484  +
                                Ok(())
         485  +
                            },
         486  +
                        )?;
  470    487   
                    }
  471    488   
                    Ok(())
  472    489   
                },
  473    490   
            )?;
  474    491   
        }
  475    492   
        if let Some(ref val) = self.list_of_strings {
  476    493   
            ser.write_list(
  477    494   
                &KITCHENSINK_MEMBER_LIST_OF_STRINGS,
  478    495   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  479    496   
                    for item in val {
  480    497   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  481    498   
                    }
  482    499   
                    Ok(())
  483    500   
                },
  484    501   
            )?;
  485    502   
        }
  486    503   
        if let Some(ref val) = self.list_of_structs {
  487    504   
            ser.write_list(
  488    505   
                &KITCHENSINK_MEMBER_LIST_OF_STRUCTS,
  489    506   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  490    507   
                    for item in val {
  491    508   
                        ser.write_struct(crate::types::SimpleStruct::SCHEMA, item)?;
  492    509   
                    }
  493    510   
                    Ok(())
  494    511   
                },
  495    512   
            )?;
  496    513   
        }
  497    514   
        if let Some(ref val) = self.long {
  498    515   
            ser.write_long(&KITCHENSINK_MEMBER_LONG, *val)?;
  499    516   
        }
  500    517   
        if let Some(ref val) = self.map_of_lists_of_strings {
  501    518   
            ser.write_map(
  502    519   
                &KITCHENSINK_MEMBER_MAP_OF_LISTS_OF_STRINGS,
  503    520   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  504    521   
                    for (key, value) in val {
  505    522   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  506         -
                        todo!("schema: unsupported map value type");
         523  +
         524  +
                        ser.write_list(
         525  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         526  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         527  +
                                for item in value {
         528  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         529  +
                                }
         530  +
                                Ok(())
         531  +
                            },
         532  +
                        )?;
  507    533   
                    }
  508    534   
                    Ok(())
  509    535   
                },
  510    536   
            )?;
  511    537   
        }
  512    538   
        if let Some(ref val) = self.map_of_maps {
  513    539   
            ser.write_map(
  514    540   
                &KITCHENSINK_MEMBER_MAP_OF_MAPS,
  515    541   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  516    542   
                    for (key, value) in val {
  517    543   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  518         -
                        todo!("schema: unsupported map value type");
         544  +
         545  +
                        ser.write_map(
         546  +
                            &::aws_smithy_schema::prelude::DOCUMENT,
         547  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         548  +
                                for (key, value) in value {
         549  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         550  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
         551  +
                                }
         552  +
                                Ok(())
         553  +
                            },
         554  +
                        )?;
  519    555   
                    }
  520    556   
                    Ok(())
  521    557   
                },
  522    558   
            )?;
  523    559   
        }
  524    560   
        if let Some(ref val) = self.map_of_strings {
  525    561   
            ser.write_map(
  526    562   
                &KITCHENSINK_MEMBER_MAP_OF_STRINGS,
  527    563   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  528    564   
                    for (key, value) in val {
@@ -564,600 +822,855 @@
  584    620   
            ser.write_timestamp(&KITCHENSINK_MEMBER_TIMESTAMP, val)?;
  585    621   
        }
  586    622   
        if let Some(ref val) = self.unix_timestamp {
  587    623   
            ser.write_timestamp(&KITCHENSINK_MEMBER_UNIX_TIMESTAMP, val)?;
  588    624   
        }
  589    625   
        Ok(())
  590    626   
    }
  591    627   
}
  592    628   
impl KitchenSink {
  593    629   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  594         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  595         -
        deserializer: &mut D,
         630  +
    pub fn deserialize(
         631  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  596    632   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  597    633   
        #[allow(unused_variables, unused_mut)]
  598    634   
        let mut builder = Self::builder();
  599    635   
        #[allow(
  600    636   
            unused_variables,
  601    637   
            unreachable_code,
  602    638   
            clippy::single_match,
  603    639   
            clippy::match_single_binding,
  604    640   
            clippy::diverging_sub_expression
  605    641   
        )]
  606         -
        deserializer.read_struct(&KITCHENSINK_SCHEMA, (), |_, member, deser| {
         642  +
        deserializer.read_struct(&KITCHENSINK_SCHEMA, &mut |member, deser| {
  607    643   
            match member.member_index() {
  608    644   
                Some(0) => {
  609    645   
                    builder.blob = Some(deser.read_blob(member)?);
  610    646   
                }
  611    647   
                Some(1) => {
  612    648   
                    builder.boolean = Some(deser.read_boolean(member)?);
  613    649   
                }
  614    650   
                Some(2) => {
  615    651   
                    builder.double = Some(deser.read_double(member)?);
  616    652   
                }
  617    653   
                Some(3) => {
  618    654   
                    builder.empty_struct = Some(crate::types::EmptyStruct::deserialize(deser)?);
  619    655   
                }
  620    656   
                Some(4) => {
  621    657   
                    builder.float = Some(deser.read_float(member)?);
  622    658   
                }
  623    659   
                Some(5) => {
  624    660   
                    builder.httpdate_timestamp = Some(deser.read_timestamp(member)?);
  625    661   
                }
  626    662   
                Some(6) => {
  627    663   
                    builder.integer = Some(deser.read_integer(member)?);
  628    664   
                }
  629    665   
                Some(7) => {
  630    666   
                    builder.iso8601_timestamp = Some(deser.read_timestamp(member)?);
  631    667   
                }
  632    668   
                Some(8) => {
  633    669   
                    builder.json_value = Some(deser.read_string(member)?);
  634    670   
                }
  635    671   
                Some(9) => {
  636    672   
                    builder.list_of_lists = Some({
  637         -
                        let container = if let Some(cap) = deser.container_size() {
  638         -
                            Vec::with_capacity(cap)
  639         -
                        } else {
  640         -
                            Vec::new()
  641         -
                        };
  642         -
                        deser.read_list(member, container, |mut list, deser| {
  643         -
                            list.push(todo!("deserialize nested aggregate"));
  644         -
                            Ok(list)
  645         -
                        })?
         673  +
                        let mut container = Vec::new();
         674  +
                        deser.read_list(member, &mut |deser| {
         675  +
                            container.push({
         676  +
                                let mut list = Vec::new();
         677  +
                                deser.read_list(member, &mut |deser| {
         678  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         679  +
                                    Ok(())
         680  +
                                })?;
         681  +
                                list
         682  +
                            });
         683  +
                            Ok(())
         684  +
                        })?;
         685  +
                        container
  646    686   
                    });
  647    687   
                }
  648    688   
                Some(10) => {
  649    689   
                    builder.list_of_maps_of_strings = Some({
  650         -
                        let container = if let Some(cap) = deser.container_size() {
  651         -
                            Vec::with_capacity(cap)
  652         -
                        } else {
  653         -
                            Vec::new()
  654         -
                        };
  655         -
                        deser.read_list(member, container, |mut list, deser| {
  656         -
                            list.push(todo!("deserialize nested aggregate"));
  657         -
                            Ok(list)
  658         -
                        })?
         690  +
                        let mut container = Vec::new();
         691  +
                        deser.read_list(member, &mut |deser| {
         692  +
                            container.push({
         693  +
                                let mut map = ::std::collections::HashMap::new();
         694  +
                                deser.read_map(member, &mut |key, deser| {
         695  +
                                    let value = deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?;
         696  +
                                    map.insert(key, value);
         697  +
                                    Ok(())
         698  +
                                })?;
         699  +
                                map
         700  +
                            });
         701  +
                            Ok(())
         702  +
                        })?;
         703  +
                        container
  659    704   
                    });
  660    705   
                }
  661    706   
                Some(11) => {
  662         -
                    builder.list_of_strings = Some({
  663         -
                        let container = if let Some(cap) = deser.container_size() {
  664         -
                            Vec::with_capacity(cap)
  665         -
                        } else {
  666         -
                            Vec::new()
  667         -
                        };
  668         -
                        deser.read_list(member, container, |mut list, deser| {
  669         -
                            list.push(deser.read_string(member)?);
  670         -
                            Ok(list)
  671         -
                        })?
  672         -
                    });
         707  +
                    builder.list_of_strings = Some(deser.read_string_list(member)?);
  673    708   
                }
  674    709   
                Some(12) => {
  675    710   
                    builder.list_of_structs = Some({
  676         -
                        let container = if let Some(cap) = deser.container_size() {
  677         -
                            Vec::with_capacity(cap)
  678         -
                        } else {
  679         -
                            Vec::new()
  680         -
                        };
  681         -
                        deser.read_list(member, container, |mut list, deser| {
  682         -
                            list.push(crate::types::SimpleStruct::deserialize(deser)?);
  683         -
                            Ok(list)
  684         -
                        })?
         711  +
                        let mut container = Vec::new();
         712  +
                        deser.read_list(member, &mut |deser| {
         713  +
                            container.push(crate::types::SimpleStruct::deserialize(deser)?);
         714  +
                            Ok(())
         715  +
                        })?;
         716  +
                        container
  685    717   
                    });
  686    718   
                }
  687    719   
                Some(13) => {
  688    720   
                    builder.long = Some(deser.read_long(member)?);
  689    721   
                }
  690    722   
                Some(14) => {
  691    723   
                    builder.map_of_lists_of_strings = Some({
  692         -
                        let container = if let Some(cap) = deser.container_size() {
  693         -
                            std::collections::HashMap::with_capacity(cap)
  694         -
                        } else {
  695         -
                            std::collections::HashMap::new()
  696         -
                        };
  697         -
                        deser.read_map(member, container, |mut map, key, deser| {
  698         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  699         -
                            Ok(map)
  700         -
                        })?
         724  +
                        let mut container = std::collections::HashMap::new();
         725  +
                        deser.read_map(member, &mut |key, deser| {
         726  +
                            container.insert(key, {
         727  +
                                let mut list = Vec::new();
         728  +
                                deser.read_list(member, &mut |deser| {
         729  +
                                    list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
         730  +
                                    Ok(())
         731  +
                                })?;
         732  +
                                list
         733  +
                            });
         734  +
                            Ok(())
         735  +
                        })?;
         736  +
                        container
  701    737   
                    });
  702    738   
                }
  703    739   
                Some(15) => {
  704    740   
                    builder.map_of_maps = Some({
  705         -
                        let container = if let Some(cap) = deser.container_size() {
  706         -
                            std::collections::HashMap::with_capacity(cap)
  707         -
                        } else {
  708         -
                            std::collections::HashMap::new()
  709         -
                        };
  710         -
                        deser.read_map(member, container, |mut map, key, deser| {
  711         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  712         -
                            Ok(map)
  713         -
                        })?
         741  +
                        let mut container = std::collections::HashMap::new();
         742  +
                        deser.read_map(member, &mut |key, deser| {
         743  +
                            container.insert(key, {
         744  +
                                let mut map = ::std::collections::HashMap::new();
         745  +
                                deser.read_map(member, &mut |key, deser| {
         746  +
                                    let value = deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?;
         747  +
                                    map.insert(key, value);
         748  +
                                    Ok(())
         749  +
                                })?;
         750  +
                                map
         751  +
                            });
         752  +
                            Ok(())
         753  +
                        })?;
         754  +
                        container
  714    755   
                    });
  715    756   
                }
  716    757   
                Some(16) => {
  717         -
                    builder.map_of_strings = Some({
  718         -
                        let container = if let Some(cap) = deser.container_size() {
  719         -
                            std::collections::HashMap::with_capacity(cap)
  720         -
                        } else {
  721         -
                            std::collections::HashMap::new()
  722         -
                        };
  723         -
                        deser.read_map(member, container, |mut map, key, deser| {
  724         -
                            map.insert(key, deser.read_string(member)?);
  725         -
                            Ok(map)
  726         -
                        })?
  727         -
                    });
         758  +
                    builder.map_of_strings = Some(deser.read_string_string_map(member)?);
  728    759   
                }
  729    760   
                Some(17) => {
  730    761   
                    builder.map_of_structs = Some({
  731         -
                        let container = if let Some(cap) = deser.container_size() {
  732         -
                            std::collections::HashMap::with_capacity(cap)
  733         -
                        } else {
  734         -
                            std::collections::HashMap::new()
  735         -
                        };
  736         -
                        deser.read_map(member, container, |mut map, key, deser| {
  737         -
                            map.insert(key, crate::types::SimpleStruct::deserialize(deser)?);
  738         -
                            Ok(map)
  739         -
                        })?
         762  +
                        let mut container = std::collections::HashMap::new();
         763  +
                        deser.read_map(member, &mut |key, deser| {
         764  +
                            container.insert(key, crate::types::SimpleStruct::deserialize(deser)?);
         765  +
                            Ok(())
         766  +
                        })?;
         767  +
                        container
  740    768   
                    });
  741    769   
                }
  742    770   
                Some(18) => {
  743    771   
                    builder.recursive_list = Some({
  744         -
                        let container = if let Some(cap) = deser.container_size() {
  745         -
                            Vec::with_capacity(cap)
  746         -
                        } else {
  747         -
                            Vec::new()
  748         -
                        };
  749         -
                        deser.read_list(member, container, |mut list, deser| {
  750         -
                            list.push(crate::types::KitchenSink::deserialize(deser)?);
  751         -
                            Ok(list)
  752         -
                        })?
         772  +
                        let mut container = Vec::new();
         773  +
                        deser.read_list(member, &mut |deser| {
         774  +
                            container.push(crate::types::KitchenSink::deserialize(deser)?);
         775  +
                            Ok(())
         776  +
                        })?;
         777  +
                        container
  753    778   
                    });
  754    779   
                }
  755    780   
                Some(19) => {
  756    781   
                    builder.recursive_map = Some({
  757         -
                        let container = if let Some(cap) = deser.container_size() {
  758         -
                            std::collections::HashMap::with_capacity(cap)
  759         -
                        } else {
  760         -
                            std::collections::HashMap::new()
  761         -
                        };
  762         -
                        deser.read_map(member, container, |mut map, key, deser| {
  763         -
                            map.insert(key, crate::types::KitchenSink::deserialize(deser)?);
  764         -
                            Ok(map)
  765         -
                        })?
         782  +
                        let mut container = std::collections::HashMap::new();
         783  +
                        deser.read_map(member, &mut |key, deser| {
         784  +
                            container.insert(key, crate::types::KitchenSink::deserialize(deser)?);
         785  +
                            Ok(())
         786  +
                        })?;
         787  +
                        container
  766    788   
                    });
  767    789   
                }
  768    790   
                Some(20) => {
  769    791   
                    builder.recursive_struct = Some(Box::new(crate::types::KitchenSink::deserialize(deser)?));
  770    792   
                }
  771    793   
                Some(21) => {
  772    794   
                    builder.simple_struct = Some(crate::types::SimpleStruct::deserialize(deser)?);
  773    795   
                }
  774    796   
                Some(22) => {
  775    797   
                    builder.string = Some(deser.read_string(member)?);
  776    798   
                }
  777    799   
                Some(23) => {
  778    800   
                    builder.struct_with_json_name = Some(crate::types::StructWithJsonName::deserialize(deser)?);
  779    801   
                }
  780    802   
                Some(24) => {
  781    803   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
  782    804   
                }
  783    805   
                Some(25) => {
  784    806   
                    builder.unix_timestamp = Some(deser.read_timestamp(member)?);
  785    807   
                }
  786    808   
                _ => {}
  787    809   
            }
  788    810   
            Ok(())
  789    811   
        })?;
  790    812   
        Ok(builder.build())
  791    813   
    }
  792    814   
}
         815  +
impl KitchenSink {
         816  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         817  +
    pub fn deserialize_with_response(
         818  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         819  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         820  +
        _status: u16,
         821  +
        _body: &[u8],
         822  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         823  +
        Self::deserialize(deserializer)
         824  +
    }
         825  +
}
  793    826   
impl KitchenSink {
  794    827   
    /// Creates a new builder-style object to manufacture [`KitchenSink`](crate::types::KitchenSink).
  795    828   
    pub fn builder() -> crate::types::builders::KitchenSinkBuilder {
  796    829   
        crate::types::builders::KitchenSinkBuilder::default()
  797    830   
    }
  798    831   
}
  799    832   
  800    833   
/// A builder for [`KitchenSink`](crate::types::KitchenSink).
  801    834   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  802    835   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_my_union.rs

@@ -128,128 +0,296 @@
  148    148   
    }
  149    149   
    /// Returns true if this is a [`TimestampValue`](crate::types::MyUnion::TimestampValue).
  150    150   
    pub fn is_timestamp_value(&self) -> bool {
  151    151   
        self.as_timestamp_value().is_ok()
  152    152   
    }
  153    153   
    /// Returns true if the enum instance is the `Unknown` variant.
  154    154   
    pub fn is_unknown(&self) -> bool {
  155    155   
        matches!(self, Self::Unknown)
  156    156   
    }
  157    157   
}
         158  +
static MYUNION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
         159  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion", "aws.protocoltests.json", "MyUnion");
         160  +
static MYUNION_MEMBER_STRINGVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         161  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$stringValue", "aws.protocoltests.json", "MyUnion"),
         162  +
    ::aws_smithy_schema::ShapeType::String,
         163  +
    "stringValue",
         164  +
    0,
         165  +
);
         166  +
static MYUNION_MEMBER_BOOLEANVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         167  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$booleanValue", "aws.protocoltests.json", "MyUnion"),
         168  +
    ::aws_smithy_schema::ShapeType::Boolean,
         169  +
    "booleanValue",
         170  +
    1,
         171  +
);
         172  +
static MYUNION_MEMBER_NUMBERVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         173  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$numberValue", "aws.protocoltests.json", "MyUnion"),
         174  +
    ::aws_smithy_schema::ShapeType::Integer,
         175  +
    "numberValue",
         176  +
    2,
         177  +
);
         178  +
static MYUNION_MEMBER_BLOBVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         179  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$blobValue", "aws.protocoltests.json", "MyUnion"),
         180  +
    ::aws_smithy_schema::ShapeType::Blob,
         181  +
    "blobValue",
         182  +
    3,
         183  +
);
         184  +
static MYUNION_MEMBER_TIMESTAMPVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         185  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$timestampValue", "aws.protocoltests.json", "MyUnion"),
         186  +
    ::aws_smithy_schema::ShapeType::Timestamp,
         187  +
    "timestampValue",
         188  +
    4,
         189  +
);
         190  +
static MYUNION_MEMBER_ENUMVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         191  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$enumValue", "aws.protocoltests.json", "MyUnion"),
         192  +
    ::aws_smithy_schema::ShapeType::String,
         193  +
    "enumValue",
         194  +
    5,
         195  +
);
         196  +
static MYUNION_MEMBER_LISTVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         197  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$listValue", "aws.protocoltests.json", "MyUnion"),
         198  +
    ::aws_smithy_schema::ShapeType::List,
         199  +
    "listValue",
         200  +
    6,
         201  +
);
         202  +
static MYUNION_MEMBER_MAPVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         203  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$mapValue", "aws.protocoltests.json", "MyUnion"),
         204  +
    ::aws_smithy_schema::ShapeType::Map,
         205  +
    "mapValue",
         206  +
    7,
         207  +
);
         208  +
static MYUNION_MEMBER_STRUCTUREVALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         209  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#MyUnion$structureValue", "aws.protocoltests.json", "MyUnion"),
         210  +
    ::aws_smithy_schema::ShapeType::Structure,
         211  +
    "structureValue",
         212  +
    8,
         213  +
);
         214  +
static MYUNION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
         215  +
    MYUNION_SCHEMA_ID,
         216  +
    ::aws_smithy_schema::ShapeType::Union,
         217  +
    &[
         218  +
        &MYUNION_MEMBER_STRINGVALUE,
         219  +
        &MYUNION_MEMBER_BOOLEANVALUE,
         220  +
        &MYUNION_MEMBER_NUMBERVALUE,
         221  +
        &MYUNION_MEMBER_BLOBVALUE,
         222  +
        &MYUNION_MEMBER_TIMESTAMPVALUE,
         223  +
        &MYUNION_MEMBER_ENUMVALUE,
         224  +
        &MYUNION_MEMBER_LISTVALUE,
         225  +
        &MYUNION_MEMBER_MAPVALUE,
         226  +
        &MYUNION_MEMBER_STRUCTUREVALUE,
         227  +
    ],
         228  +
);
         229  +
impl MyUnion {
         230  +
    /// The schema for this shape.
         231  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &MYUNION_SCHEMA;
         232  +
}
         233  +
impl ::aws_smithy_schema::serde::SerializableStruct for MyUnion {
         234  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         235  +
    fn serialize_members(
         236  +
        &self,
         237  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         238  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         239  +
        match self {
         240  +
            Self::StringValue(val) => {
         241  +
                ser.write_string(&MYUNION_MEMBER_STRINGVALUE, val)?;
         242  +
            }
         243  +
            Self::BooleanValue(val) => {
         244  +
                ser.write_boolean(&MYUNION_MEMBER_BOOLEANVALUE, *val)?;
         245  +
            }
         246  +
            Self::NumberValue(val) => {
         247  +
                ser.write_integer(&MYUNION_MEMBER_NUMBERVALUE, *val)?;
         248  +
            }
         249  +
            Self::BlobValue(val) => {
         250  +
                ser.write_blob(&MYUNION_MEMBER_BLOBVALUE, val)?;
         251  +
            }
         252  +
            Self::TimestampValue(val) => {
         253  +
                ser.write_timestamp(&MYUNION_MEMBER_TIMESTAMPVALUE, val)?;
         254  +
            }
         255  +
            Self::EnumValue(val) => {
         256  +
                ser.write_string(&MYUNION_MEMBER_ENUMVALUE, val.as_str())?;
         257  +
            }
         258  +
            Self::ListValue(val) => {
         259  +
                ser.write_string_list(&MYUNION_MEMBER_LISTVALUE, val)?;
         260  +
            }
         261  +
            Self::MapValue(val) => {
         262  +
                ser.write_string_string_map(&MYUNION_MEMBER_MAPVALUE, val)?;
         263  +
            }
         264  +
            Self::StructureValue(val) => {
         265  +
                ser.write_struct(&MYUNION_MEMBER_STRUCTUREVALUE, val)?;
         266  +
            }
         267  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
         268  +
        }
         269  +
        Ok(())
         270  +
    }
         271  +
}
         272  +
impl MyUnion {
         273  +
    /// Deserializes this union from a [`ShapeDeserializer`].
         274  +
    pub fn deserialize(
         275  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         276  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         277  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
         278  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
         279  +
        deserializer.read_struct(&MYUNION_SCHEMA, &mut |member, deser| {
         280  +
            result = ::std::option::Option::Some(match member.member_index() {
         281  +
                Some(0) => Self::StringValue(deser.read_string(member)?),
         282  +
                Some(1) => Self::BooleanValue(deser.read_boolean(member)?),
         283  +
                Some(2) => Self::NumberValue(deser.read_integer(member)?),
         284  +
                Some(3) => Self::BlobValue(deser.read_blob(member)?),
         285  +
                Some(4) => Self::TimestampValue(deser.read_timestamp(member)?),
         286  +
                Some(5) => Self::EnumValue(crate::types::FooEnum::from(deser.read_string(member)?.as_str())),
         287  +
                Some(6) => Self::ListValue(deser.read_string_list(member)?),
         288  +
                Some(7) => Self::MapValue(deser.read_string_string_map(member)?),
         289  +
                Some(8) => Self::StructureValue(crate::types::GreetingStruct::deserialize(deser)?),
         290  +
                _ => Self::Unknown,
         291  +
            });
         292  +
            Ok(())
         293  +
        })?;
         294  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         295  +
    }
         296  +
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_simple_struct.rs

@@ -1,1 +99,110 @@
   10     10   
    #[allow(missing_docs)] // documentation missing in model
   11     11   
    pub fn value(&self) -> ::std::option::Option<&str> {
   12     12   
        self.value.as_deref()
   13     13   
    }
   14     14   
}
   15     15   
static SIMPLESTRUCT_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   16     16   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#SimpleStruct", "aws.protocoltests.json", "SimpleStruct");
   17     17   
static SIMPLESTRUCT_MEMBER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   18     18   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#SimpleStruct$Value", "aws.protocoltests.json", "SimpleStruct"),
   19     19   
    ::aws_smithy_schema::ShapeType::String,
   20         -
    "value",
          20  +
    "Value",
   21     21   
    0,
   22     22   
);
   23     23   
static SIMPLESTRUCT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   24     24   
    SIMPLESTRUCT_SCHEMA_ID,
   25     25   
    ::aws_smithy_schema::ShapeType::Structure,
   26     26   
    &[&SIMPLESTRUCT_MEMBER_VALUE],
   27     27   
);
   28     28   
impl SimpleStruct {
   29     29   
    /// The schema for this shape.
   30     30   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SIMPLESTRUCT_SCHEMA;
   31     31   
}
   32     32   
impl ::aws_smithy_schema::serde::SerializableStruct for SimpleStruct {
   33     33   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   34     34   
    fn serialize_members(
   35     35   
        &self,
   36     36   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   37     37   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   38     38   
        if let Some(ref val) = self.value {
   39     39   
            ser.write_string(&SIMPLESTRUCT_MEMBER_VALUE, val)?;
   40     40   
        }
   41     41   
        Ok(())
   42     42   
    }
   43     43   
}
   44     44   
impl SimpleStruct {
   45     45   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   46         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   47         -
        deserializer: &mut D,
          46  +
    pub fn deserialize(
          47  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   48     48   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   49     49   
        #[allow(unused_variables, unused_mut)]
   50     50   
        let mut builder = Self::builder();
   51     51   
        #[allow(
   52     52   
            unused_variables,
   53     53   
            unreachable_code,
   54     54   
            clippy::single_match,
   55     55   
            clippy::match_single_binding,
   56     56   
            clippy::diverging_sub_expression
   57     57   
        )]
   58         -
        deserializer.read_struct(&SIMPLESTRUCT_SCHEMA, (), |_, member, deser| {
          58  +
        deserializer.read_struct(&SIMPLESTRUCT_SCHEMA, &mut |member, deser| {
   59     59   
            match member.member_index() {
   60     60   
                Some(0) => {
   61     61   
                    builder.value = Some(deser.read_string(member)?);
   62     62   
                }
   63     63   
                _ => {}
   64     64   
            }
   65     65   
            Ok(())
   66     66   
        })?;
   67     67   
        Ok(builder.build())
   68     68   
    }
   69     69   
}
          70  +
impl SimpleStruct {
          71  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          72  +
    pub fn deserialize_with_response(
          73  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          74  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          75  +
        _status: u16,
          76  +
        _body: &[u8],
          77  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          78  +
        Self::deserialize(deserializer)
          79  +
    }
          80  +
}
   70     81   
impl SimpleStruct {
   71     82   
    /// Creates a new builder-style object to manufacture [`SimpleStruct`](crate::types::SimpleStruct).
   72     83   
    pub fn builder() -> crate::types::builders::SimpleStructBuilder {
   73     84   
        crate::types::builders::SimpleStructBuilder::default()
   74     85   
    }
   75     86   
}
   76     87   
   77     88   
/// A builder for [`SimpleStruct`](crate::types::SimpleStruct).
   78     89   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   79     90   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/_struct_with_json_name.rs

@@ -1,1 +107,118 @@
   17     17   
    "aws.protocoltests.json",
   18     18   
    "StructWithJsonName",
   19     19   
);
   20     20   
static STRUCTWITHJSONNAME_MEMBER_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "aws.protocoltests.json#StructWithJsonName$Value",
   23     23   
        "aws.protocoltests.json",
   24     24   
        "StructWithJsonName",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "value",
          27  +
    "Value",
   28     28   
    0,
   29     29   
)
   30     30   
.with_json_name("RenamedMember");
   31     31   
static STRUCTWITHJSONNAME_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    STRUCTWITHJSONNAME_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&STRUCTWITHJSONNAME_MEMBER_VALUE],
   35     35   
);
   36     36   
impl StructWithJsonName {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STRUCTWITHJSONNAME_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for StructWithJsonName {
   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.value {
   47     47   
            ser.write_string(&STRUCTWITHJSONNAME_MEMBER_VALUE, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl StructWithJsonName {
   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(&STRUCTWITHJSONNAME_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&STRUCTWITHJSONNAME_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.value = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl StructWithJsonName {
          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  +
}
   78     89   
impl StructWithJsonName {
   79     90   
    /// Creates a new builder-style object to manufacture [`StructWithJsonName`](crate::types::StructWithJsonName).
   80     91   
    pub fn builder() -> crate::types::builders::StructWithJsonNameBuilder {
   81     92   
        crate::types::builders::StructWithJsonNameBuilder::default()
   82     93   
    }
   83     94   
}
   84     95   
   85     96   
/// A builder for [`StructWithJsonName`](crate::types::StructWithJsonName).
   86     97   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87     98   
#[non_exhaustive]

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

@@ -1,1 +133,144 @@
   20     20   
    #[allow(missing_docs)] // documentation missing in model
   21     21   
    pub fn nested(&self) -> ::std::option::Option<&crate::types::ComplexNestedErrorData> {
   22     22   
        self.nested.as_ref()
   23     23   
    }
   24     24   
}
   25     25   
static COMPLEXERROR_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   26     26   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#ComplexError", "aws.protocoltests.json", "ComplexError");
   27     27   
static COMPLEXERROR_MEMBER_TOP_LEVEL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   28     28   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#ComplexError$TopLevel", "aws.protocoltests.json", "ComplexError"),
   29     29   
    ::aws_smithy_schema::ShapeType::String,
   30         -
    "top_level",
          30  +
    "TopLevel",
   31     31   
    0,
   32     32   
);
   33     33   
static COMPLEXERROR_MEMBER_NESTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   34     34   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#ComplexError$Nested", "aws.protocoltests.json", "ComplexError"),
   35     35   
    ::aws_smithy_schema::ShapeType::Structure,
   36         -
    "nested",
          36  +
    "Nested",
   37     37   
    1,
   38     38   
);
   39     39   
static COMPLEXERROR_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   40     40   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#ComplexError$Message", "aws.protocoltests.json", "ComplexError"),
   41     41   
    ::aws_smithy_schema::ShapeType::String,
   42         -
    "message",
          42  +
    "Message",
   43     43   
    2,
   44     44   
);
   45     45   
static COMPLEXERROR_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   46     46   
    COMPLEXERROR_SCHEMA_ID,
   47     47   
    ::aws_smithy_schema::ShapeType::Structure,
   48     48   
    &[&COMPLEXERROR_MEMBER_TOP_LEVEL, &COMPLEXERROR_MEMBER_NESTED, &COMPLEXERROR_MEMBER_MESSAGE],
   49     49   
);
   50     50   
impl ComplexError {
   51     51   
    /// The schema for this shape.
   52     52   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXERROR_SCHEMA;
   53     53   
}
   54     54   
impl ::aws_smithy_schema::serde::SerializableStruct for ComplexError {
   55     55   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   56     56   
    fn serialize_members(
   57     57   
        &self,
   58     58   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   59     59   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   60     60   
        if let Some(ref val) = self.top_level {
   61     61   
            ser.write_string(&COMPLEXERROR_MEMBER_TOP_LEVEL, val)?;
   62     62   
        }
   63     63   
        if let Some(ref val) = self.nested {
   64     64   
            ser.write_struct(&COMPLEXERROR_MEMBER_NESTED, val)?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.message {
   67     67   
            ser.write_string(&COMPLEXERROR_MEMBER_MESSAGE, val)?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl ComplexError {
   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(&COMPLEXERROR_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&COMPLEXERROR_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.top_level = Some(deser.read_string(member)?);
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.nested = Some(crate::types::ComplexNestedErrorData::deserialize(deser)?);
   93     93   
                }
   94     94   
                Some(2) => {
   95     95   
                    builder.message = Some(deser.read_string(member)?);
   96     96   
                }
   97     97   
                _ => {}
   98     98   
            }
   99     99   
            Ok(())
  100    100   
        })?;
  101    101   
        Ok(builder.build())
  102    102   
    }
  103    103   
}
         104  +
impl ComplexError {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         106  +
    pub fn deserialize_with_response(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         108  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         109  +
        _status: u16,
         110  +
        _body: &[u8],
         111  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         112  +
        Self::deserialize(deserializer)
         113  +
    }
         114  +
}
  104    115   
impl ComplexError {
  105    116   
    /// Returns the error message.
  106    117   
    pub fn message(&self) -> ::std::option::Option<&str> {
  107    118   
        self.message.as_deref()
  108    119   
    }
  109    120   
}
  110    121   
impl ::std::fmt::Display for ComplexError {
  111    122   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  112    123   
        ::std::write!(f, "ComplexError")?;
  113    124   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/error/_error_with_members.rs

@@ -29,29 +149,149 @@
   49     49   
}
   50     50   
static ERRORWITHMEMBERS_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   51     51   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json#ErrorWithMembers", "aws.protocoltests.json", "ErrorWithMembers");
   52     52   
static ERRORWITHMEMBERS_MEMBER_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   53     53   
    ::aws_smithy_schema::ShapeId::from_static(
   54     54   
        "aws.protocoltests.json#ErrorWithMembers$Code",
   55     55   
        "aws.protocoltests.json",
   56     56   
        "ErrorWithMembers",
   57     57   
    ),
   58     58   
    ::aws_smithy_schema::ShapeType::String,
   59         -
    "code",
          59  +
    "Code",
   60     60   
    0,
   61     61   
);
   62     62   
static ERRORWITHMEMBERS_MEMBER_COMPLEX_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   63     63   
    ::aws_smithy_schema::ShapeId::from_static(
   64     64   
        "aws.protocoltests.json#ErrorWithMembers$ComplexData",
   65     65   
        "aws.protocoltests.json",
   66     66   
        "ErrorWithMembers",
   67     67   
    ),
   68     68   
    ::aws_smithy_schema::ShapeType::Structure,
   69         -
    "complex_data",
          69  +
    "ComplexData",
   70     70   
    1,
   71     71   
);
   72     72   
static ERRORWITHMEMBERS_MEMBER_INTEGER_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   73     73   
    ::aws_smithy_schema::ShapeId::from_static(
   74     74   
        "aws.protocoltests.json#ErrorWithMembers$IntegerField",
   75     75   
        "aws.protocoltests.json",
   76     76   
        "ErrorWithMembers",
   77     77   
    ),
   78     78   
    ::aws_smithy_schema::ShapeType::Integer,
   79         -
    "integer_field",
          79  +
    "IntegerField",
   80     80   
    2,
   81     81   
);
   82     82   
static ERRORWITHMEMBERS_MEMBER_LIST_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   83     83   
    ::aws_smithy_schema::ShapeId::from_static(
   84     84   
        "aws.protocoltests.json#ErrorWithMembers$ListField",
   85     85   
        "aws.protocoltests.json",
   86     86   
        "ErrorWithMembers",
   87     87   
    ),
   88     88   
    ::aws_smithy_schema::ShapeType::List,
   89         -
    "list_field",
          89  +
    "ListField",
   90     90   
    3,
   91     91   
);
   92     92   
static ERRORWITHMEMBERS_MEMBER_MAP_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   93     93   
    ::aws_smithy_schema::ShapeId::from_static(
   94     94   
        "aws.protocoltests.json#ErrorWithMembers$MapField",
   95     95   
        "aws.protocoltests.json",
   96     96   
        "ErrorWithMembers",
   97     97   
    ),
   98     98   
    ::aws_smithy_schema::ShapeType::Map,
   99         -
    "map_field",
          99  +
    "MapField",
  100    100   
    4,
  101    101   
);
  102    102   
static ERRORWITHMEMBERS_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  103    103   
    ::aws_smithy_schema::ShapeId::from_static(
  104    104   
        "aws.protocoltests.json#ErrorWithMembers$Message",
  105    105   
        "aws.protocoltests.json",
  106    106   
        "ErrorWithMembers",
  107    107   
    ),
  108    108   
    ::aws_smithy_schema::ShapeType::String,
  109         -
    "message",
         109  +
    "Message",
  110    110   
    5,
  111    111   
);
  112    112   
static ERRORWITHMEMBERS_MEMBER_STRING_FIELD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  113    113   
    ::aws_smithy_schema::ShapeId::from_static(
  114    114   
        "aws.protocoltests.json#ErrorWithMembers$StringField",
  115    115   
        "aws.protocoltests.json",
  116    116   
        "ErrorWithMembers",
  117    117   
    ),
  118    118   
    ::aws_smithy_schema::ShapeType::String,
  119         -
    "string_field",
         119  +
    "StringField",
  120    120   
    6,
  121    121   
);
  122    122   
static ERRORWITHMEMBERS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  123    123   
    ERRORWITHMEMBERS_SCHEMA_ID,
  124    124   
    ::aws_smithy_schema::ShapeType::Structure,
  125    125   
    &[
  126    126   
        &ERRORWITHMEMBERS_MEMBER_CODE,
  127    127   
        &ERRORWITHMEMBERS_MEMBER_COMPLEX_DATA,
  128    128   
        &ERRORWITHMEMBERS_MEMBER_INTEGER_FIELD,
  129    129   
        &ERRORWITHMEMBERS_MEMBER_LIST_FIELD,
@@ -158,158 +279,270 @@
  178    178   
            ser.write_string(&ERRORWITHMEMBERS_MEMBER_MESSAGE, val)?;
  179    179   
        }
  180    180   
        if let Some(ref val) = self.string_field {
  181    181   
            ser.write_string(&ERRORWITHMEMBERS_MEMBER_STRING_FIELD, val)?;
  182    182   
        }
  183    183   
        Ok(())
  184    184   
    }
  185    185   
}
  186    186   
impl ErrorWithMembers {
  187    187   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  188         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  189         -
        deserializer: &mut D,
         188  +
    pub fn deserialize(
         189  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  190    190   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  191    191   
        #[allow(unused_variables, unused_mut)]
  192    192   
        let mut builder = Self::builder();
  193    193   
        #[allow(
  194    194   
            unused_variables,
  195    195   
            unreachable_code,
  196    196   
            clippy::single_match,
  197    197   
            clippy::match_single_binding,
  198    198   
            clippy::diverging_sub_expression
  199    199   
        )]
  200         -
        deserializer.read_struct(&ERRORWITHMEMBERS_SCHEMA, (), |_, member, deser| {
         200  +
        deserializer.read_struct(&ERRORWITHMEMBERS_SCHEMA, &mut |member, deser| {
  201    201   
            match member.member_index() {
  202    202   
                Some(0) => {
  203    203   
                    builder.code = Some(deser.read_string(member)?);
  204    204   
                }
  205    205   
                Some(1) => {
  206    206   
                    builder.complex_data = Some(crate::types::KitchenSink::deserialize(deser)?);
  207    207   
                }
  208    208   
                Some(2) => {
  209    209   
                    builder.integer_field = Some(deser.read_integer(member)?);
  210    210   
                }
  211    211   
                Some(3) => {
  212         -
                    builder.list_field = Some({
  213         -
                        let container = if let Some(cap) = deser.container_size() {
  214         -
                            Vec::with_capacity(cap)
  215         -
                        } else {
  216         -
                            Vec::new()
  217         -
                        };
  218         -
                        deser.read_list(member, container, |mut list, deser| {
  219         -
                            list.push(deser.read_string(member)?);
  220         -
                            Ok(list)
  221         -
                        })?
  222         -
                    });
         212  +
                    builder.list_field = Some(deser.read_string_list(member)?);
  223    213   
                }
  224    214   
                Some(4) => {
  225         -
                    builder.map_field = Some({
  226         -
                        let container = if let Some(cap) = deser.container_size() {
  227         -
                            std::collections::HashMap::with_capacity(cap)
  228         -
                        } else {
  229         -
                            std::collections::HashMap::new()
  230         -
                        };
  231         -
                        deser.read_map(member, container, |mut map, key, deser| {
  232         -
                            map.insert(key, deser.read_string(member)?);
  233         -
                            Ok(map)
  234         -
                        })?
  235         -
                    });
         215  +
                    builder.map_field = Some(deser.read_string_string_map(member)?);
  236    216   
                }
  237    217   
                Some(5) => {
  238    218   
                    builder.message = Some(deser.read_string(member)?);
  239    219   
                }
  240    220   
                Some(6) => {
  241    221   
                    builder.string_field = Some(deser.read_string(member)?);
  242    222   
                }
  243    223   
                _ => {}
  244    224   
            }
  245    225   
            Ok(())
  246    226   
        })?;
  247    227   
        Ok(builder.build())
  248    228   
    }
  249    229   
}
         230  +
impl ErrorWithMembers {
         231  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         232  +
    pub fn deserialize_with_response(
         233  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         234  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         235  +
        _status: u16,
         236  +
        _body: &[u8],
         237  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         238  +
        Self::deserialize(deserializer)
         239  +
    }
         240  +
}
  250    241   
impl ErrorWithMembers {
  251    242   
    /// Returns the error message.
  252    243   
    pub fn message(&self) -> ::std::option::Option<&str> {
  253    244   
        self.message.as_deref()
  254    245   
    }
  255    246   
}
  256    247   
impl ::std::fmt::Display for ErrorWithMembers {
  257    248   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  258    249   
        ::std::write!(f, "ErrorWithMembers")?;
  259    250   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/types/error/_error_without_members.rs

@@ -1,1 +101,112 @@
   12     12   
    "aws.protocoltests.json",
   13     13   
    "ErrorWithoutMembers",
   14     14   
);
   15     15   
static ERRORWITHOUTMEMBERS_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   16     16   
    ::aws_smithy_schema::ShapeId::from_static(
   17     17   
        "aws.protocoltests.json#ErrorWithoutMembers$Message",
   18     18   
        "aws.protocoltests.json",
   19     19   
        "ErrorWithoutMembers",
   20     20   
    ),
   21     21   
    ::aws_smithy_schema::ShapeType::String,
   22         -
    "message",
          22  +
    "Message",
   23     23   
    0,
   24     24   
);
   25     25   
static ERRORWITHOUTMEMBERS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   26     26   
    ERRORWITHOUTMEMBERS_SCHEMA_ID,
   27     27   
    ::aws_smithy_schema::ShapeType::Structure,
   28     28   
    &[&ERRORWITHOUTMEMBERS_MEMBER_MESSAGE],
   29     29   
);
   30     30   
impl ErrorWithoutMembers {
   31     31   
    /// The schema for this shape.
   32     32   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ERRORWITHOUTMEMBERS_SCHEMA;
   33     33   
}
   34     34   
impl ::aws_smithy_schema::serde::SerializableStruct for ErrorWithoutMembers {
   35     35   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   36     36   
    fn serialize_members(
   37     37   
        &self,
   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(&ERRORWITHOUTMEMBERS_MEMBER_MESSAGE, val)?;
   42     42   
        }
   43     43   
        Ok(())
   44     44   
    }
   45     45   
}
   46     46   
impl ErrorWithoutMembers {
   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(&ERRORWITHOUTMEMBERS_SCHEMA, (), |_, member, deser| {
          60  +
        deserializer.read_struct(&ERRORWITHOUTMEMBERS_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 ErrorWithoutMembers {
          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 ErrorWithoutMembers {
   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 ErrorWithoutMembers {
   79     90   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   80     91   
        ::std::write!(f, "ErrorWithoutMembers")?;
   81     92   
        if let ::std::option::Option::Some(inner_1) = &self.message {

tmp-codegen-diff/codegen-client-test/json_rpc11/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.json#FooError", "aws.protocoltests.json", "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.json#FooError$Message", "aws.protocoltests.json", "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/json_rpc11/rust-client-codegen/src/types/error/_invalid_greeting.rs

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

tmp-codegen-diff/codegen-client-test/misc/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/misc/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 misc::config::Config;
@@ -1114,1137 +1173,1201 @@
 1134   1157   
#[derive(::std::fmt::Debug)]
 1135   1158   
pub(crate) struct ServiceRuntimePlugin {
 1136   1159   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1137   1160   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1138   1161   
}
 1139   1162   
 1140   1163   
impl ServiceRuntimePlugin {
 1141   1164   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1142   1165   
        let config = {
 1143   1166   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("MiscService");
        1167  +
            if _service_config.protocol().is_none() {
        1168  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1169  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1170  +
                ));
        1171  +
            }
 1144   1172   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1145   1173   
            ::std::option::Option::Some(cfg.freeze())
 1146   1174   
        };
 1147   1175   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1148   1176   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1149   1177   
            use crate::config::auth::ResolveAuthScheme;
 1150   1178   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1151   1179   
        }));
 1152   1180   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1153   1181   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());

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

@@ -81,81 +117,113 @@
  101    101   
/// Data structures used by operation inputs/outputs.
  102    102   
pub mod types;
  103    103   
  104    104   
/// All operations that this crate can perform.
  105    105   
pub mod operation;
  106    106   
  107    107   
pub(crate) mod protocol_serde;
  108    108   
  109    109   
mod sdk_feature_tracker;
  110    110   
  111         -
mod serialization_settings;
  112         -
  113         -
mod serde_util;
  114         -
  115    111   
mod json_errors;
  116    112   
  117    113   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_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 `RequiredHeaderCollectionOperation`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct RequiredHeaderCollectionOperation;
    6      6   
impl RequiredHeaderCollectionOperation {
    7      7   
    /// Creates a new `RequiredHeaderCollectionOperation`
    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::required_header_collection_operation::RequiredHeaderCollectionOperationInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput::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::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +235,336 @@
  130    136   
                crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
  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 RequiredHeaderCollectionOperationResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredHeaderCollectionOperationResponseDeserializer {
  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_required_header_collection_operation::de_required_header_collection_operation_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::required_header_collection_operation::RequiredHeaderCollectionOperationError::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  +
                "ValidationException" => {
         180  +
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::ValidationError({
         181  +
                        let mut tmp = match protocol
         182  +
                            .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         183  +
                            .and_then(|mut deser| {
         184  +
                                crate::types::error::ValidationError::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  +
                        tmp
         200  +
                    })
         201  +
                }
         202  +
                _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic),
         203  +
            };
         204  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         205  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         206  +
            ))
  154    207   
        } else {
  155         -
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_response(
  156         -
                status, headers, body,
         208  +
            let protocol = _cfg
         209  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         210  +
                .expect("a SharedClientProtocol is required");
         211  +
            let mut deser = protocol
         212  +
                .deserialize_response(response, RequiredHeaderCollectionOperation::OUTPUT_SCHEMA, _cfg)
         213  +
                .map_err(|e| {
         214  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         215  +
                })?;
         216  +
            let body = response.body().bytes().expect("body loaded");
         217  +
            let output = crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput::deserialize_with_response(
         218  +
                &mut *deser,
         219  +
                response.headers(),
         220  +
                response.status().into(),
         221  +
                body,
  157    222   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         223  +
            .map_err(|e| {
         224  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         225  +
            })?;
         226  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         227  +
        }
  160    228   
    }
  161    229   
}
  162    230   
#[derive(Debug)]
  163    231   
struct RequiredHeaderCollectionOperationRequestSerializer;
  164    232   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredHeaderCollectionOperationRequestSerializer {
  165    233   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    234   
    fn serialize_input(
  167    235   
        &self,
  168    236   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    237   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    238   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    239   
        let input = input
  172    240   
            .downcast::<crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput>()
  173    241   
            .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::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
  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, "/required-header-collection-operation").expect("formatting should succeed");
  186         -
                ::std::result::Result::Ok(())
  187         -
            }
  188         -
            #[allow(clippy::unnecessary_wraps)]
  189         -
            fn update_http_builder(
  190         -
                input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
  191         -
                builder: ::http_1x::request::Builder,
  192         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193         -
                let mut uri = ::std::string::String::new();
  194         -
                uri_base(input, &mut uri)?;
  195         -
                let builder = crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_headers(
  196         -
                    input, builder,
  197         -
                )?;
  198         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         242  +
        let protocol = _cfg
         243  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         244  +
            .expect("a SharedClientProtocol is required");
         245  +
        if protocol.supports_http_bindings() {
         246  +
            let mut request = protocol
         247  +
                .serialize_body(&input, RequiredHeaderCollectionOperation::INPUT_SCHEMA, "", _cfg)
         248  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         249  +
            {
         250  +
                let mut uri = "/required-header-collection-operation".to_string();
         251  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         252  +
                if let Some(ref val) = input.required_header_list {
         253  +
                    let header_val = val
         254  +
                        .iter()
         255  +
                        .map(|item| {
         256  +
                            let s = item.to_string();
         257  +
                            if s.contains(',') || s.contains('"') {
         258  +
                                format!("\"{}\"", s.replace('\\', "\\\\").replace('"', "\\\""))
         259  +
                            } else {
         260  +
                                s
         261  +
                            }
         262  +
                        })
         263  +
                        .collect::<Vec<_>>()
         264  +
                        .join(", ");
         265  +
                    request.headers_mut().insert("X-Required-List", header_val);
         266  +
                }
         267  +
                if let Some(ref val) = input.required_header_set {
         268  +
                    let header_val = val
         269  +
                        .iter()
         270  +
                        .map(|item| {
         271  +
                            let s = item.to_string();
         272  +
                            if s.contains(',') || s.contains('"') {
         273  +
                                format!("\"{}\"", s.replace('\\', "\\\\").replace('"', "\\\""))
         274  +
                            } else {
         275  +
                                s
         276  +
                            }
         277  +
                        })
         278  +
                        .collect::<Vec<_>>()
         279  +
                        .join(", ");
         280  +
                    request.headers_mut().insert("X-Required-Set", header_val);
         281  +
                }
         282  +
                if !query_params.is_empty() {
         283  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         284  +
                    let pairs: Vec<String> = query_params
         285  +
                        .iter()
         286  +
                        .map(|(k, v)| {
         287  +
                            format!(
         288  +
                                "{}={}",
         289  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         290  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         291  +
                            )
         292  +
                        })
         293  +
                        .collect();
         294  +
                    uri.push_str(&pairs.join("&"));
         295  +
                }
         296  +
                request.set_uri(uri.as_str()).expect("valid URI");
  199    297   
            }
  200         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  201         -
            builder
  202         -
        };
  203         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  204    298   
  205         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         299  +
            return ::std::result::Result::Ok(request);
         300  +
        } else {
         301  +
            let mut request = protocol
         302  +
                .serialize_request(&input, RequiredHeaderCollectionOperation::INPUT_SCHEMA, "", _cfg)
         303  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         304  +
         305  +
            return ::std::result::Result::Ok(request);
         306  +
        }
  206    307   
    }
  207    308   
}
  208    309   
#[derive(Debug)]
  209    310   
struct RequiredHeaderCollectionOperationEndpointParamsInterceptor;
  210    311   
  211    312   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredHeaderCollectionOperationEndpointParamsInterceptor {
  212    313   
    fn name(&self) -> &'static str {
  213    314   
        "RequiredHeaderCollectionOperationEndpointParamsInterceptor"
  214    315   
    }
  215    316   

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/_required_header_collection_operation_input.rs

@@ -7,7 +170,258 @@
   27     27   
    "aws.protocoltests.misc.synthetic",
   28     28   
    "RequiredHeaderCollectionOperationInput",
   29     29   
);
   30     30   
static REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   31     31   
    ::aws_smithy_schema::ShapeId::from_static(
   32     32   
        "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationInput$requiredHeaderList",
   33     33   
        "aws.protocoltests.misc.synthetic",
   34     34   
        "RequiredHeaderCollectionOperationInput",
   35     35   
    ),
   36     36   
    ::aws_smithy_schema::ShapeType::List,
   37         -
    "required_header_list",
          37  +
    "requiredHeaderList",
   38     38   
    0,
   39     39   
)
   40     40   
.with_http_header("X-Required-List");
   41     41   
static REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   42     42   
    ::aws_smithy_schema::ShapeId::from_static(
   43     43   
        "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationInput$requiredHeaderSet",
   44     44   
        "aws.protocoltests.misc.synthetic",
   45     45   
        "RequiredHeaderCollectionOperationInput",
   46     46   
    ),
   47     47   
    ::aws_smithy_schema::ShapeType::List,
   48         -
    "required_header_set",
          48  +
    "requiredHeaderSet",
   49     49   
    1,
   50     50   
)
   51     51   
.with_http_header("X-Required-Set");
   52     52   
static REQUIREDHEADERCOLLECTIONOPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   53     53   
    REQUIREDHEADERCOLLECTIONOPERATIONINPUT_SCHEMA_ID,
   54     54   
    ::aws_smithy_schema::ShapeType::Structure,
   55     55   
    &[
   56     56   
        &REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_LIST,
   57     57   
        &REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_SET,
   58     58   
    ],
   59         -
);
          59  +
)
          60  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          61  +
    "GET",
          62  +
    "/required-header-collection-operation",
          63  +
    None,
          64  +
));
   60     65   
impl RequiredHeaderCollectionOperationInput {
   61     66   
    /// The schema for this shape.
   62     67   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDHEADERCOLLECTIONOPERATIONINPUT_SCHEMA;
   63     68   
}
   64     69   
impl ::aws_smithy_schema::serde::SerializableStruct for RequiredHeaderCollectionOperationInput {
   65     70   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   66     71   
    fn serialize_members(
   67     72   
        &self,
   68     73   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   69     74   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   70     75   
        if let Some(ref val) = self.required_header_list {
   71     76   
            ser.write_list(
   72     77   
                &REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_LIST,
   73     78   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   74     79   
                    for item in val {
   75     80   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   76     81   
                    }
   77     82   
                    Ok(())
   78     83   
                },
   79     84   
            )?;
   80     85   
        }
   81     86   
        if let Some(ref val) = self.required_header_set {
   82     87   
            ser.write_list(
   83     88   
                &REQUIREDHEADERCOLLECTIONOPERATIONINPUT_MEMBER_REQUIRED_HEADER_SET,
   84     89   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   85     90   
                    for item in val {
   86     91   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
   87     92   
                    }
   88     93   
                    Ok(())
   89     94   
                },
   90     95   
            )?;
   91     96   
        }
   92     97   
        Ok(())
   93     98   
    }
   94     99   
}
   95    100   
impl RequiredHeaderCollectionOperationInput {
   96    101   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   97         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   98         -
        deserializer: &mut D,
         102  +
    pub fn deserialize(
         103  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   99    104   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  100    105   
        #[allow(unused_variables, unused_mut)]
  101    106   
        let mut builder = Self::builder();
  102    107   
        #[allow(
  103    108   
            unused_variables,
  104    109   
            unreachable_code,
  105    110   
            clippy::single_match,
  106    111   
            clippy::match_single_binding,
  107    112   
            clippy::diverging_sub_expression
  108    113   
        )]
  109         -
        deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONINPUT_SCHEMA, (), |_, member, deser| {
         114  +
        deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONINPUT_SCHEMA, &mut |member, deser| {
  110    115   
            match member.member_index() {
  111    116   
                Some(0) => {
  112         -
                    builder.required_header_list = Some({
  113         -
                        let container = if let Some(cap) = deser.container_size() {
  114         -
                            Vec::with_capacity(cap)
  115         -
                        } else {
  116         -
                            Vec::new()
  117         -
                        };
  118         -
                        deser.read_list(member, container, |mut list, deser| {
  119         -
                            list.push(deser.read_string(member)?);
  120         -
                            Ok(list)
  121         -
                        })?
  122         -
                    });
         117  +
                    builder.required_header_list = Some(deser.read_string_list(member)?);
  123    118   
                }
  124    119   
                Some(1) => {
  125         -
                    builder.required_header_set = Some({
  126         -
                        let container = if let Some(cap) = deser.container_size() {
  127         -
                            Vec::with_capacity(cap)
  128         -
                        } else {
  129         -
                            Vec::new()
  130         -
                        };
  131         -
                        deser.read_list(member, container, |mut list, deser| {
  132         -
                            list.push(deser.read_string(member)?);
  133         -
                            Ok(list)
  134         -
                        })?
  135         -
                    });
         120  +
                    builder.required_header_set = Some(deser.read_string_list(member)?);
  136    121   
                }
  137    122   
                _ => {}
  138    123   
            }
  139    124   
            Ok(())
  140    125   
        })?;
         126  +
        builder.required_header_list = builder.required_header_list.or(Some(Vec::new()));
         127  +
        builder.required_header_set = builder.required_header_set.or(Some(Vec::new()));
         128  +
        builder
         129  +
            .build()
         130  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         131  +
    }
         132  +
}
         133  +
impl RequiredHeaderCollectionOperationInput {
         134  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         135  +
    /// Header-bound members are read directly from headers, avoiding runtime
         136  +
    /// member iteration overhead. Body members are read via the deserializer.
         137  +
    pub fn deserialize_with_response(
         138  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         139  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         140  +
        _status: u16,
         141  +
        _body: &[u8],
         142  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         143  +
        #[allow(unused_variables, unused_mut)]
         144  +
        let mut builder = Self::builder();
         145  +
        if let Some(val) = headers.get("X-Required-List") {
         146  +
            builder.required_header_list = {
         147  +
                let mut items = Vec::new();
         148  +
                let mut chars = val.chars().peekable();
         149  +
                while chars.peek().is_some() {
         150  +
                    // Skip whitespace
         151  +
                    while chars.peek() == Some(&' ') {
         152  +
                        chars.next();
         153  +
                    }
         154  +
                    if chars.peek() == Some(&'"') {
         155  +
                        chars.next(); // skip opening quote
         156  +
                        let mut s = String::new();
         157  +
                        while let Some(&c) = chars.peek() {
         158  +
                            if c == '\\' {
         159  +
                                chars.next();
         160  +
                                if let Some(escaped) = chars.next() {
         161  +
                                    s.push(escaped);
         162  +
                                }
         163  +
                            } else if c == '"' {
         164  +
                                chars.next();
         165  +
                                break;
         166  +
                            } else {
         167  +
                                s.push(c);
         168  +
                                chars.next();
         169  +
                            }
         170  +
                        }
         171  +
                        items.push(s);
         172  +
                    } else {
         173  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         174  +
                        let trimmed = s.trim();
         175  +
                        if !trimmed.is_empty() {
         176  +
                            items.push(trimmed.to_string());
         177  +
                        }
         178  +
                    }
         179  +
                    // Skip comma separator
         180  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         181  +
                        chars.next();
         182  +
                    }
         183  +
                }
         184  +
                Some(items)
         185  +
            };
         186  +
        }
         187  +
        if let Some(val) = headers.get("X-Required-Set") {
         188  +
            builder.required_header_set = {
         189  +
                let mut items = Vec::new();
         190  +
                let mut chars = val.chars().peekable();
         191  +
                while chars.peek().is_some() {
         192  +
                    // Skip whitespace
         193  +
                    while chars.peek() == Some(&' ') {
         194  +
                        chars.next();
         195  +
                    }
         196  +
                    if chars.peek() == Some(&'"') {
         197  +
                        chars.next(); // skip opening quote
         198  +
                        let mut s = String::new();
         199  +
                        while let Some(&c) = chars.peek() {
         200  +
                            if c == '\\' {
         201  +
                                chars.next();
         202  +
                                if let Some(escaped) = chars.next() {
         203  +
                                    s.push(escaped);
         204  +
                                }
         205  +
                            } else if c == '"' {
         206  +
                                chars.next();
         207  +
                                break;
         208  +
                            } else {
         209  +
                                s.push(c);
         210  +
                                chars.next();
         211  +
                            }
         212  +
                        }
         213  +
                        items.push(s);
         214  +
                    } else {
         215  +
                        let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
         216  +
                        let trimmed = s.trim();
         217  +
                        if !trimmed.is_empty() {
         218  +
                            items.push(trimmed.to_string());
         219  +
                        }
         220  +
                    }
         221  +
                    // Skip comma separator
         222  +
                    while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
         223  +
                        chars.next();
         224  +
                    }
         225  +
                }
         226  +
                Some(items)
         227  +
            };
         228  +
        }
  141    229   
        builder
  142    230   
            .build()
  143    231   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  144    232   
    }
  145    233   
}
  146    234   
impl RequiredHeaderCollectionOperationInput {
  147    235   
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
  148    236   
    pub fn builder() -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
  149    237   
        crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder::default()
  150    238   
    }