Server Test

Server Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde.rs

@@ -0,1 +0,68 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) mod shape_complete_snapshot;
           3  +
           4  +
pub(crate) mod shape_get_snapshot_block;
           5  +
           6  +
pub(crate) mod shape_list_changed_blocks;
           7  +
           8  +
pub(crate) mod shape_list_snapshot_blocks;
           9  +
          10  +
pub(crate) mod shape_put_snapshot_block;
          11  +
          12  +
pub(crate) mod shape_start_snapshot;
          13  +
          14  +
pub(crate) mod shape_access_denied_exception;
          15  +
          16  +
pub(crate) mod shape_complete_snapshot_input;
          17  +
          18  +
pub(crate) mod shape_complete_snapshot_output;
          19  +
          20  +
pub(crate) mod shape_concurrent_limit_exceeded_exception;
          21  +
          22  +
pub(crate) mod shape_conflict_exception;
          23  +
          24  +
pub(crate) mod shape_get_snapshot_block_input;
          25  +
          26  +
pub(crate) mod shape_get_snapshot_block_output;
          27  +
          28  +
pub(crate) mod shape_internal_server_exception;
          29  +
          30  +
pub(crate) mod shape_list_changed_blocks_input;
          31  +
          32  +
pub(crate) mod shape_list_changed_blocks_output;
          33  +
          34  +
pub(crate) mod shape_list_snapshot_blocks_input;
          35  +
          36  +
pub(crate) mod shape_list_snapshot_blocks_output;
          37  +
          38  +
pub(crate) mod shape_put_snapshot_block_input;
          39  +
          40  +
pub(crate) mod shape_put_snapshot_block_output;
          41  +
          42  +
pub(crate) mod shape_request_throttled_exception;
          43  +
          44  +
pub(crate) mod shape_resource_not_found_exception;
          45  +
          46  +
pub(crate) mod shape_service_quota_exceeded_exception;
          47  +
          48  +
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
          49  +
    if data.is_empty() {
          50  +
        b"{}"
          51  +
    } else {
          52  +
        data
          53  +
    }
          54  +
}
          55  +
          56  +
pub(crate) mod shape_start_snapshot_output;
          57  +
          58  +
pub(crate) mod shape_validation_exception;
          59  +
          60  +
pub(crate) mod shape_tags;
          61  +
          62  +
pub(crate) mod shape_block;
          63  +
          64  +
pub(crate) mod shape_changed_block;
          65  +
          66  +
pub(crate) mod shape_tag;
          67  +
          68  +
pub(crate) mod shape_validation_exception_field;

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_access_denied_exception.rs

@@ -0,1 +0,26 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_access_denied_exception_error(
           3  +
    value: &crate::error::AccessDeniedException,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_access_denied_exception(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::error::AccessDeniedException,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    if let Some(var_1) = &input.message {
          20  +
        object.key("Message").string(var_1.as_str());
          21  +
    }
          22  +
    {
          23  +
        object.key("Reason").string(input.reason.as_str());
          24  +
    }
          25  +
    Ok(())
          26  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_block.rs

@@ -0,1 +0,16 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_block(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::model::Block,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    if let Some(var_1) = &input.block_token {
           7  +
        object.key("BlockToken").string(var_1.as_str());
           8  +
    }
           9  +
    if let Some(var_2) = &input.block_index {
          10  +
        object.key("BlockIndex").number(
          11  +
            #[allow(clippy::useless_conversion)]
          12  +
            ::aws_smithy_types::Number::NegInt((var_2.0).into()),
          13  +
        );
          14  +
    }
          15  +
    Ok(())
          16  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_changed_block.rs

@@ -0,1 +0,19 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_changed_block(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::model::ChangedBlock,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    if let Some(var_1) = &input.first_block_token {
           7  +
        object.key("FirstBlockToken").string(var_1.as_str());
           8  +
    }
           9  +
    if let Some(var_2) = &input.block_index {
          10  +
        object.key("BlockIndex").number(
          11  +
            #[allow(clippy::useless_conversion)]
          12  +
            ::aws_smithy_types::Number::NegInt((var_2.0).into()),
          13  +
        );
          14  +
    }
          15  +
    if let Some(var_3) = &input.second_block_token {
          16  +
        object.key("SecondBlockToken").string(var_3.as_str());
          17  +
    }
          18  +
    Ok(())
          19  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_complete_snapshot.rs

@@ -0,1 +0,257 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_complete_snapshot_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::CompleteSnapshotInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::complete_snapshot_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        if let Some(value) =
          23  +
            crate::protocol_serde::shape_complete_snapshot_input::de_changed_blocks_count_header(
          24  +
                &headers,
          25  +
            )?
          26  +
        {
          27  +
            input = input.set_changed_blocks_count(value)
          28  +
        }
          29  +
        if let Some(value) =
          30  +
            crate::protocol_serde::shape_complete_snapshot_input::de_checksum_header(&headers)?
          31  +
        {
          32  +
            input = input.set_checksum(Some(value))
          33  +
        }
          34  +
        if let Some(value) = crate::protocol_serde::shape_complete_snapshot_input::de_checksum_aggregation_method_header(&headers)? {
          35  +
                                input = input.set_checksum_aggregation_method(Some(value))
          36  +
                            }
          37  +
        if let Some(value) =
          38  +
            crate::protocol_serde::shape_complete_snapshot_input::de_checksum_algorithm_header(
          39  +
                &headers,
          40  +
            )?
          41  +
        {
          42  +
            input = input.set_checksum_algorithm(Some(value))
          43  +
        }
          44  +
        let input_string = uri.path();
          45  +
        let (input_string, (_, _, m2)) =
          46  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          47  +
                ::nom::sequence::preceded(
          48  +
                    ::nom::bytes::complete::tag("/"),
          49  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
          50  +
                ),
          51  +
                ::nom::sequence::preceded(
          52  +
                    ::nom::bytes::complete::tag("/"),
          53  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("completion"),
          54  +
                ),
          55  +
                ::nom::sequence::preceded(
          56  +
                    ::nom::bytes::complete::tag("/"),
          57  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          58  +
                        ::nom::bytes::complete::take_until("/"),
          59  +
                        ::nom::combinator::rest,
          60  +
                    )),
          61  +
                ),
          62  +
            ))(input_string)?;
          63  +
        debug_assert_eq!("", input_string);
          64  +
        input = input.set_snapshot_id(
          65  +
            crate::protocol_serde::shape_complete_snapshot_input::de_snapshot_id(m2)?,
          66  +
        );
          67  +
        input.build()?
          68  +
    })
          69  +
}
          70  +
          71  +
#[allow(clippy::unnecessary_wraps)]
          72  +
pub fn ser_complete_snapshot_http_response(
          73  +
    #[allow(unused_variables)] output: crate::output::CompleteSnapshotOutput,
          74  +
) -> std::result::Result<
          75  +
    ::aws_smithy_legacy_http_server::response::Response,
          76  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          77  +
> {
          78  +
    Ok({
          79  +
        #[allow(unused_mut)]
          80  +
        let mut builder = ::http::Response::builder();
          81  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          82  +
            builder,
          83  +
            ::http::header::CONTENT_TYPE,
          84  +
            "application/json",
          85  +
        );
          86  +
        let http_status: u16 = 202;
          87  +
        builder = builder.status(http_status);
          88  +
        let payload =
          89  +
            crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output_output(&output)?
          90  +
        ;
          91  +
        let content_length = payload.len();
          92  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          93  +
            builder,
          94  +
            ::http::header::CONTENT_LENGTH,
          95  +
            content_length,
          96  +
        );
          97  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          98  +
        builder.body(body)?
          99  +
    })
         100  +
}
         101  +
         102  +
#[allow(clippy::unnecessary_wraps)]
         103  +
pub fn ser_complete_snapshot_http_error(
         104  +
    error: &crate::error::CompleteSnapshotError,
         105  +
) -> std::result::Result<
         106  +
    ::aws_smithy_legacy_http_server::response::Response,
         107  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         108  +
> {
         109  +
    Ok({
         110  +
        match error {
         111  +
            crate::error::CompleteSnapshotError::InternalServerException(output) => {
         112  +
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         113  +
                #[allow(unused_mut)]
         114  +
                let mut builder = ::http::Response::builder();
         115  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         116  +
                    builder,
         117  +
                    ::http::header::CONTENT_TYPE,
         118  +
                    "application/json",
         119  +
                );
         120  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         121  +
                    builder,
         122  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         123  +
                    "InternalServerException",
         124  +
                );
         125  +
                let content_length = payload.len();
         126  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         127  +
                    builder,
         128  +
                    ::http::header::CONTENT_LENGTH,
         129  +
                    content_length,
         130  +
                );
         131  +
                builder
         132  +
                    .status(500)
         133  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         134  +
            }
         135  +
            crate::error::CompleteSnapshotError::ResourceNotFoundException(output) => {
         136  +
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         137  +
                #[allow(unused_mut)]
         138  +
                let mut builder = ::http::Response::builder();
         139  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         140  +
                    builder,
         141  +
                    ::http::header::CONTENT_TYPE,
         142  +
                    "application/json",
         143  +
                );
         144  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         145  +
                    builder,
         146  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         147  +
                    "ResourceNotFoundException",
         148  +
                );
         149  +
                let content_length = payload.len();
         150  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         151  +
                    builder,
         152  +
                    ::http::header::CONTENT_LENGTH,
         153  +
                    content_length,
         154  +
                );
         155  +
                builder
         156  +
                    .status(404)
         157  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         158  +
            }
         159  +
            crate::error::CompleteSnapshotError::AccessDeniedException(output) => {
         160  +
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         161  +
                #[allow(unused_mut)]
         162  +
                let mut builder = ::http::Response::builder();
         163  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         164  +
                    builder,
         165  +
                    ::http::header::CONTENT_TYPE,
         166  +
                    "application/json",
         167  +
                );
         168  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         169  +
                    builder,
         170  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         171  +
                    "AccessDeniedException",
         172  +
                );
         173  +
                let content_length = payload.len();
         174  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         175  +
                    builder,
         176  +
                    ::http::header::CONTENT_LENGTH,
         177  +
                    content_length,
         178  +
                );
         179  +
                builder
         180  +
                    .status(403)
         181  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         182  +
            }
         183  +
            crate::error::CompleteSnapshotError::RequestThrottledException(output) => {
         184  +
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         185  +
                #[allow(unused_mut)]
         186  +
                let mut builder = ::http::Response::builder();
         187  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         188  +
                    builder,
         189  +
                    ::http::header::CONTENT_TYPE,
         190  +
                    "application/json",
         191  +
                );
         192  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         193  +
                    builder,
         194  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         195  +
                    "RequestThrottledException",
         196  +
                );
         197  +
                let content_length = payload.len();
         198  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         199  +
                    builder,
         200  +
                    ::http::header::CONTENT_LENGTH,
         201  +
                    content_length,
         202  +
                );
         203  +
                builder
         204  +
                    .status(400)
         205  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         206  +
            }
         207  +
            crate::error::CompleteSnapshotError::ServiceQuotaExceededException(output) => {
         208  +
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         209  +
                #[allow(unused_mut)]
         210  +
                let mut builder = ::http::Response::builder();
         211  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         212  +
                    builder,
         213  +
                    ::http::header::CONTENT_TYPE,
         214  +
                    "application/json",
         215  +
                );
         216  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         217  +
                    builder,
         218  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         219  +
                    "ServiceQuotaExceededException",
         220  +
                );
         221  +
                let content_length = payload.len();
         222  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         223  +
                    builder,
         224  +
                    ::http::header::CONTENT_LENGTH,
         225  +
                    content_length,
         226  +
                );
         227  +
                builder
         228  +
                    .status(402)
         229  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         230  +
            }
         231  +
            crate::error::CompleteSnapshotError::ValidationException(output) => {
         232  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         233  +
                #[allow(unused_mut)]
         234  +
                let mut builder = ::http::Response::builder();
         235  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         236  +
                    builder,
         237  +
                    ::http::header::CONTENT_TYPE,
         238  +
                    "application/json",
         239  +
                );
         240  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         241  +
                    builder,
         242  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         243  +
                    "ValidationException",
         244  +
                );
         245  +
                let content_length = payload.len();
         246  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         247  +
                    builder,
         248  +
                    ::http::header::CONTENT_LENGTH,
         249  +
                    content_length,
         250  +
                );
         251  +
                builder
         252  +
                    .status(400)
         253  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         254  +
            }
         255  +
        }
         256  +
    })
         257  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_complete_snapshot_input.rs

@@ -0,1 +0,59 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_changed_blocks_count_header(
           3  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
           4  +
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
           6  +
    let headers = header_map.get_all("x-amz-ChangedBlocksCount");
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
           8  +
    if var_1.len() > 1 {
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
          10  +
            "expected one item but found {}",
          11  +
            var_1.len()
          12  +
        )))
          13  +
    } else {
          14  +
        let mut var_1 = var_1;
          15  +
        Ok(var_1.pop())
          16  +
    }
          17  +
}
          18  +
          19  +
pub(crate) fn de_checksum_header(
          20  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
          21  +
) -> ::std::result::Result<
          22  +
    ::std::option::Option<::std::string::String>,
          23  +
    ::aws_smithy_legacy_http::header::ParseError,
          24  +
> {
          25  +
    let headers = header_map.get_all("x-amz-Checksum");
          26  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
          27  +
}
          28  +
          29  +
pub(crate) fn de_checksum_aggregation_method_header(
          30  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
          31  +
) -> ::std::result::Result<
          32  +
    ::std::option::Option<::std::string::String>,
          33  +
    ::aws_smithy_legacy_http::header::ParseError,
          34  +
> {
          35  +
    let headers = header_map.get_all("x-amz-Checksum-Aggregation-Method");
          36  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
          37  +
}
          38  +
          39  +
pub(crate) fn de_checksum_algorithm_header(
          40  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
          41  +
) -> ::std::result::Result<
          42  +
    ::std::option::Option<::std::string::String>,
          43  +
    ::aws_smithy_legacy_http::header::ParseError,
          44  +
> {
          45  +
    let headers = header_map.get_all("x-amz-Checksum-Algorithm");
          46  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
          47  +
}
          48  +
          49  +
pub fn de_snapshot_id(
          50  +
    value: &str,
          51  +
) -> std::result::Result<
          52  +
    ::std::string::String,
          53  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          54  +
> {
          55  +
    let value = ::percent_encoding::percent_decode_str(value)
          56  +
        .decode_utf8()?
          57  +
        .into_owned();
          58  +
    Ok(value)
          59  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_complete_snapshot_output.rs

@@ -0,1 +0,23 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_complete_snapshot_output_output_output(
           3  +
    value: &crate::output::CompleteSnapshotOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_complete_snapshot_output_output(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::output::CompleteSnapshotOutput,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    if let Some(var_1) = &input.status {
          20  +
        object.key("Status").string(var_1.as_str());
          21  +
    }
          22  +
    Ok(())
          23  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_concurrent_limit_exceeded_exception.rs

@@ -0,1 +0,20 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_concurrent_limit_exceeded_exception_error(
           3  +
    value: &crate::error::ConcurrentLimitExceededException,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_concurrent_limit_exceeded_exception::ser_concurrent_limit_exceeded_exception(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_concurrent_limit_exceeded_exception(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::error::ConcurrentLimitExceededException,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    if let Some(var_1) = &input.message {
          17  +
        object.key("Message").string(var_1.as_str());
          18  +
    }
          19  +
    Ok(())
          20  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_conflict_exception.rs

@@ -0,1 +0,20 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_conflict_exception_error(
           3  +
    value: &crate::error::ConflictException,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_conflict_exception::ser_conflict_exception(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_conflict_exception(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::error::ConflictException,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    if let Some(var_1) = &input.message {
          17  +
        object.key("Message").string(var_1.as_str());
          18  +
    }
          19  +
    Ok(())
          20  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_get_snapshot_block.rs

@@ -0,1 +0,311 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_get_snapshot_block_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::GetSnapshotBlockInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::get_snapshot_block_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let input_string = uri.path();
          23  +
        let (input_string, (_, m1, _, m3)) =
          24  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          25  +
                ::nom::sequence::preceded(
          26  +
                    ::nom::bytes::complete::tag("/"),
          27  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
          28  +
                ),
          29  +
                ::nom::sequence::preceded(
          30  +
                    ::nom::bytes::complete::tag("/"),
          31  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          32  +
                        ::nom::bytes::complete::take_until("/"),
          33  +
                        ::nom::combinator::rest,
          34  +
                    )),
          35  +
                ),
          36  +
                ::nom::sequence::preceded(
          37  +
                    ::nom::bytes::complete::tag("/"),
          38  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("blocks"),
          39  +
                ),
          40  +
                ::nom::sequence::preceded(
          41  +
                    ::nom::bytes::complete::tag("/"),
          42  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          43  +
                        ::nom::bytes::complete::take_until("/"),
          44  +
                        ::nom::combinator::rest,
          45  +
                    )),
          46  +
                ),
          47  +
            ))(input_string)?;
          48  +
        debug_assert_eq!("", input_string);
          49  +
        input = input.set_snapshot_id(
          50  +
            crate::protocol_serde::shape_get_snapshot_block_input::de_snapshot_id(m1)?,
          51  +
        );
          52  +
        input = input.set_block_index(
          53  +
            crate::protocol_serde::shape_get_snapshot_block_input::de_block_index(m3)?,
          54  +
        );
          55  +
        let query_string = uri.query().unwrap_or("");
          56  +
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          57  +
        let mut block_token_seen = false;
          58  +
        for (k, v) in pairs {
          59  +
            if !block_token_seen && k == "blockToken" {
          60  +
                input = input.set_block_token(
          61  +
                    crate::protocol_serde::shape_get_snapshot_block_input::de_block_token(&v)?,
          62  +
                );
          63  +
                block_token_seen = true;
          64  +
            }
          65  +
        }
          66  +
        input.build()?
          67  +
    })
          68  +
}
          69  +
          70  +
#[allow(clippy::unnecessary_wraps)]
          71  +
pub fn ser_get_snapshot_block_http_response(
          72  +
    #[allow(unused_variables)] output: crate::output::GetSnapshotBlockOutput,
          73  +
) -> std::result::Result<
          74  +
    ::aws_smithy_legacy_http_server::response::Response,
          75  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          76  +
> {
          77  +
    Ok({
          78  +
        #[allow(unused_mut)]
          79  +
        let mut builder = ::http::Response::builder();
          80  +
        builder = crate::protocol_serde::shape_get_snapshot_block::ser_get_snapshot_block_headers(
          81  +
            &output, builder,
          82  +
        )?;
          83  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          84  +
            builder,
          85  +
            ::http::header::CONTENT_TYPE,
          86  +
            "application/octet-stream",
          87  +
        );
          88  +
        let http_status: u16 = 200;
          89  +
        builder = builder.status(http_status);
          90  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(::aws_smithy_legacy_http_server::body::Body::wrap_stream(
          91  +
            ::aws_smithy_legacy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
          92  +
                crate::protocol_serde::shape_get_snapshot_block_output::ser_block_data_http_payload( output.block_data)?
          93  +
            )
          94  +
        ));
          95  +
        builder.body(body)?
          96  +
    })
          97  +
}
          98  +
          99  +
#[allow(clippy::unnecessary_wraps)]
         100  +
pub fn ser_get_snapshot_block_http_error(
         101  +
    error: &crate::error::GetSnapshotBlockError,
         102  +
) -> std::result::Result<
         103  +
    ::aws_smithy_legacy_http_server::response::Response,
         104  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         105  +
> {
         106  +
    Ok({
         107  +
        match error {
         108  +
            crate::error::GetSnapshotBlockError::InternalServerException(output) => {
         109  +
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         110  +
                #[allow(unused_mut)]
         111  +
                let mut builder = ::http::Response::builder();
         112  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         113  +
                    builder,
         114  +
                    ::http::header::CONTENT_TYPE,
         115  +
                    "application/octet-stream",
         116  +
                );
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         118  +
                    builder,
         119  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         120  +
                    "InternalServerException",
         121  +
                );
         122  +
                let content_length = payload.len();
         123  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         124  +
                    builder,
         125  +
                    ::http::header::CONTENT_LENGTH,
         126  +
                    content_length,
         127  +
                );
         128  +
                builder
         129  +
                    .status(500)
         130  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         131  +
            }
         132  +
            crate::error::GetSnapshotBlockError::ResourceNotFoundException(output) => {
         133  +
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         134  +
                #[allow(unused_mut)]
         135  +
                let mut builder = ::http::Response::builder();
         136  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         137  +
                    builder,
         138  +
                    ::http::header::CONTENT_TYPE,
         139  +
                    "application/octet-stream",
         140  +
                );
         141  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         142  +
                    builder,
         143  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         144  +
                    "ResourceNotFoundException",
         145  +
                );
         146  +
                let content_length = payload.len();
         147  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         148  +
                    builder,
         149  +
                    ::http::header::CONTENT_LENGTH,
         150  +
                    content_length,
         151  +
                );
         152  +
                builder
         153  +
                    .status(404)
         154  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         155  +
            }
         156  +
            crate::error::GetSnapshotBlockError::AccessDeniedException(output) => {
         157  +
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         158  +
                #[allow(unused_mut)]
         159  +
                let mut builder = ::http::Response::builder();
         160  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         161  +
                    builder,
         162  +
                    ::http::header::CONTENT_TYPE,
         163  +
                    "application/octet-stream",
         164  +
                );
         165  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         166  +
                    builder,
         167  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         168  +
                    "AccessDeniedException",
         169  +
                );
         170  +
                let content_length = payload.len();
         171  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         172  +
                    builder,
         173  +
                    ::http::header::CONTENT_LENGTH,
         174  +
                    content_length,
         175  +
                );
         176  +
                builder
         177  +
                    .status(403)
         178  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         179  +
            }
         180  +
            crate::error::GetSnapshotBlockError::RequestThrottledException(output) => {
         181  +
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         182  +
                #[allow(unused_mut)]
         183  +
                let mut builder = ::http::Response::builder();
         184  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         185  +
                    builder,
         186  +
                    ::http::header::CONTENT_TYPE,
         187  +
                    "application/octet-stream",
         188  +
                );
         189  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         190  +
                    builder,
         191  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         192  +
                    "RequestThrottledException",
         193  +
                );
         194  +
                let content_length = payload.len();
         195  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         196  +
                    builder,
         197  +
                    ::http::header::CONTENT_LENGTH,
         198  +
                    content_length,
         199  +
                );
         200  +
                builder
         201  +
                    .status(400)
         202  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         203  +
            }
         204  +
            crate::error::GetSnapshotBlockError::ServiceQuotaExceededException(output) => {
         205  +
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         206  +
                #[allow(unused_mut)]
         207  +
                let mut builder = ::http::Response::builder();
         208  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         209  +
                    builder,
         210  +
                    ::http::header::CONTENT_TYPE,
         211  +
                    "application/octet-stream",
         212  +
                );
         213  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         214  +
                    builder,
         215  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         216  +
                    "ServiceQuotaExceededException",
         217  +
                );
         218  +
                let content_length = payload.len();
         219  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         220  +
                    builder,
         221  +
                    ::http::header::CONTENT_LENGTH,
         222  +
                    content_length,
         223  +
                );
         224  +
                builder
         225  +
                    .status(402)
         226  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         227  +
            }
         228  +
            crate::error::GetSnapshotBlockError::ValidationException(output) => {
         229  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         230  +
                #[allow(unused_mut)]
         231  +
                let mut builder = ::http::Response::builder();
         232  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         233  +
                    builder,
         234  +
                    ::http::header::CONTENT_TYPE,
         235  +
                    "application/octet-stream",
         236  +
                );
         237  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         238  +
                    builder,
         239  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         240  +
                    "ValidationException",
         241  +
                );
         242  +
                let content_length = payload.len();
         243  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         244  +
                    builder,
         245  +
                    ::http::header::CONTENT_LENGTH,
         246  +
                    content_length,
         247  +
                );
         248  +
                builder
         249  +
                    .status(400)
         250  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         251  +
            }
         252  +
        }
         253  +
    })
         254  +
}
         255  +
         256  +
pub fn ser_get_snapshot_block_headers(
         257  +
    input: &crate::output::GetSnapshotBlockOutput,
         258  +
    mut builder: ::http::response::Builder,
         259  +
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
         260  +
{
         261  +
    if let ::std::option::Option::Some(inner_1) = &input.data_length {
         262  +
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
         263  +
        let formatted_2 = encoder.encode();
         264  +
        if !formatted_2.is_empty() {
         265  +
            let header_value = formatted_2;
         266  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         267  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         268  +
                    "data_length",
         269  +
                    format!(
         270  +
                        "`{}` cannot be used as a header value: {}",
         271  +
                        &header_value, err
         272  +
                    ),
         273  +
                )
         274  +
            })?;
         275  +
            builder = builder.header("x-amz-Data-Length", header_value);
         276  +
        }
         277  +
    }
         278  +
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
         279  +
        let formatted_4 = inner_3.as_str();
         280  +
        if !formatted_4.is_empty() {
         281  +
            let header_value = formatted_4;
         282  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         283  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         284  +
                    "checksum_algorithm",
         285  +
                    format!(
         286  +
                        "`{}` cannot be used as a header value: {}",
         287  +
                        &header_value, err
         288  +
                    ),
         289  +
                )
         290  +
            })?;
         291  +
            builder = builder.header("x-amz-Checksum-Algorithm", header_value);
         292  +
        }
         293  +
    }
         294  +
    if let ::std::option::Option::Some(inner_5) = &input.checksum {
         295  +
        let formatted_6 = inner_5.as_str();
         296  +
        if !formatted_6.is_empty() {
         297  +
            let header_value = formatted_6;
         298  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         299  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         300  +
                    "checksum",
         301  +
                    format!(
         302  +
                        "`{}` cannot be used as a header value: {}",
         303  +
                        &header_value, err
         304  +
                    ),
         305  +
                )
         306  +
            })?;
         307  +
            builder = builder.header("x-amz-Checksum", header_value);
         308  +
        }
         309  +
    }
         310  +
    Ok(builder)
         311  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_get_snapshot_block_input.rs

@@ -0,1 +0,32 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn de_snapshot_id(
           3  +
    value: &str,
           4  +
) -> std::result::Result<
           5  +
    ::std::string::String,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
> {
           8  +
    let value = ::percent_encoding::percent_decode_str(value)
           9  +
        .decode_utf8()?
          10  +
        .into_owned();
          11  +
    Ok(value)
          12  +
}
          13  +
          14  +
pub fn de_block_index(
          15  +
    value: &str,
          16  +
) -> std::result::Result<
          17  +
    i32,
          18  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          19  +
> {
          20  +
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          21  +
    Ok(value)
          22  +
}
          23  +
          24  +
pub fn de_block_token(
          25  +
    value: &str,
          26  +
) -> std::result::Result<
          27  +
    ::std::string::String,
          28  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          29  +
> {
          30  +
    let value = value.to_owned();
          31  +
    Ok(value)
          32  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_get_snapshot_block_output.rs

@@ -0,1 +0,9 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_block_data_http_payload(
           3  +
    payload: ::aws_smithy_types::byte_stream::ByteStream,
           4  +
) -> ::std::result::Result<
           5  +
    ::aws_smithy_types::byte_stream::ByteStream,
           6  +
    ::aws_smithy_types::error::operation::BuildError,
           7  +
> {
           8  +
    Ok(payload)
           9  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_internal_server_exception.rs

@@ -0,1 +0,23 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_internal_server_exception_error(
           3  +
    value: &crate::error::InternalServerException,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_internal_server_exception(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::error::InternalServerException,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    if let Some(var_1) = &input.message {
          20  +
        object.key("Message").string(var_1.as_str());
          21  +
    }
          22  +
    Ok(())
          23  +
}

tmp-codegen-diff/codegen-server-test/ebs-http0x/rust-server-codegen/src/protocol_serde/shape_list_changed_blocks.rs

@@ -0,1 +0,269 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_list_changed_blocks_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::ListChangedBlocksInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::list_changed_blocks_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let input_string = uri.path();
          23  +
        let (input_string, (_, m1, _)) =
          24  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          25  +
                ::nom::sequence::preceded(
          26  +
                    ::nom::bytes::complete::tag("/"),
          27  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
          28  +
                ),
          29  +
                ::nom::sequence::preceded(
          30  +
                    ::nom::bytes::complete::tag("/"),
          31  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          32  +
                        ::nom::bytes::complete::take_until("/"),
          33  +
                        ::nom::combinator::rest,
          34  +
                    )),
          35  +
                ),
          36  +
                ::nom::sequence::preceded(
          37  +
                    ::nom::bytes::complete::tag("/"),
          38  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("changedblocks"),
          39  +
                ),
          40  +
            ))(input_string)?;
          41  +
        debug_assert_eq!("", input_string);
          42  +
        input = input.set_second_snapshot_id(
          43  +
            crate::protocol_serde::shape_list_changed_blocks_input::de_second_snapshot_id(m1)?,
          44  +
        );
          45  +
        let query_string = uri.query().unwrap_or("");
          46  +
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          47  +
        let mut first_snapshot_id_seen = false;
          48  +
        let mut max_results_seen = false;
          49  +
        let mut next_token_seen = false;
          50  +
        let mut starting_block_index_seen = false;
          51  +
        for (k, v) in pairs {
          52  +
            if !first_snapshot_id_seen && k == "firstSnapshotId" {
          53  +
                input = input.set_first_snapshot_id(
          54  +
                    crate::protocol_serde::shape_list_changed_blocks_input::de_first_snapshot_id(
          55  +
                        &v,
          56  +
                    )?,
          57  +
                );
          58  +
                first_snapshot_id_seen = true;
          59  +
            }
          60  +
            if !max_results_seen && k == "maxResults" {
          61  +
                input = input.set_max_results(
          62  +
                    crate::protocol_serde::shape_list_changed_blocks_input::de_max_results(&v)?,
          63  +
                );
          64  +
                max_results_seen = true;
          65  +
            }
          66  +
            if !next_token_seen && k == "pageToken" {
          67  +
                input = input.set_next_token(
          68  +
                    crate::protocol_serde::shape_list_changed_blocks_input::de_next_token(&v)?,
          69  +
                );
          70  +
                next_token_seen = true;
          71  +
            }
          72  +
            if !starting_block_index_seen && k == "startingBlockIndex" {
          73  +
                input = input.set_starting_block_index(
          74  +
                    crate::protocol_serde::shape_list_changed_blocks_input::de_starting_block_index(&v)?
          75  +
                );
          76  +
                starting_block_index_seen = true;
          77  +
            }
          78  +
        }
          79  +
        input.build()?
          80  +
    })
          81  +
}
          82  +
          83  +
#[allow(clippy::unnecessary_wraps)]
          84  +
pub fn ser_list_changed_blocks_http_response(
          85  +
    #[allow(unused_variables)] output: crate::output::ListChangedBlocksOutput,
          86  +
) -> std::result::Result<
          87  +
    ::aws_smithy_legacy_http_server::response::Response,
          88  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          89  +
> {
          90  +
    Ok({
          91  +
        #[allow(unused_mut)]
          92  +
        let mut builder = ::http::Response::builder();
          93  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          94  +
            builder,
          95  +
            ::http::header::CONTENT_TYPE,
          96  +
            "application/json",
          97  +
        );
          98  +
        let http_status: u16 = 200;
          99  +
        builder = builder.status(http_status);
         100  +
        let payload =
         101  +
            crate::protocol_serde::shape_list_changed_blocks_output::ser_list_changed_blocks_output_output_output(&output)?
         102  +
        ;
         103  +
        let content_length = payload.len();
         104  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         105  +
            builder,
         106  +
            ::http::header::CONTENT_LENGTH,
         107  +
            content_length,
         108  +
        );
         109  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
         110  +
        builder.body(body)?
         111  +
    })
         112  +
}
         113  +
         114  +
#[allow(clippy::unnecessary_wraps)]
         115  +
pub fn ser_list_changed_blocks_http_error(
         116  +
    error: &crate::error::ListChangedBlocksError,
         117  +
) -> std::result::Result<
         118  +
    ::aws_smithy_legacy_http_server::response::Response,
         119  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         120  +
> {
         121  +
    Ok({
         122  +
        match error {
         123  +
            crate::error::ListChangedBlocksError::InternalServerException(output) => {
         124  +
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         125  +
                #[allow(unused_mut)]
         126  +
                let mut builder = ::http::Response::builder();
         127  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         128  +
                    builder,
         129  +
                    ::http::header::CONTENT_TYPE,
         130  +
                    "application/json",
         131  +
                );
         132  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         133  +
                    builder,
         134  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         135  +
                    "InternalServerException",
         136  +
                );
         137  +
                let content_length = payload.len();
         138  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         139  +
                    builder,
         140  +
                    ::http::header::CONTENT_LENGTH,
         141  +
                    content_length,
         142  +
                );
         143  +
                builder
         144  +
                    .status(500)
         145  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         146  +
            }
         147  +
            crate::error::ListChangedBlocksError::ResourceNotFoundException(output) => {
         148  +
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         149  +
                #[allow(unused_mut)]
         150  +
                let mut builder = ::http::Response::builder();
         151  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         152  +
                    builder,
         153  +
                    ::http::header::CONTENT_TYPE,
         154  +
                    "application/json",
         155  +
                );
         156  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         157  +
                    builder,
         158  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         159  +
                    "ResourceNotFoundException",
         160  +
                );
         161  +
                let content_length = payload.len();
         162  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         163  +
                    builder,
         164  +
                    ::http::header::CONTENT_LENGTH,
         165  +
                    content_length,
         166  +
                );
         167  +
                builder
         168  +
                    .status(404)
         169  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         170  +
            }
         171  +
            crate::error::ListChangedBlocksError::AccessDeniedException(output) => {
         172  +
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         173  +
                #[allow(unused_mut)]
         174  +
                let mut builder = ::http::Response::builder();
         175  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         176  +
                    builder,
         177  +
                    ::http::header::CONTENT_TYPE,
         178  +
                    "application/json",
         179  +
                );
         180  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         181  +
                    builder,
         182  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         183  +
                    "AccessDeniedException",
         184  +
                );
         185  +
                let content_length = payload.len();
         186  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         187  +
                    builder,
         188  +
                    ::http::header::CONTENT_LENGTH,
         189  +
                    content_length,
         190  +
                );
         191  +
                builder
         192  +
                    .status(403)
         193  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         194  +
            }
         195  +
            crate::error::ListChangedBlocksError::RequestThrottledException(output) => {
         196  +
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         197  +
                #[allow(unused_mut)]
         198  +
                let mut builder = ::http::Response::builder();
         199  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         200  +
                    builder,
         201  +
                    ::http::header::CONTENT_TYPE,
         202  +
                    "application/json",
         203  +
                );
         204  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         205  +
                    builder,
         206  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         207  +
                    "RequestThrottledException",
         208  +
                );
         209  +
                let content_length = payload.len();
         210  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         211  +
                    builder,
         212  +
                    ::http::header::CONTENT_LENGTH,
         213  +
                    content_length,
         214  +
                );
         215  +
                builder
         216  +
                    .status(400)
         217  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         218  +
            }
         219  +
            crate::error::ListChangedBlocksError::ServiceQuotaExceededException(output) => {
         220  +
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         221  +
                #[allow(unused_mut)]
         222  +
                let mut builder = ::http::Response::builder();
         223  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         224  +
                    builder,
         225  +
                    ::http::header::CONTENT_TYPE,
         226  +
                    "application/json",
         227  +
                );
         228  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         229  +
                    builder,
         230  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         231  +
                    "ServiceQuotaExceededException",
         232  +
                );
         233  +
                let content_length = payload.len();
         234  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         235  +
                    builder,
         236  +
                    ::http::header::CONTENT_LENGTH,
         237  +
                    content_length,
         238  +
                );
         239  +
                builder
         240  +
                    .status(402)
         241  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         242  +
            }
         243  +
            crate::error::ListChangedBlocksError::ValidationException(output) => {
         244  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         245  +
                #[allow(unused_mut)]
         246  +
                let mut builder = ::http::Response::builder();
         247  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         248  +
                    builder,
         249  +
                    ::http::header::CONTENT_TYPE,
         250  +
                    "application/json",
         251  +
                );
         252  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         253  +
                    builder,
         254  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         255  +
                    "ValidationException",
         256  +
                );
         257  +
                let content_length = payload.len();
         258  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         259  +
                    builder,
         260  +
                    ::http::header::CONTENT_LENGTH,
         261  +
                    content_length,
         262  +
                );
         263  +
                builder
         264  +
                    .status(400)
         265  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         266  +
            }
         267  +
        }
         268  +
    })
         269  +
}