Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/scan/_scan_input.rs

@@ -248,248 +458,458 @@
  268    268   
    "com.amazonaws.dynamodb.synthetic",
  269    269   
    "ScanInput",
  270    270   
);
  271    271   
static SCANINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  272    272   
    ::aws_smithy_schema::ShapeId::from_static(
  273    273   
        "com.amazonaws.dynamodb.synthetic#ScanInput$TableName",
  274    274   
        "com.amazonaws.dynamodb.synthetic",
  275    275   
        "ScanInput",
  276    276   
    ),
  277    277   
    ::aws_smithy_schema::ShapeType::String,
  278         -
    "table_name",
         278  +
    "TableName",
  279    279   
    0,
  280    280   
);
  281    281   
static SCANINPUT_MEMBER_INDEX_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  282    282   
    ::aws_smithy_schema::ShapeId::from_static(
  283    283   
        "com.amazonaws.dynamodb.synthetic#ScanInput$IndexName",
  284    284   
        "com.amazonaws.dynamodb.synthetic",
  285    285   
        "ScanInput",
  286    286   
    ),
  287    287   
    ::aws_smithy_schema::ShapeType::String,
  288         -
    "index_name",
         288  +
    "IndexName",
  289    289   
    1,
  290    290   
);
  291    291   
static SCANINPUT_MEMBER_ATTRIBUTES_TO_GET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  292    292   
    ::aws_smithy_schema::ShapeId::from_static(
  293    293   
        "com.amazonaws.dynamodb.synthetic#ScanInput$AttributesToGet",
  294    294   
        "com.amazonaws.dynamodb.synthetic",
  295    295   
        "ScanInput",
  296    296   
    ),
  297    297   
    ::aws_smithy_schema::ShapeType::List,
  298         -
    "attributes_to_get",
         298  +
    "AttributesToGet",
  299    299   
    2,
  300    300   
);
  301    301   
static SCANINPUT_MEMBER_LIMIT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  302    302   
    ::aws_smithy_schema::ShapeId::from_static(
  303    303   
        "com.amazonaws.dynamodb.synthetic#ScanInput$Limit",
  304    304   
        "com.amazonaws.dynamodb.synthetic",
  305    305   
        "ScanInput",
  306    306   
    ),
  307    307   
    ::aws_smithy_schema::ShapeType::Integer,
  308         -
    "limit",
         308  +
    "Limit",
  309    309   
    3,
  310    310   
);
  311    311   
static SCANINPUT_MEMBER_SELECT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  312    312   
    ::aws_smithy_schema::ShapeId::from_static(
  313    313   
        "com.amazonaws.dynamodb.synthetic#ScanInput$Select",
  314    314   
        "com.amazonaws.dynamodb.synthetic",
  315    315   
        "ScanInput",
  316    316   
    ),
  317    317   
    ::aws_smithy_schema::ShapeType::String,
  318         -
    "select",
         318  +
    "Select",
  319    319   
    4,
  320    320   
);
  321    321   
static SCANINPUT_MEMBER_SCAN_FILTER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  322    322   
    ::aws_smithy_schema::ShapeId::from_static(
  323    323   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ScanFilter",
  324    324   
        "com.amazonaws.dynamodb.synthetic",
  325    325   
        "ScanInput",
  326    326   
    ),
  327    327   
    ::aws_smithy_schema::ShapeType::Map,
  328         -
    "scan_filter",
         328  +
    "ScanFilter",
  329    329   
    5,
  330    330   
);
  331    331   
static SCANINPUT_MEMBER_CONDITIONAL_OPERATOR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  332    332   
    ::aws_smithy_schema::ShapeId::from_static(
  333    333   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ConditionalOperator",
  334    334   
        "com.amazonaws.dynamodb.synthetic",
  335    335   
        "ScanInput",
  336    336   
    ),
  337    337   
    ::aws_smithy_schema::ShapeType::String,
  338         -
    "conditional_operator",
         338  +
    "ConditionalOperator",
  339    339   
    6,
  340    340   
);
  341    341   
static SCANINPUT_MEMBER_EXCLUSIVE_START_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  342    342   
    ::aws_smithy_schema::ShapeId::from_static(
  343    343   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ExclusiveStartKey",
  344    344   
        "com.amazonaws.dynamodb.synthetic",
  345    345   
        "ScanInput",
  346    346   
    ),
  347    347   
    ::aws_smithy_schema::ShapeType::Map,
  348         -
    "exclusive_start_key",
         348  +
    "ExclusiveStartKey",
  349    349   
    7,
  350    350   
);
  351    351   
static SCANINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  352    352   
    ::aws_smithy_schema::ShapeId::from_static(
  353    353   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ReturnConsumedCapacity",
  354    354   
        "com.amazonaws.dynamodb.synthetic",
  355    355   
        "ScanInput",
  356    356   
    ),
  357    357   
    ::aws_smithy_schema::ShapeType::String,
  358         -
    "return_consumed_capacity",
         358  +
    "ReturnConsumedCapacity",
  359    359   
    8,
  360    360   
);
  361    361   
static SCANINPUT_MEMBER_TOTAL_SEGMENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  362    362   
    ::aws_smithy_schema::ShapeId::from_static(
  363    363   
        "com.amazonaws.dynamodb.synthetic#ScanInput$TotalSegments",
  364    364   
        "com.amazonaws.dynamodb.synthetic",
  365    365   
        "ScanInput",
  366    366   
    ),
  367    367   
    ::aws_smithy_schema::ShapeType::Integer,
  368         -
    "total_segments",
         368  +
    "TotalSegments",
  369    369   
    9,
  370    370   
);
  371    371   
static SCANINPUT_MEMBER_SEGMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  372    372   
    ::aws_smithy_schema::ShapeId::from_static(
  373    373   
        "com.amazonaws.dynamodb.synthetic#ScanInput$Segment",
  374    374   
        "com.amazonaws.dynamodb.synthetic",
  375    375   
        "ScanInput",
  376    376   
    ),
  377    377   
    ::aws_smithy_schema::ShapeType::Integer,
  378         -
    "segment",
         378  +
    "Segment",
  379    379   
    10,
  380    380   
);
  381    381   
static SCANINPUT_MEMBER_PROJECTION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  382    382   
    ::aws_smithy_schema::ShapeId::from_static(
  383    383   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ProjectionExpression",
  384    384   
        "com.amazonaws.dynamodb.synthetic",
  385    385   
        "ScanInput",
  386    386   
    ),
  387    387   
    ::aws_smithy_schema::ShapeType::String,
  388         -
    "projection_expression",
         388  +
    "ProjectionExpression",
  389    389   
    11,
  390    390   
);
  391    391   
static SCANINPUT_MEMBER_FILTER_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  392    392   
    ::aws_smithy_schema::ShapeId::from_static(
  393    393   
        "com.amazonaws.dynamodb.synthetic#ScanInput$FilterExpression",
  394    394   
        "com.amazonaws.dynamodb.synthetic",
  395    395   
        "ScanInput",
  396    396   
    ),
  397    397   
    ::aws_smithy_schema::ShapeType::String,
  398         -
    "filter_expression",
         398  +
    "FilterExpression",
  399    399   
    12,
  400    400   
);
  401    401   
static SCANINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  402    402   
    ::aws_smithy_schema::ShapeId::from_static(
  403    403   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ExpressionAttributeNames",
  404    404   
        "com.amazonaws.dynamodb.synthetic",
  405    405   
        "ScanInput",
  406    406   
    ),
  407    407   
    ::aws_smithy_schema::ShapeType::Map,
  408         -
    "expression_attribute_names",
         408  +
    "ExpressionAttributeNames",
  409    409   
    13,
  410    410   
);
  411    411   
static SCANINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  412    412   
    ::aws_smithy_schema::ShapeId::from_static(
  413    413   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ExpressionAttributeValues",
  414    414   
        "com.amazonaws.dynamodb.synthetic",
  415    415   
        "ScanInput",
  416    416   
    ),
  417    417   
    ::aws_smithy_schema::ShapeType::Map,
  418         -
    "expression_attribute_values",
         418  +
    "ExpressionAttributeValues",
  419    419   
    14,
  420    420   
);
  421    421   
static SCANINPUT_MEMBER_CONSISTENT_READ: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  422    422   
    ::aws_smithy_schema::ShapeId::from_static(
  423    423   
        "com.amazonaws.dynamodb.synthetic#ScanInput$ConsistentRead",
  424    424   
        "com.amazonaws.dynamodb.synthetic",
  425    425   
        "ScanInput",
  426    426   
    ),
  427    427   
    ::aws_smithy_schema::ShapeType::Boolean,
  428         -
    "consistent_read",
         428  +
    "ConsistentRead",
  429    429   
    15,
  430    430   
);
  431    431   
static SCANINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  432    432   
    SCANINPUT_SCHEMA_ID,
  433    433   
    ::aws_smithy_schema::ShapeType::Structure,
  434    434   
    &[
  435    435   
        &SCANINPUT_MEMBER_TABLE_NAME,
  436    436   
        &SCANINPUT_MEMBER_INDEX_NAME,
  437    437   
        &SCANINPUT_MEMBER_ATTRIBUTES_TO_GET,
  438    438   
        &SCANINPUT_MEMBER_LIMIT,
@@ -477,477 +710,693 @@
  497    497   
        }
  498    498   
        if let Some(ref val) = self.conditional_operator {
  499    499   
            ser.write_string(&SCANINPUT_MEMBER_CONDITIONAL_OPERATOR, val.as_str())?;
  500    500   
        }
  501    501   
        if let Some(ref val) = self.exclusive_start_key {
  502    502   
            ser.write_map(
  503    503   
                &SCANINPUT_MEMBER_EXCLUSIVE_START_KEY,
  504    504   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  505    505   
                    for (key, value) in val {
  506    506   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  507         -
                        todo!("schema: unsupported map value type");
         507  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  508    508   
                    }
  509    509   
                    Ok(())
  510    510   
                },
  511    511   
            )?;
  512    512   
        }
  513    513   
        if let Some(ref val) = self.return_consumed_capacity {
  514    514   
            ser.write_string(&SCANINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
  515    515   
        }
  516    516   
        if let Some(ref val) = self.total_segments {
  517    517   
            ser.write_integer(&SCANINPUT_MEMBER_TOTAL_SEGMENTS, *val)?;
  518    518   
        }
  519    519   
        if let Some(ref val) = self.segment {
  520    520   
            ser.write_integer(&SCANINPUT_MEMBER_SEGMENT, *val)?;
  521    521   
        }
  522    522   
        if let Some(ref val) = self.projection_expression {
  523    523   
            ser.write_string(&SCANINPUT_MEMBER_PROJECTION_EXPRESSION, val)?;
  524    524   
        }
  525    525   
        if let Some(ref val) = self.filter_expression {
  526    526   
            ser.write_string(&SCANINPUT_MEMBER_FILTER_EXPRESSION, val)?;
  527    527   
        }
  528    528   
        if let Some(ref val) = self.expression_attribute_names {
  529    529   
            ser.write_map(
  530    530   
                &SCANINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES,
  531    531   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  532    532   
                    for (key, value) in val {
  533    533   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  534    534   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
  535    535   
                    }
  536    536   
                    Ok(())
  537    537   
                },
  538    538   
            )?;
  539    539   
        }
  540    540   
        if let Some(ref val) = self.expression_attribute_values {
  541    541   
            ser.write_map(
  542    542   
                &SCANINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES,
  543    543   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  544    544   
                    for (key, value) in val {
  545    545   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  546         -
                        todo!("schema: unsupported map value type");
         546  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  547    547   
                    }
  548    548   
                    Ok(())
  549    549   
                },
  550    550   
            )?;
  551    551   
        }
  552    552   
        if let Some(ref val) = self.consistent_read {
  553    553   
            ser.write_boolean(&SCANINPUT_MEMBER_CONSISTENT_READ, *val)?;
  554    554   
        }
  555    555   
        Ok(())
  556    556   
    }
  557    557   
}
  558    558   
impl ScanInput {
  559    559   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  560         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  561         -
        deserializer: &mut D,
         560  +
    pub fn deserialize(
         561  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  562    562   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  563    563   
        #[allow(unused_variables, unused_mut)]
  564    564   
        let mut builder = Self::builder();
  565    565   
        #[allow(
  566    566   
            unused_variables,
  567    567   
            unreachable_code,
  568    568   
            clippy::single_match,
  569    569   
            clippy::match_single_binding,
  570    570   
            clippy::diverging_sub_expression
  571    571   
        )]
  572         -
        deserializer.read_struct(&SCANINPUT_SCHEMA, (), |_, member, deser| {
         572  +
        deserializer.read_struct(&SCANINPUT_SCHEMA, &mut |member, deser| {
  573    573   
            match member.member_index() {
  574    574   
                Some(0) => {
  575    575   
                    builder.table_name = Some(deser.read_string(member)?);
  576    576   
                }
  577    577   
                Some(1) => {
  578    578   
                    builder.index_name = Some(deser.read_string(member)?);
  579    579   
                }
  580    580   
                Some(2) => {
  581         -
                    builder.attributes_to_get = Some({
  582         -
                        let container = if let Some(cap) = deser.container_size() {
  583         -
                            Vec::with_capacity(cap)
  584         -
                        } else {
  585         -
                            Vec::new()
  586         -
                        };
  587         -
                        deser.read_list(member, container, |mut list, deser| {
  588         -
                            list.push(deser.read_string(member)?);
  589         -
                            Ok(list)
  590         -
                        })?
  591         -
                    });
         581  +
                    builder.attributes_to_get = Some(deser.read_string_list(member)?);
  592    582   
                }
  593    583   
                Some(3) => {
  594    584   
                    builder.limit = Some(deser.read_integer(member)?);
  595    585   
                }
  596    586   
                Some(4) => {
  597    587   
                    builder.select = Some(crate::types::Select::from(deser.read_string(member)?.as_str()));
  598    588   
                }
  599    589   
                Some(5) => {
  600    590   
                    builder.scan_filter = Some({
  601         -
                        let container = if let Some(cap) = deser.container_size() {
  602         -
                            std::collections::HashMap::with_capacity(cap)
  603         -
                        } else {
  604         -
                            std::collections::HashMap::new()
  605         -
                        };
  606         -
                        deser.read_map(member, container, |mut map, key, deser| {
  607         -
                            map.insert(key, crate::types::Condition::deserialize(deser)?);
  608         -
                            Ok(map)
  609         -
                        })?
         591  +
                        let mut container = std::collections::HashMap::new();
         592  +
                        deser.read_map(member, &mut |key, deser| {
         593  +
                            container.insert(key, crate::types::Condition::deserialize(deser)?);
         594  +
                            Ok(())
         595  +
                        })?;
         596  +
                        container
  610    597   
                    });
  611    598   
                }
  612    599   
                Some(6) => {
  613    600   
                    builder.conditional_operator = Some(crate::types::ConditionalOperator::from(deser.read_string(member)?.as_str()));
  614    601   
                }
  615    602   
                Some(7) => {
  616    603   
                    builder.exclusive_start_key = Some({
  617         -
                        let container = if let Some(cap) = deser.container_size() {
  618         -
                            std::collections::HashMap::with_capacity(cap)
  619         -
                        } else {
  620         -
                            std::collections::HashMap::new()
  621         -
                        };
  622         -
                        deser.read_map(member, container, |mut map, key, deser| {
  623         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  624         -
                            Ok(map)
  625         -
                        })?
         604  +
                        let mut container = std::collections::HashMap::new();
         605  +
                        deser.read_map(member, &mut |key, deser| {
         606  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         607  +
                            Ok(())
         608  +
                        })?;
         609  +
                        container
  626    610   
                    });
  627    611   
                }
  628    612   
                Some(8) => {
  629    613   
                    builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
  630    614   
                }
  631    615   
                Some(9) => {
  632    616   
                    builder.total_segments = Some(deser.read_integer(member)?);
  633    617   
                }
  634    618   
                Some(10) => {
  635    619   
                    builder.segment = Some(deser.read_integer(member)?);
  636    620   
                }
  637    621   
                Some(11) => {
  638    622   
                    builder.projection_expression = Some(deser.read_string(member)?);
  639    623   
                }
  640    624   
                Some(12) => {
  641    625   
                    builder.filter_expression = Some(deser.read_string(member)?);
  642    626   
                }
  643    627   
                Some(13) => {
  644         -
                    builder.expression_attribute_names = Some({
  645         -
                        let container = if let Some(cap) = deser.container_size() {
  646         -
                            std::collections::HashMap::with_capacity(cap)
  647         -
                        } else {
  648         -
                            std::collections::HashMap::new()
  649         -
                        };
  650         -
                        deser.read_map(member, container, |mut map, key, deser| {
  651         -
                            map.insert(key, deser.read_string(member)?);
  652         -
                            Ok(map)
  653         -
                        })?
  654         -
                    });
         628  +
                    builder.expression_attribute_names = Some(deser.read_string_string_map(member)?);
  655    629   
                }
  656    630   
                Some(14) => {
  657    631   
                    builder.expression_attribute_values = Some({
  658         -
                        let container = if let Some(cap) = deser.container_size() {
  659         -
                            std::collections::HashMap::with_capacity(cap)
  660         -
                        } else {
  661         -
                            std::collections::HashMap::new()
  662         -
                        };
  663         -
                        deser.read_map(member, container, |mut map, key, deser| {
  664         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  665         -
                            Ok(map)
  666         -
                        })?
         632  +
                        let mut container = std::collections::HashMap::new();
         633  +
                        deser.read_map(member, &mut |key, deser| {
         634  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         635  +
                            Ok(())
         636  +
                        })?;
         637  +
                        container
  667    638   
                    });
  668    639   
                }
  669    640   
                Some(15) => {
  670    641   
                    builder.consistent_read = Some(deser.read_boolean(member)?);
  671    642   
                }
  672    643   
                _ => {}
  673    644   
            }
  674    645   
            Ok(())
  675    646   
        })?;
         647  +
        builder.table_name = builder.table_name.or(Some(String::new()));
  676    648   
        builder
  677    649   
            .build()
  678    650   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  679    651   
    }
  680    652   
}
         653  +
impl ScanInput {
         654  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         655  +
    pub fn deserialize_with_response(
         656  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         657  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         658  +
        _status: u16,
         659  +
        _body: &[u8],
         660  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         661  +
        Self::deserialize(deserializer)
         662  +
    }
         663  +
}
  681    664   
impl ScanInput {
  682    665   
    /// Creates a new builder-style object to manufacture [`ScanInput`](crate::operation::scan::ScanInput).
  683    666   
    pub fn builder() -> crate::operation::scan::builders::ScanInputBuilder {
  684    667   
        crate::operation::scan::builders::ScanInputBuilder::default()
  685    668   
    }
  686    669   
}
  687    670   
  688    671   
/// A builder for [`ScanInput`](crate::operation::scan::ScanInput).
  689    672   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  690    673   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/scan/_scan_output.rs

@@ -34,34 +249,271 @@
   54     54   
    "com.amazonaws.dynamodb.synthetic",
   55     55   
    "ScanOutput",
   56     56   
);
   57     57   
static SCANOUTPUT_MEMBER_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   58     58   
    ::aws_smithy_schema::ShapeId::from_static(
   59     59   
        "com.amazonaws.dynamodb.synthetic#ScanOutput$Items",
   60     60   
        "com.amazonaws.dynamodb.synthetic",
   61     61   
        "ScanOutput",
   62     62   
    ),
   63     63   
    ::aws_smithy_schema::ShapeType::List,
   64         -
    "items",
          64  +
    "Items",
   65     65   
    0,
   66     66   
);
   67     67   
static SCANOUTPUT_MEMBER_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.dynamodb.synthetic#ScanOutput$Count",
   70     70   
        "com.amazonaws.dynamodb.synthetic",
   71     71   
        "ScanOutput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::Integer,
   74         -
    "count",
          74  +
    "Count",
   75     75   
    1,
   76     76   
);
   77     77   
static SCANOUTPUT_MEMBER_SCANNED_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "com.amazonaws.dynamodb.synthetic#ScanOutput$ScannedCount",
   80     80   
        "com.amazonaws.dynamodb.synthetic",
   81     81   
        "ScanOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Integer,
   84         -
    "scanned_count",
          84  +
    "ScannedCount",
   85     85   
    2,
   86     86   
);
   87     87   
static SCANOUTPUT_MEMBER_LAST_EVALUATED_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     88   
    ::aws_smithy_schema::ShapeId::from_static(
   89     89   
        "com.amazonaws.dynamodb.synthetic#ScanOutput$LastEvaluatedKey",
   90     90   
        "com.amazonaws.dynamodb.synthetic",
   91     91   
        "ScanOutput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::Map,
   94         -
    "last_evaluated_key",
          94  +
    "LastEvaluatedKey",
   95     95   
    3,
   96     96   
);
   97     97   
static SCANOUTPUT_MEMBER_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   98     98   
    ::aws_smithy_schema::ShapeId::from_static(
   99     99   
        "com.amazonaws.dynamodb.synthetic#ScanOutput$ConsumedCapacity",
  100    100   
        "com.amazonaws.dynamodb.synthetic",
  101    101   
        "ScanOutput",
  102    102   
    ),
  103    103   
    ::aws_smithy_schema::ShapeType::Structure,
  104         -
    "consumed_capacity",
         104  +
    "ConsumedCapacity",
  105    105   
    4,
  106    106   
);
  107    107   
static SCANOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  108    108   
    SCANOUTPUT_SCHEMA_ID,
  109    109   
    ::aws_smithy_schema::ShapeType::Structure,
  110    110   
    &[
  111    111   
        &SCANOUTPUT_MEMBER_ITEMS,
  112    112   
        &SCANOUTPUT_MEMBER_COUNT,
  113    113   
        &SCANOUTPUT_MEMBER_SCANNED_COUNT,
  114    114   
        &SCANOUTPUT_MEMBER_LAST_EVALUATED_KEY,
  115    115   
        &SCANOUTPUT_MEMBER_CONSUMED_CAPACITY,
  116    116   
    ],
  117    117   
);
  118    118   
impl ScanOutput {
  119    119   
    /// The schema for this shape.
  120    120   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SCANOUTPUT_SCHEMA;
  121    121   
}
  122    122   
impl ::aws_smithy_schema::serde::SerializableStruct for ScanOutput {
  123    123   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  124    124   
    fn serialize_members(
  125    125   
        &self,
  126    126   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  127    127   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  128    128   
        if let Some(ref val) = self.items {
  129    129   
            ser.write_list(&SCANOUTPUT_MEMBER_ITEMS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  130    130   
                for item in val {
  131         -
                    todo!("schema: unsupported list element type");
         131  +
                    ser.write_map(
         132  +
                        &::aws_smithy_schema::prelude::DOCUMENT,
         133  +
                        &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         134  +
                            for (key, value) in item {
         135  +
                                ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         136  +
                                ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
         137  +
                            }
         138  +
                            Ok(())
         139  +
                        },
         140  +
                    )?;
  132    141   
                }
  133    142   
                Ok(())
  134    143   
            })?;
  135    144   
        }
  136    145   
        {
  137    146   
            let val = &self.count;
  138    147   
            ser.write_integer(&SCANOUTPUT_MEMBER_COUNT, *val)?;
  139    148   
        }
  140    149   
        {
  141    150   
            let val = &self.scanned_count;
  142    151   
            ser.write_integer(&SCANOUTPUT_MEMBER_SCANNED_COUNT, *val)?;
  143    152   
        }
  144    153   
        if let Some(ref val) = self.last_evaluated_key {
  145    154   
            ser.write_map(
  146    155   
                &SCANOUTPUT_MEMBER_LAST_EVALUATED_KEY,
  147    156   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  148    157   
                    for (key, value) in val {
  149    158   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  150         -
                        todo!("schema: unsupported map value type");
         159  +
                        ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
  151    160   
                    }
  152    161   
                    Ok(())
  153    162   
                },
  154    163   
            )?;
  155    164   
        }
  156    165   
        if let Some(ref val) = self.consumed_capacity {
  157    166   
            ser.write_struct(&SCANOUTPUT_MEMBER_CONSUMED_CAPACITY, val)?;
  158    167   
        }
  159    168   
        Ok(())
  160    169   
    }
  161    170   
}
  162    171   
impl ScanOutput {
  163    172   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  164         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  165         -
        deserializer: &mut D,
         173  +
    pub fn deserialize(
         174  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  166    175   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  167    176   
        #[allow(unused_variables, unused_mut)]
  168    177   
        let mut builder = Self::builder();
  169    178   
        #[allow(
  170    179   
            unused_variables,
  171    180   
            unreachable_code,
  172    181   
            clippy::single_match,
  173    182   
            clippy::match_single_binding,
  174    183   
            clippy::diverging_sub_expression
  175    184   
        )]
  176         -
        deserializer.read_struct(&SCANOUTPUT_SCHEMA, (), |_, member, deser| {
         185  +
        deserializer.read_struct(&SCANOUTPUT_SCHEMA, &mut |member, deser| {
  177    186   
            match member.member_index() {
  178    187   
                Some(0) => {
  179    188   
                    builder.items = Some({
  180         -
                        let container = if let Some(cap) = deser.container_size() {
  181         -
                            Vec::with_capacity(cap)
  182         -
                        } else {
  183         -
                            Vec::new()
  184         -
                        };
  185         -
                        deser.read_list(member, container, |mut list, deser| {
  186         -
                            list.push(todo!("deserialize nested aggregate"));
  187         -
                            Ok(list)
  188         -
                        })?
         189  +
                        let mut container = Vec::new();
         190  +
                        deser.read_list(member, &mut |deser| {
         191  +
                            container.push({
         192  +
                                let mut map = ::std::collections::HashMap::new();
         193  +
                                deser.read_map(member, &mut |key, deser| {
         194  +
                                    let value = crate::types::AttributeValue::deserialize(deser)?;
         195  +
                                    map.insert(key, value);
         196  +
                                    Ok(())
         197  +
                                })?;
         198  +
                                map
         199  +
                            });
         200  +
                            Ok(())
         201  +
                        })?;
         202  +
                        container
  189    203   
                    });
  190    204   
                }
  191    205   
                Some(1) => {
  192    206   
                    builder.count = Some(deser.read_integer(member)?);
  193    207   
                }
  194    208   
                Some(2) => {
  195    209   
                    builder.scanned_count = Some(deser.read_integer(member)?);
  196    210   
                }
  197    211   
                Some(3) => {
  198    212   
                    builder.last_evaluated_key = Some({
  199         -
                        let container = if let Some(cap) = deser.container_size() {
  200         -
                            std::collections::HashMap::with_capacity(cap)
  201         -
                        } else {
  202         -
                            std::collections::HashMap::new()
  203         -
                        };
  204         -
                        deser.read_map(member, container, |mut map, key, deser| {
  205         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  206         -
                            Ok(map)
  207         -
                        })?
         213  +
                        let mut container = std::collections::HashMap::new();
         214  +
                        deser.read_map(member, &mut |key, deser| {
         215  +
                            container.insert(key, crate::types::AttributeValue::deserialize(deser)?);
         216  +
                            Ok(())
         217  +
                        })?;
         218  +
                        container
  208    219   
                    });
  209    220   
                }
  210    221   
                Some(4) => {
  211    222   
                    builder.consumed_capacity = Some(crate::types::ConsumedCapacity::deserialize(deser)?);
  212    223   
                }
  213    224   
                _ => {}
  214    225   
            }
  215    226   
            Ok(())
  216    227   
        })?;
  217    228   
        Ok(builder.build())
  218    229   
    }
  219    230   
}
         231  +
impl ScanOutput {
         232  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         233  +
    pub fn deserialize_with_response(
         234  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         235  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         236  +
        _status: u16,
         237  +
        _body: &[u8],
         238  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         239  +
        Self::deserialize(deserializer)
         240  +
    }
         241  +
}
  220    242   
impl ScanOutput {
  221    243   
    /// Creates a new builder-style object to manufacture [`ScanOutput`](crate::operation::scan::ScanOutput).
  222    244   
    pub fn builder() -> crate::operation::scan::builders::ScanOutputBuilder {
  223    245   
        crate::operation::scan::builders::ScanOutputBuilder::default()
  224    246   
    }
  225    247   
}
  226    248   
  227    249   
/// A builder for [`ScanOutput`](crate::operation::scan::ScanOutput).
  228    250   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  229    251   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/tag_resource.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 `TagResource`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TagResource;
    6      6   
impl TagResource {
    7      7   
    /// Creates a new `TagResource`
    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::tag_resource::TagResourceInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::tag_resource::TagResourceOutput::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::tag_resource::TagResourceInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::tag_resource::TagResourceOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::tag_resource::TagResourceError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +228,361 @@
  121    125   
                crate::operation::tag_resource::TagResourceError,
  122    126   
            >::new());
  123    127   
  124    128   
        ::std::borrow::Cow::Owned(rcb)
  125    129   
    }
  126    130   
}
  127    131   
  128    132   
#[derive(Debug)]
  129    133   
struct TagResourceResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TagResourceResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 200 || force_error {
  142         -
            crate::protocol_serde::shape_tag_resource::de_tag_resource_http_error(status, headers, body)
         144  +
        if !success && status != 200 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::tag_resource::TagResourceError::unhandled(generic)),
         158  +
                    ))
         159  +
                }
         160  +
            };
         161  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         162  +
            let protocol = _cfg
         163  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         164  +
                .expect("a SharedClientProtocol is required");
         165  +
            let err = match error_code {
         166  +
                "InternalServerError" => crate::operation::tag_resource::TagResourceError::InternalServerError({
         167  +
                    let mut tmp = match protocol
         168  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         169  +
                        .and_then(|mut deser| {
         170  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         171  +
                                &mut *deser,
         172  +
                                response.headers(),
         173  +
                                response.status().into(),
         174  +
                                body,
         175  +
                            )
         176  +
                        }) {
         177  +
                        ::std::result::Result::Ok(val) => val,
         178  +
                        ::std::result::Result::Err(e) => {
         179  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         180  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         181  +
                            ))
         182  +
                        }
         183  +
                    };
         184  +
                    tmp.meta = generic;
         185  +
                    if tmp.message.is_none() {
         186  +
                        tmp.message = _error_message;
         187  +
                    }
         188  +
                    tmp
         189  +
                }),
         190  +
                "InvalidEndpointException" => crate::operation::tag_resource::TagResourceError::InvalidEndpointError({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         195  +
                                &mut *deser,
         196  +
                                response.headers(),
         197  +
                                response.status().into(),
         198  +
                                body,
         199  +
                            )
         200  +
                        }) {
         201  +
                        ::std::result::Result::Ok(val) => val,
         202  +
                        ::std::result::Result::Err(e) => {
         203  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         204  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         205  +
                            ))
         206  +
                        }
         207  +
                    };
         208  +
                    tmp.meta = generic;
         209  +
                    if tmp.message.is_none() {
         210  +
                        tmp.message = _error_message;
         211  +
                    }
         212  +
                    tmp
         213  +
                }),
         214  +
                "LimitExceededException" => crate::operation::tag_resource::TagResourceError::LimitExceededError({
         215  +
                    let mut tmp = match protocol
         216  +
                        .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
         217  +
                        .and_then(|mut deser| {
         218  +
                            crate::types::error::LimitExceededError::deserialize_with_response(
         219  +
                                &mut *deser,
         220  +
                                response.headers(),
         221  +
                                response.status().into(),
         222  +
                                body,
         223  +
                            )
         224  +
                        }) {
         225  +
                        ::std::result::Result::Ok(val) => val,
         226  +
                        ::std::result::Result::Err(e) => {
         227  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         228  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         229  +
                            ))
         230  +
                        }
         231  +
                    };
         232  +
                    tmp.meta = generic;
         233  +
                    if tmp.message.is_none() {
         234  +
                        tmp.message = _error_message;
         235  +
                    }
         236  +
                    tmp
         237  +
                }),
         238  +
                "ResourceInUseException" => crate::operation::tag_resource::TagResourceError::ResourceInUseError({
         239  +
                    let mut tmp = match protocol
         240  +
                        .deserialize_response(response, crate::types::error::ResourceInUseError::SCHEMA, _cfg)
         241  +
                        .and_then(|mut deser| {
         242  +
                            crate::types::error::ResourceInUseError::deserialize_with_response(
         243  +
                                &mut *deser,
         244  +
                                response.headers(),
         245  +
                                response.status().into(),
         246  +
                                body,
         247  +
                            )
         248  +
                        }) {
         249  +
                        ::std::result::Result::Ok(val) => val,
         250  +
                        ::std::result::Result::Err(e) => {
         251  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         252  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         253  +
                            ))
         254  +
                        }
         255  +
                    };
         256  +
                    tmp.meta = generic;
         257  +
                    if tmp.message.is_none() {
         258  +
                        tmp.message = _error_message;
         259  +
                    }
         260  +
                    tmp
         261  +
                }),
         262  +
                "ResourceNotFoundException" => crate::operation::tag_resource::TagResourceError::ResourceNotFoundError({
         263  +
                    let mut tmp = match protocol
         264  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         265  +
                        .and_then(|mut deser| {
         266  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         267  +
                                &mut *deser,
         268  +
                                response.headers(),
         269  +
                                response.status().into(),
         270  +
                                body,
         271  +
                            )
         272  +
                        }) {
         273  +
                        ::std::result::Result::Ok(val) => val,
         274  +
                        ::std::result::Result::Err(e) => {
         275  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         276  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         277  +
                            ))
         278  +
                        }
         279  +
                    };
         280  +
                    tmp.meta = generic;
         281  +
                    if tmp.message.is_none() {
         282  +
                        tmp.message = _error_message;
         283  +
                    }
         284  +
                    tmp
         285  +
                }),
         286  +
                _ => crate::operation::tag_resource::TagResourceError::generic(generic),
         287  +
            };
         288  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         289  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         290  +
            ))
  143    291   
        } else {
  144         -
            crate::protocol_serde::shape_tag_resource::de_tag_resource_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         292  +
            let protocol = _cfg
         293  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         294  +
                .expect("a SharedClientProtocol is required");
         295  +
            let mut deser = protocol.deserialize_response(response, TagResource::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         296  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         297  +
            })?;
         298  +
            let body = response.body().bytes().expect("body loaded");
         299  +
            let output = crate::operation::tag_resource::TagResourceOutput::deserialize_with_response(
         300  +
                &mut *deser,
         301  +
                response.headers(),
         302  +
                response.status().into(),
         303  +
                body,
         304  +
            )
         305  +
            .map_err(|e| {
         306  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         307  +
            })?;
         308  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         309  +
        }
  147    310   
    }
  148    311   
}
  149    312   
#[derive(Debug)]
  150    313   
struct TagResourceRequestSerializer;
  151    314   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TagResourceRequestSerializer {
  152    315   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    316   
    fn serialize_input(
  154    317   
        &self,
  155    318   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    319   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    320   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    321   
        let input = input
  159    322   
            .downcast::<crate::operation::tag_resource::TagResourceInput>()
  160    323   
            .expect("correct type");
  161         -
        let _header_serialization_settings = _cfg
  162         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163         -
            .cloned()
  164         -
            .unwrap_or_default();
  165         -
        let mut request_builder = {
  166         -
            #[allow(clippy::uninlined_format_args)]
  167         -
            fn uri_base(
  168         -
                _input: &crate::operation::tag_resource::TagResourceInput,
  169         -
                output: &mut ::std::string::String,
  170         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  171         -
                use ::std::fmt::Write as _;
  172         -
                ::std::write!(output, "/").expect("formatting should succeed");
  173         -
                ::std::result::Result::Ok(())
  174         -
            }
  175         -
            #[allow(clippy::unnecessary_wraps)]
  176         -
            fn update_http_builder(
  177         -
                input: &crate::operation::tag_resource::TagResourceInput,
  178         -
                builder: ::http_1x::request::Builder,
  179         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  180         -
                let mut uri = ::std::string::String::new();
  181         -
                uri_base(input, &mut uri)?;
  182         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  183         -
            }
  184         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  185         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  186         -
            builder = _header_serialization_settings.set_default_header(
  187         -
                builder,
  188         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  189         -
                "DynamoDB_20120810.TagResource",
  190         -
            );
  191         -
            builder
  192         -
        };
  193         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_tag_resource::ser_tag_resource_input(&input)?);
  194         -
        if let Some(content_length) = body.content_length() {
  195         -
            let content_length = content_length.to_string();
  196         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  197         -
        }
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         324  +
        let protocol = _cfg
         325  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         326  +
            .expect("a SharedClientProtocol is required");
         327  +
        let mut request = protocol
         328  +
            .serialize_request(&input, TagResource::INPUT_SCHEMA, "", _cfg)
         329  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         330  +
         331  +
        return ::std::result::Result::Ok(request);
  199    332   
    }
  200    333   
}
  201    334   
#[derive(Debug)]
  202    335   
struct TagResourceEndpointParamsInterceptor;
  203    336   
  204    337   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TagResourceEndpointParamsInterceptor {
  205    338   
    fn name(&self) -> &'static str {
  206    339   
        "TagResourceEndpointParamsInterceptor"
  207    340   
    }
  208    341   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/tag_resource/_tag_resource_input.rs

@@ -5,5 +150,160 @@
   25     25   
    "com.amazonaws.dynamodb.synthetic",
   26     26   
    "TagResourceInput",
   27     27   
);
   28     28   
static TAGRESOURCEINPUT_MEMBER_RESOURCE_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   29     29   
    ::aws_smithy_schema::ShapeId::from_static(
   30     30   
        "com.amazonaws.dynamodb.synthetic#TagResourceInput$ResourceArn",
   31     31   
        "com.amazonaws.dynamodb.synthetic",
   32     32   
        "TagResourceInput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::String,
   35         -
    "resource_arn",
          35  +
    "ResourceArn",
   36     36   
    0,
   37     37   
);
   38     38   
static TAGRESOURCEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.dynamodb.synthetic#TagResourceInput$Tags",
   41     41   
        "com.amazonaws.dynamodb.synthetic",
   42     42   
        "TagResourceInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::List,
   45         -
    "tags",
          45  +
    "Tags",
   46     46   
    1,
   47     47   
);
   48     48   
static TAGRESOURCEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    TAGRESOURCEINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&TAGRESOURCEINPUT_MEMBER_RESOURCE_ARN, &TAGRESOURCEINPUT_MEMBER_TAGS],
   52     52   
);
   53     53   
impl TagResourceInput {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TAGRESOURCEINPUT_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for TagResourceInput {
   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   
        if let Some(ref val) = self.resource_arn {
   64     64   
            ser.write_string(&TAGRESOURCEINPUT_MEMBER_RESOURCE_ARN, val)?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.tags {
   67     67   
            ser.write_list(
   68     68   
                &TAGRESOURCEINPUT_MEMBER_TAGS,
   69     69   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     70   
                    for item in val {
   71     71   
                        ser.write_struct(crate::types::Tag::SCHEMA, item)?;
   72     72   
                    }
   73     73   
                    Ok(())
   74     74   
                },
   75     75   
            )?;
   76     76   
        }
   77     77   
        Ok(())
   78     78   
    }
   79     79   
}
   80     80   
impl TagResourceInput {
   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(&TAGRESOURCEINPUT_SCHEMA, (), |_, member, deser| {
          94  +
        deserializer.read_struct(&TAGRESOURCEINPUT_SCHEMA, &mut |member, deser| {
   95     95   
            match member.member_index() {
   96     96   
                Some(0) => {
   97     97   
                    builder.resource_arn = Some(deser.read_string(member)?);
   98     98   
                }
   99     99   
                Some(1) => {
  100    100   
                    builder.tags = Some({
  101         -
                        let container = if let Some(cap) = deser.container_size() {
  102         -
                            Vec::with_capacity(cap)
  103         -
                        } else {
  104         -
                            Vec::new()
  105         -
                        };
  106         -
                        deser.read_list(member, container, |mut list, deser| {
  107         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  108         -
                            Ok(list)
  109         -
                        })?
         101  +
                        let mut container = Vec::new();
         102  +
                        deser.read_list(member, &mut |deser| {
         103  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         104  +
                            Ok(())
         105  +
                        })?;
         106  +
                        container
  110    107   
                    });
  111    108   
                }
  112    109   
                _ => {}
  113    110   
            }
  114    111   
            Ok(())
  115    112   
        })?;
         113  +
        builder.resource_arn = builder.resource_arn.or(Some(String::new()));
         114  +
        builder.tags = builder.tags.or(Some(Vec::new()));
  116    115   
        builder
  117    116   
            .build()
  118    117   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  119    118   
    }
  120    119   
}
         120  +
impl TagResourceInput {
         121  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         122  +
    pub fn deserialize_with_response(
         123  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         124  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         125  +
        _status: u16,
         126  +
        _body: &[u8],
         127  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         128  +
        Self::deserialize(deserializer)
         129  +
    }
         130  +
}
  121    131   
impl TagResourceInput {
  122    132   
    /// Creates a new builder-style object to manufacture [`TagResourceInput`](crate::operation::tag_resource::TagResourceInput).
  123    133   
    pub fn builder() -> crate::operation::tag_resource::builders::TagResourceInputBuilder {
  124    134   
        crate::operation::tag_resource::builders::TagResourceInputBuilder::default()
  125    135   
    }
  126    136   
}
  127    137   
  128    138   
/// A builder for [`TagResourceInput`](crate::operation::tag_resource::TagResourceInput).
  129    139   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  130    140   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/tag_resource/_tag_resource_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 TagResourceOutput {
   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(&TAGRESOURCEOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&TAGRESOURCEOUTPUT_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 TagResourceOutput {
          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 TagResourceOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput).
   51     62   
    pub fn builder() -> crate::operation::tag_resource::builders::TagResourceOutputBuilder {
   52     63   
        crate::operation::tag_resource::builders::TagResourceOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput).
   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/dynamo/rust-client-codegen/src/operation/transact_get_items.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 `TransactGetItems`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TransactGetItems;
    6      6   
impl TransactGetItems {
    7      7   
    /// Creates a new `TransactGetItems`
    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::transact_get_items::TransactGetItemsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::transact_get_items::TransactGetItemsOutput::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::transact_get_items::TransactGetItemsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::transact_get_items::TransactGetItemsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::transact_get_items::TransactGetItemsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +231,394 @@
  124    128   
                crate::operation::transact_get_items::TransactGetItemsError,
  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 TransactGetItemsResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TransactGetItemsResponseDeserializer {
  134         -
    fn deserialize_nonstreaming(
         138  +
    fn deserialize_nonstreaming_with_config(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_transact_get_items::de_transact_get_items_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         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  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            let error_code = match generic.code() {
         157  +
                ::std::option::Option::Some(code) => code,
         158  +
                ::std::option::Option::None => {
         159  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         160  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::transact_get_items::TransactGetItemsError::unhandled(
         161  +
                            generic,
         162  +
                        )),
         163  +
                    ))
         164  +
                }
         165  +
            };
         166  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         167  +
            let protocol = _cfg
         168  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         169  +
                .expect("a SharedClientProtocol is required");
         170  +
            let err = match error_code {
         171  +
                "InternalServerError" => crate::operation::transact_get_items::TransactGetItemsError::InternalServerError({
         172  +
                    let mut tmp = match protocol
         173  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         174  +
                        .and_then(|mut deser| {
         175  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         176  +
                                &mut *deser,
         177  +
                                response.headers(),
         178  +
                                response.status().into(),
         179  +
                                body,
         180  +
                            )
         181  +
                        }) {
         182  +
                        ::std::result::Result::Ok(val) => val,
         183  +
                        ::std::result::Result::Err(e) => {
         184  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         185  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         186  +
                            ))
         187  +
                        }
         188  +
                    };
         189  +
                    tmp.meta = generic;
         190  +
                    if tmp.message.is_none() {
         191  +
                        tmp.message = _error_message;
         192  +
                    }
         193  +
                    tmp
         194  +
                }),
         195  +
                "InvalidEndpointException" => crate::operation::transact_get_items::TransactGetItemsError::InvalidEndpointError({
         196  +
                    let mut tmp = match protocol
         197  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         198  +
                        .and_then(|mut deser| {
         199  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         200  +
                                &mut *deser,
         201  +
                                response.headers(),
         202  +
                                response.status().into(),
         203  +
                                body,
         204  +
                            )
         205  +
                        }) {
         206  +
                        ::std::result::Result::Ok(val) => val,
         207  +
                        ::std::result::Result::Err(e) => {
         208  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         209  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         210  +
                            ))
         211  +
                        }
         212  +
                    };
         213  +
                    tmp.meta = generic;
         214  +
                    if tmp.message.is_none() {
         215  +
                        tmp.message = _error_message;
         216  +
                    }
         217  +
                    tmp
         218  +
                }),
         219  +
                "ProvisionedThroughputExceededException" => {
         220  +
                    crate::operation::transact_get_items::TransactGetItemsError::ProvisionedThroughputExceededError({
         221  +
                        let mut tmp = match protocol
         222  +
                            .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededError::SCHEMA, _cfg)
         223  +
                            .and_then(|mut deser| {
         224  +
                                crate::types::error::ProvisionedThroughputExceededError::deserialize_with_response(
         225  +
                                    &mut *deser,
         226  +
                                    response.headers(),
         227  +
                                    response.status().into(),
         228  +
                                    body,
         229  +
                                )
         230  +
                            }) {
         231  +
                            ::std::result::Result::Ok(val) => val,
         232  +
                            ::std::result::Result::Err(e) => {
         233  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         234  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         235  +
                                ))
         236  +
                            }
         237  +
                        };
         238  +
                        tmp.meta = generic;
         239  +
                        if tmp.message.is_none() {
         240  +
                            tmp.message = _error_message;
         241  +
                        }
         242  +
                        tmp
         243  +
                    })
         244  +
                }
         245  +
                "RequestLimitExceeded" => crate::operation::transact_get_items::TransactGetItemsError::RequestLimitExceeded({
         246  +
                    let mut tmp = match protocol
         247  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         248  +
                        .and_then(|mut deser| {
         249  +
                            crate::types::error::RequestLimitExceeded::deserialize_with_response(
         250  +
                                &mut *deser,
         251  +
                                response.headers(),
         252  +
                                response.status().into(),
         253  +
                                body,
         254  +
                            )
         255  +
                        }) {
         256  +
                        ::std::result::Result::Ok(val) => val,
         257  +
                        ::std::result::Result::Err(e) => {
         258  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         259  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         260  +
                            ))
         261  +
                        }
         262  +
                    };
         263  +
                    tmp.meta = generic;
         264  +
                    if tmp.message.is_none() {
         265  +
                        tmp.message = _error_message;
         266  +
                    }
         267  +
                    tmp
         268  +
                }),
         269  +
                "ResourceNotFoundException" => crate::operation::transact_get_items::TransactGetItemsError::ResourceNotFoundError({
         270  +
                    let mut tmp = match protocol
         271  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         272  +
                        .and_then(|mut deser| {
         273  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         274  +
                                &mut *deser,
         275  +
                                response.headers(),
         276  +
                                response.status().into(),
         277  +
                                body,
         278  +
                            )
         279  +
                        }) {
         280  +
                        ::std::result::Result::Ok(val) => val,
         281  +
                        ::std::result::Result::Err(e) => {
         282  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         283  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         284  +
                            ))
         285  +
                        }
         286  +
                    };
         287  +
                    tmp.meta = generic;
         288  +
                    if tmp.message.is_none() {
         289  +
                        tmp.message = _error_message;
         290  +
                    }
         291  +
                    tmp
         292  +
                }),
         293  +
                "TransactionCanceledException" => crate::operation::transact_get_items::TransactGetItemsError::TransactionCanceledError({
         294  +
                    let mut tmp = match protocol
         295  +
                        .deserialize_response(response, crate::types::error::TransactionCanceledError::SCHEMA, _cfg)
         296  +
                        .and_then(|mut deser| {
         297  +
                            crate::types::error::TransactionCanceledError::deserialize_with_response(
         298  +
                                &mut *deser,
         299  +
                                response.headers(),
         300  +
                                response.status().into(),
         301  +
                                body,
         302  +
                            )
         303  +
                        }) {
         304  +
                        ::std::result::Result::Ok(val) => val,
         305  +
                        ::std::result::Result::Err(e) => {
         306  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         307  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         308  +
                            ))
         309  +
                        }
         310  +
                    };
         311  +
                    tmp.meta = generic;
         312  +
                    if tmp.message.is_none() {
         313  +
                        tmp.message = _error_message;
         314  +
                    }
         315  +
                    tmp
         316  +
                }),
         317  +
                _ => crate::operation::transact_get_items::TransactGetItemsError::generic(generic),
         318  +
            };
         319  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         320  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         321  +
            ))
  146    322   
        } else {
  147         -
            crate::protocol_serde::shape_transact_get_items::de_transact_get_items_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         323  +
            let protocol = _cfg
         324  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         325  +
                .expect("a SharedClientProtocol is required");
         326  +
            let mut deser = protocol
         327  +
                .deserialize_response(response, TransactGetItems::OUTPUT_SCHEMA, _cfg)
         328  +
                .map_err(|e| {
         329  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         330  +
                })?;
         331  +
            let body = response.body().bytes().expect("body loaded");
         332  +
            let output = crate::operation::transact_get_items::TransactGetItemsOutput::deserialize_with_response(
         333  +
                &mut *deser,
         334  +
                response.headers(),
         335  +
                response.status().into(),
         336  +
                body,
         337  +
            )
         338  +
            .map_err(|e| {
         339  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         340  +
            })?;
         341  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         342  +
        }
  150    343   
    }
  151    344   
}
  152    345   
#[derive(Debug)]
  153    346   
struct TransactGetItemsRequestSerializer;
  154    347   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TransactGetItemsRequestSerializer {
  155    348   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    349   
    fn serialize_input(
  157    350   
        &self,
  158    351   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    352   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    353   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    354   
        let input = input
  162    355   
            .downcast::<crate::operation::transact_get_items::TransactGetItemsInput>()
  163    356   
            .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::transact_get_items::TransactGetItemsInput,
  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::transact_get_items::TransactGetItemsInput,
  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.0");
  189         -
            builder = _header_serialization_settings.set_default_header(
  190         -
                builder,
  191         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192         -
                "DynamoDB_20120810.TransactGetItems",
  193         -
            );
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_transact_get_items::ser_transact_get_items_input(&input)?);
  197         -
        if let Some(content_length) = body.content_length() {
  198         -
            let content_length = content_length.to_string();
  199         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  200         -
        }
  201         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         357  +
        let protocol = _cfg
         358  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         359  +
            .expect("a SharedClientProtocol is required");
         360  +
        let mut request = protocol
         361  +
            .serialize_request(&input, TransactGetItems::INPUT_SCHEMA, "", _cfg)
         362  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         363  +
         364  +
        return ::std::result::Result::Ok(request);
  202    365   
    }
  203    366   
}
  204    367   
#[derive(Debug)]
  205    368   
struct TransactGetItemsEndpointParamsInterceptor;
  206    369   
  207    370   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TransactGetItemsEndpointParamsInterceptor {
  208    371   
    fn name(&self) -> &'static str {
  209    372   
        "TransactGetItemsEndpointParamsInterceptor"
  210    373   
    }
  211    374   

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/transact_get_items/_transact_get_items_input.rs

@@ -5,5 +153,162 @@
   25     25   
    "com.amazonaws.dynamodb.synthetic",
   26     26   
    "TransactGetItemsInput",
   27     27   
);
   28     28   
static TRANSACTGETITEMSINPUT_MEMBER_TRANSACT_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   29     29   
    ::aws_smithy_schema::ShapeId::from_static(
   30     30   
        "com.amazonaws.dynamodb.synthetic#TransactGetItemsInput$TransactItems",
   31     31   
        "com.amazonaws.dynamodb.synthetic",
   32     32   
        "TransactGetItemsInput",
   33     33   
    ),
   34     34   
    ::aws_smithy_schema::ShapeType::List,
   35         -
    "transact_items",
          35  +
    "TransactItems",
   36     36   
    0,
   37     37   
);
   38     38   
static TRANSACTGETITEMSINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.dynamodb.synthetic#TransactGetItemsInput$ReturnConsumedCapacity",
   41     41   
        "com.amazonaws.dynamodb.synthetic",
   42     42   
        "TransactGetItemsInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::String,
   45         -
    "return_consumed_capacity",
          45  +
    "ReturnConsumedCapacity",
   46     46   
    1,
   47     47   
);
   48     48   
static TRANSACTGETITEMSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    TRANSACTGETITEMSINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &TRANSACTGETITEMSINPUT_MEMBER_TRANSACT_ITEMS,
   53     53   
        &TRANSACTGETITEMSINPUT_MEMBER_RETURN_CONSUMED_CAPACITY,
   54     54   
    ],
   55     55   
);
   56     56   
impl TransactGetItemsInput {
   57     57   
    /// The schema for this shape.
   58     58   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TRANSACTGETITEMSINPUT_SCHEMA;
   59     59   
}
   60     60   
impl ::aws_smithy_schema::serde::SerializableStruct for TransactGetItemsInput {
   61     61   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     62   
    fn serialize_members(
   63     63   
        &self,
   64     64   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     65   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     66   
        if let Some(ref val) = self.transact_items {
   67     67   
            ser.write_list(
   68     68   
                &TRANSACTGETITEMSINPUT_MEMBER_TRANSACT_ITEMS,
   69     69   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   70     70   
                    for item in val {
   71     71   
                        ser.write_struct(crate::types::TransactGetItem::SCHEMA, item)?;
   72     72   
                    }
   73     73   
                    Ok(())
   74     74   
                },
   75     75   
            )?;
   76     76   
        }
   77     77   
        if let Some(ref val) = self.return_consumed_capacity {
   78     78   
            ser.write_string(&TRANSACTGETITEMSINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
   79     79   
        }
   80     80   
        Ok(())
   81     81   
    }
   82     82   
}
   83     83   
impl TransactGetItemsInput {
   84     84   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   85         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   86         -
        deserializer: &mut D,
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   87     87   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   88     88   
        #[allow(unused_variables, unused_mut)]
   89     89   
        let mut builder = Self::builder();
   90     90   
        #[allow(
   91     91   
            unused_variables,
   92     92   
            unreachable_code,
   93     93   
            clippy::single_match,
   94     94   
            clippy::match_single_binding,
   95     95   
            clippy::diverging_sub_expression
   96     96   
        )]
   97         -
        deserializer.read_struct(&TRANSACTGETITEMSINPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&TRANSACTGETITEMSINPUT_SCHEMA, &mut |member, deser| {
   98     98   
            match member.member_index() {
   99     99   
                Some(0) => {
  100    100   
                    builder.transact_items = Some({
  101         -
                        let container = if let Some(cap) = deser.container_size() {
  102         -
                            Vec::with_capacity(cap)
  103         -
                        } else {
  104         -
                            Vec::new()
  105         -
                        };
  106         -
                        deser.read_list(member, container, |mut list, deser| {
  107         -
                            list.push(crate::types::TransactGetItem::deserialize(deser)?);
  108         -
                            Ok(list)
  109         -
                        })?
         101  +
                        let mut container = Vec::new();
         102  +
                        deser.read_list(member, &mut |deser| {
         103  +
                            container.push(crate::types::TransactGetItem::deserialize(deser)?);
         104  +
                            Ok(())
         105  +
                        })?;
         106  +
                        container
  110    107   
                    });
  111    108   
                }
  112    109   
                Some(1) => {
  113    110   
                    builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
  114    111   
                }
  115    112   
                _ => {}
  116    113   
            }
  117    114   
            Ok(())
  118    115   
        })?;
         116  +
        builder.transact_items = builder.transact_items.or(Some(Vec::new()));
  119    117   
        builder
  120    118   
            .build()
  121    119   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  122    120   
    }
  123    121   
}
         122  +
impl TransactGetItemsInput {
         123  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         124  +
    pub fn deserialize_with_response(
         125  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         126  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         127  +
        _status: u16,
         128  +
        _body: &[u8],
         129  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         130  +
        Self::deserialize(deserializer)
         131  +
    }
         132  +
}
  124    133   
impl TransactGetItemsInput {
  125    134   
    /// Creates a new builder-style object to manufacture [`TransactGetItemsInput`](crate::operation::transact_get_items::TransactGetItemsInput).
  126    135   
    pub fn builder() -> crate::operation::transact_get_items::builders::TransactGetItemsInputBuilder {
  127    136   
        crate::operation::transact_get_items::builders::TransactGetItemsInputBuilder::default()
  128    137   
    }
  129    138   
}
  130    139   
  131    140   
/// A builder for [`TransactGetItemsInput`](crate::operation::transact_get_items::TransactGetItemsInput).
  132    141   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  133    142   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/transact_get_items/_transact_get_items_output.rs

@@ -9,9 +170,175 @@
   29     29   
    "com.amazonaws.dynamodb.synthetic",
   30     30   
    "TransactGetItemsOutput",
   31     31   
);
   32     32   
static TRANSACTGETITEMSOUTPUT_MEMBER_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   33     33   
    ::aws_smithy_schema::ShapeId::from_static(
   34     34   
        "com.amazonaws.dynamodb.synthetic#TransactGetItemsOutput$ConsumedCapacity",
   35     35   
        "com.amazonaws.dynamodb.synthetic",
   36     36   
        "TransactGetItemsOutput",
   37     37   
    ),
   38     38   
    ::aws_smithy_schema::ShapeType::List,
   39         -
    "consumed_capacity",
          39  +
    "ConsumedCapacity",
   40     40   
    0,
   41     41   
);
   42     42   
static TRANSACTGETITEMSOUTPUT_MEMBER_RESPONSES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   43     43   
    ::aws_smithy_schema::ShapeId::from_static(
   44     44   
        "com.amazonaws.dynamodb.synthetic#TransactGetItemsOutput$Responses",
   45     45   
        "com.amazonaws.dynamodb.synthetic",
   46     46   
        "TransactGetItemsOutput",
   47     47   
    ),
   48     48   
    ::aws_smithy_schema::ShapeType::List,
   49         -
    "responses",
          49  +
    "Responses",
   50     50   
    1,
   51     51   
);
   52     52   
static TRANSACTGETITEMSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   53     53   
    TRANSACTGETITEMSOUTPUT_SCHEMA_ID,
   54     54   
    ::aws_smithy_schema::ShapeType::Structure,
   55     55   
    &[&TRANSACTGETITEMSOUTPUT_MEMBER_CONSUMED_CAPACITY, &TRANSACTGETITEMSOUTPUT_MEMBER_RESPONSES],
   56     56   
);
   57     57   
impl TransactGetItemsOutput {
   58     58   
    /// The schema for this shape.
   59     59   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TRANSACTGETITEMSOUTPUT_SCHEMA;
   60     60   
}
   61     61   
impl ::aws_smithy_schema::serde::SerializableStruct for TransactGetItemsOutput {
   62     62   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   63     63   
    fn serialize_members(
   64     64   
        &self,
   65     65   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   66     66   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   67     67   
        if let Some(ref val) = self.consumed_capacity {
   68     68   
            ser.write_list(
   69     69   
                &TRANSACTGETITEMSOUTPUT_MEMBER_CONSUMED_CAPACITY,
   70     70   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   71     71   
                    for item in val {
   72     72   
                        ser.write_struct(crate::types::ConsumedCapacity::SCHEMA, item)?;
   73     73   
                    }
   74     74   
                    Ok(())
   75     75   
                },
   76     76   
            )?;
   77     77   
        }
   78     78   
        if let Some(ref val) = self.responses {
   79     79   
            ser.write_list(
   80     80   
                &TRANSACTGETITEMSOUTPUT_MEMBER_RESPONSES,
   81     81   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   82     82   
                    for item in val {
   83     83   
                        ser.write_struct(crate::types::ItemResponse::SCHEMA, item)?;
   84     84   
                    }
   85     85   
                    Ok(())
   86     86   
                },
   87     87   
            )?;
   88     88   
        }
   89     89   
        Ok(())
   90     90   
    }
   91     91   
}
   92     92   
impl TransactGetItemsOutput {
   93     93   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   94         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   95         -
        deserializer: &mut D,
          94  +
    pub fn deserialize(
          95  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   96     96   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   97     97   
        #[allow(unused_variables, unused_mut)]
   98     98   
        let mut builder = Self::builder();
   99     99   
        #[allow(
  100    100   
            unused_variables,
  101    101   
            unreachable_code,
  102    102   
            clippy::single_match,
  103    103   
            clippy::match_single_binding,
  104    104   
            clippy::diverging_sub_expression
  105    105   
        )]
  106         -
        deserializer.read_struct(&TRANSACTGETITEMSOUTPUT_SCHEMA, (), |_, member, deser| {
         106  +
        deserializer.read_struct(&TRANSACTGETITEMSOUTPUT_SCHEMA, &mut |member, deser| {
  107    107   
            match member.member_index() {
  108    108   
                Some(0) => {
  109    109   
                    builder.consumed_capacity = Some({
  110         -
                        let container = if let Some(cap) = deser.container_size() {
  111         -
                            Vec::with_capacity(cap)
  112         -
                        } else {
  113         -
                            Vec::new()
  114         -
                        };
  115         -
                        deser.read_list(member, container, |mut list, deser| {
  116         -
                            list.push(crate::types::ConsumedCapacity::deserialize(deser)?);
  117         -
                            Ok(list)
  118         -
                        })?
         110  +
                        let mut container = Vec::new();
         111  +
                        deser.read_list(member, &mut |deser| {
         112  +
                            container.push(crate::types::ConsumedCapacity::deserialize(deser)?);
         113  +
                            Ok(())
         114  +
                        })?;
         115  +
                        container
  119    116   
                    });
  120    117   
                }
  121    118   
                Some(1) => {
  122    119   
                    builder.responses = Some({
  123         -
                        let container = if let Some(cap) = deser.container_size() {
  124         -
                            Vec::with_capacity(cap)
  125         -
                        } else {
  126         -
                            Vec::new()
  127         -
                        };
  128         -
                        deser.read_list(member, container, |mut list, deser| {
  129         -
                            list.push(crate::types::ItemResponse::deserialize(deser)?);
  130         -
                            Ok(list)
  131         -
                        })?
         120  +
                        let mut container = Vec::new();
         121  +
                        deser.read_list(member, &mut |deser| {
         122  +
                            container.push(crate::types::ItemResponse::deserialize(deser)?);
         123  +
                            Ok(())
         124  +
                        })?;
         125  +
                        container
  132    126   
                    });
  133    127   
                }
  134    128   
                _ => {}
  135    129   
            }
  136    130   
            Ok(())
  137    131   
        })?;
  138    132   
        Ok(builder.build())
  139    133   
    }
  140    134   
}
         135  +
impl TransactGetItemsOutput {
         136  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         137  +
    pub fn deserialize_with_response(
         138  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         139  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         140  +
        _status: u16,
         141  +
        _body: &[u8],
         142  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         143  +
        Self::deserialize(deserializer)
         144  +
    }
         145  +
}
  141    146   
impl TransactGetItemsOutput {
  142    147   
    /// Creates a new builder-style object to manufacture [`TransactGetItemsOutput`](crate::operation::transact_get_items::TransactGetItemsOutput).
  143    148   
    pub fn builder() -> crate::operation::transact_get_items::builders::TransactGetItemsOutputBuilder {
  144    149   
        crate::operation::transact_get_items::builders::TransactGetItemsOutputBuilder::default()
  145    150   
    }
  146    151   
}
  147    152   
  148    153   
/// A builder for [`TransactGetItemsOutput`](crate::operation::transact_get_items::TransactGetItemsOutput).
  149    154   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  150    155   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/operation/transact_write_items.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 `TransactWriteItems`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct TransactWriteItems;
    6      6   
impl TransactWriteItems {
    7      7   
    /// Creates a new `TransactWriteItems`
    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::transact_write_items::TransactWriteItemsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::transact_write_items::TransactWriteItemsOutput::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::transact_write_items::TransactWriteItemsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::transact_write_items::TransactWriteItemsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::transact_write_items::TransactWriteItemsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -111,115 +239,451 @@
  131    135   
                crate::operation::transact_write_items::TransactWriteItemsError,
  132    136   
            >::new());
  133    137   
  134    138   
        ::std::borrow::Cow::Owned(rcb)
  135    139   
    }
  136    140   
}
  137    141   
  138    142   
#[derive(Debug)]
  139    143   
struct TransactWriteItemsResponseDeserializer;
  140    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TransactWriteItemsResponseDeserializer {
  141         -
    fn deserialize_nonstreaming(
         145  +
    fn deserialize_nonstreaming_with_config(
  142    146   
        &self,
  143    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         148  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  144    149   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  145    150   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  146         -
        let headers = response.headers();
  147         -
        let body = response.body().bytes().expect("body loaded");
  148    151   
        #[allow(unused_mut)]
  149    152   
        let mut force_error = false;
  150    153   
  151         -
        let parse_result = if !success && status != 200 || force_error {
  152         -
            crate::protocol_serde::shape_transact_write_items::de_transact_write_items_http_error(status, headers, body)
         154  +
        if !success && status != 200 || force_error {
         155  +
            let headers = response.headers();
         156  +
            let body = response.body().bytes().expect("body loaded");
         157  +
            #[allow(unused_mut)]
         158  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         159  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         160  +
            })?;
         161  +
         162  +
            let generic = generic_builder.build();
         163  +
            let error_code = match generic.code() {
         164  +
                ::std::option::Option::Some(code) => code,
         165  +
                ::std::option::Option::None => {
         166  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         167  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         168  +
                            crate::operation::transact_write_items::TransactWriteItemsError::unhandled(generic),
         169  +
                        ),
         170  +
                    ))
         171  +
                }
         172  +
            };
         173  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         174  +
            let protocol = _cfg
         175  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         176  +
                .expect("a SharedClientProtocol is required");
         177  +
            let err = match error_code {
         178  +
                "IdempotentParameterMismatchException" => {
         179  +
                    crate::operation::transact_write_items::TransactWriteItemsError::IdempotentParameterMismatchError({
         180  +
                        let mut tmp = match protocol
         181  +
                            .deserialize_response(response, crate::types::error::IdempotentParameterMismatchError::SCHEMA, _cfg)
         182  +
                            .and_then(|mut deser| {
         183  +
                                crate::types::error::IdempotentParameterMismatchError::deserialize_with_response(
         184  +
                                    &mut *deser,
         185  +
                                    response.headers(),
         186  +
                                    response.status().into(),
         187  +
                                    body,
         188  +
                                )
         189  +
                            }) {
         190  +
                            ::std::result::Result::Ok(val) => val,
         191  +
                            ::std::result::Result::Err(e) => {
         192  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         193  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         194  +
                                ))
         195  +
                            }
         196  +
                        };
         197  +
                        tmp.meta = generic;
         198  +
                        if tmp.message.is_none() {
         199  +
                            tmp.message = _error_message;
         200  +
                        }
         201  +
                        tmp
         202  +
                    })
         203  +
                }
         204  +
                "InternalServerError" => crate::operation::transact_write_items::TransactWriteItemsError::InternalServerError({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         209  +
                                &mut *deser,
         210  +
                                response.headers(),
         211  +
                                response.status().into(),
         212  +
                                body,
         213  +
                            )
         214  +
                        }) {
         215  +
                        ::std::result::Result::Ok(val) => val,
         216  +
                        ::std::result::Result::Err(e) => {
         217  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         218  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         219  +
                            ))
         220  +
                        }
         221  +
                    };
         222  +
                    tmp.meta = generic;
         223  +
                    if tmp.message.is_none() {
         224  +
                        tmp.message = _error_message;
         225  +
                    }
         226  +
                    tmp
         227  +
                }),
         228  +
                "InvalidEndpointException" => crate::operation::transact_write_items::TransactWriteItemsError::InvalidEndpointError({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::InvalidEndpointError::deserialize_with_response(
         233  +
                                &mut *deser,
         234  +
                                response.headers(),
         235  +
                                response.status().into(),
         236  +
                                body,
         237  +
                            )
         238  +
                        }) {
         239  +
                        ::std::result::Result::Ok(val) => val,
         240  +
                        ::std::result::Result::Err(e) => {
         241  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         242  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         243  +
                            ))
         244  +
                        }
         245  +
                    };
         246  +
                    tmp.meta = generic;
         247  +
                    if tmp.message.is_none() {
         248  +
                        tmp.message = _error_message;
         249  +
                    }
         250  +
                    tmp
         251  +
                }),
         252  +
                "ProvisionedThroughputExceededException" => {
         253  +
                    crate::operation::transact_write_items::TransactWriteItemsError::ProvisionedThroughputExceededError({
         254  +
                        let mut tmp = match protocol
         255  +
                            .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededError::SCHEMA, _cfg)
         256  +
                            .and_then(|mut deser| {
         257  +
                                crate::types::error::ProvisionedThroughputExceededError::deserialize_with_response(
         258  +
                                    &mut *deser,
         259  +
                                    response.headers(),
         260  +
                                    response.status().into(),
         261  +
                                    body,
         262  +
                                )
         263  +
                            }) {
         264  +
                            ::std::result::Result::Ok(val) => val,
         265  +
                            ::std::result::Result::Err(e) => {
         266  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         267  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         268  +
                                ))
         269  +
                            }
         270  +
                        };
         271  +
                        tmp.meta = generic;
         272  +
                        if tmp.message.is_none() {
         273  +
                            tmp.message = _error_message;
         274  +
                        }
         275  +
                        tmp
         276  +
                    })
         277  +
                }
         278  +
                "RequestLimitExceeded" => crate::operation::transact_write_items::TransactWriteItemsError::RequestLimitExceeded({
         279  +
                    let mut tmp = match protocol
         280  +
                        .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
         281  +
                        .and_then(|mut deser| {
         282  +
                            crate::types::error::RequestLimitExceeded::deserialize_with_response(
         283  +
                                &mut *deser,
         284  +
                                response.headers(),
         285  +
                                response.status().into(),
         286  +
                                body,
         287  +
                            )
         288  +
                        }) {
         289  +
                        ::std::result::Result::Ok(val) => val,
         290  +
                        ::std::result::Result::Err(e) => {
         291  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         292  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         293  +
                            ))
         294  +
                        }
         295  +
                    };
         296  +
                    tmp.meta = generic;
         297  +
                    if tmp.message.is_none() {
         298  +
                        tmp.message = _error_message;
         299  +
                    }
         300  +
                    tmp
         301  +
                }),
         302  +
                "ResourceNotFoundException" => crate::operation::transact_write_items::TransactWriteItemsError::ResourceNotFoundError({
         303  +
                    let mut tmp = match protocol
         304  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         305  +
                        .and_then(|mut deser| {
         306  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         307  +
                                &mut *deser,
         308  +
                                response.headers(),
         309  +
                                response.status().into(),
         310  +
                                body,
         311  +
                            )
         312  +
                        }) {
         313  +
                        ::std::result::Result::Ok(val) => val,
         314  +
                        ::std::result::Result::Err(e) => {
         315  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         316  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         317  +
                            ))
         318  +
                        }
         319  +
                    };
         320  +
                    tmp.meta = generic;
         321  +
                    if tmp.message.is_none() {
         322  +
                        tmp.message = _error_message;
         323  +
                    }
         324  +
                    tmp
         325  +
                }),
         326  +
                "TransactionCanceledException" => crate::operation::transact_write_items::TransactWriteItemsError::TransactionCanceledError({
         327  +
                    let mut tmp = match protocol
         328  +
                        .deserialize_response(response, crate::types::error::TransactionCanceledError::SCHEMA, _cfg)
         329  +
                        .and_then(|mut deser| {
         330  +
                            crate::types::error::TransactionCanceledError::deserialize_with_response(
         331  +
                                &mut *deser,
         332  +
                                response.headers(),
         333  +
                                response.status().into(),
         334  +
                                body,
         335  +
                            )
         336  +
                        }) {
         337  +
                        ::std::result::Result::Ok(val) => val,
         338  +
                        ::std::result::Result::Err(e) => {
         339  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         340  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         341  +
                            ))
         342  +
                        }
         343  +
                    };
         344  +
                    tmp.meta = generic;
         345  +
                    if tmp.message.is_none() {
         346  +
                        tmp.message = _error_message;
         347  +
                    }
         348  +
                    tmp
         349  +
                }),
         350  +
                "TransactionInProgressException" => crate::operation::transact_write_items::TransactWriteItemsError::TransactionInProgressError({
         351  +
                    let mut tmp = match protocol
         352  +
                        .deserialize_response(response, crate::types::error::TransactionInProgressError::SCHEMA, _cfg)
         353  +
                        .and_then(|mut deser| {
         354  +
                            crate::types::error::TransactionInProgressError::deserialize_with_response(
         355  +
                                &mut *deser,
         356  +
                                response.headers(),
         357  +
                                response.status().into(),
         358  +
                                body,
         359  +
                            )
         360  +
                        }) {
         361  +
                        ::std::result::Result::Ok(val) => val,
         362  +
                        ::std::result::Result::Err(e) => {
         363  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         364  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         365  +
                            ))
         366  +
                        }
         367  +
                    };
         368  +
                    tmp.meta = generic;
         369  +
                    if tmp.message.is_none() {
         370  +
                        tmp.message = _error_message;
         371  +
                    }
         372  +
                    tmp
         373  +
                }),
         374  +
                _ => crate::operation::transact_write_items::TransactWriteItemsError::generic(generic),
         375  +
            };
         376  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         377  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         378  +
            ))
  153    379   
        } else {
  154         -
            crate::protocol_serde::shape_transact_write_items::de_transact_write_items_http_response(status, headers, body)
  155         -
        };
  156         -
        crate::protocol_serde::type_erase_result(parse_result)
         380  +
            let protocol = _cfg
         381  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         382  +
                .expect("a SharedClientProtocol is required");
         383  +
            let mut deser = protocol
         384  +
                .deserialize_response(response, TransactWriteItems::OUTPUT_SCHEMA, _cfg)
         385  +
                .map_err(|e| {
         386  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         387  +
                })?;
         388  +
            let body = response.body().bytes().expect("body loaded");
         389  +
            let output = crate::operation::transact_write_items::TransactWriteItemsOutput::deserialize_with_response(
         390  +
                &mut *deser,
         391  +
                response.headers(),
         392  +
                response.status().into(),
         393  +
                body,
         394  +
            )
         395  +
            .map_err(|e| {
         396  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         397  +
            })?;
         398  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         399  +
        }
  157    400   
    }
  158    401   
}
  159    402   
#[derive(Debug)]
  160    403   
struct TransactWriteItemsRequestSerializer;
  161    404   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TransactWriteItemsRequestSerializer {
  162    405   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  163    406   
    fn serialize_input(
  164    407   
        &self,
  165    408   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  166    409   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  167    410   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  168    411   
        let input = input
  169    412   
            .downcast::<crate::operation::transact_write_items::TransactWriteItemsInput>()
  170    413   
            .expect("correct type");
  171         -
        let _header_serialization_settings = _cfg
  172         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  173         -
            .cloned()
  174         -
            .unwrap_or_default();
  175         -
        let mut request_builder = {
  176         -
            #[allow(clippy::uninlined_format_args)]
  177         -
            fn uri_base(
  178         -
                _input: &crate::operation::transact_write_items::TransactWriteItemsInput,
  179         -
                output: &mut ::std::string::String,
  180         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  181         -
                use ::std::fmt::Write as _;
  182         -
                ::std::write!(output, "/").expect("formatting should succeed");
  183         -
                ::std::result::Result::Ok(())
  184         -
            }
  185         -
            #[allow(clippy::unnecessary_wraps)]
  186         -
            fn update_http_builder(
  187         -
                input: &crate::operation::transact_write_items::TransactWriteItemsInput,
  188         -
                builder: ::http_1x::request::Builder,
  189         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  190         -
                let mut uri = ::std::string::String::new();
  191         -
                uri_base(input, &mut uri)?;
  192         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  193         -
            }
  194         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  195         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  196         -
            builder = _header_serialization_settings.set_default_header(
  197         -
                builder,
  198         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  199         -
                "DynamoDB_20120810.TransactWriteItems",
  200         -
            );
  201         -
            builder
  202         -
        };
  203         -
        let body =
  204         -
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_transact_write_items::ser_transact_write_items_input(&input)?);
  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())
         414  +
        let protocol = _cfg
         415  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         416  +
            .expect("a SharedClientProtocol is required");
         417  +
        let mut request = protocol
         418  +
            .serialize_request(&input, TransactWriteItems::INPUT_SCHEMA, "", _cfg)
         419  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         420  +
         421  +
        return ::std::result::Result::Ok(request);
  210    422   
    }
  211    423   
}
  212    424   
#[derive(Debug)]
  213    425   
struct TransactWriteItemsEndpointParamsInterceptor;
  214    426   
  215    427   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TransactWriteItemsEndpointParamsInterceptor {
  216    428   
    fn name(&self) -> &'static str {
  217    429   
        "TransactWriteItemsEndpointParamsInterceptor"
  218    430   
    }
  219    431