Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_defaults.rs

@@ -155,155 +401,401 @@
  175    175   
    #[allow(missing_docs)] // documentation missing in model
  176    176   
    pub fn zero_double(&self) -> f64 {
  177    177   
        self.zero_double
  178    178   
    }
  179    179   
}
  180    180   
static DEFAULTS_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
  181    181   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults", "aws.protocoltests.json10", "Defaults");
  182    182   
static DEFAULTS_MEMBER_DEFAULT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultString", "aws.protocoltests.json10", "Defaults"),
  184    184   
    ::aws_smithy_schema::ShapeType::String,
  185         -
    "default_string",
         185  +
    "defaultString",
  186    186   
    0,
  187    187   
);
  188    188   
static DEFAULTS_MEMBER_DEFAULT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  189    189   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultBoolean", "aws.protocoltests.json10", "Defaults"),
  190    190   
    ::aws_smithy_schema::ShapeType::Boolean,
  191         -
    "default_boolean",
         191  +
    "defaultBoolean",
  192    192   
    1,
  193    193   
);
  194    194   
static DEFAULTS_MEMBER_DEFAULT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  195    195   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultList", "aws.protocoltests.json10", "Defaults"),
  196    196   
    ::aws_smithy_schema::ShapeType::List,
  197         -
    "default_list",
         197  +
    "defaultList",
  198    198   
    2,
  199    199   
);
  200    200   
static DEFAULTS_MEMBER_DEFAULT_DOCUMENT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  201    201   
    ::aws_smithy_schema::ShapeId::from_static(
  202    202   
        "aws.protocoltests.json10#Defaults$defaultDocumentMap",
  203    203   
        "aws.protocoltests.json10",
  204    204   
        "Defaults",
  205    205   
    ),
  206    206   
    ::aws_smithy_schema::ShapeType::Document,
  207         -
    "default_document_map",
         207  +
    "defaultDocumentMap",
  208    208   
    3,
  209    209   
);
  210    210   
static DEFAULTS_MEMBER_DEFAULT_DOCUMENT_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  211    211   
    ::aws_smithy_schema::ShapeId::from_static(
  212    212   
        "aws.protocoltests.json10#Defaults$defaultDocumentString",
  213    213   
        "aws.protocoltests.json10",
  214    214   
        "Defaults",
  215    215   
    ),
  216    216   
    ::aws_smithy_schema::ShapeType::Document,
  217         -
    "default_document_string",
         217  +
    "defaultDocumentString",
  218    218   
    4,
  219    219   
);
  220    220   
static DEFAULTS_MEMBER_DEFAULT_DOCUMENT_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  221    221   
    ::aws_smithy_schema::ShapeId::from_static(
  222    222   
        "aws.protocoltests.json10#Defaults$defaultDocumentBoolean",
  223    223   
        "aws.protocoltests.json10",
  224    224   
        "Defaults",
  225    225   
    ),
  226    226   
    ::aws_smithy_schema::ShapeType::Document,
  227         -
    "default_document_boolean",
         227  +
    "defaultDocumentBoolean",
  228    228   
    5,
  229    229   
);
  230    230   
static DEFAULTS_MEMBER_DEFAULT_DOCUMENT_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  231    231   
    ::aws_smithy_schema::ShapeId::from_static(
  232    232   
        "aws.protocoltests.json10#Defaults$defaultDocumentList",
  233    233   
        "aws.protocoltests.json10",
  234    234   
        "Defaults",
  235    235   
    ),
  236    236   
    ::aws_smithy_schema::ShapeType::Document,
  237         -
    "default_document_list",
         237  +
    "defaultDocumentList",
  238    238   
    6,
  239    239   
);
  240    240   
static DEFAULTS_MEMBER_DEFAULT_NULL_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  241    241   
    ::aws_smithy_schema::ShapeId::from_static(
  242    242   
        "aws.protocoltests.json10#Defaults$defaultNullDocument",
  243    243   
        "aws.protocoltests.json10",
  244    244   
        "Defaults",
  245    245   
    ),
  246    246   
    ::aws_smithy_schema::ShapeType::Document,
  247         -
    "default_null_document",
         247  +
    "defaultNullDocument",
  248    248   
    7,
  249    249   
);
  250    250   
static DEFAULTS_MEMBER_DEFAULT_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  251    251   
    ::aws_smithy_schema::ShapeId::from_static(
  252    252   
        "aws.protocoltests.json10#Defaults$defaultTimestamp",
  253    253   
        "aws.protocoltests.json10",
  254    254   
        "Defaults",
  255    255   
    ),
  256    256   
    ::aws_smithy_schema::ShapeType::Timestamp,
  257         -
    "default_timestamp",
         257  +
    "defaultTimestamp",
  258    258   
    8,
  259    259   
);
  260    260   
static DEFAULTS_MEMBER_DEFAULT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  261    261   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultBlob", "aws.protocoltests.json10", "Defaults"),
  262    262   
    ::aws_smithy_schema::ShapeType::Blob,
  263         -
    "default_blob",
         263  +
    "defaultBlob",
  264    264   
    9,
  265    265   
);
  266    266   
static DEFAULTS_MEMBER_DEFAULT_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  267    267   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultByte", "aws.protocoltests.json10", "Defaults"),
  268    268   
    ::aws_smithy_schema::ShapeType::Byte,
  269         -
    "default_byte",
         269  +
    "defaultByte",
  270    270   
    10,
  271    271   
);
  272    272   
static DEFAULTS_MEMBER_DEFAULT_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  273    273   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultShort", "aws.protocoltests.json10", "Defaults"),
  274    274   
    ::aws_smithy_schema::ShapeType::Short,
  275         -
    "default_short",
         275  +
    "defaultShort",
  276    276   
    11,
  277    277   
);
  278    278   
static DEFAULTS_MEMBER_DEFAULT_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  279    279   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultInteger", "aws.protocoltests.json10", "Defaults"),
  280    280   
    ::aws_smithy_schema::ShapeType::Integer,
  281         -
    "default_integer",
         281  +
    "defaultInteger",
  282    282   
    12,
  283    283   
);
  284    284   
static DEFAULTS_MEMBER_DEFAULT_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  285    285   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultLong", "aws.protocoltests.json10", "Defaults"),
  286    286   
    ::aws_smithy_schema::ShapeType::Long,
  287         -
    "default_long",
         287  +
    "defaultLong",
  288    288   
    13,
  289    289   
);
  290    290   
static DEFAULTS_MEMBER_DEFAULT_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  291    291   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultFloat", "aws.protocoltests.json10", "Defaults"),
  292    292   
    ::aws_smithy_schema::ShapeType::Float,
  293         -
    "default_float",
         293  +
    "defaultFloat",
  294    294   
    14,
  295    295   
);
  296    296   
static DEFAULTS_MEMBER_DEFAULT_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  297    297   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultDouble", "aws.protocoltests.json10", "Defaults"),
  298    298   
    ::aws_smithy_schema::ShapeType::Double,
  299         -
    "default_double",
         299  +
    "defaultDouble",
  300    300   
    15,
  301    301   
);
  302    302   
static DEFAULTS_MEMBER_DEFAULT_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  303    303   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultMap", "aws.protocoltests.json10", "Defaults"),
  304    304   
    ::aws_smithy_schema::ShapeType::Map,
  305         -
    "default_map",
         305  +
    "defaultMap",
  306    306   
    16,
  307    307   
);
  308    308   
static DEFAULTS_MEMBER_DEFAULT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  309    309   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultEnum", "aws.protocoltests.json10", "Defaults"),
  310    310   
    ::aws_smithy_schema::ShapeType::String,
  311         -
    "default_enum",
         311  +
    "defaultEnum",
  312    312   
    17,
  313    313   
);
  314    314   
static DEFAULTS_MEMBER_DEFAULT_INT_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  315    315   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$defaultIntEnum", "aws.protocoltests.json10", "Defaults"),
  316    316   
    ::aws_smithy_schema::ShapeType::Integer,
  317         -
    "default_int_enum",
         317  +
    "defaultIntEnum",
  318    318   
    18,
  319    319   
);
  320    320   
static DEFAULTS_MEMBER_EMPTY_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  321    321   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$emptyString", "aws.protocoltests.json10", "Defaults"),
  322    322   
    ::aws_smithy_schema::ShapeType::String,
  323         -
    "empty_string",
         323  +
    "emptyString",
  324    324   
    19,
  325    325   
);
  326    326   
static DEFAULTS_MEMBER_FALSE_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  327    327   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$falseBoolean", "aws.protocoltests.json10", "Defaults"),
  328    328   
    ::aws_smithy_schema::ShapeType::Boolean,
  329         -
    "false_boolean",
         329  +
    "falseBoolean",
  330    330   
    20,
  331    331   
);
  332    332   
static DEFAULTS_MEMBER_EMPTY_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  333    333   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$emptyBlob", "aws.protocoltests.json10", "Defaults"),
  334    334   
    ::aws_smithy_schema::ShapeType::Blob,
  335         -
    "empty_blob",
         335  +
    "emptyBlob",
  336    336   
    21,
  337    337   
);
  338    338   
static DEFAULTS_MEMBER_ZERO_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  339    339   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroByte", "aws.protocoltests.json10", "Defaults"),
  340    340   
    ::aws_smithy_schema::ShapeType::Byte,
  341         -
    "zero_byte",
         341  +
    "zeroByte",
  342    342   
    22,
  343    343   
);
  344    344   
static DEFAULTS_MEMBER_ZERO_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  345    345   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroShort", "aws.protocoltests.json10", "Defaults"),
  346    346   
    ::aws_smithy_schema::ShapeType::Short,
  347         -
    "zero_short",
         347  +
    "zeroShort",
  348    348   
    23,
  349    349   
);
  350    350   
static DEFAULTS_MEMBER_ZERO_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  351    351   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroInteger", "aws.protocoltests.json10", "Defaults"),
  352    352   
    ::aws_smithy_schema::ShapeType::Integer,
  353         -
    "zero_integer",
         353  +
    "zeroInteger",
  354    354   
    24,
  355    355   
);
  356    356   
static DEFAULTS_MEMBER_ZERO_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  357    357   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroLong", "aws.protocoltests.json10", "Defaults"),
  358    358   
    ::aws_smithy_schema::ShapeType::Long,
  359         -
    "zero_long",
         359  +
    "zeroLong",
  360    360   
    25,
  361    361   
);
  362    362   
static DEFAULTS_MEMBER_ZERO_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  363    363   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroFloat", "aws.protocoltests.json10", "Defaults"),
  364    364   
    ::aws_smithy_schema::ShapeType::Float,
  365         -
    "zero_float",
         365  +
    "zeroFloat",
  366    366   
    26,
  367    367   
);
  368    368   
static DEFAULTS_MEMBER_ZERO_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  369    369   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#Defaults$zeroDouble", "aws.protocoltests.json10", "Defaults"),
  370    370   
    ::aws_smithy_schema::ShapeType::Double,
  371         -
    "zero_double",
         371  +
    "zeroDouble",
  372    372   
    27,
  373    373   
);
  374    374   
static DEFAULTS_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  375    375   
    DEFAULTS_SCHEMA_ID,
  376    376   
    ::aws_smithy_schema::ShapeType::Structure,
  377    377   
    &[
  378    378   
        &DEFAULTS_MEMBER_DEFAULT_STRING,
  379    379   
        &DEFAULTS_MEMBER_DEFAULT_BOOLEAN,
  380    380   
        &DEFAULTS_MEMBER_DEFAULT_LIST,
  381    381   
        &DEFAULTS_MEMBER_DEFAULT_DOCUMENT_MAP,
@@ -523,523 +707,698 @@
  543    543   
        }
  544    544   
        {
  545    545   
            let val = &self.zero_double;
  546    546   
            ser.write_double(&DEFAULTS_MEMBER_ZERO_DOUBLE, *val)?;
  547    547   
        }
  548    548   
        Ok(())
  549    549   
    }
  550    550   
}
  551    551   
impl Defaults {
  552    552   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  553         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  554         -
        deserializer: &mut D,
         553  +
    pub fn deserialize(
         554  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  555    555   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  556    556   
        #[allow(unused_variables, unused_mut)]
  557    557   
        let mut builder = Self::builder();
  558    558   
        #[allow(
  559    559   
            unused_variables,
  560    560   
            unreachable_code,
  561    561   
            clippy::single_match,
  562    562   
            clippy::match_single_binding,
  563    563   
            clippy::diverging_sub_expression
  564    564   
        )]
  565         -
        deserializer.read_struct(&DEFAULTS_SCHEMA, (), |_, member, deser| {
         565  +
        deserializer.read_struct(&DEFAULTS_SCHEMA, &mut |member, deser| {
  566    566   
            match member.member_index() {
  567    567   
                Some(0) => {
  568    568   
                    builder.default_string = Some(deser.read_string(member)?);
  569    569   
                }
  570    570   
                Some(1) => {
  571    571   
                    builder.default_boolean = Some(deser.read_boolean(member)?);
  572    572   
                }
  573    573   
                Some(2) => {
  574         -
                    builder.default_list = Some({
  575         -
                        let container = if let Some(cap) = deser.container_size() {
  576         -
                            Vec::with_capacity(cap)
  577         -
                        } else {
  578         -
                            Vec::new()
  579         -
                        };
  580         -
                        deser.read_list(member, container, |mut list, deser| {
  581         -
                            list.push(deser.read_string(member)?);
  582         -
                            Ok(list)
  583         -
                        })?
  584         -
                    });
         574  +
                    builder.default_list = Some(deser.read_string_list(member)?);
  585    575   
                }
  586    576   
                Some(3) => {
  587    577   
                    builder.default_document_map = Some(deser.read_document(member)?);
  588    578   
                }
  589    579   
                Some(4) => {
  590    580   
                    builder.default_document_string = Some(deser.read_document(member)?);
  591    581   
                }
  592    582   
                Some(5) => {
  593    583   
                    builder.default_document_boolean = Some(deser.read_document(member)?);
  594    584   
                }
  595    585   
                Some(6) => {
  596    586   
                    builder.default_document_list = Some(deser.read_document(member)?);
  597    587   
                }
  598    588   
                Some(7) => {
  599    589   
                    builder.default_null_document = Some(deser.read_document(member)?);
  600    590   
                }
  601    591   
                Some(8) => {
  602    592   
                    builder.default_timestamp = Some(deser.read_timestamp(member)?);
  603    593   
                }
  604    594   
                Some(9) => {
  605    595   
                    builder.default_blob = Some(deser.read_blob(member)?);
  606    596   
                }
  607    597   
                Some(10) => {
  608    598   
                    builder.default_byte = Some(deser.read_byte(member)?);
  609    599   
                }
  610    600   
                Some(11) => {
  611    601   
                    builder.default_short = Some(deser.read_short(member)?);
  612    602   
                }
  613    603   
                Some(12) => {
  614    604   
                    builder.default_integer = Some(deser.read_integer(member)?);
  615    605   
                }
  616    606   
                Some(13) => {
  617    607   
                    builder.default_long = Some(deser.read_long(member)?);
  618    608   
                }
  619    609   
                Some(14) => {
  620    610   
                    builder.default_float = Some(deser.read_float(member)?);
  621    611   
                }
  622    612   
                Some(15) => {
  623    613   
                    builder.default_double = Some(deser.read_double(member)?);
  624    614   
                }
  625    615   
                Some(16) => {
  626         -
                    builder.default_map = Some({
  627         -
                        let container = if let Some(cap) = deser.container_size() {
  628         -
                            std::collections::HashMap::with_capacity(cap)
  629         -
                        } else {
  630         -
                            std::collections::HashMap::new()
  631         -
                        };
  632         -
                        deser.read_map(member, container, |mut map, key, deser| {
  633         -
                            map.insert(key, deser.read_string(member)?);
  634         -
                            Ok(map)
  635         -
                        })?
  636         -
                    });
         616  +
                    builder.default_map = Some(deser.read_string_string_map(member)?);
  637    617   
                }
  638    618   
                Some(17) => {
  639    619   
                    builder.default_enum = Some(crate::types::TestEnum::from(deser.read_string(member)?.as_str()));
  640    620   
                }
  641    621   
                Some(18) => {
  642    622   
                    builder.default_int_enum = Some(deser.read_integer(member)?);
  643    623   
                }
  644    624   
                Some(19) => {
  645    625   
                    builder.empty_string = Some(deser.read_string(member)?);
  646    626   
                }
  647    627   
                Some(20) => {
  648    628   
                    builder.false_boolean = Some(deser.read_boolean(member)?);
  649    629   
                }
  650    630   
                Some(21) => {
  651    631   
                    builder.empty_blob = Some(deser.read_blob(member)?);
  652    632   
                }
  653    633   
                Some(22) => {
  654    634   
                    builder.zero_byte = Some(deser.read_byte(member)?);
  655    635   
                }
  656    636   
                Some(23) => {
  657    637   
                    builder.zero_short = Some(deser.read_short(member)?);
  658    638   
                }
  659    639   
                Some(24) => {
  660    640   
                    builder.zero_integer = Some(deser.read_integer(member)?);
  661    641   
                }
  662    642   
                Some(25) => {
  663    643   
                    builder.zero_long = Some(deser.read_long(member)?);
  664    644   
                }
  665    645   
                Some(26) => {
  666    646   
                    builder.zero_float = Some(deser.read_float(member)?);
  667    647   
                }
  668    648   
                Some(27) => {
  669    649   
                    builder.zero_double = Some(deser.read_double(member)?);
  670    650   
                }
  671    651   
                _ => {}
  672    652   
            }
  673    653   
            Ok(())
  674    654   
        })?;
  675    655   
        Ok(builder.build())
  676    656   
    }
  677    657   
}
         658  +
impl Defaults {
         659  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         660  +
    pub fn deserialize_with_response(
         661  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         662  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         663  +
        _status: u16,
         664  +
        _body: &[u8],
         665  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         666  +
        Self::deserialize(deserializer)
         667  +
    }
         668  +
}
  678    669   
impl Defaults {
  679    670   
    /// Creates a new builder-style object to manufacture [`Defaults`](crate::types::Defaults).
  680    671   
    pub fn builder() -> crate::types::builders::DefaultsBuilder {
  681    672   
        crate::types::builders::DefaultsBuilder::default()
  682    673   
    }
  683    674   
}
  684    675   
  685    676   
/// A builder for [`Defaults`](crate::types::Defaults).
  686    677   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  687    678   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_dialog.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_farewell.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/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_rpc10/rust-client-codegen/src/types/_my_union.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_top_level.rs

@@ -9,9 +180,185 @@
   29     29   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#TopLevel", "aws.protocoltests.json10", "TopLevel");
   30     30   
static TOPLEVEL_MEMBER_DIALOG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   31     31   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#TopLevel$dialog", "aws.protocoltests.json10", "TopLevel"),
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    "dialog",
   34     34   
    0,
   35     35   
);
   36     36   
static TOPLEVEL_MEMBER_DIALOG_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   37     37   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#TopLevel$dialogList", "aws.protocoltests.json10", "TopLevel"),
   38     38   
    ::aws_smithy_schema::ShapeType::List,
   39         -
    "dialog_list",
          39  +
    "dialogList",
   40     40   
    1,
   41     41   
);
   42     42   
static TOPLEVEL_MEMBER_DIALOG_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   43     43   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.json10#TopLevel$dialogMap", "aws.protocoltests.json10", "TopLevel"),
   44     44   
    ::aws_smithy_schema::ShapeType::Map,
   45         -
    "dialog_map",
          45  +
    "dialogMap",
   46     46   
    2,
   47     47   
);
   48     48   
static TOPLEVEL_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    TOPLEVEL_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&TOPLEVEL_MEMBER_DIALOG, &TOPLEVEL_MEMBER_DIALOG_LIST, &TOPLEVEL_MEMBER_DIALOG_MAP],
   52     52   
);
   53     53   
impl TopLevel {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TOPLEVEL_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for TopLevel {
   58     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     59   
    fn serialize_members(
   60     60   
        &self,
   61     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     63   
        {
   64     64   
            let val = &self.dialog;
   65     65   
            ser.write_struct(&TOPLEVEL_MEMBER_DIALOG, val)?;
   66     66   
        }
   67     67   
        {
   68     68   
            let val = &self.dialog_list;
   69     69   
   70     70   
            ser.write_list(
   71     71   
                &TOPLEVEL_MEMBER_DIALOG_LIST,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::Dialog::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        {
   81     81   
            let val = &self.dialog_map;
   82     82   
   83     83   
            ser.write_map(
   84     84   
                &TOPLEVEL_MEMBER_DIALOG_MAP,
   85     85   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   86     86   
                    for (key, value) in val {
   87     87   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
   88     88   
                        ser.write_struct(crate::types::Dialog::SCHEMA, value)?;
   89     89   
                    }
   90     90   
                    Ok(())
   91     91   
                },
   92     92   
            )?;
   93     93   
        }
   94     94   
        Ok(())
   95     95   
    }
   96     96   
}
   97     97   
impl TopLevel {
   98     98   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   99         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  100         -
        deserializer: &mut D,
          99  +
    pub fn deserialize(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  101    101   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  102    102   
        #[allow(unused_variables, unused_mut)]
  103    103   
        let mut builder = Self::builder();
  104    104   
        #[allow(
  105    105   
            unused_variables,
  106    106   
            unreachable_code,
  107    107   
            clippy::single_match,
  108    108   
            clippy::match_single_binding,
  109    109   
            clippy::diverging_sub_expression
  110    110   
        )]
  111         -
        deserializer.read_struct(&TOPLEVEL_SCHEMA, (), |_, member, deser| {
         111  +
        deserializer.read_struct(&TOPLEVEL_SCHEMA, &mut |member, deser| {
  112    112   
            match member.member_index() {
  113    113   
                Some(0) => {
  114    114   
                    builder.dialog = Some(crate::types::Dialog::deserialize(deser)?);
  115    115   
                }
  116    116   
                Some(1) => {
  117    117   
                    builder.dialog_list = Some({
  118         -
                        let container = if let Some(cap) = deser.container_size() {
  119         -
                            Vec::with_capacity(cap)
  120         -
                        } else {
  121         -
                            Vec::new()
  122         -
                        };
  123         -
                        deser.read_list(member, container, |mut list, deser| {
  124         -
                            list.push(crate::types::Dialog::deserialize(deser)?);
  125         -
                            Ok(list)
  126         -
                        })?
         118  +
                        let mut container = Vec::new();
         119  +
                        deser.read_list(member, &mut |deser| {
         120  +
                            container.push(crate::types::Dialog::deserialize(deser)?);
         121  +
                            Ok(())
         122  +
                        })?;
         123  +
                        container
  127    124   
                    });
  128    125   
                }
  129    126   
                Some(2) => {
  130    127   
                    builder.dialog_map = Some({
  131         -
                        let container = if let Some(cap) = deser.container_size() {
  132         -
                            std::collections::HashMap::with_capacity(cap)
  133         -
                        } else {
  134         -
                            std::collections::HashMap::new()
  135         -
                        };
  136         -
                        deser.read_map(member, container, |mut map, key, deser| {
  137         -
                            map.insert(key, crate::types::Dialog::deserialize(deser)?);
  138         -
                            Ok(map)
  139         -
                        })?
         128  +
                        let mut container = std::collections::HashMap::new();
         129  +
                        deser.read_map(member, &mut |key, deser| {
         130  +
                            container.insert(key, crate::types::Dialog::deserialize(deser)?);
         131  +
                            Ok(())
         132  +
                        })?;
         133  +
                        container
  140    134   
                    });
  141    135   
                }
  142    136   
                _ => {}
  143    137   
            }
  144    138   
            Ok(())
  145    139   
        })?;
  146    140   
        builder
  147    141   
            .build()
  148    142   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  149    143   
    }
  150    144   
}
         145  +
impl TopLevel {
         146  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         147  +
    pub fn deserialize_with_response(
         148  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         149  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         150  +
        _status: u16,
         151  +
        _body: &[u8],
         152  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         153  +
        Self::deserialize(deserializer)
         154  +
    }
         155  +
}
  151    156   
impl TopLevel {
  152    157   
    /// Creates a new builder-style object to manufacture [`TopLevel`](crate::types::TopLevel).
  153    158   
    pub fn builder() -> crate::types::builders::TopLevelBuilder {
  154    159   
        crate::types::builders::TopLevelBuilder::default()
  155    160   
    }
  156    161   
}
  157    162   
  158    163   
/// A builder for [`TopLevel`](crate::types::TopLevel).
  159    164   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  160    165   
#[non_exhaustive]

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/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.json10#FooError", "aws.protocoltests.json10", "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.json10#FooError$Message", "aws.protocoltests.json10", "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_rpc10/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.json10#InvalidGreeting", "aws.protocoltests.json10", "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.json10#InvalidGreeting$Message",
   16     16   
        "aws.protocoltests.json10",
   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/json_rpc11/rust-client-codegen/Cargo.toml

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

tmp-codegen-diff/codegen-client-test/json_rpc11/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 json_rpc11::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("JsonProtocol");
        1167  +
            if _service_config.protocol().is_none() {
        1168  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1169  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
        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/json_rpc11/rust-client-codegen/src/lib.rs

@@ -99,99 +133,131 @@
  119    119   
  120    120   
mod client_request_compression;
  121    121   
  122    122   
/// All operations that this crate can perform.
  123    123   
pub mod operation;
  124    124   
  125    125   
pub(crate) mod protocol_serde;
  126    126   
  127    127   
mod sdk_feature_tracker;
  128    128   
  129         -
mod serialization_settings;
  130         -
  131    129   
mod json_errors;
  132    130   
  133    131   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/content_type_parameters.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ContentTypeParameters`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ContentTypeParameters;
    6      6   
impl ContentTypeParameters {
    7      7   
    /// Creates a new `ContentTypeParameters`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::content_type_parameters::ContentTypeParametersInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::content_type_parameters::ContentTypeParametersOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::content_type_parameters::ContentTypeParametersInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::content_type_parameters::ContentTypeParametersError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +239,239 @@
  130    134   
                crate::operation::content_type_parameters::ContentTypeParametersError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct ContentTypeParametersResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ContentTypeParametersResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         150  +
        #[allow(unused_mut)]
         151  +
        let mut force_error = false;
         152  +
         153  +
        if !success && status != 200 || force_error {
  145    154   
            let headers = response.headers();
  146    155   
            let body = response.body().bytes().expect("body loaded");
  147    156   
            #[allow(unused_mut)]
  148         -
        let mut force_error = false;
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
  149    160   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_error(status, headers, body)
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, ContentTypeParameters::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::content_type_parameters::ContentTypeParametersOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct ContentTypeParametersRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ContentTypeParametersRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::content_type_parameters::ContentTypeParametersInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  195         -
            builder = _header_serialization_settings.set_default_header(
  196         -
                builder,
  197         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198         -
                "JsonProtocol.ContentTypeParameters",
  199         -
            );
  200         -
            builder
  201         -
        };
  202         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_input(
  203         -
            &input,
  204         -
        )?);
  205         -
        if let Some(content_length) = body.content_length() {
  206         -
            let content_length = content_length.to_string();
  207         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  208         -
        }
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, ContentTypeParameters::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         208  +
         209  +
        return ::std::result::Result::Ok(request);
  210    210   
    }
  211    211   
}
  212    212   
#[derive(Debug)]
  213    213   
struct ContentTypeParametersEndpointParamsInterceptor;
  214    214   
  215    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ContentTypeParametersEndpointParamsInterceptor {
  216    216   
    fn name(&self) -> &'static str {
  217    217   
        "ContentTypeParametersEndpointParamsInterceptor"
  218    218   
    }
  219    219   

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/content_type_parameters/_content_type_parameters_input.rs

@@ -23,23 +108,119 @@
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.value {
   46     46   
            ser.write_integer(&CONTENTTYPEPARAMETERSINPUT_MEMBER_VALUE, *val)?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl ContentTypeParametersInput {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&CONTENTTYPEPARAMETERSINPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&CONTENTTYPEPARAMETERSINPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.value = Some(deser.read_integer(member)?);
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        builder
   75     75   
            .build()
   76     76   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   77     77   
    }
   78     78   
}
          79  +
impl ContentTypeParametersInput {
          80  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          81  +
    pub fn deserialize_with_response(
          82  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          83  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          84  +
        _status: u16,
          85  +
        _body: &[u8],
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        Self::deserialize(deserializer)
          88  +
    }
          89  +
}
   79     90   
impl ContentTypeParametersInput {
   80     91   
    /// Creates a new builder-style object to manufacture [`ContentTypeParametersInput`](crate::operation::content_type_parameters::ContentTypeParametersInput).
   81     92   
    pub fn builder() -> crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder {
   82     93   
        crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder::default()
   83     94   
    }
   84     95   
}
   85     96   
   86     97   
/// A builder for [`ContentTypeParametersInput`](crate::operation::content_type_parameters::ContentTypeParametersInput).
   87     98   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   88     99   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/content_type_parameters/_content_type_parameters_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/datetime_offsets.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `DatetimeOffsets`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct DatetimeOffsets;
    6      6   
impl DatetimeOffsets {
    7      7   
    /// Creates a new `DatetimeOffsets`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::datetime_offsets::DatetimeOffsetsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::datetime_offsets::DatetimeOffsetsOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::datetime_offsets::DatetimeOffsetsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::datetime_offsets::DatetimeOffsetsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::datetime_offsets::DatetimeOffsetsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +228,233 @@
  124    128   
                crate::operation::datetime_offsets::DatetimeOffsetsError,
  125    129   
            >::new());
  126    130   
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct DatetimeOffsetsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DatetimeOffsetsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        #[allow(unused_mut)]
         145  +
        let mut force_error = false;
         146  +
         147  +
        if !success && status != 200 || force_error {
  139    148   
            let headers = response.headers();
  140    149   
            let body = response.body().bytes().expect("body loaded");
  141    150   
            #[allow(unused_mut)]
  142         -
        let mut force_error = false;
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
  143    154   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_error(status, headers, body)
         155  +
            let generic = generic_builder.build();
         156  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         157  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         158  +
                    crate::operation::datetime_offsets::DatetimeOffsetsError::generic(generic),
         159  +
                ),
         160  +
            ))
  146    161   
        } else {
  147         -
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let mut deser = protocol
         166  +
                .deserialize_response(response, DatetimeOffsets::OUTPUT_SCHEMA, _cfg)
         167  +
                .map_err(|e| {
         168  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         169  +
                })?;
         170  +
            let body = response.body().bytes().expect("body loaded");
         171  +
            let output = crate::operation::datetime_offsets::DatetimeOffsetsOutput::deserialize_with_response(
         172  +
                &mut *deser,
         173  +
                response.headers(),
         174  +
                response.status().into(),
         175  +
                body,
         176  +
            )
         177  +
            .map_err(|e| {
         178  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         179  +
            })?;
         180  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         181  +
        }
  150    182   
    }
  151    183   
}
  152    184   
#[derive(Debug)]
  153    185   
struct DatetimeOffsetsRequestSerializer;
  154    186   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DatetimeOffsetsRequestSerializer {
  155    187   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    188   
    fn serialize_input(
  157    189   
        &self,
  158    190   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    191   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    192   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    193   
        let input = input
  162    194   
            .downcast::<crate::operation::datetime_offsets::DatetimeOffsetsInput>()
  163    195   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::datetime_offsets::DatetimeOffsetsInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                ::std::write!(output, "/").expect("formatting should succeed");
  176         -
                ::std::result::Result::Ok(())
  177         -
            }
  178         -
            #[allow(clippy::unnecessary_wraps)]
  179         -
            fn update_http_builder(
  180         -
                input: &crate::operation::datetime_offsets::DatetimeOffsetsInput,
  181         -
                builder: ::http_1x::request::Builder,
  182         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183         -
                let mut uri = ::std::string::String::new();
  184         -
                uri_base(input, &mut uri)?;
  185         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186         -
            }
  187         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "JsonProtocol.DatetimeOffsets",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_datetime_offsets::ser_datetime_offsets_input(&input)?);
         196  +
        let protocol = _cfg
         197  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         198  +
            .expect("a SharedClientProtocol is required");
         199  +
        let mut request = protocol
         200  +
            .serialize_request(&input, DatetimeOffsets::INPUT_SCHEMA, "", _cfg)
         201  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    202   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         203  +
        return ::std::result::Result::Ok(request);
  199    204   
    }
  200    205   
}
  201    206   
#[derive(Debug)]
  202    207   
struct DatetimeOffsetsEndpointParamsInterceptor;
  203    208   
  204    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DatetimeOffsetsEndpointParamsInterceptor {
  205    210   
    fn name(&self) -> &'static str {
  206    211   
        "DatetimeOffsetsEndpointParamsInterceptor"
  207    212   
    }
  208    213   
@@ -247,252 +353,378 @@
  267    272   
            .expect("the config must have a deserializer");
  268    273   
  269    274   
        let parsed = de.deserialize_streaming(&mut http_response);
  270    275   
        let parsed = parsed.unwrap_or_else(|| {
  271    276   
            let http_response = http_response.map(|body| {
  272    277   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  273    278   
                    body.bytes().unwrap(),
  274    279   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  275    280   
                )))
  276    281   
            });
  277         -
            de.deserialize_nonstreaming(&http_response)
         282  +
            // Build a config bag with the protocol for schema-based deserialization
         283  +
            #[allow(unused_mut)]
         284  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         285  +
            {
         286  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         287  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         288  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         289  +
                ));
         290  +
                test_cfg.push_shared_layer(layer.freeze());
         291  +
            }
         292  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  278    293   
        });
  279    294   
        let parsed = parsed
  280    295   
            .expect("should be successful response")
  281    296   
            .downcast::<crate::operation::datetime_offsets::DatetimeOffsetsOutput>()
  282    297   
            .unwrap();
  283    298   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  284    299   
    }
  285    300   
  286    301   
    /// Ensures that clients can correctly parse datetime (timestamps) with offsets
  287    302   
    /// Test ID: AwsJson11DateTimeWithPositiveOffset
  288    303   
    #[::tokio::test]
  289    304   
    #[::tracing_test::traced_test]
  290    305   
    async fn aws_json11_date_time_with_positive_offset_response() {
  291    306   
        let expected_output = crate::operation::datetime_offsets::DatetimeOffsetsOutput::builder()
  292    307   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  293    308   
                1576540098, 0_f64,
  294    309   
            )))
  295    310   
            .build();
  296    311   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  297    312   
            ::http_1x::response::Builder::new()
  298    313   
                .header("Content-Type", "application/x-amz-json-1.1")
  299    314   
                .status(200)
  300    315   
                .body(::aws_smithy_types::body::SdkBody::from(
  301    316   
                    "      {\n          \"datetime\": \"2019-12-17T00:48:18+01:00\"\n      }\n",
  302    317   
                ))
  303    318   
                .unwrap(),
  304    319   
        )
  305    320   
        .unwrap();
  306    321   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  307    322   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  308    323   
  309    324   
        let op = crate::operation::datetime_offsets::DatetimeOffsets::new();
  310    325   
        let config = op.config().expect("the operation has config");
  311    326   
        let de = config
  312    327   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  313    328   
            .expect("the config must have a deserializer");
  314    329   
  315    330   
        let parsed = de.deserialize_streaming(&mut http_response);
  316    331   
        let parsed = parsed.unwrap_or_else(|| {
  317    332   
            let http_response = http_response.map(|body| {
  318    333   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  319    334   
                    body.bytes().unwrap(),
  320    335   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  321    336   
                )))
  322    337   
            });
  323         -
            de.deserialize_nonstreaming(&http_response)
         338  +
            // Build a config bag with the protocol for schema-based deserialization
         339  +
            #[allow(unused_mut)]
         340  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         341  +
            {
         342  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         343  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         344  +
                    ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_1("JsonProtocol"),
         345  +
                ));
         346  +
                test_cfg.push_shared_layer(layer.freeze());
         347  +
            }
         348  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  324    349   
        });
  325    350   
        let parsed = parsed
  326    351   
            .expect("should be successful response")
  327    352   
            .downcast::<crate::operation::datetime_offsets::DatetimeOffsetsOutput>()
  328    353   
            .unwrap();
  329    354   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  330    355   
    }
  331    356   
}
  332    357   
  333    358   
/// Error type for the `DatetimeOffsetsError` operation.