Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_changed_blocks/_list_changed_blocks_input.rs

@@ -31,31 +217,234 @@
   51     51   
    "com.amazonaws.ebs.synthetic",
   52     52   
    "ListChangedBlocksInput",
   53     53   
);
   54     54   
static LISTCHANGEDBLOCKSINPUT_MEMBER_SECOND_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   55     55   
    ::aws_smithy_schema::ShapeId::from_static(
   56     56   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksInput$SecondSnapshotId",
   57     57   
        "com.amazonaws.ebs.synthetic",
   58     58   
        "ListChangedBlocksInput",
   59     59   
    ),
   60     60   
    ::aws_smithy_schema::ShapeType::String,
   61         -
    "second_snapshot_id",
          61  +
    "SecondSnapshotId",
   62     62   
    0,
   63     63   
)
   64     64   
.with_http_label();
   65     65   
static LISTCHANGEDBLOCKSINPUT_MEMBER_FIRST_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   66     66   
    ::aws_smithy_schema::ShapeId::from_static(
   67     67   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksInput$FirstSnapshotId",
   68     68   
        "com.amazonaws.ebs.synthetic",
   69     69   
        "ListChangedBlocksInput",
   70     70   
    ),
   71     71   
    ::aws_smithy_schema::ShapeType::String,
   72         -
    "first_snapshot_id",
          72  +
    "FirstSnapshotId",
   73     73   
    1,
   74     74   
)
   75     75   
.with_http_query("firstSnapshotId");
   76     76   
static LISTCHANGEDBLOCKSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   77     77   
    ::aws_smithy_schema::ShapeId::from_static(
   78     78   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksInput$NextToken",
   79     79   
        "com.amazonaws.ebs.synthetic",
   80     80   
        "ListChangedBlocksInput",
   81     81   
    ),
   82     82   
    ::aws_smithy_schema::ShapeType::String,
   83         -
    "next_token",
          83  +
    "NextToken",
   84     84   
    2,
   85     85   
)
   86     86   
.with_http_query("pageToken");
   87     87   
static LISTCHANGEDBLOCKSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     88   
    ::aws_smithy_schema::ShapeId::from_static(
   89     89   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksInput$MaxResults",
   90     90   
        "com.amazonaws.ebs.synthetic",
   91     91   
        "ListChangedBlocksInput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::Integer,
   94         -
    "max_results",
          94  +
    "MaxResults",
   95     95   
    3,
   96     96   
)
   97     97   
.with_http_query("maxResults");
   98     98   
static LISTCHANGEDBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99     99   
    ::aws_smithy_schema::ShapeId::from_static(
  100    100   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksInput$StartingBlockIndex",
  101    101   
        "com.amazonaws.ebs.synthetic",
  102    102   
        "ListChangedBlocksInput",
  103    103   
    ),
  104    104   
    ::aws_smithy_schema::ShapeType::Integer,
  105         -
    "starting_block_index",
         105  +
    "StartingBlockIndex",
  106    106   
    4,
  107    107   
)
  108    108   
.with_http_query("startingBlockIndex");
  109    109   
static LISTCHANGEDBLOCKSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  110    110   
    LISTCHANGEDBLOCKSINPUT_SCHEMA_ID,
  111    111   
    ::aws_smithy_schema::ShapeType::Structure,
  112    112   
    &[
  113    113   
        &LISTCHANGEDBLOCKSINPUT_MEMBER_SECOND_SNAPSHOT_ID,
  114    114   
        &LISTCHANGEDBLOCKSINPUT_MEMBER_FIRST_SNAPSHOT_ID,
  115    115   
        &LISTCHANGEDBLOCKSINPUT_MEMBER_NEXT_TOKEN,
  116    116   
        &LISTCHANGEDBLOCKSINPUT_MEMBER_MAX_RESULTS,
  117    117   
        &LISTCHANGEDBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX,
  118    118   
    ],
  119         -
);
         119  +
)
         120  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         121  +
    "GET",
         122  +
    "/snapshots/{SecondSnapshotId}/changedblocks",
         123  +
    None,
         124  +
));
  120    125   
impl ListChangedBlocksInput {
  121    126   
    /// The schema for this shape.
  122    127   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTCHANGEDBLOCKSINPUT_SCHEMA;
  123    128   
}
  124    129   
impl ::aws_smithy_schema::serde::SerializableStruct for ListChangedBlocksInput {
  125    130   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  126    131   
    fn serialize_members(
  127    132   
        &self,
  128    133   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  129    134   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  130    135   
        if let Some(ref val) = self.second_snapshot_id {
  131    136   
            ser.write_string(&LISTCHANGEDBLOCKSINPUT_MEMBER_SECOND_SNAPSHOT_ID, val)?;
  132    137   
        }
  133    138   
        if let Some(ref val) = self.first_snapshot_id {
  134    139   
            ser.write_string(&LISTCHANGEDBLOCKSINPUT_MEMBER_FIRST_SNAPSHOT_ID, val)?;
  135    140   
        }
  136    141   
        if let Some(ref val) = self.next_token {
  137    142   
            ser.write_string(&LISTCHANGEDBLOCKSINPUT_MEMBER_NEXT_TOKEN, val)?;
  138    143   
        }
  139    144   
        if let Some(ref val) = self.max_results {
  140    145   
            ser.write_integer(&LISTCHANGEDBLOCKSINPUT_MEMBER_MAX_RESULTS, *val)?;
  141    146   
        }
  142    147   
        if let Some(ref val) = self.starting_block_index {
  143    148   
            ser.write_integer(&LISTCHANGEDBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX, *val)?;
  144    149   
        }
  145    150   
        Ok(())
  146    151   
    }
  147    152   
}
  148    153   
impl ListChangedBlocksInput {
  149    154   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  150         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  151         -
        deserializer: &mut D,
         155  +
    pub fn deserialize(
         156  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  152    157   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  153    158   
        #[allow(unused_variables, unused_mut)]
  154    159   
        let mut builder = Self::builder();
  155    160   
        #[allow(
  156    161   
            unused_variables,
  157    162   
            unreachable_code,
  158    163   
            clippy::single_match,
  159    164   
            clippy::match_single_binding,
  160    165   
            clippy::diverging_sub_expression
  161    166   
        )]
  162         -
        deserializer.read_struct(&LISTCHANGEDBLOCKSINPUT_SCHEMA, (), |_, member, deser| {
         167  +
        deserializer.read_struct(&LISTCHANGEDBLOCKSINPUT_SCHEMA, &mut |member, deser| {
  163    168   
            match member.member_index() {
  164    169   
                Some(0) => {
  165    170   
                    builder.second_snapshot_id = Some(deser.read_string(member)?);
  166    171   
                }
  167    172   
                Some(1) => {
  168    173   
                    builder.first_snapshot_id = Some(deser.read_string(member)?);
  169    174   
                }
  170    175   
                Some(2) => {
  171    176   
                    builder.next_token = Some(deser.read_string(member)?);
  172    177   
                }
  173    178   
                Some(3) => {
  174    179   
                    builder.max_results = Some(deser.read_integer(member)?);
  175    180   
                }
  176    181   
                Some(4) => {
  177    182   
                    builder.starting_block_index = Some(deser.read_integer(member)?);
  178    183   
                }
  179    184   
                _ => {}
  180    185   
            }
  181    186   
            Ok(())
  182    187   
        })?;
         188  +
        builder.second_snapshot_id = builder.second_snapshot_id.or(Some(String::new()));
  183    189   
        builder
  184    190   
            .build()
  185    191   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  186    192   
    }
  187    193   
}
         194  +
impl ListChangedBlocksInput {
         195  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         196  +
    pub fn deserialize_with_response(
         197  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         198  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         199  +
        _status: u16,
         200  +
        _body: &[u8],
         201  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         202  +
        Self::deserialize(deserializer)
         203  +
    }
         204  +
}
  188    205   
impl ListChangedBlocksInput {
  189    206   
    /// Creates a new builder-style object to manufacture [`ListChangedBlocksInput`](crate::operation::list_changed_blocks::ListChangedBlocksInput).
  190    207   
    pub fn builder() -> crate::operation::list_changed_blocks::builders::ListChangedBlocksInputBuilder {
  191    208   
        crate::operation::list_changed_blocks::builders::ListChangedBlocksInputBuilder::default()
  192    209   
    }
  193    210   
}
  194    211   
  195    212   
/// A builder for [`ListChangedBlocksInput`](crate::operation::list_changed_blocks::ListChangedBlocksInput).
  196    213   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  197    214   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_changed_blocks/_list_changed_blocks_output.rs

@@ -23,23 +220,228 @@
   43     43   
    "com.amazonaws.ebs.synthetic",
   44     44   
    "ListChangedBlocksOutput",
   45     45   
);
   46     46   
static LISTCHANGEDBLOCKSOUTPUT_MEMBER_BLOCK_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   47     47   
    ::aws_smithy_schema::ShapeId::from_static(
   48     48   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksOutput$BlockSize",
   49     49   
        "com.amazonaws.ebs.synthetic",
   50     50   
        "ListChangedBlocksOutput",
   51     51   
    ),
   52     52   
    ::aws_smithy_schema::ShapeType::Integer,
   53         -
    "block_size",
          53  +
    "BlockSize",
   54     54   
    0,
   55     55   
);
   56     56   
static LISTCHANGEDBLOCKSOUTPUT_MEMBER_EXPIRY_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   57     57   
    ::aws_smithy_schema::ShapeId::from_static(
   58     58   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksOutput$ExpiryTime",
   59     59   
        "com.amazonaws.ebs.synthetic",
   60     60   
        "ListChangedBlocksOutput",
   61     61   
    ),
   62     62   
    ::aws_smithy_schema::ShapeType::Timestamp,
   63         -
    "expiry_time",
          63  +
    "ExpiryTime",
   64     64   
    1,
   65     65   
);
   66     66   
static LISTCHANGEDBLOCKSOUTPUT_MEMBER_VOLUME_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksOutput$VolumeSize",
   69     69   
        "com.amazonaws.ebs.synthetic",
   70     70   
        "ListChangedBlocksOutput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::Long,
   73         -
    "volume_size",
          73  +
    "VolumeSize",
   74     74   
    2,
   75     75   
);
   76     76   
static LISTCHANGEDBLOCKSOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   77     77   
    ::aws_smithy_schema::ShapeId::from_static(
   78     78   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksOutput$NextToken",
   79     79   
        "com.amazonaws.ebs.synthetic",
   80     80   
        "ListChangedBlocksOutput",
   81     81   
    ),
   82     82   
    ::aws_smithy_schema::ShapeType::String,
   83         -
    "next_token",
          83  +
    "NextToken",
   84     84   
    3,
   85     85   
);
   86     86   
static LISTCHANGEDBLOCKSOUTPUT_MEMBER_CHANGED_BLOCKS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   87     87   
    ::aws_smithy_schema::ShapeId::from_static(
   88     88   
        "com.amazonaws.ebs.synthetic#ListChangedBlocksOutput$ChangedBlocks",
   89     89   
        "com.amazonaws.ebs.synthetic",
   90     90   
        "ListChangedBlocksOutput",
   91     91   
    ),
   92     92   
    ::aws_smithy_schema::ShapeType::List,
   93         -
    "changed_blocks",
          93  +
    "ChangedBlocks",
   94     94   
    4,
   95     95   
);
   96     96   
static LISTCHANGEDBLOCKSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   97     97   
    LISTCHANGEDBLOCKSOUTPUT_SCHEMA_ID,
   98     98   
    ::aws_smithy_schema::ShapeType::Structure,
   99     99   
    &[
  100    100   
        &LISTCHANGEDBLOCKSOUTPUT_MEMBER_BLOCK_SIZE,
  101    101   
        &LISTCHANGEDBLOCKSOUTPUT_MEMBER_EXPIRY_TIME,
  102    102   
        &LISTCHANGEDBLOCKSOUTPUT_MEMBER_VOLUME_SIZE,
  103    103   
        &LISTCHANGEDBLOCKSOUTPUT_MEMBER_NEXT_TOKEN,
  104    104   
        &LISTCHANGEDBLOCKSOUTPUT_MEMBER_CHANGED_BLOCKS,
  105    105   
    ],
  106    106   
);
  107    107   
impl ListChangedBlocksOutput {
  108    108   
    /// The schema for this shape.
  109    109   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTCHANGEDBLOCKSOUTPUT_SCHEMA;
  110    110   
}
  111    111   
impl ::aws_smithy_schema::serde::SerializableStruct for ListChangedBlocksOutput {
  112    112   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  113    113   
    fn serialize_members(
  114    114   
        &self,
  115    115   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  116    116   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  117    117   
        if let Some(ref val) = self.block_size {
  118    118   
            ser.write_integer(&LISTCHANGEDBLOCKSOUTPUT_MEMBER_BLOCK_SIZE, *val)?;
  119    119   
        }
  120    120   
        if let Some(ref val) = self.expiry_time {
  121    121   
            ser.write_timestamp(&LISTCHANGEDBLOCKSOUTPUT_MEMBER_EXPIRY_TIME, val)?;
  122    122   
        }
  123    123   
        if let Some(ref val) = self.volume_size {
  124    124   
            ser.write_long(&LISTCHANGEDBLOCKSOUTPUT_MEMBER_VOLUME_SIZE, *val)?;
  125    125   
        }
  126    126   
        if let Some(ref val) = self.next_token {
  127    127   
            ser.write_string(&LISTCHANGEDBLOCKSOUTPUT_MEMBER_NEXT_TOKEN, val)?;
  128    128   
        }
  129    129   
        if let Some(ref val) = self.changed_blocks {
  130    130   
            ser.write_list(
  131    131   
                &LISTCHANGEDBLOCKSOUTPUT_MEMBER_CHANGED_BLOCKS,
  132    132   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  133    133   
                    for item in val {
  134    134   
                        ser.write_struct(crate::types::ChangedBlock::SCHEMA, item)?;
  135    135   
                    }
  136    136   
                    Ok(())
  137    137   
                },
  138    138   
            )?;
  139    139   
        }
  140    140   
        Ok(())
  141    141   
    }
  142    142   
}
  143    143   
impl ListChangedBlocksOutput {
  144    144   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  145         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  146         -
        deserializer: &mut D,
         145  +
    pub fn deserialize(
         146  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  147    147   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  148    148   
        #[allow(unused_variables, unused_mut)]
  149    149   
        let mut builder = Self::builder();
  150    150   
        #[allow(
  151    151   
            unused_variables,
  152    152   
            unreachable_code,
  153    153   
            clippy::single_match,
  154    154   
            clippy::match_single_binding,
  155    155   
            clippy::diverging_sub_expression
  156    156   
        )]
  157         -
        deserializer.read_struct(&LISTCHANGEDBLOCKSOUTPUT_SCHEMA, (), |_, member, deser| {
         157  +
        deserializer.read_struct(&LISTCHANGEDBLOCKSOUTPUT_SCHEMA, &mut |member, deser| {
  158    158   
            match member.member_index() {
  159    159   
                Some(0) => {
  160    160   
                    builder.block_size = Some(deser.read_integer(member)?);
  161    161   
                }
  162    162   
                Some(1) => {
  163    163   
                    builder.expiry_time = Some(deser.read_timestamp(member)?);
  164    164   
                }
  165    165   
                Some(2) => {
  166    166   
                    builder.volume_size = Some(deser.read_long(member)?);
  167    167   
                }
  168    168   
                Some(3) => {
  169    169   
                    builder.next_token = Some(deser.read_string(member)?);
  170    170   
                }
  171    171   
                Some(4) => {
  172    172   
                    builder.changed_blocks = Some({
  173         -
                        let container = if let Some(cap) = deser.container_size() {
  174         -
                            Vec::with_capacity(cap)
  175         -
                        } else {
  176         -
                            Vec::new()
  177         -
                        };
  178         -
                        deser.read_list(member, container, |mut list, deser| {
  179         -
                            list.push(crate::types::ChangedBlock::deserialize(deser)?);
  180         -
                            Ok(list)
  181         -
                        })?
         173  +
                        let mut container = Vec::new();
         174  +
                        deser.read_list(member, &mut |deser| {
         175  +
                            container.push(crate::types::ChangedBlock::deserialize(deser)?);
         176  +
                            Ok(())
         177  +
                        })?;
         178  +
                        container
  182    179   
                    });
  183    180   
                }
  184    181   
                _ => {}
  185    182   
            }
  186    183   
            Ok(())
  187    184   
        })?;
  188    185   
        Ok(builder.build())
  189    186   
    }
  190    187   
}
         188  +
impl ListChangedBlocksOutput {
         189  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         190  +
    pub fn deserialize_with_response(
         191  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         192  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         193  +
        _status: u16,
         194  +
        _body: &[u8],
         195  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         196  +
        Self::deserialize(deserializer)
         197  +
    }
         198  +
}
  191    199   
impl ListChangedBlocksOutput {
  192    200   
    /// Creates a new builder-style object to manufacture [`ListChangedBlocksOutput`](crate::operation::list_changed_blocks::ListChangedBlocksOutput).
  193    201   
    pub fn builder() -> crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder {
  194    202   
        crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder::default()
  195    203   
    }
  196    204   
}
  197    205   
  198    206   
/// A builder for [`ListChangedBlocksOutput`](crate::operation::list_changed_blocks::ListChangedBlocksOutput).
  199    207   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  200    208   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_snapshot_blocks.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 `ListSnapshotBlocks`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListSnapshotBlocks;
    6      6   
impl ListSnapshotBlocks {
    7      7   
    /// Creates a new `ListSnapshotBlocks`
    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::list_snapshot_blocks::ListSnapshotBlocksInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput::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::list_snapshot_blocks::ListSnapshotBlocksInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_snapshot_blocks::ListSnapshotBlocksError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -105,109 +254,429 @@
  125    129   
        ::std::borrow::Cow::Owned(rcb)
  126    130   
    }
  127    131   
}
  128    132   
  129    133   
#[derive(Debug)]
  130    134   
struct ListSnapshotBlocksResponseDeserializer;
  131    135   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSnapshotBlocksResponseDeserializer {
  132    136   
    fn deserialize_nonstreaming(
  133    137   
        &self,
  134    138   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         139  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  135    140   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  136    141   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         142  +
        #[allow(unused_mut)]
         143  +
        let mut force_error = false;
         144  +
         145  +
        if !success && status != 200 || force_error {
  137    146   
            let headers = response.headers();
  138    147   
            let body = response.body().bytes().expect("body loaded");
  139    148   
            #[allow(unused_mut)]
  140         -
        let mut force_error = false;
         149  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         150  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         151  +
            })?;
  141    152   
  142         -
        let parse_result = if !success && status != 200 || force_error {
  143         -
            crate::protocol_serde::shape_list_snapshot_blocks::de_list_snapshot_blocks_http_error(status, headers, body)
  144         -
        } else {
  145         -
            crate::protocol_serde::shape_list_snapshot_blocks::de_list_snapshot_blocks_http_response(status, headers, body)
         153  +
            let generic = generic_builder.build();
         154  +
            let error_code = match generic.code() {
         155  +
                ::std::option::Option::Some(code) => code,
         156  +
                ::std::option::Option::None => {
         157  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         158  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         159  +
                            crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled(generic),
         160  +
                        ),
         161  +
                    ))
         162  +
                }
         163  +
            };
         164  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         165  +
            let protocol = _cfg
         166  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         167  +
                .expect("a SharedClientProtocol is required");
         168  +
            let err = match error_code {
         169  +
                "AccessDeniedException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::AccessDeniedError({
         170  +
                    let mut tmp = match protocol
         171  +
                        .deserialize_response(response, crate::types::error::AccessDeniedError::SCHEMA, _cfg)
         172  +
                        .and_then(|mut deser| {
         173  +
                            crate::types::error::AccessDeniedError::deserialize_with_response(
         174  +
                                &mut *deser,
         175  +
                                response.headers(),
         176  +
                                response.status().into(),
         177  +
                                body,
         178  +
                            )
         179  +
                        }) {
         180  +
                        ::std::result::Result::Ok(val) => val,
         181  +
                        ::std::result::Result::Err(e) => {
         182  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         183  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         184  +
                            ))
         185  +
                        }
         186  +
                    };
         187  +
                    tmp.meta = generic;
         188  +
                    if tmp.message.is_none() {
         189  +
                        tmp.message = _error_message;
         190  +
                    }
         191  +
                    tmp
         192  +
                }),
         193  +
                "InternalServerException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::InternalServerError({
         194  +
                    let mut tmp = match protocol
         195  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         196  +
                        .and_then(|mut deser| {
         197  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         198  +
                                &mut *deser,
         199  +
                                response.headers(),
         200  +
                                response.status().into(),
         201  +
                                body,
         202  +
                            )
         203  +
                        }) {
         204  +
                        ::std::result::Result::Ok(val) => val,
         205  +
                        ::std::result::Result::Err(e) => {
         206  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         207  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         208  +
                            ))
         209  +
                        }
         210  +
                    };
         211  +
                    tmp.meta = generic;
         212  +
                    if tmp.message.is_none() {
         213  +
                        tmp.message = _error_message;
         214  +
                    }
         215  +
                    tmp
         216  +
                }),
         217  +
                "RequestThrottledException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::RequestThrottledError({
         218  +
                    let mut tmp = match protocol
         219  +
                        .deserialize_response(response, crate::types::error::RequestThrottledError::SCHEMA, _cfg)
         220  +
                        .and_then(|mut deser| {
         221  +
                            crate::types::error::RequestThrottledError::deserialize_with_response(
         222  +
                                &mut *deser,
         223  +
                                response.headers(),
         224  +
                                response.status().into(),
         225  +
                                body,
         226  +
                            )
         227  +
                        }) {
         228  +
                        ::std::result::Result::Ok(val) => val,
         229  +
                        ::std::result::Result::Err(e) => {
         230  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         231  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         232  +
                            ))
         233  +
                        }
  146    234   
                    };
  147         -
        crate::protocol_serde::type_erase_result(parse_result)
         235  +
                    tmp.meta = generic;
         236  +
                    if tmp.message.is_none() {
         237  +
                        tmp.message = _error_message;
         238  +
                    }
         239  +
                    tmp
         240  +
                }),
         241  +
                "ResourceNotFoundException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ResourceNotFoundError({
         242  +
                    let mut tmp = match protocol
         243  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         244  +
                        .and_then(|mut deser| {
         245  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         246  +
                                &mut *deser,
         247  +
                                response.headers(),
         248  +
                                response.status().into(),
         249  +
                                body,
         250  +
                            )
         251  +
                        }) {
         252  +
                        ::std::result::Result::Ok(val) => val,
         253  +
                        ::std::result::Result::Err(e) => {
         254  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         255  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         256  +
                            ))
         257  +
                        }
         258  +
                    };
         259  +
                    tmp.meta = generic;
         260  +
                    if tmp.message.is_none() {
         261  +
                        tmp.message = _error_message;
         262  +
                    }
         263  +
                    tmp
         264  +
                }),
         265  +
                "ServiceQuotaExceededException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ServiceQuotaExceededError({
         266  +
                    let mut tmp = match protocol
         267  +
                        .deserialize_response(response, crate::types::error::ServiceQuotaExceededError::SCHEMA, _cfg)
         268  +
                        .and_then(|mut deser| {
         269  +
                            crate::types::error::ServiceQuotaExceededError::deserialize_with_response(
         270  +
                                &mut *deser,
         271  +
                                response.headers(),
         272  +
                                response.status().into(),
         273  +
                                body,
         274  +
                            )
         275  +
                        }) {
         276  +
                        ::std::result::Result::Ok(val) => val,
         277  +
                        ::std::result::Result::Err(e) => {
         278  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         279  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         280  +
                            ))
         281  +
                        }
         282  +
                    };
         283  +
                    tmp.meta = generic;
         284  +
                    if tmp.message.is_none() {
         285  +
                        tmp.message = _error_message;
         286  +
                    }
         287  +
                    tmp
         288  +
                }),
         289  +
                "ValidationException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ValidationError({
         290  +
                    let mut tmp = match protocol
         291  +
                        .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         292  +
                        .and_then(|mut deser| {
         293  +
                            crate::types::error::ValidationError::deserialize_with_response(
         294  +
                                &mut *deser,
         295  +
                                response.headers(),
         296  +
                                response.status().into(),
         297  +
                                body,
         298  +
                            )
         299  +
                        }) {
         300  +
                        ::std::result::Result::Ok(val) => val,
         301  +
                        ::std::result::Result::Err(e) => {
         302  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         303  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         304  +
                            ))
         305  +
                        }
         306  +
                    };
         307  +
                    tmp.meta = generic;
         308  +
                    if tmp.message.is_none() {
         309  +
                        tmp.message = _error_message;
         310  +
                    }
         311  +
                    tmp
         312  +
                }),
         313  +
                _ => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::generic(generic),
         314  +
            };
         315  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         316  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         317  +
            ))
         318  +
        } else {
         319  +
            let protocol = _cfg
         320  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         321  +
                .expect("a SharedClientProtocol is required");
         322  +
            let mut deser = protocol
         323  +
                .deserialize_response(response, ListSnapshotBlocks::OUTPUT_SCHEMA, _cfg)
         324  +
                .map_err(|e| {
         325  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         326  +
                })?;
         327  +
            let body = response.body().bytes().expect("body loaded");
         328  +
            let output = crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput::deserialize_with_response(
         329  +
                &mut *deser,
         330  +
                response.headers(),
         331  +
                response.status().into(),
         332  +
                body,
         333  +
            )
         334  +
            .map_err(|e| {
         335  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         336  +
            })?;
         337  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         338  +
        }
  148    339   
    }
  149    340   
}
  150    341   
#[derive(Debug)]
  151    342   
struct ListSnapshotBlocksRequestSerializer;
  152    343   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListSnapshotBlocksRequestSerializer {
  153    344   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  154    345   
    fn serialize_input(
  155    346   
        &self,
  156    347   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  157    348   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  158    349   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  159    350   
        let input = input
  160    351   
            .downcast::<crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput>()
  161    352   
            .expect("correct type");
  162         -
        let _header_serialization_settings = _cfg
  163         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  164         -
            .cloned()
  165         -
            .unwrap_or_default();
  166         -
        let mut request_builder = {
  167         -
            #[allow(clippy::uninlined_format_args)]
  168         -
            fn uri_base(
  169         -
                _input: &crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput,
  170         -
                output: &mut ::std::string::String,
  171         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172         -
                use ::std::fmt::Write as _;
  173         -
                let input_1 = &_input.snapshot_id;
  174         -
                let input_1 = input_1
  175         -
                    .as_ref()
  176         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("snapshot_id", "cannot be empty or unset"))?;
  177         -
                let snapshot_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  178         -
                if snapshot_id.is_empty() {
  179         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  180         -
                        "snapshot_id",
  181         -
                        "cannot be empty or unset",
  182         -
                    ));
  183         -
                }
  184         -
                ::std::write!(output, "/snapshots/{SnapshotId}/blocks", SnapshotId = snapshot_id).expect("formatting should succeed");
  185         -
                ::std::result::Result::Ok(())
  186         -
            }
  187         -
            fn uri_query(
  188         -
                _input: &crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput,
  189         -
                mut output: &mut ::std::string::String,
  190         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  191         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  192         -
                if let ::std::option::Option::Some(inner_2) = &_input.max_results {
         353  +
        let protocol = _cfg
         354  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         355  +
            .expect("a SharedClientProtocol is required");
         356  +
        if protocol.supports_http_bindings() {
         357  +
            let mut request = protocol
         358  +
                .serialize_body(&input, ListSnapshotBlocks::INPUT_SCHEMA, "", _cfg)
         359  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  193    360   
            {
  194         -
                        query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_2).encode());
  195         -
                    }
  196         -
                }
  197         -
                if let ::std::option::Option::Some(inner_3) = &_input.starting_block_index {
  198         -
                    {
  199         -
                        query.push_kv("startingBlockIndex", ::aws_smithy_types::primitive::Encoder::from(*inner_3).encode());
  200         -
                    }
  201         -
                }
  202         -
                if let ::std::option::Option::Some(inner_4) = &_input.next_token {
  203         -
                    {
  204         -
                        query.push_kv("pageToken", &::aws_smithy_http::query::fmt_string(inner_4));
  205         -
                    }
         361  +
                let mut uri = "/snapshots/{SnapshotId}/blocks".to_string();
         362  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         363  +
                if let Some(ref val) = input.max_results {
         364  +
                    query_params.push(("maxResults".to_string(), val.to_string()));
         365  +
                }
         366  +
                if let Some(ref val) = input.starting_block_index {
         367  +
                    query_params.push(("startingBlockIndex".to_string(), val.to_string()));
         368  +
                }
         369  +
                if let Some(ref val) = input.next_token {
         370  +
                    query_params.push(("pageToken".to_string(), val.to_string()));
         371  +
                }
         372  +
                if let Some(ref val) = input.snapshot_id {
         373  +
                    uri = uri.replace("{SnapshotId}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
         374  +
                }
         375  +
                if !query_params.is_empty() {
         376  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         377  +
                    let pairs: Vec<String> = query_params
         378  +
                        .iter()
         379  +
                        .map(|(k, v)| {
         380  +
                            format!(
         381  +
                                "{}={}",
         382  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         383  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         384  +
                            )
         385  +
                        })
         386  +
                        .collect();
         387  +
                    uri.push_str(&pairs.join("&"));
  206    388   
                }
  207         -
                ::std::result::Result::Ok(())
         389  +
                request.set_uri(uri.as_str()).expect("valid URI");
  208    390   
            }
  209         -
            #[allow(clippy::unnecessary_wraps)]
  210         -
            fn update_http_builder(
  211         -
                input: &crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput,
  212         -
                builder: ::http_1x::request::Builder,
  213         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  214         -
                let mut uri = ::std::string::String::new();
  215         -
                uri_base(input, &mut uri)?;
  216         -
                uri_query(input, &mut uri)?;
  217         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  218         -
            }
  219         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  220         -
            builder
  221         -
        };
  222         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  223    391   
  224         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         392  +
            return ::std::result::Result::Ok(request);
         393  +
        } else {
         394  +
            let mut request = protocol
         395  +
                .serialize_request(&input, ListSnapshotBlocks::INPUT_SCHEMA, "", _cfg)
         396  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         397  +
         398  +
            return ::std::result::Result::Ok(request);
         399  +
        }
  225    400   
    }
  226    401   
}
  227    402   
#[derive(Debug)]
  228    403   
struct ListSnapshotBlocksEndpointParamsInterceptor;
  229    404   
  230    405   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSnapshotBlocksEndpointParamsInterceptor {
  231    406   
    fn name(&self) -> &'static str {
  232    407   
        "ListSnapshotBlocksEndpointParamsInterceptor"
  233    408   
    }
  234    409   

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_snapshot_blocks/_list_snapshot_blocks_input.rs

@@ -15,15 +183,196 @@
   35     35   
    "com.amazonaws.ebs.synthetic",
   36     36   
    "ListSnapshotBlocksInput",
   37     37   
);
   38     38   
static LISTSNAPSHOTBLOCKSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksInput$MaxResults",
   41     41   
        "com.amazonaws.ebs.synthetic",
   42     42   
        "ListSnapshotBlocksInput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::Integer,
   45         -
    "max_results",
          45  +
    "MaxResults",
   46     46   
    0,
   47     47   
)
   48     48   
.with_http_query("maxResults");
   49     49   
static LISTSNAPSHOTBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   50     50   
    ::aws_smithy_schema::ShapeId::from_static(
   51     51   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksInput$StartingBlockIndex",
   52     52   
        "com.amazonaws.ebs.synthetic",
   53     53   
        "ListSnapshotBlocksInput",
   54     54   
    ),
   55     55   
    ::aws_smithy_schema::ShapeType::Integer,
   56         -
    "starting_block_index",
          56  +
    "StartingBlockIndex",
   57     57   
    1,
   58     58   
)
   59     59   
.with_http_query("startingBlockIndex");
   60     60   
static LISTSNAPSHOTBLOCKSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   61     61   
    ::aws_smithy_schema::ShapeId::from_static(
   62     62   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksInput$NextToken",
   63     63   
        "com.amazonaws.ebs.synthetic",
   64     64   
        "ListSnapshotBlocksInput",
   65     65   
    ),
   66     66   
    ::aws_smithy_schema::ShapeType::String,
   67         -
    "next_token",
          67  +
    "NextToken",
   68     68   
    2,
   69     69   
)
   70     70   
.with_http_query("pageToken");
   71     71   
static LISTSNAPSHOTBLOCKSINPUT_MEMBER_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   72     72   
    ::aws_smithy_schema::ShapeId::from_static(
   73     73   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksInput$SnapshotId",
   74     74   
        "com.amazonaws.ebs.synthetic",
   75     75   
        "ListSnapshotBlocksInput",
   76     76   
    ),
   77     77   
    ::aws_smithy_schema::ShapeType::String,
   78         -
    "snapshot_id",
          78  +
    "SnapshotId",
   79     79   
    3,
   80     80   
)
   81     81   
.with_http_label();
   82     82   
static LISTSNAPSHOTBLOCKSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   83     83   
    LISTSNAPSHOTBLOCKSINPUT_SCHEMA_ID,
   84     84   
    ::aws_smithy_schema::ShapeType::Structure,
   85     85   
    &[
   86     86   
        &LISTSNAPSHOTBLOCKSINPUT_MEMBER_MAX_RESULTS,
   87     87   
        &LISTSNAPSHOTBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX,
   88     88   
        &LISTSNAPSHOTBLOCKSINPUT_MEMBER_NEXT_TOKEN,
   89     89   
        &LISTSNAPSHOTBLOCKSINPUT_MEMBER_SNAPSHOT_ID,
   90     90   
    ],
   91         -
);
          91  +
)
          92  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/snapshots/{SnapshotId}/blocks", None));
   92     93   
impl ListSnapshotBlocksInput {
   93     94   
    /// The schema for this shape.
   94     95   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTSNAPSHOTBLOCKSINPUT_SCHEMA;
   95     96   
}
   96     97   
impl ::aws_smithy_schema::serde::SerializableStruct for ListSnapshotBlocksInput {
   97     98   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   98     99   
    fn serialize_members(
   99    100   
        &self,
  100    101   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  101    102   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  102    103   
        if let Some(ref val) = self.max_results {
  103    104   
            ser.write_integer(&LISTSNAPSHOTBLOCKSINPUT_MEMBER_MAX_RESULTS, *val)?;
  104    105   
        }
  105    106   
        if let Some(ref val) = self.starting_block_index {
  106    107   
            ser.write_integer(&LISTSNAPSHOTBLOCKSINPUT_MEMBER_STARTING_BLOCK_INDEX, *val)?;
  107    108   
        }
  108    109   
        if let Some(ref val) = self.next_token {
  109    110   
            ser.write_string(&LISTSNAPSHOTBLOCKSINPUT_MEMBER_NEXT_TOKEN, val)?;
  110    111   
        }
  111    112   
        if let Some(ref val) = self.snapshot_id {
  112    113   
            ser.write_string(&LISTSNAPSHOTBLOCKSINPUT_MEMBER_SNAPSHOT_ID, val)?;
  113    114   
        }
  114    115   
        Ok(())
  115    116   
    }
  116    117   
}
  117    118   
impl ListSnapshotBlocksInput {
  118    119   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  119         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  120         -
        deserializer: &mut D,
         120  +
    pub fn deserialize(
         121  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  121    122   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  122    123   
        #[allow(unused_variables, unused_mut)]
  123    124   
        let mut builder = Self::builder();
  124    125   
        #[allow(
  125    126   
            unused_variables,
  126    127   
            unreachable_code,
  127    128   
            clippy::single_match,
  128    129   
            clippy::match_single_binding,
  129    130   
            clippy::diverging_sub_expression
  130    131   
        )]
  131         -
        deserializer.read_struct(&LISTSNAPSHOTBLOCKSINPUT_SCHEMA, (), |_, member, deser| {
         132  +
        deserializer.read_struct(&LISTSNAPSHOTBLOCKSINPUT_SCHEMA, &mut |member, deser| {
  132    133   
            match member.member_index() {
  133    134   
                Some(0) => {
  134    135   
                    builder.max_results = Some(deser.read_integer(member)?);
  135    136   
                }
  136    137   
                Some(1) => {
  137    138   
                    builder.starting_block_index = Some(deser.read_integer(member)?);
  138    139   
                }
  139    140   
                Some(2) => {
  140    141   
                    builder.next_token = Some(deser.read_string(member)?);
  141    142   
                }
  142    143   
                Some(3) => {
  143    144   
                    builder.snapshot_id = Some(deser.read_string(member)?);
  144    145   
                }
  145    146   
                _ => {}
  146    147   
            }
  147    148   
            Ok(())
  148    149   
        })?;
         150  +
        builder.snapshot_id = builder.snapshot_id.or(Some(String::new()));
  149    151   
        builder
  150    152   
            .build()
  151    153   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  152    154   
    }
  153    155   
}
         156  +
impl ListSnapshotBlocksInput {
         157  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         158  +
    pub fn deserialize_with_response(
         159  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         160  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         161  +
        _status: u16,
         162  +
        _body: &[u8],
         163  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         164  +
        Self::deserialize(deserializer)
         165  +
    }
         166  +
}
  154    167   
impl ListSnapshotBlocksInput {
  155    168   
    /// Creates a new builder-style object to manufacture [`ListSnapshotBlocksInput`](crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput).
  156    169   
    pub fn builder() -> crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksInputBuilder {
  157    170   
        crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksInputBuilder::default()
  158    171   
    }
  159    172   
}
  160    173   
  161    174   
/// A builder for [`ListSnapshotBlocksInput`](crate::operation::list_snapshot_blocks::ListSnapshotBlocksInput).
  162    175   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  163    176   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_snapshot_blocks/_list_snapshot_blocks_output.rs

@@ -34,34 +231,239 @@
   54     54   
    "com.amazonaws.ebs.synthetic",
   55     55   
    "ListSnapshotBlocksOutput",
   56     56   
);
   57     57   
static LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_VOLUME_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   58     58   
    ::aws_smithy_schema::ShapeId::from_static(
   59     59   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksOutput$VolumeSize",
   60     60   
        "com.amazonaws.ebs.synthetic",
   61     61   
        "ListSnapshotBlocksOutput",
   62     62   
    ),
   63     63   
    ::aws_smithy_schema::ShapeType::Long,
   64         -
    "volume_size",
          64  +
    "VolumeSize",
   65     65   
    0,
   66     66   
);
   67     67   
static LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksOutput$NextToken",
   70     70   
        "com.amazonaws.ebs.synthetic",
   71     71   
        "ListSnapshotBlocksOutput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::String,
   74         -
    "next_token",
          74  +
    "NextToken",
   75     75   
    1,
   76     76   
);
   77     77   
static LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_EXPIRY_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksOutput$ExpiryTime",
   80     80   
        "com.amazonaws.ebs.synthetic",
   81     81   
        "ListSnapshotBlocksOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Timestamp,
   84         -
    "expiry_time",
          84  +
    "ExpiryTime",
   85     85   
    2,
   86     86   
);
   87     87   
static LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCKS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     88   
    ::aws_smithy_schema::ShapeId::from_static(
   89     89   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksOutput$Blocks",
   90     90   
        "com.amazonaws.ebs.synthetic",
   91     91   
        "ListSnapshotBlocksOutput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::List,
   94         -
    "blocks",
          94  +
    "Blocks",
   95     95   
    3,
   96     96   
);
   97     97   
static LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCK_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   98     98   
    ::aws_smithy_schema::ShapeId::from_static(
   99     99   
        "com.amazonaws.ebs.synthetic#ListSnapshotBlocksOutput$BlockSize",
  100    100   
        "com.amazonaws.ebs.synthetic",
  101    101   
        "ListSnapshotBlocksOutput",
  102    102   
    ),
  103    103   
    ::aws_smithy_schema::ShapeType::Integer,
  104         -
    "block_size",
         104  +
    "BlockSize",
  105    105   
    4,
  106    106   
);
  107    107   
static LISTSNAPSHOTBLOCKSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  108    108   
    LISTSNAPSHOTBLOCKSOUTPUT_SCHEMA_ID,
  109    109   
    ::aws_smithy_schema::ShapeType::Structure,
  110    110   
    &[
  111    111   
        &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_VOLUME_SIZE,
  112    112   
        &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_NEXT_TOKEN,
  113    113   
        &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_EXPIRY_TIME,
  114    114   
        &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCKS,
  115    115   
        &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCK_SIZE,
  116    116   
    ],
  117    117   
);
  118    118   
impl ListSnapshotBlocksOutput {
  119    119   
    /// The schema for this shape.
  120    120   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LISTSNAPSHOTBLOCKSOUTPUT_SCHEMA;
  121    121   
}
  122    122   
impl ::aws_smithy_schema::serde::SerializableStruct for ListSnapshotBlocksOutput {
  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.volume_size {
  129    129   
            ser.write_long(&LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_VOLUME_SIZE, *val)?;
  130    130   
        }
  131    131   
        if let Some(ref val) = self.next_token {
  132    132   
            ser.write_string(&LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_NEXT_TOKEN, val)?;
  133    133   
        }
  134    134   
        if let Some(ref val) = self.expiry_time {
  135    135   
            ser.write_timestamp(&LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_EXPIRY_TIME, val)?;
  136    136   
        }
  137    137   
        if let Some(ref val) = self.blocks {
  138    138   
            ser.write_list(
  139    139   
                &LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCKS,
  140    140   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  141    141   
                    for item in val {
  142    142   
                        ser.write_struct(crate::types::Block::SCHEMA, item)?;
  143    143   
                    }
  144    144   
                    Ok(())
  145    145   
                },
  146    146   
            )?;
  147    147   
        }
  148    148   
        if let Some(ref val) = self.block_size {
  149    149   
            ser.write_integer(&LISTSNAPSHOTBLOCKSOUTPUT_MEMBER_BLOCK_SIZE, *val)?;
  150    150   
        }
  151    151   
        Ok(())
  152    152   
    }
  153    153   
}
  154    154   
impl ListSnapshotBlocksOutput {
  155    155   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  156         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  157         -
        deserializer: &mut D,
         156  +
    pub fn deserialize(
         157  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  158    158   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  159    159   
        #[allow(unused_variables, unused_mut)]
  160    160   
        let mut builder = Self::builder();
  161    161   
        #[allow(
  162    162   
            unused_variables,
  163    163   
            unreachable_code,
  164    164   
            clippy::single_match,
  165    165   
            clippy::match_single_binding,
  166    166   
            clippy::diverging_sub_expression
  167    167   
        )]
  168         -
        deserializer.read_struct(&LISTSNAPSHOTBLOCKSOUTPUT_SCHEMA, (), |_, member, deser| {
         168  +
        deserializer.read_struct(&LISTSNAPSHOTBLOCKSOUTPUT_SCHEMA, &mut |member, deser| {
  169    169   
            match member.member_index() {
  170    170   
                Some(0) => {
  171    171   
                    builder.volume_size = Some(deser.read_long(member)?);
  172    172   
                }
  173    173   
                Some(1) => {
  174    174   
                    builder.next_token = Some(deser.read_string(member)?);
  175    175   
                }
  176    176   
                Some(2) => {
  177    177   
                    builder.expiry_time = Some(deser.read_timestamp(member)?);
  178    178   
                }
  179    179   
                Some(3) => {
  180    180   
                    builder.blocks = Some({
  181         -
                        let container = if let Some(cap) = deser.container_size() {
  182         -
                            Vec::with_capacity(cap)
  183         -
                        } else {
  184         -
                            Vec::new()
  185         -
                        };
  186         -
                        deser.read_list(member, container, |mut list, deser| {
  187         -
                            list.push(crate::types::Block::deserialize(deser)?);
  188         -
                            Ok(list)
  189         -
                        })?
         181  +
                        let mut container = Vec::new();
         182  +
                        deser.read_list(member, &mut |deser| {
         183  +
                            container.push(crate::types::Block::deserialize(deser)?);
         184  +
                            Ok(())
         185  +
                        })?;
         186  +
                        container
  190    187   
                    });
  191    188   
                }
  192    189   
                Some(4) => {
  193    190   
                    builder.block_size = Some(deser.read_integer(member)?);
  194    191   
                }
  195    192   
                _ => {}
  196    193   
            }
  197    194   
            Ok(())
  198    195   
        })?;
  199    196   
        Ok(builder.build())
  200    197   
    }
  201    198   
}
         199  +
impl ListSnapshotBlocksOutput {
         200  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         201  +
    pub fn deserialize_with_response(
         202  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         203  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         204  +
        _status: u16,
         205  +
        _body: &[u8],
         206  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         207  +
        Self::deserialize(deserializer)
         208  +
    }
         209  +
}
  202    210   
impl ListSnapshotBlocksOutput {
  203    211   
    /// Creates a new builder-style object to manufacture [`ListSnapshotBlocksOutput`](crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput).
  204    212   
    pub fn builder() -> crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksOutputBuilder {
  205    213   
        crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksOutputBuilder::default()
  206    214   
    }
  207    215   
}
  208    216   
  209    217   
/// A builder for [`ListSnapshotBlocksOutput`](crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput).
  210    218   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  211    219   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/put_snapshot_block.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 `PutSnapshotBlock`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct PutSnapshotBlock;
    6      6   
impl PutSnapshotBlock {
    7      7   
    /// Creates a new `PutSnapshotBlock`
    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::put_snapshot_block::PutSnapshotBlockInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::put_snapshot_block::PutSnapshotBlockOutput::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::put_snapshot_block::PutSnapshotBlockInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::put_snapshot_block::PutSnapshotBlockOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::put_snapshot_block::PutSnapshotBlockError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -104,108 +253,395 @@
  124    128   
        ::std::borrow::Cow::Owned(rcb)
  125    129   
    }
  126    130   
}
  127    131   
  128    132   
#[derive(Debug)]
  129    133   
struct PutSnapshotBlockResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutSnapshotBlockResponseDeserializer {
  131    135   
    fn deserialize_nonstreaming(
  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());
         141  +
        #[allow(unused_mut)]
         142  +
        let mut force_error = false;
         143  +
         144  +
        if !success && status != 201 || force_error {
  136    145   
            let headers = response.headers();
  137    146   
            let body = response.body().bytes().expect("body loaded");
  138    147   
            #[allow(unused_mut)]
  139         -
        let mut force_error = false;
         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  +
            })?;
  140    151   
  141         -
        let parse_result = if !success && status != 201 || force_error {
  142         -
            crate::protocol_serde::shape_put_snapshot_block::de_put_snapshot_block_http_error(status, headers, body)
  143         -
        } else {
  144         -
            crate::protocol_serde::shape_put_snapshot_block::de_put_snapshot_block_http_response(status, headers, body)
         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::put_snapshot_block::PutSnapshotBlockError::unhandled(
         158  +
                            generic,
         159  +
                        )),
         160  +
                    ))
         161  +
                }
         162  +
            };
         163  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         164  +
            let protocol = _cfg
         165  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         166  +
                .expect("a SharedClientProtocol is required");
         167  +
            let err = match error_code {
         168  +
                "AccessDeniedException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::AccessDeniedError({
         169  +
                    let mut tmp = match protocol
         170  +
                        .deserialize_response(response, crate::types::error::AccessDeniedError::SCHEMA, _cfg)
         171  +
                        .and_then(|mut deser| {
         172  +
                            crate::types::error::AccessDeniedError::deserialize_with_response(
         173  +
                                &mut *deser,
         174  +
                                response.headers(),
         175  +
                                response.status().into(),
         176  +
                                body,
         177  +
                            )
         178  +
                        }) {
         179  +
                        ::std::result::Result::Ok(val) => val,
         180  +
                        ::std::result::Result::Err(e) => {
         181  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         182  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         183  +
                            ))
         184  +
                        }
         185  +
                    };
         186  +
                    tmp.meta = generic;
         187  +
                    if tmp.message.is_none() {
         188  +
                        tmp.message = _error_message;
         189  +
                    }
         190  +
                    tmp
         191  +
                }),
         192  +
                "InternalServerException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::InternalServerError({
         193  +
                    let mut tmp = match protocol
         194  +
                        .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
         195  +
                        .and_then(|mut deser| {
         196  +
                            crate::types::error::InternalServerError::deserialize_with_response(
         197  +
                                &mut *deser,
         198  +
                                response.headers(),
         199  +
                                response.status().into(),
         200  +
                                body,
         201  +
                            )
         202  +
                        }) {
         203  +
                        ::std::result::Result::Ok(val) => val,
         204  +
                        ::std::result::Result::Err(e) => {
         205  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         206  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         207  +
                            ))
         208  +
                        }
         209  +
                    };
         210  +
                    tmp.meta = generic;
         211  +
                    if tmp.message.is_none() {
         212  +
                        tmp.message = _error_message;
         213  +
                    }
         214  +
                    tmp
         215  +
                }),
         216  +
                "RequestThrottledException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::RequestThrottledError({
         217  +
                    let mut tmp = match protocol
         218  +
                        .deserialize_response(response, crate::types::error::RequestThrottledError::SCHEMA, _cfg)
         219  +
                        .and_then(|mut deser| {
         220  +
                            crate::types::error::RequestThrottledError::deserialize_with_response(
         221  +
                                &mut *deser,
         222  +
                                response.headers(),
         223  +
                                response.status().into(),
         224  +
                                body,
         225  +
                            )
         226  +
                        }) {
         227  +
                        ::std::result::Result::Ok(val) => val,
         228  +
                        ::std::result::Result::Err(e) => {
         229  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         230  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         231  +
                            ))
         232  +
                        }
         233  +
                    };
         234  +
                    tmp.meta = generic;
         235  +
                    if tmp.message.is_none() {
         236  +
                        tmp.message = _error_message;
         237  +
                    }
         238  +
                    tmp
         239  +
                }),
         240  +
                "ResourceNotFoundException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ResourceNotFoundError({
         241  +
                    let mut tmp = match protocol
         242  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         243  +
                        .and_then(|mut deser| {
         244  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         245  +
                                &mut *deser,
         246  +
                                response.headers(),
         247  +
                                response.status().into(),
         248  +
                                body,
         249  +
                            )
         250  +
                        }) {
         251  +
                        ::std::result::Result::Ok(val) => val,
         252  +
                        ::std::result::Result::Err(e) => {
         253  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         254  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         255  +
                            ))
         256  +
                        }
         257  +
                    };
         258  +
                    tmp.meta = generic;
         259  +
                    if tmp.message.is_none() {
         260  +
                        tmp.message = _error_message;
         261  +
                    }
         262  +
                    tmp
         263  +
                }),
         264  +
                "ServiceQuotaExceededException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ServiceQuotaExceededError({
         265  +
                    let mut tmp = match protocol
         266  +
                        .deserialize_response(response, crate::types::error::ServiceQuotaExceededError::SCHEMA, _cfg)
         267  +
                        .and_then(|mut deser| {
         268  +
                            crate::types::error::ServiceQuotaExceededError::deserialize_with_response(
         269  +
                                &mut *deser,
         270  +
                                response.headers(),
         271  +
                                response.status().into(),
         272  +
                                body,
         273  +
                            )
         274  +
                        }) {
         275  +
                        ::std::result::Result::Ok(val) => val,
         276  +
                        ::std::result::Result::Err(e) => {
         277  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         278  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         279  +
                            ))
         280  +
                        }
         281  +
                    };
         282  +
                    tmp.meta = generic;
         283  +
                    if tmp.message.is_none() {
         284  +
                        tmp.message = _error_message;
         285  +
                    }
         286  +
                    tmp
         287  +
                }),
         288  +
                "ValidationException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ValidationError({
         289  +
                    let mut tmp = match protocol
         290  +
                        .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         291  +
                        .and_then(|mut deser| {
         292  +
                            crate::types::error::ValidationError::deserialize_with_response(
         293  +
                                &mut *deser,
         294  +
                                response.headers(),
         295  +
                                response.status().into(),
         296  +
                                body,
         297  +
                            )
         298  +
                        }) {
         299  +
                        ::std::result::Result::Ok(val) => val,
         300  +
                        ::std::result::Result::Err(e) => {
         301  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         302  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         303  +
                            ))
         304  +
                        }
  145    305   
                    };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         306  +
                    tmp.meta = generic;
         307  +
                    if tmp.message.is_none() {
         308  +
                        tmp.message = _error_message;
         309  +
                    }
         310  +
                    tmp
         311  +
                }),
         312  +
                _ => crate::operation::put_snapshot_block::PutSnapshotBlockError::generic(generic),
         313  +
            };
         314  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         315  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         316  +
            ))
         317  +
        } else {
         318  +
            let protocol = _cfg
         319  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         320  +
                .expect("a SharedClientProtocol is required");
         321  +
            let mut deser = protocol
         322  +
                .deserialize_response(response, PutSnapshotBlock::OUTPUT_SCHEMA, _cfg)
         323  +
                .map_err(|e| {
         324  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         325  +
                })?;
         326  +
            let body = response.body().bytes().expect("body loaded");
         327  +
            let output = crate::operation::put_snapshot_block::PutSnapshotBlockOutput::deserialize_with_response(
         328  +
                &mut *deser,
         329  +
                response.headers(),
         330  +
                response.status().into(),
         331  +
                body,
         332  +
            )
         333  +
            .map_err(|e| {
         334  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         335  +
            })?;
         336  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         337  +
        }
  147    338   
    }
  148    339   
}
  149    340   
#[derive(Debug)]
  150    341   
struct PutSnapshotBlockRequestSerializer;
  151    342   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PutSnapshotBlockRequestSerializer {
  152    343   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  153    344   
    fn serialize_input(
  154    345   
        &self,
  155    346   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  156    347   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  157    348   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  158    349   
        let input = input
  159    350   
            .downcast::<crate::operation::put_snapshot_block::PutSnapshotBlockInput>()
  160    351   
            .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::put_snapshot_block::PutSnapshotBlockInput,
  169         -
                output: &mut ::std::string::String,
  170         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  171         -
                use ::std::fmt::Write as _;
  172         -
                let input_1 = &_input.snapshot_id;
  173         -
                let input_1 = input_1
  174         -
                    .as_ref()
  175         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("snapshot_id", "cannot be empty or unset"))?;
  176         -
                let snapshot_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  177         -
                if snapshot_id.is_empty() {
  178         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  179         -
                        "snapshot_id",
  180         -
                        "cannot be empty or unset",
  181         -
                    ));
  182         -
                }
  183         -
                let input_2 = &_input.block_index;
  184         -
                let input_2 = input_2
  185         -
                    .as_ref()
  186         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("block_index", "cannot be empty or unset"))?;
  187         -
                let mut block_index_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_2);
  188         -
                let block_index = block_index_encoder.encode();
  189         -
                if block_index.is_empty() {
  190         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  191         -
                        "block_index",
  192         -
                        "cannot be empty or unset",
  193         -
                    ));
         352  +
        let protocol = _cfg
         353  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         354  +
            .expect("a SharedClientProtocol is required");
         355  +
        let mut request = protocol
         356  +
            .serialize_request(&input, PutSnapshotBlock::INPUT_SCHEMA, "", _cfg)
         357  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         358  +
        // Streaming blob payload: replace the body with the raw ByteStream.
         359  +
        *request.body_mut() = input.block_data.into_inner();
         360  +
        request.headers_mut().insert("Content-Type", "application/octet-stream");
         361  +
        if let ::std::option::Option::Some(content_length) = request.body().content_length() {
         362  +
            request.headers_mut().insert("Content-Length", content_length.to_string());
  194    363   
        }
  195         -
                ::std::write!(
  196         -
                    output,
  197         -
                    "/snapshots/{SnapshotId}/blocks/{BlockIndex}",
  198         -
                    SnapshotId = snapshot_id,
  199         -
                    BlockIndex = block_index
  200         -
                )
  201         -
                .expect("formatting should succeed");
  202         -
                ::std::result::Result::Ok(())
  203         -
            }
  204         -
            #[allow(clippy::unnecessary_wraps)]
  205         -
            fn update_http_builder(
  206         -
                input: &crate::operation::put_snapshot_block::PutSnapshotBlockInput,
  207         -
                builder: ::http_1x::request::Builder,
  208         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  209         -
                let mut uri = ::std::string::String::new();
  210         -
                uri_base(input, &mut uri)?;
  211         -
                let builder = crate::protocol_serde::shape_put_snapshot_block::ser_put_snapshot_block_headers(input, builder)?;
  212         -
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  213         -
            }
  214         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  215         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/octet-stream");
  216         -
            builder
  217         -
        };
  218         -
        let body = crate::protocol_serde::shape_put_snapshot_block_input::ser_block_data_http_payload(input.block_data)?.into_inner();
  219         -
        if let Some(content_length) = body.content_length() {
  220         -
            let content_length = content_length.to_string();
  221         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  222         -
        }
  223         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         364  +
         365  +
        return ::std::result::Result::Ok(request);
  224    366   
    }
  225    367   
}
  226    368   
#[derive(Debug)]
  227    369   
struct PutSnapshotBlockEndpointParamsInterceptor;
  228    370   
  229    371   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutSnapshotBlockEndpointParamsInterceptor {
  230    372   
    fn name(&self) -> &'static str {
  231    373   
        "PutSnapshotBlockEndpointParamsInterceptor"
  232    374   
    }
  233    375   

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/put_snapshot_block/_put_snapshot_block_input.rs

@@ -49,49 +270,333 @@
   69     69   
    "com.amazonaws.ebs.synthetic",
   70     70   
    "PutSnapshotBlockInput",
   71     71   
);
   72     72   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   73     73   
    ::aws_smithy_schema::ShapeId::from_static(
   74     74   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$SnapshotId",
   75     75   
        "com.amazonaws.ebs.synthetic",
   76     76   
        "PutSnapshotBlockInput",
   77     77   
    ),
   78     78   
    ::aws_smithy_schema::ShapeType::String,
   79         -
    "snapshot_id",
          79  +
    "SnapshotId",
   80     80   
    0,
   81     81   
)
   82     82   
.with_http_label();
   83     83   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static(
   85     85   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$BlockIndex",
   86     86   
        "com.amazonaws.ebs.synthetic",
   87     87   
        "PutSnapshotBlockInput",
   88     88   
    ),
   89     89   
    ::aws_smithy_schema::ShapeType::Integer,
   90         -
    "block_index",
          90  +
    "BlockIndex",
   91     91   
    1,
   92     92   
)
   93     93   
.with_http_label();
   94     94   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   95     95   
    ::aws_smithy_schema::ShapeId::from_static(
   96     96   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$Checksum",
   97     97   
        "com.amazonaws.ebs.synthetic",
   98     98   
        "PutSnapshotBlockInput",
   99     99   
    ),
  100    100   
    ::aws_smithy_schema::ShapeType::String,
  101         -
    "checksum",
         101  +
    "Checksum",
  102    102   
    2,
  103    103   
)
  104    104   
.with_http_header("x-amz-Checksum");
  105    105   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  106    106   
    ::aws_smithy_schema::ShapeId::from_static(
  107    107   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$Progress",
  108    108   
        "com.amazonaws.ebs.synthetic",
  109    109   
        "PutSnapshotBlockInput",
  110    110   
    ),
  111    111   
    ::aws_smithy_schema::ShapeType::Integer,
  112         -
    "progress",
         112  +
    "Progress",
  113    113   
    3,
  114    114   
)
  115    115   
.with_http_header("x-amz-Progress");
  116    116   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    117   
    ::aws_smithy_schema::ShapeId::from_static(
  118    118   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$BlockData",
  119    119   
        "com.amazonaws.ebs.synthetic",
  120    120   
        "PutSnapshotBlockInput",
  121    121   
    ),
  122    122   
    ::aws_smithy_schema::ShapeType::Blob,
  123         -
    "block_data",
         123  +
    "BlockData",
  124    124   
    4,
  125    125   
)
  126    126   
.with_http_payload();
  127    127   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  128    128   
    ::aws_smithy_schema::ShapeId::from_static(
  129    129   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$DataLength",
  130    130   
        "com.amazonaws.ebs.synthetic",
  131    131   
        "PutSnapshotBlockInput",
  132    132   
    ),
  133    133   
    ::aws_smithy_schema::ShapeType::Integer,
  134         -
    "data_length",
         134  +
    "DataLength",
  135    135   
    5,
  136    136   
)
  137    137   
.with_http_header("x-amz-Data-Length");
  138    138   
static PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  139    139   
    ::aws_smithy_schema::ShapeId::from_static(
  140    140   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$ChecksumAlgorithm",
  141    141   
        "com.amazonaws.ebs.synthetic",
  142    142   
        "PutSnapshotBlockInput",
  143    143   
    ),
  144    144   
    ::aws_smithy_schema::ShapeType::String,
  145         -
    "checksum_algorithm",
         145  +
    "ChecksumAlgorithm",
  146    146   
    6,
  147    147   
)
  148    148   
.with_http_header("x-amz-Checksum-Algorithm");
  149    149   
static PUTSNAPSHOTBLOCKINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  150    150   
    PUTSNAPSHOTBLOCKINPUT_SCHEMA_ID,
  151    151   
    ::aws_smithy_schema::ShapeType::Structure,
  152    152   
    &[
  153    153   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID,
  154    154   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX,
  155    155   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM,
  156    156   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS,
  157    157   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_DATA,
  158    158   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH,
  159    159   
        &PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM,
  160    160   
    ],
  161         -
);
         161  +
)
         162  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         163  +
    "PUT",
         164  +
    "/snapshots/{SnapshotId}/blocks/{BlockIndex}",
         165  +
    Some(201),
         166  +
));
  162    167   
impl PutSnapshotBlockInput {
  163    168   
    /// The schema for this shape.
  164    169   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTSNAPSHOTBLOCKINPUT_SCHEMA;
  165    170   
}
  166    171   
impl ::aws_smithy_schema::serde::SerializableStruct for PutSnapshotBlockInput {
  167    172   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  168    173   
    fn serialize_members(
  169    174   
        &self,
  170    175   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  171    176   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  172    177   
        if let Some(ref val) = self.snapshot_id {
  173    178   
            ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID, val)?;
  174    179   
        }
  175    180   
        if let Some(ref val) = self.block_index {
  176    181   
            ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX, *val)?;
  177    182   
        }
  178    183   
        if let Some(ref val) = self.checksum {
  179    184   
            ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM, val)?;
  180    185   
        }
  181    186   
        if let Some(ref val) = self.progress {
  182    187   
            ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS, *val)?;
  183    188   
        }
  184         -
        {
  185         -
            let val = &self.block_data;
  186         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
  187         -
        }
  188    189   
        if let Some(ref val) = self.data_length {
  189    190   
            ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH, *val)?;
  190    191   
        }
  191    192   
        if let Some(ref val) = self.checksum_algorithm {
  192    193   
            ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
  193    194   
        }
  194    195   
        Ok(())
  195    196   
    }
  196    197   
}
  197    198   
impl PutSnapshotBlockInput {
  198    199   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  199         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  200         -
        deserializer: &mut D,
         200  +
    pub fn deserialize(
         201  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  201    202   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  202    203   
        #[allow(unused_variables, unused_mut)]
  203    204   
        let mut builder = Self::builder();
  204    205   
        #[allow(
  205    206   
            unused_variables,
  206    207   
            unreachable_code,
  207    208   
            clippy::single_match,
  208    209   
            clippy::match_single_binding,
  209    210   
            clippy::diverging_sub_expression
  210    211   
        )]
  211         -
        deserializer.read_struct(&PUTSNAPSHOTBLOCKINPUT_SCHEMA, (), |_, member, deser| {
         212  +
        deserializer.read_struct(&PUTSNAPSHOTBLOCKINPUT_SCHEMA, &mut |member, deser| {
  212    213   
            match member.member_index() {
  213    214   
                Some(0) => {
  214    215   
                    builder.snapshot_id = Some(deser.read_string(member)?);
  215    216   
                }
  216    217   
                Some(1) => {
  217    218   
                    builder.block_index = Some(deser.read_integer(member)?);
  218    219   
                }
  219    220   
                Some(2) => {
  220    221   
                    builder.checksum = Some(deser.read_string(member)?);
  221    222   
                }
  222    223   
                Some(3) => {
  223    224   
                    builder.progress = Some(deser.read_integer(member)?);
  224    225   
                }
  225    226   
                Some(4) => {
  226    227   
                    builder.block_data = Some({
  227    228   
                        let _ = member;
  228    229   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
  229    230   
                    });
  230    231   
                }
  231    232   
                Some(5) => {
  232    233   
                    builder.data_length = Some(deser.read_integer(member)?);
  233    234   
                }
  234    235   
                Some(6) => {
  235    236   
                    builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
  236    237   
                }
  237    238   
                _ => {}
  238    239   
            }
  239    240   
            Ok(())
  240    241   
        })?;
         242  +
        builder.snapshot_id = builder.snapshot_id.or(Some(String::new()));
         243  +
        builder.block_index = builder.block_index.or(Some(0i32));
         244  +
        builder.checksum = builder.checksum.or(Some(String::new()));
         245  +
        builder.data_length = builder.data_length.or(Some(0i32));
         246  +
        builder
         247  +
            .build()
         248  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         249  +
    }
         250  +
}
         251  +
impl PutSnapshotBlockInput {
         252  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         253  +
    /// Header-bound members are read directly from headers, avoiding runtime
         254  +
    /// member iteration overhead. Body members are read via the deserializer.
         255  +
    pub fn deserialize_with_response(
         256  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         257  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         258  +
        _status: u16,
         259  +
        _body: &[u8],
         260  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         261  +
        #[allow(unused_variables, unused_mut)]
         262  +
        let mut builder = Self::builder();
         263  +
        if let Some(val) = headers.get("x-amz-Checksum") {
         264  +
            builder.checksum = Some(val.to_string());
         265  +
        }
         266  +
        if let Some(val) = headers.get("x-amz-Progress") {
         267  +
            builder.progress = val.parse::<i32>().ok();
         268  +
        }
         269  +
        if let Some(val) = headers.get("x-amz-Data-Length") {
         270  +
            builder.data_length = val.parse::<i32>().ok();
         271  +
        }
         272  +
        if let Some(val) = headers.get("x-amz-Checksum-Algorithm") {
         273  +
            builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(val));
         274  +
        }
         275  +
        #[allow(
         276  +
            unused_variables,
         277  +
            unreachable_code,
         278  +
            clippy::single_match,
         279  +
            clippy::match_single_binding,
         280  +
            clippy::diverging_sub_expression
         281  +
        )]
         282  +
        deserializer.read_struct(&PUTSNAPSHOTBLOCKINPUT_SCHEMA, &mut |member, deser| {
         283  +
            match member.member_index() {
         284  +
                Some(0) => {
         285  +
                    builder.snapshot_id = Some(deser.read_string(member)?);
         286  +
                }
         287  +
                Some(1) => {
         288  +
                    builder.block_index = Some(deser.read_integer(member)?);
         289  +
                }
         290  +
                Some(2) => { /* read from headers above */ }
         291  +
                Some(3) => { /* read from headers above */ }
         292  +
                Some(4) => {
         293  +
                    builder.block_data = Some({
         294  +
                        let _ = member;
         295  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         296  +
                    });
         297  +
                }
         298  +
                Some(5) => { /* read from headers above */ }
         299  +
                Some(6) => { /* read from headers above */ }
         300  +
                _ => {}
         301  +
            }
         302  +
            Ok(())
         303  +
        })?;
  241    304   
        builder
  242    305   
            .build()
  243    306   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  244    307   
    }
  245    308   
}
  246    309   
impl PutSnapshotBlockInput {
  247    310   
    /// Creates a new builder-style object to manufacture [`PutSnapshotBlockInput`](crate::operation::put_snapshot_block::PutSnapshotBlockInput).
  248    311   
    pub fn builder() -> crate::operation::put_snapshot_block::builders::PutSnapshotBlockInputBuilder {
  249    312   
        crate::operation::put_snapshot_block::builders::PutSnapshotBlockInputBuilder::default()
  250    313   
    }

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/put_snapshot_block/_put_snapshot_block_output.rs

@@ -3,3 +130,151 @@
   23     23   
    "com.amazonaws.ebs.synthetic",
   24     24   
    "PutSnapshotBlockOutput",
   25     25   
);
   26     26   
static PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   27     27   
    ::aws_smithy_schema::ShapeId::from_static(
   28     28   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockOutput$ChecksumAlgorithm",
   29     29   
        "com.amazonaws.ebs.synthetic",
   30     30   
        "PutSnapshotBlockOutput",
   31     31   
    ),
   32     32   
    ::aws_smithy_schema::ShapeType::String,
   33         -
    "checksum_algorithm",
          33  +
    "ChecksumAlgorithm",
   34     34   
    0,
   35     35   
)
   36     36   
.with_http_header("x-amz-Checksum-Algorithm");
   37     37   
static PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   38     38   
    ::aws_smithy_schema::ShapeId::from_static(
   39     39   
        "com.amazonaws.ebs.synthetic#PutSnapshotBlockOutput$Checksum",
   40     40   
        "com.amazonaws.ebs.synthetic",
   41     41   
        "PutSnapshotBlockOutput",
   42     42   
    ),
   43     43   
    ::aws_smithy_schema::ShapeType::String,
   44         -
    "checksum",
          44  +
    "Checksum",
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_header("x-amz-Checksum");
   48     48   
static PUTSNAPSHOTBLOCKOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    PUTSNAPSHOTBLOCKOUTPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM, &PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM],
   52     52   
);
   53     53   
impl PutSnapshotBlockOutput {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTSNAPSHOTBLOCKOUTPUT_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for PutSnapshotBlockOutput {
   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.checksum_algorithm {
   64     64   
            ser.write_string(&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
   65     65   
        }
   66     66   
        if let Some(ref val) = self.checksum {
   67     67   
            ser.write_string(&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM, val)?;
   68     68   
        }
   69     69   
        Ok(())
   70     70   
    }
   71     71   
}
   72     72   
impl PutSnapshotBlockOutput {
   73     73   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   74         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   75         -
        deserializer: &mut D,
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   76     76   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   77     77   
        #[allow(unused_variables, unused_mut)]
   78     78   
        let mut builder = Self::builder();
   79     79   
        #[allow(
   80     80   
            unused_variables,
   81     81   
            unreachable_code,
   82     82   
            clippy::single_match,
   83     83   
            clippy::match_single_binding,
   84     84   
            clippy::diverging_sub_expression
   85     85   
        )]
   86         -
        deserializer.read_struct(&PUTSNAPSHOTBLOCKOUTPUT_SCHEMA, (), |_, member, deser| {
          86  +
        deserializer.read_struct(&PUTSNAPSHOTBLOCKOUTPUT_SCHEMA, &mut |member, deser| {
   87     87   
            match member.member_index() {
   88     88   
                Some(0) => {
   89     89   
                    builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
   90     90   
                }
   91     91   
                Some(1) => {
   92     92   
                    builder.checksum = Some(deser.read_string(member)?);
   93     93   
                }
   94     94   
                _ => {}
   95     95   
            }
   96     96   
            Ok(())
   97     97   
        })?;
   98     98   
        Ok(builder.build())
   99     99   
    }
  100    100   
}
         101  +
impl PutSnapshotBlockOutput {
         102  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         103  +
    /// Header-bound members are read directly from headers, avoiding runtime
         104  +
    /// member iteration overhead. Body members are read via the deserializer.
         105  +
    pub fn deserialize_with_response(
         106  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         107  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         108  +
        _status: u16,
         109  +
        _body: &[u8],
         110  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         111  +
        #[allow(unused_variables, unused_mut)]
         112  +
        let mut builder = Self::builder();
         113  +
        if let Some(val) = headers.get("x-amz-Checksum-Algorithm") {
         114  +
            builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(val));
         115  +
        }
         116  +
        if let Some(val) = headers.get("x-amz-Checksum") {
         117  +
            builder.checksum = Some(val.to_string());
         118  +
        }
         119  +
        Ok(builder.build())
         120  +
    }
         121  +
}
  101    122   
impl PutSnapshotBlockOutput {
  102    123   
    /// Creates a new builder-style object to manufacture [`PutSnapshotBlockOutput`](crate::operation::put_snapshot_block::PutSnapshotBlockOutput).
  103    124   
    pub fn builder() -> crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder {
  104    125   
        crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder::default()
  105    126   
    }
  106    127   
}
  107    128   
  108    129   
/// A builder for [`PutSnapshotBlockOutput`](crate::operation::put_snapshot_block::PutSnapshotBlockOutput).
  109    130   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  110    131   
#[non_exhaustive]

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