Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

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

@@ -120,120 +158,154 @@
  140    140   
  141    141   
mod idempotency_token;
  142    142   
  143    143   
/// All operations that this crate can perform.
  144    144   
pub mod operation;
  145    145   
  146    146   
pub(crate) mod protocol_serde;
  147    147   
  148    148   
mod sdk_feature_tracker;
  149    149   
  150         -
mod serialization_settings;
         150  +
mod json_errors;
  151    151   
  152    152   
mod lens;
  153    153   
  154         -
mod serde_util;
  155         -
  156         -
mod json_errors;
  157         -
  158    154   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/complete_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 `CompleteSnapshot`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CompleteSnapshot;
    6      6   
impl CompleteSnapshot {
    7      7   
    /// Creates a new `CompleteSnapshot`
    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::complete_snapshot::CompleteSnapshotInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::complete_snapshot::CompleteSnapshotOutput::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::complete_snapshot::CompleteSnapshotInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::complete_snapshot::CompleteSnapshotOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::complete_snapshot::CompleteSnapshotError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -101,105 +231,433 @@
  121    125   
                crate::operation::complete_snapshot::CompleteSnapshotError,
  122    126   
            >::new());
  123    127   
  124    128   
        ::std::borrow::Cow::Owned(rcb)
  125    129   
    }
  126    130   
}
  127    131   
  128    132   
#[derive(Debug)]
  129    133   
struct CompleteSnapshotResponseDeserializer;
  130    134   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CompleteSnapshotResponseDeserializer {
  131         -
    fn deserialize_nonstreaming(
         135  +
    fn deserialize_nonstreaming_with_config(
  132    136   
        &self,
  133    137   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         138  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  134    139   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  135    140   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  136         -
        let headers = response.headers();
  137         -
        let body = response.body().bytes().expect("body loaded");
  138    141   
        #[allow(unused_mut)]
  139    142   
        let mut force_error = false;
  140    143   
  141         -
        let parse_result = if !success && status != 202 || force_error {
  142         -
            crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot_http_error(status, headers, body)
         144  +
        if !success && status != 202 || force_error {
         145  +
            let headers = response.headers();
         146  +
            let body = response.body().bytes().expect("body loaded");
         147  +
            #[allow(unused_mut)]
         148  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         149  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         150  +
            })?;
         151  +
         152  +
            let generic = generic_builder.build();
         153  +
            let error_code = match generic.code() {
         154  +
                ::std::option::Option::Some(code) => code,
         155  +
                ::std::option::Option::None => {
         156  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         157  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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  +
                        }
         305  +
                    };
         306  +
                    tmp.meta = generic;
         307  +
                    if tmp.message.is_none() {
         308  +
                        tmp.message = _error_message;
         309  +
                    }
         310  +
                    tmp
         311  +
                }),
         312  +
                _ => crate::operation::complete_snapshot::CompleteSnapshotError::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  +
            ))
  143    317   
        } else {
  144         -
            crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot_http_response(status, headers, body)
  145         -
        };
  146         -
        crate::protocol_serde::type_erase_result(parse_result)
         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, CompleteSnapshot::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::complete_snapshot::CompleteSnapshotOutput::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 CompleteSnapshotRequestSerializer;
  151    342   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CompleteSnapshotRequestSerializer {
  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::complete_snapshot::CompleteSnapshotInput>()
  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::complete_snapshot::CompleteSnapshotInput,
  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         -
                    ));
         352  +
        let protocol = _cfg
         353  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         354  +
            .expect("a SharedClientProtocol is required");
         355  +
        if protocol.supports_http_bindings() {
         356  +
            let mut request = protocol
         357  +
                .serialize_body(&input, CompleteSnapshot::INPUT_SCHEMA, "", _cfg)
         358  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         359  +
            {
         360  +
                let mut uri = "/snapshots/completion/{SnapshotId}".to_string();
         361  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         362  +
                if let Some(ref val) = input.changed_blocks_count {
         363  +
                    request.headers_mut().insert("x-amz-ChangedBlocksCount", val.to_string());
  182    364   
                }
  183         -
                ::std::write!(output, "/snapshots/completion/{SnapshotId}", SnapshotId = snapshot_id).expect("formatting should succeed");
  184         -
                ::std::result::Result::Ok(())
  185         -
            }
  186         -
            #[allow(clippy::unnecessary_wraps)]
  187         -
            fn update_http_builder(
  188         -
                input: &crate::operation::complete_snapshot::CompleteSnapshotInput,
  189         -
                builder: ::http_1x::request::Builder,
  190         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191         -
                let mut uri = ::std::string::String::new();
  192         -
                uri_base(input, &mut uri)?;
  193         -
                let builder = crate::protocol_serde::shape_complete_snapshot::ser_complete_snapshot_headers(input, builder)?;
  194         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         365  +
                if let Some(ref val) = input.checksum_aggregation_method {
         366  +
                    request
         367  +
                        .headers_mut()
         368  +
                        .insert("x-amz-Checksum-Aggregation-Method", val.as_str().to_string());
         369  +
                }
         370  +
                if let Some(ref val) = input.checksum_algorithm {
         371  +
                    request.headers_mut().insert("x-amz-Checksum-Algorithm", val.as_str().to_string());
         372  +
                }
         373  +
                if let Some(ref val) = input.snapshot_id {
         374  +
                    uri = uri.replace("{SnapshotId}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
         375  +
                }
         376  +
                if let Some(ref val) = input.checksum {
         377  +
                    request.headers_mut().insert("x-amz-Checksum", val.to_string());
         378  +
                }
         379  +
                if !query_params.is_empty() {
         380  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         381  +
                    let pairs: Vec<String> = query_params
         382  +
                        .iter()
         383  +
                        .map(|(k, v)| {
         384  +
                            format!(
         385  +
                                "{}={}",
         386  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         387  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         388  +
                            )
         389  +
                        })
         390  +
                        .collect();
         391  +
                    uri.push_str(&pairs.join("&"));
         392  +
                }
         393  +
                request.set_uri(uri.as_str()).expect("valid URI");
  195    394   
            }
  196         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  197         -
            builder
  198         -
        };
  199         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  200    395   
  201         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         396  +
            return ::std::result::Result::Ok(request);
         397  +
        } else {
         398  +
            let mut request = protocol
         399  +
                .serialize_request(&input, CompleteSnapshot::INPUT_SCHEMA, "", _cfg)
         400  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         401  +
         402  +
            return ::std::result::Result::Ok(request);
         403  +
        }
  202    404   
    }
  203    405   
}
  204    406   
#[derive(Debug)]
  205    407   
struct CompleteSnapshotEndpointParamsInterceptor;
  206    408   
  207    409   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CompleteSnapshotEndpointParamsInterceptor {
  208    410   
    fn name(&self) -> &'static str {
  209    411   
        "CompleteSnapshotEndpointParamsInterceptor"
  210    412   
    }
  211    413   

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/complete_snapshot/_complete_snapshot_input.rs

@@ -23,23 +204,260 @@
   43     43   
    "com.amazonaws.ebs.synthetic",
   44     44   
    "CompleteSnapshotInput",
   45     45   
);
   46     46   
static COMPLETESNAPSHOTINPUT_MEMBER_CHANGED_BLOCKS_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   47     47   
    ::aws_smithy_schema::ShapeId::from_static(
   48     48   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotInput$ChangedBlocksCount",
   49     49   
        "com.amazonaws.ebs.synthetic",
   50     50   
        "CompleteSnapshotInput",
   51     51   
    ),
   52     52   
    ::aws_smithy_schema::ShapeType::Integer,
   53         -
    "changed_blocks_count",
          53  +
    "ChangedBlocksCount",
   54     54   
    0,
   55     55   
)
   56     56   
.with_http_header("x-amz-ChangedBlocksCount");
   57     57   
static COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_AGGREGATION_METHOD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   58     58   
    ::aws_smithy_schema::ShapeId::from_static(
   59     59   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotInput$ChecksumAggregationMethod",
   60     60   
        "com.amazonaws.ebs.synthetic",
   61     61   
        "CompleteSnapshotInput",
   62     62   
    ),
   63     63   
    ::aws_smithy_schema::ShapeType::String,
   64         -
    "checksum_aggregation_method",
          64  +
    "ChecksumAggregationMethod",
   65     65   
    1,
   66     66   
)
   67     67   
.with_http_header("x-amz-Checksum-Aggregation-Method");
   68     68   
static COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   69     69   
    ::aws_smithy_schema::ShapeId::from_static(
   70     70   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotInput$ChecksumAlgorithm",
   71     71   
        "com.amazonaws.ebs.synthetic",
   72     72   
        "CompleteSnapshotInput",
   73     73   
    ),
   74     74   
    ::aws_smithy_schema::ShapeType::String,
   75         -
    "checksum_algorithm",
          75  +
    "ChecksumAlgorithm",
   76     76   
    2,
   77     77   
)
   78     78   
.with_http_header("x-amz-Checksum-Algorithm");
   79     79   
static COMPLETESNAPSHOTINPUT_MEMBER_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   80     80   
    ::aws_smithy_schema::ShapeId::from_static(
   81     81   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotInput$SnapshotId",
   82     82   
        "com.amazonaws.ebs.synthetic",
   83     83   
        "CompleteSnapshotInput",
   84     84   
    ),
   85     85   
    ::aws_smithy_schema::ShapeType::String,
   86         -
    "snapshot_id",
          86  +
    "SnapshotId",
   87     87   
    3,
   88     88   
)
   89     89   
.with_http_label();
   90     90   
static COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotInput$Checksum",
   93     93   
        "com.amazonaws.ebs.synthetic",
   94     94   
        "CompleteSnapshotInput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::String,
   97         -
    "checksum",
          97  +
    "Checksum",
   98     98   
    4,
   99     99   
)
  100    100   
.with_http_header("x-amz-Checksum");
  101    101   
static COMPLETESNAPSHOTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  102    102   
    COMPLETESNAPSHOTINPUT_SCHEMA_ID,
  103    103   
    ::aws_smithy_schema::ShapeType::Structure,
  104    104   
    &[
  105    105   
        &COMPLETESNAPSHOTINPUT_MEMBER_CHANGED_BLOCKS_COUNT,
  106    106   
        &COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_AGGREGATION_METHOD,
  107    107   
        &COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_ALGORITHM,
  108    108   
        &COMPLETESNAPSHOTINPUT_MEMBER_SNAPSHOT_ID,
  109    109   
        &COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM,
  110    110   
    ],
  111         -
);
         111  +
)
         112  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         113  +
    "POST",
         114  +
    "/snapshots/completion/{SnapshotId}",
         115  +
    Some(202),
         116  +
));
  112    117   
impl CompleteSnapshotInput {
  113    118   
    /// The schema for this shape.
  114    119   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLETESNAPSHOTINPUT_SCHEMA;
  115    120   
}
  116    121   
impl ::aws_smithy_schema::serde::SerializableStruct for CompleteSnapshotInput {
  117    122   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  118    123   
    fn serialize_members(
  119    124   
        &self,
  120    125   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  121    126   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  122    127   
        if let Some(ref val) = self.changed_blocks_count {
  123    128   
            ser.write_integer(&COMPLETESNAPSHOTINPUT_MEMBER_CHANGED_BLOCKS_COUNT, *val)?;
  124    129   
        }
  125    130   
        if let Some(ref val) = self.checksum_aggregation_method {
  126    131   
            ser.write_string(&COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_AGGREGATION_METHOD, val.as_str())?;
  127    132   
        }
  128    133   
        if let Some(ref val) = self.checksum_algorithm {
  129    134   
            ser.write_string(&COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
  130    135   
        }
  131    136   
        if let Some(ref val) = self.snapshot_id {
  132    137   
            ser.write_string(&COMPLETESNAPSHOTINPUT_MEMBER_SNAPSHOT_ID, val)?;
  133    138   
        }
  134    139   
        if let Some(ref val) = self.checksum {
  135    140   
            ser.write_string(&COMPLETESNAPSHOTINPUT_MEMBER_CHECKSUM, val)?;
  136    141   
        }
  137    142   
        Ok(())
  138    143   
    }
  139    144   
}
  140    145   
impl CompleteSnapshotInput {
  141    146   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  142         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  143         -
        deserializer: &mut D,
         147  +
    pub fn deserialize(
         148  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  144    149   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  145    150   
        #[allow(unused_variables, unused_mut)]
  146    151   
        let mut builder = Self::builder();
  147    152   
        #[allow(
  148    153   
            unused_variables,
  149    154   
            unreachable_code,
  150    155   
            clippy::single_match,
  151    156   
            clippy::match_single_binding,
  152    157   
            clippy::diverging_sub_expression
  153    158   
        )]
  154         -
        deserializer.read_struct(&COMPLETESNAPSHOTINPUT_SCHEMA, (), |_, member, deser| {
         159  +
        deserializer.read_struct(&COMPLETESNAPSHOTINPUT_SCHEMA, &mut |member, deser| {
  155    160   
            match member.member_index() {
  156    161   
                Some(0) => {
  157    162   
                    builder.changed_blocks_count = Some(deser.read_integer(member)?);
  158    163   
                }
  159    164   
                Some(1) => {
  160    165   
                    builder.checksum_aggregation_method = Some(crate::types::ChecksumAggregationMethod::from(deser.read_string(member)?.as_str()));
  161    166   
                }
  162    167   
                Some(2) => {
  163    168   
                    builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
  164    169   
                }
  165    170   
                Some(3) => {
  166    171   
                    builder.snapshot_id = Some(deser.read_string(member)?);
  167    172   
                }
  168    173   
                Some(4) => {
  169    174   
                    builder.checksum = Some(deser.read_string(member)?);
  170    175   
                }
  171    176   
                _ => {}
  172    177   
            }
  173    178   
            Ok(())
  174    179   
        })?;
         180  +
        builder.changed_blocks_count = builder.changed_blocks_count.or(Some(0i32));
         181  +
        builder.snapshot_id = builder.snapshot_id.or(Some(String::new()));
         182  +
        builder
         183  +
            .build()
         184  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         185  +
    }
         186  +
}
         187  +
impl CompleteSnapshotInput {
         188  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         189  +
    /// Header-bound members are read directly from headers, avoiding runtime
         190  +
    /// member iteration overhead. Body members are read via the deserializer.
         191  +
    pub fn deserialize_with_response(
         192  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         193  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         194  +
        _status: u16,
         195  +
        _body: &[u8],
         196  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         197  +
        #[allow(unused_variables, unused_mut)]
         198  +
        let mut builder = Self::builder();
         199  +
        if let Some(val) = headers.get("x-amz-ChangedBlocksCount") {
         200  +
            builder.changed_blocks_count = val.parse::<i32>().ok();
         201  +
        }
         202  +
        if let Some(val) = headers.get("x-amz-Checksum-Aggregation-Method") {
         203  +
            builder.checksum_aggregation_method = Some(crate::types::ChecksumAggregationMethod::from(val));
         204  +
        }
         205  +
        if let Some(val) = headers.get("x-amz-Checksum-Algorithm") {
         206  +
            builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(val));
         207  +
        }
         208  +
        if let Some(val) = headers.get("x-amz-Checksum") {
         209  +
            builder.checksum = Some(val.to_string());
         210  +
        }
         211  +
        #[allow(
         212  +
            unused_variables,
         213  +
            unreachable_code,
         214  +
            clippy::single_match,
         215  +
            clippy::match_single_binding,
         216  +
            clippy::diverging_sub_expression
         217  +
        )]
         218  +
        deserializer.read_struct(&COMPLETESNAPSHOTINPUT_SCHEMA, &mut |member, deser| {
         219  +
            match member.member_index() {
         220  +
                Some(0) => { /* read from headers above */ }
         221  +
                Some(1) => { /* read from headers above */ }
         222  +
                Some(2) => { /* read from headers above */ }
         223  +
                Some(3) => {
         224  +
                    builder.snapshot_id = Some(deser.read_string(member)?);
         225  +
                }
         226  +
                Some(4) => { /* read from headers above */ }
         227  +
                _ => {}
         228  +
            }
         229  +
            Ok(())
         230  +
        })?;
  175    231   
        builder
  176    232   
            .build()
  177    233   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  178    234   
    }
  179    235   
}
  180    236   
impl CompleteSnapshotInput {
  181    237   
    /// Creates a new builder-style object to manufacture [`CompleteSnapshotInput`](crate::operation::complete_snapshot::CompleteSnapshotInput).
  182    238   
    pub fn builder() -> crate::operation::complete_snapshot::builders::CompleteSnapshotInputBuilder {
  183    239   
        crate::operation::complete_snapshot::builders::CompleteSnapshotInputBuilder::default()
  184    240   
    }

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/complete_snapshot/_complete_snapshot_output.rs

@@ -1,1 +106,117 @@
   17     17   
    "com.amazonaws.ebs.synthetic",
   18     18   
    "CompleteSnapshotOutput",
   19     19   
);
   20     20   
static COMPLETESNAPSHOTOUTPUT_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   21     21   
    ::aws_smithy_schema::ShapeId::from_static(
   22     22   
        "com.amazonaws.ebs.synthetic#CompleteSnapshotOutput$Status",
   23     23   
        "com.amazonaws.ebs.synthetic",
   24     24   
        "CompleteSnapshotOutput",
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27         -
    "status",
          27  +
    "Status",
   28     28   
    0,
   29     29   
);
   30     30   
static COMPLETESNAPSHOTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   31     31   
    COMPLETESNAPSHOTOUTPUT_SCHEMA_ID,
   32     32   
    ::aws_smithy_schema::ShapeType::Structure,
   33     33   
    &[&COMPLETESNAPSHOTOUTPUT_MEMBER_STATUS],
   34     34   
);
   35     35   
impl CompleteSnapshotOutput {
   36     36   
    /// The schema for this shape.
   37     37   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLETESNAPSHOTOUTPUT_SCHEMA;
   38     38   
}
   39     39   
impl ::aws_smithy_schema::serde::SerializableStruct for CompleteSnapshotOutput {
   40     40   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   41     41   
    fn serialize_members(
   42     42   
        &self,
   43     43   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        if let Some(ref val) = self.status {
   46     46   
            ser.write_string(&COMPLETESNAPSHOTOUTPUT_MEMBER_STATUS, val.as_str())?;
   47     47   
        }
   48     48   
        Ok(())
   49     49   
    }
   50     50   
}
   51     51   
impl CompleteSnapshotOutput {
   52     52   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   53         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   54         -
        deserializer: &mut D,
          53  +
    pub fn deserialize(
          54  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   55     55   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   56     56   
        #[allow(unused_variables, unused_mut)]
   57     57   
        let mut builder = Self::builder();
   58     58   
        #[allow(
   59     59   
            unused_variables,
   60     60   
            unreachable_code,
   61     61   
            clippy::single_match,
   62     62   
            clippy::match_single_binding,
   63     63   
            clippy::diverging_sub_expression
   64     64   
        )]
   65         -
        deserializer.read_struct(&COMPLETESNAPSHOTOUTPUT_SCHEMA, (), |_, member, deser| {
          65  +
        deserializer.read_struct(&COMPLETESNAPSHOTOUTPUT_SCHEMA, &mut |member, deser| {
   66     66   
            match member.member_index() {
   67     67   
                Some(0) => {
   68     68   
                    builder.status = Some(crate::types::Status::from(deser.read_string(member)?.as_str()));
   69     69   
                }
   70     70   
                _ => {}
   71     71   
            }
   72     72   
            Ok(())
   73     73   
        })?;
   74     74   
        Ok(builder.build())
   75     75   
    }
   76     76   
}
          77  +
impl CompleteSnapshotOutput {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl CompleteSnapshotOutput {
   78     89   
    /// Creates a new builder-style object to manufacture [`CompleteSnapshotOutput`](crate::operation::complete_snapshot::CompleteSnapshotOutput).
   79     90   
    pub fn builder() -> crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder {
   80     91   
        crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`CompleteSnapshotOutput`](crate::operation::complete_snapshot::CompleteSnapshotOutput).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/get_snapshot_block/_get_snapshot_block_input.rs

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/get_snapshot_block/_get_snapshot_block_output.rs

@@ -24,24 +194,236 @@
   44     44   
    "com.amazonaws.ebs.synthetic",
   45     45   
    "GetSnapshotBlockOutput",
   46     46   
);
   47     47   
static GETSNAPSHOTBLOCKOUTPUT_MEMBER_DATA_LENGTH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   48     48   
    ::aws_smithy_schema::ShapeId::from_static(
   49     49   
        "com.amazonaws.ebs.synthetic#GetSnapshotBlockOutput$DataLength",
   50     50   
        "com.amazonaws.ebs.synthetic",
   51     51   
        "GetSnapshotBlockOutput",
   52     52   
    ),
   53     53   
    ::aws_smithy_schema::ShapeType::Integer,
   54         -
    "data_length",
          54  +
    "DataLength",
   55     55   
    0,
   56     56   
)
   57     57   
.with_http_header("x-amz-Data-Length");
   58     58   
static GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   59     59   
    ::aws_smithy_schema::ShapeId::from_static(
   60     60   
        "com.amazonaws.ebs.synthetic#GetSnapshotBlockOutput$ChecksumAlgorithm",
   61     61   
        "com.amazonaws.ebs.synthetic",
   62     62   
        "GetSnapshotBlockOutput",
   63     63   
    ),
   64     64   
    ::aws_smithy_schema::ShapeType::String,
   65         -
    "checksum_algorithm",
          65  +
    "ChecksumAlgorithm",
   66     66   
    1,
   67     67   
)
   68     68   
.with_http_header("x-amz-Checksum-Algorithm");
   69     69   
static GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   70     70   
    ::aws_smithy_schema::ShapeId::from_static(
   71     71   
        "com.amazonaws.ebs.synthetic#GetSnapshotBlockOutput$Checksum",
   72     72   
        "com.amazonaws.ebs.synthetic",
   73     73   
        "GetSnapshotBlockOutput",
   74     74   
    ),
   75     75   
    ::aws_smithy_schema::ShapeType::String,
   76         -
    "checksum",
          76  +
    "Checksum",
   77     77   
    2,
   78     78   
)
   79     79   
.with_http_header("x-amz-Checksum");
   80     80   
static GETSNAPSHOTBLOCKOUTPUT_MEMBER_BLOCK_DATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   81     81   
    ::aws_smithy_schema::ShapeId::from_static(
   82     82   
        "com.amazonaws.ebs.synthetic#GetSnapshotBlockOutput$BlockData",
   83     83   
        "com.amazonaws.ebs.synthetic",
   84     84   
        "GetSnapshotBlockOutput",
   85     85   
    ),
   86     86   
    ::aws_smithy_schema::ShapeType::Blob,
   87         -
    "block_data",
          87  +
    "BlockData",
   88     88   
    3,
   89     89   
)
   90     90   
.with_http_payload();
   91     91   
static GETSNAPSHOTBLOCKOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   92     92   
    GETSNAPSHOTBLOCKOUTPUT_SCHEMA_ID,
   93     93   
    ::aws_smithy_schema::ShapeType::Structure,
   94     94   
    &[
   95     95   
        &GETSNAPSHOTBLOCKOUTPUT_MEMBER_DATA_LENGTH,
   96     96   
        &GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM,
   97     97   
        &GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM,
   98     98   
        &GETSNAPSHOTBLOCKOUTPUT_MEMBER_BLOCK_DATA,
   99     99   
    ],
  100    100   
);
  101    101   
impl GetSnapshotBlockOutput {
  102    102   
    /// The schema for this shape.
  103    103   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETSNAPSHOTBLOCKOUTPUT_SCHEMA;
  104    104   
}
  105    105   
impl ::aws_smithy_schema::serde::SerializableStruct for GetSnapshotBlockOutput {
  106    106   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  107    107   
    fn serialize_members(
  108    108   
        &self,
  109    109   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  110    110   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  111    111   
        if let Some(ref val) = self.data_length {
  112    112   
            ser.write_integer(&GETSNAPSHOTBLOCKOUTPUT_MEMBER_DATA_LENGTH, *val)?;
  113    113   
        }
  114    114   
        if let Some(ref val) = self.checksum_algorithm {
  115    115   
            ser.write_string(&GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
  116    116   
        }
  117    117   
        if let Some(ref val) = self.checksum {
  118    118   
            ser.write_string(&GETSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM, val)?;
  119    119   
        }
  120         -
        {
  121         -
            let val = &self.block_data;
  122         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
  123         -
        }
  124    120   
        Ok(())
  125    121   
    }
  126    122   
}
  127    123   
impl GetSnapshotBlockOutput {
  128    124   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  129         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  130         -
        deserializer: &mut D,
         125  +
    pub fn deserialize(
         126  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  131    127   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  132    128   
        #[allow(unused_variables, unused_mut)]
  133    129   
        let mut builder = Self::builder();
  134    130   
        #[allow(
  135    131   
            unused_variables,
  136    132   
            unreachable_code,
  137    133   
            clippy::single_match,
  138    134   
            clippy::match_single_binding,
  139    135   
            clippy::diverging_sub_expression
  140    136   
        )]
  141         -
        deserializer.read_struct(&GETSNAPSHOTBLOCKOUTPUT_SCHEMA, (), |_, member, deser| {
         137  +
        deserializer.read_struct(&GETSNAPSHOTBLOCKOUTPUT_SCHEMA, &mut |member, deser| {
  142    138   
            match member.member_index() {
  143    139   
                Some(0) => {
  144    140   
                    builder.data_length = Some(deser.read_integer(member)?);
  145    141   
                }
  146    142   
                Some(1) => {
  147    143   
                    builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
  148    144   
                }
  149    145   
                Some(2) => {
  150    146   
                    builder.checksum = Some(deser.read_string(member)?);
  151    147   
                }
  152    148   
                Some(3) => {
  153    149   
                    builder.block_data = Some({
  154    150   
                        let _ = member;
  155    151   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
  156    152   
                    });
  157    153   
                }
  158    154   
                _ => {}
  159    155   
            }
  160    156   
            Ok(())
  161    157   
        })?;
  162    158   
        Ok(builder.build())
  163    159   
    }
  164    160   
}
         161  +
impl GetSnapshotBlockOutput {
         162  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         163  +
    /// Header-bound members are read directly from headers, avoiding runtime
         164  +
    /// member iteration overhead. Body members are read via the deserializer.
         165  +
    pub fn deserialize_with_response(
         166  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         167  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         168  +
        _status: u16,
         169  +
        _body: &[u8],
         170  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         171  +
        #[allow(unused_variables, unused_mut)]
         172  +
        let mut builder = Self::builder();
         173  +
        if let Some(val) = headers.get("x-amz-Data-Length") {
         174  +
            builder.data_length = val.parse::<i32>().ok();
         175  +
        }
         176  +
        if let Some(val) = headers.get("x-amz-Checksum-Algorithm") {
         177  +
            builder.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(val));
         178  +
        }
         179  +
        if let Some(val) = headers.get("x-amz-Checksum") {
         180  +
            builder.checksum = Some(val.to_string());
         181  +
        }
         182  +
        #[allow(
         183  +
            unused_variables,
         184  +
            unreachable_code,
         185  +
            clippy::single_match,
         186  +
            clippy::match_single_binding,
         187  +
            clippy::diverging_sub_expression
         188  +
        )]
         189  +
        deserializer.read_struct(&GETSNAPSHOTBLOCKOUTPUT_SCHEMA, &mut |member, deser| {
         190  +
            match member.member_index() {
         191  +
                Some(0) => { /* read from headers above */ }
         192  +
                Some(1) => { /* read from headers above */ }
         193  +
                Some(2) => { /* read from headers above */ }
         194  +
                Some(3) => {
         195  +
                    builder.block_data = Some({
         196  +
                        let _ = member;
         197  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         198  +
                    });
         199  +
                }
         200  +
                _ => {}
         201  +
            }
         202  +
            Ok(())
         203  +
        })?;
         204  +
        Ok(builder.build())
         205  +
    }
         206  +
}
  165    207   
impl GetSnapshotBlockOutput {
  166    208   
    /// Creates a new builder-style object to manufacture [`GetSnapshotBlockOutput`](crate::operation::get_snapshot_block::GetSnapshotBlockOutput).
  167    209   
    pub fn builder() -> crate::operation::get_snapshot_block::builders::GetSnapshotBlockOutputBuilder {
  168    210   
        crate::operation::get_snapshot_block::builders::GetSnapshotBlockOutputBuilder::default()
  169    211   
    }
  170    212   
}
  171    213   
  172    214   
/// A builder for [`GetSnapshotBlockOutput`](crate::operation::get_snapshot_block::GetSnapshotBlockOutput).
  173    215   
#[derive(::std::default::Default)]
  174    216   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/list_changed_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 `ListChangedBlocks`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ListChangedBlocks;
    6      6   
impl ListChangedBlocks {
    7      7   
    /// Creates a new `ListChangedBlocks`
    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_changed_blocks::ListChangedBlocksInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::list_changed_blocks::ListChangedBlocksOutput::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_changed_blocks::ListChangedBlocksInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::list_changed_blocks::ListChangedBlocksOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::list_changed_blocks::ListChangedBlocksError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -102,106 +264,435 @@
  122    126   
                crate::operation::list_changed_blocks::ListChangedBlocksError,
  123    127   
            >::new());
  124    128   
  125    129   
        ::std::borrow::Cow::Owned(rcb)
  126    130   
    }
  127    131   
}
  128    132   
  129    133   
#[derive(Debug)]
  130    134   
struct ListChangedBlocksResponseDeserializer;
  131    135   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListChangedBlocksResponseDeserializer {
  132         -
    fn deserialize_nonstreaming(
         136  +
    fn deserialize_nonstreaming_with_config(
  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());
  137         -
        let headers = response.headers();
  138         -
        let body = response.body().bytes().expect("body loaded");
  139    142   
        #[allow(unused_mut)]
  140    143   
        let mut force_error = false;
  141    144   
  142         -
        let parse_result = if !success && status != 200 || force_error {
  143         -
            crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks_http_error(status, headers, body)
         145  +
        if !success && status != 200 || force_error {
         146  +
            let headers = response.headers();
         147  +
            let body = response.body().bytes().expect("body loaded");
         148  +
            #[allow(unused_mut)]
         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  +
            })?;
         152  +
         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_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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  +
                        }
         234  +
                    };
         235  +
                    tmp.meta = generic;
         236  +
                    if tmp.message.is_none() {
         237  +
                        tmp.message = _error_message;
         238  +
                    }
         239  +
                    tmp
         240  +
                }),
         241  +
                "ResourceNotFoundException" => crate::operation::list_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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_changed_blocks::ListChangedBlocksError::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  +
            ))
  144    318   
        } else {
  145         -
            crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks_http_response(status, headers, body)
  146         -
        };
  147         -
        crate::protocol_serde::type_erase_result(parse_result)
         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, ListChangedBlocks::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_changed_blocks::ListChangedBlocksOutput::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 ListChangedBlocksRequestSerializer;
  152    343   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListChangedBlocksRequestSerializer {
  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_changed_blocks::ListChangedBlocksInput>()
  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_changed_blocks::ListChangedBlocksInput,
  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.second_snapshot_id;
  174         -
                let input_1 = input_1.as_ref().ok_or_else(|| {
  175         -
                    ::aws_smithy_types::error::operation::BuildError::missing_field("second_snapshot_id", "cannot be empty or unset")
  176         -
                })?;
  177         -
                let second_snapshot_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  178         -
                if second_snapshot_id.is_empty() {
  179         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  180         -
                        "second_snapshot_id",
  181         -
                        "cannot be empty or unset",
  182         -
                    ));
         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, ListChangedBlocks::INPUT_SCHEMA, "", _cfg)
         359  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         360  +
            {
         361  +
                let mut uri = "/snapshots/{SecondSnapshotId}/changedblocks".to_string();
         362  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         363  +
                if let Some(ref val) = input.second_snapshot_id {
         364  +
                    uri = uri.replace(
         365  +
                        "{SecondSnapshotId}",
         366  +
                        &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()),
         367  +
                    );
  183    368   
                }
  184         -
                ::std::write!(
  185         -
                    output,
  186         -
                    "/snapshots/{SecondSnapshotId}/changedblocks",
  187         -
                    SecondSnapshotId = second_snapshot_id
  188         -
                )
  189         -
                .expect("formatting should succeed");
  190         -
                ::std::result::Result::Ok(())
  191         -
            }
  192         -
            fn uri_query(
  193         -
                _input: &crate::operation::list_changed_blocks::ListChangedBlocksInput,
  194         -
                mut output: &mut ::std::string::String,
  195         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  196         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  197         -
                if let ::std::option::Option::Some(inner_2) = &_input.first_snapshot_id {
  198         -
                    {
  199         -
                        query.push_kv("firstSnapshotId", &::aws_smithy_http::query::fmt_string(inner_2));
  200         -
                    }
         369  +
                if let Some(ref val) = input.first_snapshot_id {
         370  +
                    query_params.push(("firstSnapshotId".to_string(), val.to_string()));
  201    371   
                }
  202         -
                if let ::std::option::Option::Some(inner_3) = &_input.next_token {
  203         -
                    {
  204         -
                        query.push_kv("pageToken", &::aws_smithy_http::query::fmt_string(inner_3));
  205         -
                    }
         372  +
                if let Some(ref val) = input.next_token {
         373  +
                    query_params.push(("pageToken".to_string(), val.to_string()));
  206    374   
                }
  207         -
                if let ::std::option::Option::Some(inner_4) = &_input.max_results {
  208         -
                    {
  209         -
                        query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode());
  210         -
                    }
         375  +
                if let Some(ref val) = input.max_results {
         376  +
                    query_params.push(("maxResults".to_string(), val.to_string()));
  211    377   
                }
  212         -
                if let ::std::option::Option::Some(inner_5) = &_input.starting_block_index {
  213         -
                    {
  214         -
                        query.push_kv("startingBlockIndex", ::aws_smithy_types::primitive::Encoder::from(*inner_5).encode());
  215         -
                    }
         378  +
                if let Some(ref val) = input.starting_block_index {
         379  +
                    query_params.push(("startingBlockIndex".to_string(), val.to_string()));
  216    380   
                }
  217         -
                ::std::result::Result::Ok(())
  218         -
            }
  219         -
            #[allow(clippy::unnecessary_wraps)]
  220         -
            fn update_http_builder(
  221         -
                input: &crate::operation::list_changed_blocks::ListChangedBlocksInput,
  222         -
                builder: ::http_1x::request::Builder,
  223         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  224         -
                let mut uri = ::std::string::String::new();
  225         -
                uri_base(input, &mut uri)?;
  226         -
                uri_query(input, &mut uri)?;
  227         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         381  +
                if !query_params.is_empty() {
         382  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         383  +
                    let pairs: Vec<String> = query_params
         384  +
                        .iter()
         385  +
                        .map(|(k, v)| {
         386  +
                            format!(
         387  +
                                "{}={}",
         388  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         389  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         390  +
                            )
         391  +
                        })
         392  +
                        .collect();
         393  +
                    uri.push_str(&pairs.join("&"));
         394  +
                }
         395  +
                request.set_uri(uri.as_str()).expect("valid URI");
  228    396   
            }
  229         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  230         -
            builder
  231         -
        };
  232         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  233    397   
  234         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         398  +
            return ::std::result::Result::Ok(request);
         399  +
        } else {
         400  +
            let mut request = protocol
         401  +
                .serialize_request(&input, ListChangedBlocks::INPUT_SCHEMA, "", _cfg)
         402  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         403  +
         404  +
            return ::std::result::Result::Ok(request);
         405  +
        }
  235    406   
    }
  236    407   
}
  237    408   
#[derive(Debug)]
  238    409   
struct ListChangedBlocksEndpointParamsInterceptor;
  239    410   
  240    411   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListChangedBlocksEndpointParamsInterceptor {
  241    412   
    fn name(&self) -> &'static str {
  242    413   
        "ListChangedBlocksEndpointParamsInterceptor"
  243    414   
    }
  244    415